001package org.hl7.fhir.r4.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.r4.model.Enumerations.PublicationStatus;
042import org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051
052/**
053 * The ChargeItemDefinition resource provides the properties that apply to the
054 * (billing) codes necessary to calculate costs and prices. The properties may
055 * differ largely depending on type and realm, therefore this resource gives
056 * only a rough structure and requires profiling for each type of billing code
057 * system.
058 */
059@ResourceDef(name = "ChargeItemDefinition", profile = "http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition")
060@ChildOrder(names = { "url", "identifier", "version", "title", "derivedFromUri", "partOf", "replaces", "status",
061    "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "copyright",
062    "approvalDate", "lastReviewDate", "effectivePeriod", "code", "instance", "applicability", "propertyGroup" })
063public class ChargeItemDefinition extends MetadataResource {
064
065  public enum ChargeItemDefinitionPriceComponentType {
066    /**
067     * the amount is the base price used for calculating the total price before
068     * applying surcharges, discount or taxes.
069     */
070    BASE,
071    /**
072     * the amount is a surcharge applied on the base price.
073     */
074    SURCHARGE,
075    /**
076     * the amount is a deduction applied on the base price.
077     */
078    DEDUCTION,
079    /**
080     * the amount is a discount applied on the base price.
081     */
082    DISCOUNT,
083    /**
084     * the amount is the tax component of the total price.
085     */
086    TAX,
087    /**
088     * the amount is of informational character, it has not been applied in the
089     * calculation of the total price.
090     */
091    INFORMATIONAL,
092    /**
093     * added to help the parsers with the generic types
094     */
095    NULL;
096
097    public static ChargeItemDefinitionPriceComponentType fromCode(String codeString) throws FHIRException {
098      if (codeString == null || "".equals(codeString))
099        return null;
100      if ("base".equals(codeString))
101        return BASE;
102      if ("surcharge".equals(codeString))
103        return SURCHARGE;
104      if ("deduction".equals(codeString))
105        return DEDUCTION;
106      if ("discount".equals(codeString))
107        return DISCOUNT;
108      if ("tax".equals(codeString))
109        return TAX;
110      if ("informational".equals(codeString))
111        return INFORMATIONAL;
112      if (Configuration.isAcceptInvalidEnums())
113        return null;
114      else
115        throw new FHIRException("Unknown ChargeItemDefinitionPriceComponentType code '" + codeString + "'");
116    }
117
118    public String toCode() {
119      switch (this) {
120      case BASE:
121        return "base";
122      case SURCHARGE:
123        return "surcharge";
124      case DEDUCTION:
125        return "deduction";
126      case DISCOUNT:
127        return "discount";
128      case TAX:
129        return "tax";
130      case INFORMATIONAL:
131        return "informational";
132      case NULL:
133        return null;
134      default:
135        return "?";
136      }
137    }
138
139    public String getSystem() {
140      switch (this) {
141      case BASE:
142        return "http://hl7.org/fhir/invoice-priceComponentType";
143      case SURCHARGE:
144        return "http://hl7.org/fhir/invoice-priceComponentType";
145      case DEDUCTION:
146        return "http://hl7.org/fhir/invoice-priceComponentType";
147      case DISCOUNT:
148        return "http://hl7.org/fhir/invoice-priceComponentType";
149      case TAX:
150        return "http://hl7.org/fhir/invoice-priceComponentType";
151      case INFORMATIONAL:
152        return "http://hl7.org/fhir/invoice-priceComponentType";
153      case NULL:
154        return null;
155      default:
156        return "?";
157      }
158    }
159
160    public String getDefinition() {
161      switch (this) {
162      case BASE:
163        return "the amount is the base price used for calculating the total price before applying surcharges, discount or taxes.";
164      case SURCHARGE:
165        return "the amount is a surcharge applied on the base price.";
166      case DEDUCTION:
167        return "the amount is a deduction applied on the base price.";
168      case DISCOUNT:
169        return "the amount is a discount applied on the base price.";
170      case TAX:
171        return "the amount is the tax component of the total price.";
172      case INFORMATIONAL:
173        return "the amount is of informational character, it has not been applied in the calculation of the total price.";
174      case NULL:
175        return null;
176      default:
177        return "?";
178      }
179    }
180
181    public String getDisplay() {
182      switch (this) {
183      case BASE:
184        return "base price";
185      case SURCHARGE:
186        return "surcharge";
187      case DEDUCTION:
188        return "deduction";
189      case DISCOUNT:
190        return "discount";
191      case TAX:
192        return "tax";
193      case INFORMATIONAL:
194        return "informational";
195      case NULL:
196        return null;
197      default:
198        return "?";
199      }
200    }
201  }
202
203  public static class ChargeItemDefinitionPriceComponentTypeEnumFactory
204      implements EnumFactory<ChargeItemDefinitionPriceComponentType> {
205    public ChargeItemDefinitionPriceComponentType fromCode(String codeString) throws IllegalArgumentException {
206      if (codeString == null || "".equals(codeString))
207        if (codeString == null || "".equals(codeString))
208          return null;
209      if ("base".equals(codeString))
210        return ChargeItemDefinitionPriceComponentType.BASE;
211      if ("surcharge".equals(codeString))
212        return ChargeItemDefinitionPriceComponentType.SURCHARGE;
213      if ("deduction".equals(codeString))
214        return ChargeItemDefinitionPriceComponentType.DEDUCTION;
215      if ("discount".equals(codeString))
216        return ChargeItemDefinitionPriceComponentType.DISCOUNT;
217      if ("tax".equals(codeString))
218        return ChargeItemDefinitionPriceComponentType.TAX;
219      if ("informational".equals(codeString))
220        return ChargeItemDefinitionPriceComponentType.INFORMATIONAL;
221      throw new IllegalArgumentException("Unknown ChargeItemDefinitionPriceComponentType code '" + codeString + "'");
222    }
223
224    public Enumeration<ChargeItemDefinitionPriceComponentType> fromType(PrimitiveType<?> code) throws FHIRException {
225      if (code == null)
226        return null;
227      if (code.isEmpty())
228        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
229            ChargeItemDefinitionPriceComponentType.NULL, code);
230      String codeString = code.asStringValue();
231      if (codeString == null || "".equals(codeString))
232        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
233            ChargeItemDefinitionPriceComponentType.NULL, code);
234      if ("base".equals(codeString))
235        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
236            ChargeItemDefinitionPriceComponentType.BASE, code);
237      if ("surcharge".equals(codeString))
238        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
239            ChargeItemDefinitionPriceComponentType.SURCHARGE, code);
240      if ("deduction".equals(codeString))
241        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
242            ChargeItemDefinitionPriceComponentType.DEDUCTION, code);
243      if ("discount".equals(codeString))
244        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
245            ChargeItemDefinitionPriceComponentType.DISCOUNT, code);
246      if ("tax".equals(codeString))
247        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this, ChargeItemDefinitionPriceComponentType.TAX,
248            code);
249      if ("informational".equals(codeString))
250        return new Enumeration<ChargeItemDefinitionPriceComponentType>(this,
251            ChargeItemDefinitionPriceComponentType.INFORMATIONAL, code);
252      throw new FHIRException("Unknown ChargeItemDefinitionPriceComponentType code '" + codeString + "'");
253    }
254
255    public String toCode(ChargeItemDefinitionPriceComponentType code) {
256      if (code == ChargeItemDefinitionPriceComponentType.BASE)
257        return "base";
258      if (code == ChargeItemDefinitionPriceComponentType.SURCHARGE)
259        return "surcharge";
260      if (code == ChargeItemDefinitionPriceComponentType.DEDUCTION)
261        return "deduction";
262      if (code == ChargeItemDefinitionPriceComponentType.DISCOUNT)
263        return "discount";
264      if (code == ChargeItemDefinitionPriceComponentType.TAX)
265        return "tax";
266      if (code == ChargeItemDefinitionPriceComponentType.INFORMATIONAL)
267        return "informational";
268      return "?";
269    }
270
271    public String toSystem(ChargeItemDefinitionPriceComponentType code) {
272      return code.getSystem();
273    }
274  }
275
276  @Block()
277  public static class ChargeItemDefinitionApplicabilityComponent extends BackboneElement
278      implements IBaseBackboneElement {
279    /**
280     * A brief, natural language description of the condition that effectively
281     * communicates the intended semantics.
282     */
283    @Child(name = "description", type = {
284        StringType.class }, order = 1, min = 0, max = 1, modifier = false, summary = false)
285    @Description(shortDefinition = "Natural language description of the condition", formalDefinition = "A brief, natural language description of the condition that effectively communicates the intended semantics.")
286    protected StringType description;
287
288    /**
289     * The media type of the language for the expression, e.g. "text/cql" for
290     * Clinical Query Language expressions or "text/fhirpath" for FHIRPath
291     * expressions.
292     */
293    @Child(name = "language", type = {
294        StringType.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
295    @Description(shortDefinition = "Language of the expression", formalDefinition = "The media type of the language for the expression, e.g. \"text/cql\" for Clinical Query Language expressions or \"text/fhirpath\" for FHIRPath expressions.")
296    protected StringType language;
297
298    /**
299     * An expression that returns true or false, indicating whether the condition is
300     * satisfied. When using FHIRPath expressions, the %context environment variable
301     * must be replaced at runtime with the ChargeItem resource to which this
302     * definition is applied.
303     */
304    @Child(name = "expression", type = {
305        StringType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
306    @Description(shortDefinition = "Boolean-valued expression", formalDefinition = "An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied.")
307    protected StringType expression;
308
309    private static final long serialVersionUID = 1354288281L;
310
311    /**
312     * Constructor
313     */
314    public ChargeItemDefinitionApplicabilityComponent() {
315      super();
316    }
317
318    /**
319     * @return {@link #description} (A brief, natural language description of the
320     *         condition that effectively communicates the intended semantics.).
321     *         This is the underlying object with id, value and extensions. The
322     *         accessor "getDescription" gives direct access to the value
323     */
324    public StringType getDescriptionElement() {
325      if (this.description == null)
326        if (Configuration.errorOnAutoCreate())
327          throw new Error("Attempt to auto-create ChargeItemDefinitionApplicabilityComponent.description");
328        else if (Configuration.doAutoCreate())
329          this.description = new StringType(); // bb
330      return this.description;
331    }
332
333    public boolean hasDescriptionElement() {
334      return this.description != null && !this.description.isEmpty();
335    }
336
337    public boolean hasDescription() {
338      return this.description != null && !this.description.isEmpty();
339    }
340
341    /**
342     * @param value {@link #description} (A brief, natural language description of
343     *              the condition that effectively communicates the intended
344     *              semantics.). This is the underlying object with id, value and
345     *              extensions. The accessor "getDescription" gives direct access to
346     *              the value
347     */
348    public ChargeItemDefinitionApplicabilityComponent setDescriptionElement(StringType value) {
349      this.description = value;
350      return this;
351    }
352
353    /**
354     * @return A brief, natural language description of the condition that
355     *         effectively communicates the intended semantics.
356     */
357    public String getDescription() {
358      return this.description == null ? null : this.description.getValue();
359    }
360
361    /**
362     * @param value A brief, natural language description of the condition that
363     *              effectively communicates the intended semantics.
364     */
365    public ChargeItemDefinitionApplicabilityComponent setDescription(String value) {
366      if (Utilities.noString(value))
367        this.description = null;
368      else {
369        if (this.description == null)
370          this.description = new StringType();
371        this.description.setValue(value);
372      }
373      return this;
374    }
375
376    /**
377     * @return {@link #language} (The media type of the language for the expression,
378     *         e.g. "text/cql" for Clinical Query Language expressions or
379     *         "text/fhirpath" for FHIRPath expressions.). This is the underlying
380     *         object with id, value and extensions. The accessor "getLanguage"
381     *         gives direct access to the value
382     */
383    public StringType getLanguageElement() {
384      if (this.language == null)
385        if (Configuration.errorOnAutoCreate())
386          throw new Error("Attempt to auto-create ChargeItemDefinitionApplicabilityComponent.language");
387        else if (Configuration.doAutoCreate())
388          this.language = new StringType(); // bb
389      return this.language;
390    }
391
392    public boolean hasLanguageElement() {
393      return this.language != null && !this.language.isEmpty();
394    }
395
396    public boolean hasLanguage() {
397      return this.language != null && !this.language.isEmpty();
398    }
399
400    /**
401     * @param value {@link #language} (The media type of the language for the
402     *              expression, e.g. "text/cql" for Clinical Query Language
403     *              expressions or "text/fhirpath" for FHIRPath expressions.). This
404     *              is the underlying object with id, value and extensions. The
405     *              accessor "getLanguage" gives direct access to the value
406     */
407    public ChargeItemDefinitionApplicabilityComponent setLanguageElement(StringType value) {
408      this.language = value;
409      return this;
410    }
411
412    /**
413     * @return The media type of the language for the expression, e.g. "text/cql"
414     *         for Clinical Query Language expressions or "text/fhirpath" for
415     *         FHIRPath expressions.
416     */
417    public String getLanguage() {
418      return this.language == null ? null : this.language.getValue();
419    }
420
421    /**
422     * @param value The media type of the language for the expression, e.g.
423     *              "text/cql" for Clinical Query Language expressions or
424     *              "text/fhirpath" for FHIRPath expressions.
425     */
426    public ChargeItemDefinitionApplicabilityComponent setLanguage(String value) {
427      if (Utilities.noString(value))
428        this.language = null;
429      else {
430        if (this.language == null)
431          this.language = new StringType();
432        this.language.setValue(value);
433      }
434      return this;
435    }
436
437    /**
438     * @return {@link #expression} (An expression that returns true or false,
439     *         indicating whether the condition is satisfied. When using FHIRPath
440     *         expressions, the %context environment variable must be replaced at
441     *         runtime with the ChargeItem resource to which this definition is
442     *         applied.). This is the underlying object with id, value and
443     *         extensions. The accessor "getExpression" gives direct access to the
444     *         value
445     */
446    public StringType getExpressionElement() {
447      if (this.expression == null)
448        if (Configuration.errorOnAutoCreate())
449          throw new Error("Attempt to auto-create ChargeItemDefinitionApplicabilityComponent.expression");
450        else if (Configuration.doAutoCreate())
451          this.expression = new StringType(); // bb
452      return this.expression;
453    }
454
455    public boolean hasExpressionElement() {
456      return this.expression != null && !this.expression.isEmpty();
457    }
458
459    public boolean hasExpression() {
460      return this.expression != null && !this.expression.isEmpty();
461    }
462
463    /**
464     * @param value {@link #expression} (An expression that returns true or false,
465     *              indicating whether the condition is satisfied. When using
466     *              FHIRPath expressions, the %context environment variable must be
467     *              replaced at runtime with the ChargeItem resource to which this
468     *              definition is applied.). This is the underlying object with id,
469     *              value and extensions. The accessor "getExpression" gives direct
470     *              access to the value
471     */
472    public ChargeItemDefinitionApplicabilityComponent setExpressionElement(StringType value) {
473      this.expression = value;
474      return this;
475    }
476
477    /**
478     * @return An expression that returns true or false, indicating whether the
479     *         condition is satisfied. When using FHIRPath expressions, the %context
480     *         environment variable must be replaced at runtime with the ChargeItem
481     *         resource to which this definition is applied.
482     */
483    public String getExpression() {
484      return this.expression == null ? null : this.expression.getValue();
485    }
486
487    /**
488     * @param value An expression that returns true or false, indicating whether the
489     *              condition is satisfied. When using FHIRPath expressions, the
490     *              %context environment variable must be replaced at runtime with
491     *              the ChargeItem resource to which this definition is applied.
492     */
493    public ChargeItemDefinitionApplicabilityComponent setExpression(String value) {
494      if (Utilities.noString(value))
495        this.expression = null;
496      else {
497        if (this.expression == null)
498          this.expression = new StringType();
499        this.expression.setValue(value);
500      }
501      return this;
502    }
503
504    protected void listChildren(List<Property> children) {
505      super.listChildren(children);
506      children.add(new Property("description", "string",
507          "A brief, natural language description of the condition that effectively communicates the intended semantics.",
508          0, 1, description));
509      children.add(new Property("language", "string",
510          "The media type of the language for the expression, e.g. \"text/cql\" for Clinical Query Language expressions or \"text/fhirpath\" for FHIRPath expressions.",
511          0, 1, language));
512      children.add(new Property("expression", "string",
513          "An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied.",
514          0, 1, expression));
515    }
516
517    @Override
518    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
519      switch (_hash) {
520      case -1724546052:
521        /* description */ return new Property("description", "string",
522            "A brief, natural language description of the condition that effectively communicates the intended semantics.",
523            0, 1, description);
524      case -1613589672:
525        /* language */ return new Property("language", "string",
526            "The media type of the language for the expression, e.g. \"text/cql\" for Clinical Query Language expressions or \"text/fhirpath\" for FHIRPath expressions.",
527            0, 1, language);
528      case -1795452264:
529        /* expression */ return new Property("expression", "string",
530            "An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied.",
531            0, 1, expression);
532      default:
533        return super.getNamedProperty(_hash, _name, _checkValid);
534      }
535
536    }
537
538    @Override
539    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
540      switch (hash) {
541      case -1724546052:
542        /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // StringType
543      case -1613589672:
544        /* language */ return this.language == null ? new Base[0] : new Base[] { this.language }; // StringType
545      case -1795452264:
546        /* expression */ return this.expression == null ? new Base[0] : new Base[] { this.expression }; // StringType
547      default:
548        return super.getProperty(hash, name, checkValid);
549      }
550
551    }
552
553    @Override
554    public Base setProperty(int hash, String name, Base value) throws FHIRException {
555      switch (hash) {
556      case -1724546052: // description
557        this.description = castToString(value); // StringType
558        return value;
559      case -1613589672: // language
560        this.language = castToString(value); // StringType
561        return value;
562      case -1795452264: // expression
563        this.expression = castToString(value); // StringType
564        return value;
565      default:
566        return super.setProperty(hash, name, value);
567      }
568
569    }
570
571    @Override
572    public Base setProperty(String name, Base value) throws FHIRException {
573      if (name.equals("description")) {
574        this.description = castToString(value); // StringType
575      } else if (name.equals("language")) {
576        this.language = castToString(value); // StringType
577      } else if (name.equals("expression")) {
578        this.expression = castToString(value); // StringType
579      } else
580        return super.setProperty(name, value);
581      return value;
582    }
583
584  @Override
585  public void removeChild(String name, Base value) throws FHIRException {
586      if (name.equals("description")) {
587        this.description = null;
588      } else if (name.equals("language")) {
589        this.language = null;
590      } else if (name.equals("expression")) {
591        this.expression = null;
592      } else
593        super.removeChild(name, value);
594      
595    }
596
597    @Override
598    public Base makeProperty(int hash, String name) throws FHIRException {
599      switch (hash) {
600      case -1724546052:
601        return getDescriptionElement();
602      case -1613589672:
603        return getLanguageElement();
604      case -1795452264:
605        return getExpressionElement();
606      default:
607        return super.makeProperty(hash, name);
608      }
609
610    }
611
612    @Override
613    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
614      switch (hash) {
615      case -1724546052:
616        /* description */ return new String[] { "string" };
617      case -1613589672:
618        /* language */ return new String[] { "string" };
619      case -1795452264:
620        /* expression */ return new String[] { "string" };
621      default:
622        return super.getTypesForProperty(hash, name);
623      }
624
625    }
626
627    @Override
628    public Base addChild(String name) throws FHIRException {
629      if (name.equals("description")) {
630        throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.description");
631      } else if (name.equals("language")) {
632        throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.language");
633      } else if (name.equals("expression")) {
634        throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.expression");
635      } else
636        return super.addChild(name);
637    }
638
639    public ChargeItemDefinitionApplicabilityComponent copy() {
640      ChargeItemDefinitionApplicabilityComponent dst = new ChargeItemDefinitionApplicabilityComponent();
641      copyValues(dst);
642      return dst;
643    }
644
645    public void copyValues(ChargeItemDefinitionApplicabilityComponent dst) {
646      super.copyValues(dst);
647      dst.description = description == null ? null : description.copy();
648      dst.language = language == null ? null : language.copy();
649      dst.expression = expression == null ? null : expression.copy();
650    }
651
652    @Override
653    public boolean equalsDeep(Base other_) {
654      if (!super.equalsDeep(other_))
655        return false;
656      if (!(other_ instanceof ChargeItemDefinitionApplicabilityComponent))
657        return false;
658      ChargeItemDefinitionApplicabilityComponent o = (ChargeItemDefinitionApplicabilityComponent) other_;
659      return compareDeep(description, o.description, true) && compareDeep(language, o.language, true)
660          && compareDeep(expression, o.expression, true);
661    }
662
663    @Override
664    public boolean equalsShallow(Base other_) {
665      if (!super.equalsShallow(other_))
666        return false;
667      if (!(other_ instanceof ChargeItemDefinitionApplicabilityComponent))
668        return false;
669      ChargeItemDefinitionApplicabilityComponent o = (ChargeItemDefinitionApplicabilityComponent) other_;
670      return compareValues(description, o.description, true) && compareValues(language, o.language, true)
671          && compareValues(expression, o.expression, true);
672    }
673
674    public boolean isEmpty() {
675      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(description, language, expression);
676    }
677
678    public String fhirType() {
679      return "ChargeItemDefinition.applicability";
680
681    }
682
683  }
684
685  @Block()
686  public static class ChargeItemDefinitionPropertyGroupComponent extends BackboneElement
687      implements IBaseBackboneElement {
688    /**
689     * Expressions that describe applicability criteria for the priceComponent.
690     */
691    @Child(name = "applicability", type = {
692        ChargeItemDefinitionApplicabilityComponent.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
693    @Description(shortDefinition = "Conditions under which the priceComponent is applicable", formalDefinition = "Expressions that describe applicability criteria for the priceComponent.")
694    protected List<ChargeItemDefinitionApplicabilityComponent> applicability;
695
696    /**
697     * The price for a ChargeItem may be calculated as a base price with
698     * surcharges/deductions that apply in certain conditions. A
699     * ChargeItemDefinition resource that defines the prices, factors and conditions
700     * that apply to a billing code is currently under development. The
701     * priceComponent element can be used to offer transparency to the recipient of
702     * the Invoice of how the prices have been calculated.
703     */
704    @Child(name = "priceComponent", type = {}, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
705    @Description(shortDefinition = "Components of total line item price", formalDefinition = "The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated.")
706    protected List<ChargeItemDefinitionPropertyGroupPriceComponentComponent> priceComponent;
707
708    private static final long serialVersionUID = 1723436176L;
709
710    /**
711     * Constructor
712     */
713    public ChargeItemDefinitionPropertyGroupComponent() {
714      super();
715    }
716
717    /**
718     * @return {@link #applicability} (Expressions that describe applicability
719     *         criteria for the priceComponent.)
720     */
721    public List<ChargeItemDefinitionApplicabilityComponent> getApplicability() {
722      if (this.applicability == null)
723        this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
724      return this.applicability;
725    }
726
727    /**
728     * @return Returns a reference to <code>this</code> for easy method chaining
729     */
730    public ChargeItemDefinitionPropertyGroupComponent setApplicability(
731        List<ChargeItemDefinitionApplicabilityComponent> theApplicability) {
732      this.applicability = theApplicability;
733      return this;
734    }
735
736    public boolean hasApplicability() {
737      if (this.applicability == null)
738        return false;
739      for (ChargeItemDefinitionApplicabilityComponent item : this.applicability)
740        if (!item.isEmpty())
741          return true;
742      return false;
743    }
744
745    public ChargeItemDefinitionApplicabilityComponent addApplicability() { // 3
746      ChargeItemDefinitionApplicabilityComponent t = new ChargeItemDefinitionApplicabilityComponent();
747      if (this.applicability == null)
748        this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
749      this.applicability.add(t);
750      return t;
751    }
752
753    public ChargeItemDefinitionPropertyGroupComponent addApplicability(ChargeItemDefinitionApplicabilityComponent t) { // 3
754      if (t == null)
755        return this;
756      if (this.applicability == null)
757        this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
758      this.applicability.add(t);
759      return this;
760    }
761
762    /**
763     * @return The first repetition of repeating field {@link #applicability},
764     *         creating it if it does not already exist
765     */
766    public ChargeItemDefinitionApplicabilityComponent getApplicabilityFirstRep() {
767      if (getApplicability().isEmpty()) {
768        addApplicability();
769      }
770      return getApplicability().get(0);
771    }
772
773    /**
774     * @return {@link #priceComponent} (The price for a ChargeItem may be calculated
775     *         as a base price with surcharges/deductions that apply in certain
776     *         conditions. A ChargeItemDefinition resource that defines the prices,
777     *         factors and conditions that apply to a billing code is currently
778     *         under development. The priceComponent element can be used to offer
779     *         transparency to the recipient of the Invoice of how the prices have
780     *         been calculated.)
781     */
782    public List<ChargeItemDefinitionPropertyGroupPriceComponentComponent> getPriceComponent() {
783      if (this.priceComponent == null)
784        this.priceComponent = new ArrayList<ChargeItemDefinitionPropertyGroupPriceComponentComponent>();
785      return this.priceComponent;
786    }
787
788    /**
789     * @return Returns a reference to <code>this</code> for easy method chaining
790     */
791    public ChargeItemDefinitionPropertyGroupComponent setPriceComponent(
792        List<ChargeItemDefinitionPropertyGroupPriceComponentComponent> thePriceComponent) {
793      this.priceComponent = thePriceComponent;
794      return this;
795    }
796
797    public boolean hasPriceComponent() {
798      if (this.priceComponent == null)
799        return false;
800      for (ChargeItemDefinitionPropertyGroupPriceComponentComponent item : this.priceComponent)
801        if (!item.isEmpty())
802          return true;
803      return false;
804    }
805
806    public ChargeItemDefinitionPropertyGroupPriceComponentComponent addPriceComponent() { // 3
807      ChargeItemDefinitionPropertyGroupPriceComponentComponent t = new ChargeItemDefinitionPropertyGroupPriceComponentComponent();
808      if (this.priceComponent == null)
809        this.priceComponent = new ArrayList<ChargeItemDefinitionPropertyGroupPriceComponentComponent>();
810      this.priceComponent.add(t);
811      return t;
812    }
813
814    public ChargeItemDefinitionPropertyGroupComponent addPriceComponent(
815        ChargeItemDefinitionPropertyGroupPriceComponentComponent t) { // 3
816      if (t == null)
817        return this;
818      if (this.priceComponent == null)
819        this.priceComponent = new ArrayList<ChargeItemDefinitionPropertyGroupPriceComponentComponent>();
820      this.priceComponent.add(t);
821      return this;
822    }
823
824    /**
825     * @return The first repetition of repeating field {@link #priceComponent},
826     *         creating it if it does not already exist
827     */
828    public ChargeItemDefinitionPropertyGroupPriceComponentComponent getPriceComponentFirstRep() {
829      if (getPriceComponent().isEmpty()) {
830        addPriceComponent();
831      }
832      return getPriceComponent().get(0);
833    }
834
835    protected void listChildren(List<Property> children) {
836      super.listChildren(children);
837      children.add(new Property("applicability", "@ChargeItemDefinition.applicability",
838          "Expressions that describe applicability criteria for the priceComponent.", 0, java.lang.Integer.MAX_VALUE,
839          applicability));
840      children.add(new Property("priceComponent", "",
841          "The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated.",
842          0, java.lang.Integer.MAX_VALUE, priceComponent));
843    }
844
845    @Override
846    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
847      switch (_hash) {
848      case -1526770491:
849        /* applicability */ return new Property("applicability", "@ChargeItemDefinition.applicability",
850            "Expressions that describe applicability criteria for the priceComponent.", 0, java.lang.Integer.MAX_VALUE,
851            applicability);
852      case 1219095988:
853        /* priceComponent */ return new Property("priceComponent", "",
854            "The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated.",
855            0, java.lang.Integer.MAX_VALUE, priceComponent);
856      default:
857        return super.getNamedProperty(_hash, _name, _checkValid);
858      }
859
860    }
861
862    @Override
863    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
864      switch (hash) {
865      case -1526770491:
866        /* applicability */ return this.applicability == null ? new Base[0]
867            : this.applicability.toArray(new Base[this.applicability.size()]); // ChargeItemDefinitionApplicabilityComponent
868      case 1219095988:
869        /* priceComponent */ return this.priceComponent == null ? new Base[0]
870            : this.priceComponent.toArray(new Base[this.priceComponent.size()]); // ChargeItemDefinitionPropertyGroupPriceComponentComponent
871      default:
872        return super.getProperty(hash, name, checkValid);
873      }
874
875    }
876
877    @Override
878    public Base setProperty(int hash, String name, Base value) throws FHIRException {
879      switch (hash) {
880      case -1526770491: // applicability
881        this.getApplicability().add((ChargeItemDefinitionApplicabilityComponent) value); // ChargeItemDefinitionApplicabilityComponent
882        return value;
883      case 1219095988: // priceComponent
884        this.getPriceComponent().add((ChargeItemDefinitionPropertyGroupPriceComponentComponent) value); // ChargeItemDefinitionPropertyGroupPriceComponentComponent
885        return value;
886      default:
887        return super.setProperty(hash, name, value);
888      }
889
890    }
891
892    @Override
893    public Base setProperty(String name, Base value) throws FHIRException {
894      if (name.equals("applicability")) {
895        this.getApplicability().add((ChargeItemDefinitionApplicabilityComponent) value);
896      } else if (name.equals("priceComponent")) {
897        this.getPriceComponent().add((ChargeItemDefinitionPropertyGroupPriceComponentComponent) value);
898      } else
899        return super.setProperty(name, value);
900      return value;
901    }
902
903  @Override
904  public void removeChild(String name, Base value) throws FHIRException {
905      if (name.equals("applicability")) {
906        this.getApplicability().remove((ChargeItemDefinitionApplicabilityComponent) value);
907      } else if (name.equals("priceComponent")) {
908        this.getPriceComponent().remove((ChargeItemDefinitionPropertyGroupPriceComponentComponent) value);
909      } else
910        super.removeChild(name, value);
911      
912    }
913
914    @Override
915    public Base makeProperty(int hash, String name) throws FHIRException {
916      switch (hash) {
917      case -1526770491:
918        return addApplicability();
919      case 1219095988:
920        return addPriceComponent();
921      default:
922        return super.makeProperty(hash, name);
923      }
924
925    }
926
927    @Override
928    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
929      switch (hash) {
930      case -1526770491:
931        /* applicability */ return new String[] { "@ChargeItemDefinition.applicability" };
932      case 1219095988:
933        /* priceComponent */ return new String[] {};
934      default:
935        return super.getTypesForProperty(hash, name);
936      }
937
938    }
939
940    @Override
941    public Base addChild(String name) throws FHIRException {
942      if (name.equals("applicability")) {
943        return addApplicability();
944      } else if (name.equals("priceComponent")) {
945        return addPriceComponent();
946      } else
947        return super.addChild(name);
948    }
949
950    public ChargeItemDefinitionPropertyGroupComponent copy() {
951      ChargeItemDefinitionPropertyGroupComponent dst = new ChargeItemDefinitionPropertyGroupComponent();
952      copyValues(dst);
953      return dst;
954    }
955
956    public void copyValues(ChargeItemDefinitionPropertyGroupComponent dst) {
957      super.copyValues(dst);
958      if (applicability != null) {
959        dst.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
960        for (ChargeItemDefinitionApplicabilityComponent i : applicability)
961          dst.applicability.add(i.copy());
962      }
963      ;
964      if (priceComponent != null) {
965        dst.priceComponent = new ArrayList<ChargeItemDefinitionPropertyGroupPriceComponentComponent>();
966        for (ChargeItemDefinitionPropertyGroupPriceComponentComponent i : priceComponent)
967          dst.priceComponent.add(i.copy());
968      }
969      ;
970    }
971
972    @Override
973    public boolean equalsDeep(Base other_) {
974      if (!super.equalsDeep(other_))
975        return false;
976      if (!(other_ instanceof ChargeItemDefinitionPropertyGroupComponent))
977        return false;
978      ChargeItemDefinitionPropertyGroupComponent o = (ChargeItemDefinitionPropertyGroupComponent) other_;
979      return compareDeep(applicability, o.applicability, true) && compareDeep(priceComponent, o.priceComponent, true);
980    }
981
982    @Override
983    public boolean equalsShallow(Base other_) {
984      if (!super.equalsShallow(other_))
985        return false;
986      if (!(other_ instanceof ChargeItemDefinitionPropertyGroupComponent))
987        return false;
988      ChargeItemDefinitionPropertyGroupComponent o = (ChargeItemDefinitionPropertyGroupComponent) other_;
989      return true;
990    }
991
992    public boolean isEmpty() {
993      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(applicability, priceComponent);
994    }
995
996    public String fhirType() {
997      return "ChargeItemDefinition.propertyGroup";
998
999    }
1000
1001  }
1002
1003  @Block()
1004  public static class ChargeItemDefinitionPropertyGroupPriceComponentComponent extends BackboneElement
1005      implements IBaseBackboneElement {
1006    /**
1007     * This code identifies the type of the component.
1008     */
1009    @Child(name = "type", type = { CodeType.class }, order = 1, min = 1, max = 1, modifier = false, summary = false)
1010    @Description(shortDefinition = "base | surcharge | deduction | discount | tax | informational", formalDefinition = "This code identifies the type of the component.")
1011    @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/invoice-priceComponentType")
1012    protected Enumeration<ChargeItemDefinitionPriceComponentType> type;
1013
1014    /**
1015     * A code that identifies the component. Codes may be used to differentiate
1016     * between kinds of taxes, surcharges, discounts etc.
1017     */
1018    @Child(name = "code", type = {
1019        CodeableConcept.class }, order = 2, min = 0, max = 1, modifier = false, summary = false)
1020    @Description(shortDefinition = "Code identifying the specific component", formalDefinition = "A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.")
1021    protected CodeableConcept code;
1022
1023    /**
1024     * The factor that has been applied on the base price for calculating this
1025     * component.
1026     */
1027    @Child(name = "factor", type = {
1028        DecimalType.class }, order = 3, min = 0, max = 1, modifier = false, summary = false)
1029    @Description(shortDefinition = "Factor used for calculating this component", formalDefinition = "The factor that has been applied on the base price for calculating this component.")
1030    protected DecimalType factor;
1031
1032    /**
1033     * The amount calculated for this component.
1034     */
1035    @Child(name = "amount", type = { Money.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
1036    @Description(shortDefinition = "Monetary amount associated with this component", formalDefinition = "The amount calculated for this component.")
1037    protected Money amount;
1038
1039    private static final long serialVersionUID = -841451335L;
1040
1041    /**
1042     * Constructor
1043     */
1044    public ChargeItemDefinitionPropertyGroupPriceComponentComponent() {
1045      super();
1046    }
1047
1048    /**
1049     * Constructor
1050     */
1051    public ChargeItemDefinitionPropertyGroupPriceComponentComponent(
1052        Enumeration<ChargeItemDefinitionPriceComponentType> type) {
1053      super();
1054      this.type = type;
1055    }
1056
1057    /**
1058     * @return {@link #type} (This code identifies the type of the component.). This
1059     *         is the underlying object with id, value and extensions. The accessor
1060     *         "getType" gives direct access to the value
1061     */
1062    public Enumeration<ChargeItemDefinitionPriceComponentType> getTypeElement() {
1063      if (this.type == null)
1064        if (Configuration.errorOnAutoCreate())
1065          throw new Error("Attempt to auto-create ChargeItemDefinitionPropertyGroupPriceComponentComponent.type");
1066        else if (Configuration.doAutoCreate())
1067          this.type = new Enumeration<ChargeItemDefinitionPriceComponentType>(
1068              new ChargeItemDefinitionPriceComponentTypeEnumFactory()); // bb
1069      return this.type;
1070    }
1071
1072    public boolean hasTypeElement() {
1073      return this.type != null && !this.type.isEmpty();
1074    }
1075
1076    public boolean hasType() {
1077      return this.type != null && !this.type.isEmpty();
1078    }
1079
1080    /**
1081     * @param value {@link #type} (This code identifies the type of the component.).
1082     *              This is the underlying object with id, value and extensions. The
1083     *              accessor "getType" gives direct access to the value
1084     */
1085    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setTypeElement(
1086        Enumeration<ChargeItemDefinitionPriceComponentType> value) {
1087      this.type = value;
1088      return this;
1089    }
1090
1091    /**
1092     * @return This code identifies the type of the component.
1093     */
1094    public ChargeItemDefinitionPriceComponentType getType() {
1095      return this.type == null ? null : this.type.getValue();
1096    }
1097
1098    /**
1099     * @param value This code identifies the type of the component.
1100     */
1101    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setType(
1102        ChargeItemDefinitionPriceComponentType value) {
1103      if (this.type == null)
1104        this.type = new Enumeration<ChargeItemDefinitionPriceComponentType>(
1105            new ChargeItemDefinitionPriceComponentTypeEnumFactory());
1106      this.type.setValue(value);
1107      return this;
1108    }
1109
1110    /**
1111     * @return {@link #code} (A code that identifies the component. Codes may be
1112     *         used to differentiate between kinds of taxes, surcharges, discounts
1113     *         etc.)
1114     */
1115    public CodeableConcept getCode() {
1116      if (this.code == null)
1117        if (Configuration.errorOnAutoCreate())
1118          throw new Error("Attempt to auto-create ChargeItemDefinitionPropertyGroupPriceComponentComponent.code");
1119        else if (Configuration.doAutoCreate())
1120          this.code = new CodeableConcept(); // cc
1121      return this.code;
1122    }
1123
1124    public boolean hasCode() {
1125      return this.code != null && !this.code.isEmpty();
1126    }
1127
1128    /**
1129     * @param value {@link #code} (A code that identifies the component. Codes may
1130     *              be used to differentiate between kinds of taxes, surcharges,
1131     *              discounts etc.)
1132     */
1133    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setCode(CodeableConcept value) {
1134      this.code = value;
1135      return this;
1136    }
1137
1138    /**
1139     * @return {@link #factor} (The factor that has been applied on the base price
1140     *         for calculating this component.). This is the underlying object with
1141     *         id, value and extensions. The accessor "getFactor" gives direct
1142     *         access to the value
1143     */
1144    public DecimalType getFactorElement() {
1145      if (this.factor == null)
1146        if (Configuration.errorOnAutoCreate())
1147          throw new Error("Attempt to auto-create ChargeItemDefinitionPropertyGroupPriceComponentComponent.factor");
1148        else if (Configuration.doAutoCreate())
1149          this.factor = new DecimalType(); // bb
1150      return this.factor;
1151    }
1152
1153    public boolean hasFactorElement() {
1154      return this.factor != null && !this.factor.isEmpty();
1155    }
1156
1157    public boolean hasFactor() {
1158      return this.factor != null && !this.factor.isEmpty();
1159    }
1160
1161    /**
1162     * @param value {@link #factor} (The factor that has been applied on the base
1163     *              price for calculating this component.). This is the underlying
1164     *              object with id, value and extensions. The accessor "getFactor"
1165     *              gives direct access to the value
1166     */
1167    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setFactorElement(DecimalType value) {
1168      this.factor = value;
1169      return this;
1170    }
1171
1172    /**
1173     * @return The factor that has been applied on the base price for calculating
1174     *         this component.
1175     */
1176    public BigDecimal getFactor() {
1177      return this.factor == null ? null : this.factor.getValue();
1178    }
1179
1180    /**
1181     * @param value The factor that has been applied on the base price for
1182     *              calculating this component.
1183     */
1184    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setFactor(BigDecimal value) {
1185      if (value == null)
1186        this.factor = null;
1187      else {
1188        if (this.factor == null)
1189          this.factor = new DecimalType();
1190        this.factor.setValue(value);
1191      }
1192      return this;
1193    }
1194
1195    /**
1196     * @param value The factor that has been applied on the base price for
1197     *              calculating this component.
1198     */
1199    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setFactor(long value) {
1200      this.factor = new DecimalType();
1201      this.factor.setValue(value);
1202      return this;
1203    }
1204
1205    /**
1206     * @param value The factor that has been applied on the base price for
1207     *              calculating this component.
1208     */
1209    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setFactor(double value) {
1210      this.factor = new DecimalType();
1211      this.factor.setValue(value);
1212      return this;
1213    }
1214
1215    /**
1216     * @return {@link #amount} (The amount calculated for this component.)
1217     */
1218    public Money getAmount() {
1219      if (this.amount == null)
1220        if (Configuration.errorOnAutoCreate())
1221          throw new Error("Attempt to auto-create ChargeItemDefinitionPropertyGroupPriceComponentComponent.amount");
1222        else if (Configuration.doAutoCreate())
1223          this.amount = new Money(); // cc
1224      return this.amount;
1225    }
1226
1227    public boolean hasAmount() {
1228      return this.amount != null && !this.amount.isEmpty();
1229    }
1230
1231    /**
1232     * @param value {@link #amount} (The amount calculated for this component.)
1233     */
1234    public ChargeItemDefinitionPropertyGroupPriceComponentComponent setAmount(Money value) {
1235      this.amount = value;
1236      return this;
1237    }
1238
1239    protected void listChildren(List<Property> children) {
1240      super.listChildren(children);
1241      children.add(new Property("type", "code", "This code identifies the type of the component.", 0, 1, type));
1242      children.add(new Property("code", "CodeableConcept",
1243          "A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.",
1244          0, 1, code));
1245      children.add(new Property("factor", "decimal",
1246          "The factor that has been applied on the base price for calculating this component.", 0, 1, factor));
1247      children.add(new Property("amount", "Money", "The amount calculated for this component.", 0, 1, amount));
1248    }
1249
1250    @Override
1251    public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1252      switch (_hash) {
1253      case 3575610:
1254        /* type */ return new Property("type", "code", "This code identifies the type of the component.", 0, 1, type);
1255      case 3059181:
1256        /* code */ return new Property("code", "CodeableConcept",
1257            "A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.",
1258            0, 1, code);
1259      case -1282148017:
1260        /* factor */ return new Property("factor", "decimal",
1261            "The factor that has been applied on the base price for calculating this component.", 0, 1, factor);
1262      case -1413853096:
1263        /* amount */ return new Property("amount", "Money", "The amount calculated for this component.", 0, 1, amount);
1264      default:
1265        return super.getNamedProperty(_hash, _name, _checkValid);
1266      }
1267
1268    }
1269
1270    @Override
1271    public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1272      switch (hash) {
1273      case 3575610:
1274        /* type */ return this.type == null ? new Base[0] : new Base[] { this.type }; // Enumeration<ChargeItemDefinitionPriceComponentType>
1275      case 3059181:
1276        /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
1277      case -1282148017:
1278        /* factor */ return this.factor == null ? new Base[0] : new Base[] { this.factor }; // DecimalType
1279      case -1413853096:
1280        /* amount */ return this.amount == null ? new Base[0] : new Base[] { this.amount }; // Money
1281      default:
1282        return super.getProperty(hash, name, checkValid);
1283      }
1284
1285    }
1286
1287    @Override
1288    public Base setProperty(int hash, String name, Base value) throws FHIRException {
1289      switch (hash) {
1290      case 3575610: // type
1291        value = new ChargeItemDefinitionPriceComponentTypeEnumFactory().fromType(castToCode(value));
1292        this.type = (Enumeration) value; // Enumeration<ChargeItemDefinitionPriceComponentType>
1293        return value;
1294      case 3059181: // code
1295        this.code = castToCodeableConcept(value); // CodeableConcept
1296        return value;
1297      case -1282148017: // factor
1298        this.factor = castToDecimal(value); // DecimalType
1299        return value;
1300      case -1413853096: // amount
1301        this.amount = castToMoney(value); // Money
1302        return value;
1303      default:
1304        return super.setProperty(hash, name, value);
1305      }
1306
1307    }
1308
1309    @Override
1310    public Base setProperty(String name, Base value) throws FHIRException {
1311      if (name.equals("type")) {
1312        value = new ChargeItemDefinitionPriceComponentTypeEnumFactory().fromType(castToCode(value));
1313        this.type = (Enumeration) value; // Enumeration<ChargeItemDefinitionPriceComponentType>
1314      } else if (name.equals("code")) {
1315        this.code = castToCodeableConcept(value); // CodeableConcept
1316      } else if (name.equals("factor")) {
1317        this.factor = castToDecimal(value); // DecimalType
1318      } else if (name.equals("amount")) {
1319        this.amount = castToMoney(value); // Money
1320      } else
1321        return super.setProperty(name, value);
1322      return value;
1323    }
1324
1325  @Override
1326  public void removeChild(String name, Base value) throws FHIRException {
1327      if (name.equals("type")) {
1328        this.type = null;
1329      } else if (name.equals("code")) {
1330        this.code = null;
1331      } else if (name.equals("factor")) {
1332        this.factor = null;
1333      } else if (name.equals("amount")) {
1334        this.amount = null;
1335      } else
1336        super.removeChild(name, value);
1337      
1338    }
1339
1340    @Override
1341    public Base makeProperty(int hash, String name) throws FHIRException {
1342      switch (hash) {
1343      case 3575610:
1344        return getTypeElement();
1345      case 3059181:
1346        return getCode();
1347      case -1282148017:
1348        return getFactorElement();
1349      case -1413853096:
1350        return getAmount();
1351      default:
1352        return super.makeProperty(hash, name);
1353      }
1354
1355    }
1356
1357    @Override
1358    public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1359      switch (hash) {
1360      case 3575610:
1361        /* type */ return new String[] { "code" };
1362      case 3059181:
1363        /* code */ return new String[] { "CodeableConcept" };
1364      case -1282148017:
1365        /* factor */ return new String[] { "decimal" };
1366      case -1413853096:
1367        /* amount */ return new String[] { "Money" };
1368      default:
1369        return super.getTypesForProperty(hash, name);
1370      }
1371
1372    }
1373
1374    @Override
1375    public Base addChild(String name) throws FHIRException {
1376      if (name.equals("type")) {
1377        throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.type");
1378      } else if (name.equals("code")) {
1379        this.code = new CodeableConcept();
1380        return this.code;
1381      } else if (name.equals("factor")) {
1382        throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.factor");
1383      } else if (name.equals("amount")) {
1384        this.amount = new Money();
1385        return this.amount;
1386      } else
1387        return super.addChild(name);
1388    }
1389
1390    public ChargeItemDefinitionPropertyGroupPriceComponentComponent copy() {
1391      ChargeItemDefinitionPropertyGroupPriceComponentComponent dst = new ChargeItemDefinitionPropertyGroupPriceComponentComponent();
1392      copyValues(dst);
1393      return dst;
1394    }
1395
1396    public void copyValues(ChargeItemDefinitionPropertyGroupPriceComponentComponent dst) {
1397      super.copyValues(dst);
1398      dst.type = type == null ? null : type.copy();
1399      dst.code = code == null ? null : code.copy();
1400      dst.factor = factor == null ? null : factor.copy();
1401      dst.amount = amount == null ? null : amount.copy();
1402    }
1403
1404    @Override
1405    public boolean equalsDeep(Base other_) {
1406      if (!super.equalsDeep(other_))
1407        return false;
1408      if (!(other_ instanceof ChargeItemDefinitionPropertyGroupPriceComponentComponent))
1409        return false;
1410      ChargeItemDefinitionPropertyGroupPriceComponentComponent o = (ChargeItemDefinitionPropertyGroupPriceComponentComponent) other_;
1411      return compareDeep(type, o.type, true) && compareDeep(code, o.code, true) && compareDeep(factor, o.factor, true)
1412          && compareDeep(amount, o.amount, true);
1413    }
1414
1415    @Override
1416    public boolean equalsShallow(Base other_) {
1417      if (!super.equalsShallow(other_))
1418        return false;
1419      if (!(other_ instanceof ChargeItemDefinitionPropertyGroupPriceComponentComponent))
1420        return false;
1421      ChargeItemDefinitionPropertyGroupPriceComponentComponent o = (ChargeItemDefinitionPropertyGroupPriceComponentComponent) other_;
1422      return compareValues(type, o.type, true) && compareValues(factor, o.factor, true);
1423    }
1424
1425    public boolean isEmpty() {
1426      return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, code, factor, amount);
1427    }
1428
1429    public String fhirType() {
1430      return "ChargeItemDefinition.propertyGroup.priceComponent";
1431
1432    }
1433
1434  }
1435
1436  /**
1437   * A formal identifier that is used to identify this charge item definition when
1438   * it is represented in other formats, or referenced in a specification, model,
1439   * design or an instance.
1440   */
1441  @Child(name = "identifier", type = {
1442      Identifier.class }, order = 0, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1443  @Description(shortDefinition = "Additional identifier for the charge item definition", formalDefinition = "A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance.")
1444  protected List<Identifier> identifier;
1445
1446  /**
1447   * The URL pointing to an externally-defined charge item definition that is
1448   * adhered to in whole or in part by this definition.
1449   */
1450  @Child(name = "derivedFromUri", type = {
1451      UriType.class }, order = 1, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1452  @Description(shortDefinition = "Underlying externally-defined charge item definition", formalDefinition = "The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition.")
1453  protected List<UriType> derivedFromUri;
1454
1455  /**
1456   * A larger definition of which this particular definition is a component or
1457   * step.
1458   */
1459  @Child(name = "partOf", type = {
1460      CanonicalType.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1461  @Description(shortDefinition = "A larger definition of which this particular definition is a component or step", formalDefinition = "A larger definition of which this particular definition is a component or step.")
1462  protected List<CanonicalType> partOf;
1463
1464  /**
1465   * As new versions of a protocol or guideline are defined, allows identification
1466   * of what versions are replaced by a new instance.
1467   */
1468  @Child(name = "replaces", type = {
1469      CanonicalType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true)
1470  @Description(shortDefinition = "Completed or terminated request(s) whose function is taken by this new request", formalDefinition = "As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance.")
1471  protected List<CanonicalType> replaces;
1472
1473  /**
1474   * A copyright statement relating to the charge item definition and/or its
1475   * contents. Copyright statements are generally legal restrictions on the use
1476   * and publishing of the charge item definition.
1477   */
1478  @Child(name = "copyright", type = {
1479      MarkdownType.class }, order = 4, min = 0, max = 1, modifier = false, summary = false)
1480  @Description(shortDefinition = "Use and/or publishing restrictions", formalDefinition = "A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition.")
1481  protected MarkdownType copyright;
1482
1483  /**
1484   * The date on which the resource content was approved by the publisher.
1485   * Approval happens once when the content is officially approved for usage.
1486   */
1487  @Child(name = "approvalDate", type = {
1488      DateType.class }, order = 5, min = 0, max = 1, modifier = false, summary = false)
1489  @Description(shortDefinition = "When the charge item definition was approved by publisher", formalDefinition = "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.")
1490  protected DateType approvalDate;
1491
1492  /**
1493   * The date on which the resource content was last reviewed. Review happens
1494   * periodically after approval but does not change the original approval date.
1495   */
1496  @Child(name = "lastReviewDate", type = {
1497      DateType.class }, order = 6, min = 0, max = 1, modifier = false, summary = false)
1498  @Description(shortDefinition = "When the charge item definition was last reviewed", formalDefinition = "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.")
1499  protected DateType lastReviewDate;
1500
1501  /**
1502   * The period during which the charge item definition content was or is planned
1503   * to be in active use.
1504   */
1505  @Child(name = "effectivePeriod", type = {
1506      Period.class }, order = 7, min = 0, max = 1, modifier = false, summary = true)
1507  @Description(shortDefinition = "When the charge item definition is expected to be used", formalDefinition = "The period during which the charge item definition content was or is planned to be in active use.")
1508  protected Period effectivePeriod;
1509
1510  /**
1511   * The defined billing details in this resource pertain to the given billing
1512   * code.
1513   */
1514  @Child(name = "code", type = { CodeableConcept.class }, order = 8, min = 0, max = 1, modifier = false, summary = true)
1515  @Description(shortDefinition = "Billing codes or product types this definition applies to", formalDefinition = "The defined billing details in this resource pertain to the given billing code.")
1516  @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/chargeitem-billingcodes")
1517  protected CodeableConcept code;
1518
1519  /**
1520   * The defined billing details in this resource pertain to the given product
1521   * instance(s).
1522   */
1523  @Child(name = "instance", type = { Medication.class, Substance.class,
1524      Device.class }, order = 9, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1525  @Description(shortDefinition = "Instances this definition applies to", formalDefinition = "The defined billing details in this resource pertain to the given product instance(s).")
1526  protected List<Reference> instance;
1527  /**
1528   * The actual objects that are the target of the reference (The defined billing
1529   * details in this resource pertain to the given product instance(s).)
1530   */
1531  protected List<Resource> instanceTarget;
1532
1533  /**
1534   * Expressions that describe applicability criteria for the billing code.
1535   */
1536  @Child(name = "applicability", type = {}, order = 10, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1537  @Description(shortDefinition = "Whether or not the billing code is applicable", formalDefinition = "Expressions that describe applicability criteria for the billing code.")
1538  protected List<ChargeItemDefinitionApplicabilityComponent> applicability;
1539
1540  /**
1541   * Group of properties which are applicable under the same conditions. If no
1542   * applicability rules are established for the group, then all properties always
1543   * apply.
1544   */
1545  @Child(name = "propertyGroup", type = {}, order = 11, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = false)
1546  @Description(shortDefinition = "Group of properties which are applicable under the same conditions", formalDefinition = "Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply.")
1547  protected List<ChargeItemDefinitionPropertyGroupComponent> propertyGroup;
1548
1549  private static final long serialVersionUID = -583681330L;
1550
1551  /**
1552   * Constructor
1553   */
1554  public ChargeItemDefinition() {
1555    super();
1556  }
1557
1558  /**
1559   * Constructor
1560   */
1561  public ChargeItemDefinition(UriType url, Enumeration<PublicationStatus> status) {
1562    super();
1563    this.url = url;
1564    this.status = status;
1565  }
1566
1567  /**
1568   * @return {@link #url} (An absolute URI that is used to identify this charge
1569   *         item definition when it is referenced in a specification, model,
1570   *         design or an instance; also called its canonical identifier. This
1571   *         SHOULD be globally unique and SHOULD be a literal address at which at
1572   *         which an authoritative instance of this charge item definition is (or
1573   *         will be) published. This URL can be the target of a canonical
1574   *         reference. It SHALL remain the same when the charge item definition
1575   *         is stored on different servers.). This is the underlying object with
1576   *         id, value and extensions. The accessor "getUrl" gives direct access
1577   *         to the value
1578   */
1579  public UriType getUrlElement() {
1580    if (this.url == null)
1581      if (Configuration.errorOnAutoCreate())
1582        throw new Error("Attempt to auto-create ChargeItemDefinition.url");
1583      else if (Configuration.doAutoCreate())
1584        this.url = new UriType(); // bb
1585    return this.url;
1586  }
1587
1588  public boolean hasUrlElement() {
1589    return this.url != null && !this.url.isEmpty();
1590  }
1591
1592  public boolean hasUrl() {
1593    return this.url != null && !this.url.isEmpty();
1594  }
1595
1596  /**
1597   * @param value {@link #url} (An absolute URI that is used to identify this
1598   *              charge item definition when it is referenced in a specification,
1599   *              model, design or an instance; also called its canonical
1600   *              identifier. This SHOULD be globally unique and SHOULD be a
1601   *              literal address at which at which an authoritative instance of
1602   *              this charge item definition is (or will be) published. This URL
1603   *              can be the target of a canonical reference. It SHALL remain the
1604   *              same when the charge item definition is stored on different
1605   *              servers.). This is the underlying object with id, value and
1606   *              extensions. The accessor "getUrl" gives direct access to the
1607   *              value
1608   */
1609  public ChargeItemDefinition setUrlElement(UriType value) {
1610    this.url = value;
1611    return this;
1612  }
1613
1614  /**
1615   * @return An absolute URI that is used to identify this charge item definition
1616   *         when it is referenced in a specification, model, design or an
1617   *         instance; also called its canonical identifier. This SHOULD be
1618   *         globally unique and SHOULD be a literal address at which at which an
1619   *         authoritative instance of this charge item definition is (or will be)
1620   *         published. This URL can be the target of a canonical reference. It
1621   *         SHALL remain the same when the charge item definition is stored on
1622   *         different servers.
1623   */
1624  public String getUrl() {
1625    return this.url == null ? null : this.url.getValue();
1626  }
1627
1628  /**
1629   * @param value An absolute URI that is used to identify this charge item
1630   *              definition when it is referenced in a specification, model,
1631   *              design or an instance; also called its canonical identifier.
1632   *              This SHOULD be globally unique and SHOULD be a literal address
1633   *              at which at which an authoritative instance of this charge item
1634   *              definition is (or will be) published. This URL can be the target
1635   *              of a canonical reference. It SHALL remain the same when the
1636   *              charge item definition is stored on different servers.
1637   */
1638  public ChargeItemDefinition setUrl(String value) {
1639    if (this.url == null)
1640      this.url = new UriType();
1641    this.url.setValue(value);
1642    return this;
1643  }
1644
1645  /**
1646   * @return {@link #identifier} (A formal identifier that is used to identify
1647   *         this charge item definition when it is represented in other formats,
1648   *         or referenced in a specification, model, design or an instance.)
1649   */
1650  public List<Identifier> getIdentifier() {
1651    if (this.identifier == null)
1652      this.identifier = new ArrayList<Identifier>();
1653    return this.identifier;
1654  }
1655
1656  /**
1657   * @return Returns a reference to <code>this</code> for easy method chaining
1658   */
1659  public ChargeItemDefinition setIdentifier(List<Identifier> theIdentifier) {
1660    this.identifier = theIdentifier;
1661    return this;
1662  }
1663
1664  public boolean hasIdentifier() {
1665    if (this.identifier == null)
1666      return false;
1667    for (Identifier item : this.identifier)
1668      if (!item.isEmpty())
1669        return true;
1670    return false;
1671  }
1672
1673  public Identifier addIdentifier() { // 3
1674    Identifier t = new Identifier();
1675    if (this.identifier == null)
1676      this.identifier = new ArrayList<Identifier>();
1677    this.identifier.add(t);
1678    return t;
1679  }
1680
1681  public ChargeItemDefinition addIdentifier(Identifier t) { // 3
1682    if (t == null)
1683      return this;
1684    if (this.identifier == null)
1685      this.identifier = new ArrayList<Identifier>();
1686    this.identifier.add(t);
1687    return this;
1688  }
1689
1690  /**
1691   * @return The first repetition of repeating field {@link #identifier}, creating
1692   *         it if it does not already exist
1693   */
1694  public Identifier getIdentifierFirstRep() {
1695    if (getIdentifier().isEmpty()) {
1696      addIdentifier();
1697    }
1698    return getIdentifier().get(0);
1699  }
1700
1701  /**
1702   * @return {@link #version} (The identifier that is used to identify this
1703   *         version of the charge item definition when it is referenced in a
1704   *         specification, model, design or instance. This is an arbitrary value
1705   *         managed by the charge item definition author and is not expected to
1706   *         be globally unique. For example, it might be a timestamp (e.g.
1707   *         yyyymmdd) if a managed version is not available. There is also no
1708   *         expectation that versions can be placed in a lexicographical
1709   *         sequence. To provide a version consistent with the Decision Support
1710   *         Service specification, use the format Major.Minor.Revision (e.g.
1711   *         1.0.0). For more information on versioning knowledge assets, refer to
1712   *         the Decision Support Service specification. Note that a version is
1713   *         required for non-experimental active assets.). This is the underlying
1714   *         object with id, value and extensions. The accessor "getVersion" gives
1715   *         direct access to the value
1716   */
1717  public StringType getVersionElement() {
1718    if (this.version == null)
1719      if (Configuration.errorOnAutoCreate())
1720        throw new Error("Attempt to auto-create ChargeItemDefinition.version");
1721      else if (Configuration.doAutoCreate())
1722        this.version = new StringType(); // bb
1723    return this.version;
1724  }
1725
1726  public boolean hasVersionElement() {
1727    return this.version != null && !this.version.isEmpty();
1728  }
1729
1730  public boolean hasVersion() {
1731    return this.version != null && !this.version.isEmpty();
1732  }
1733
1734  /**
1735   * @param value {@link #version} (The identifier that is used to identify this
1736   *              version of the charge item definition when it is referenced in a
1737   *              specification, model, design or instance. This is an arbitrary
1738   *              value managed by the charge item definition author and is not
1739   *              expected to be globally unique. For example, it might be a
1740   *              timestamp (e.g. yyyymmdd) if a managed version is not available.
1741   *              There is also no expectation that versions can be placed in a
1742   *              lexicographical sequence. To provide a version consistent with
1743   *              the Decision Support Service specification, use the format
1744   *              Major.Minor.Revision (e.g. 1.0.0). For more information on
1745   *              versioning knowledge assets, refer to the Decision Support
1746   *              Service specification. Note that a version is required for
1747   *              non-experimental active assets.). This is the underlying object
1748   *              with id, value and extensions. The accessor "getVersion" gives
1749   *              direct access to the value
1750   */
1751  public ChargeItemDefinition setVersionElement(StringType value) {
1752    this.version = value;
1753    return this;
1754  }
1755
1756  /**
1757   * @return The identifier that is used to identify this version of the charge
1758   *         item definition when it is referenced in a specification, model,
1759   *         design or instance. This is an arbitrary value managed by the charge
1760   *         item definition author and is not expected to be globally unique. For
1761   *         example, it might be a timestamp (e.g. yyyymmdd) if a managed version
1762   *         is not available. There is also no expectation that versions can be
1763   *         placed in a lexicographical sequence. To provide a version consistent
1764   *         with the Decision Support Service specification, use the format
1765   *         Major.Minor.Revision (e.g. 1.0.0). For more information on versioning
1766   *         knowledge assets, refer to the Decision Support Service
1767   *         specification. Note that a version is required for non-experimental
1768   *         active assets.
1769   */
1770  public String getVersion() {
1771    return this.version == null ? null : this.version.getValue();
1772  }
1773
1774  /**
1775   * @param value The identifier that is used to identify this version of the
1776   *              charge item definition when it is referenced in a specification,
1777   *              model, design or instance. This is an arbitrary value managed by
1778   *              the charge item definition author and is not expected to be
1779   *              globally unique. For example, it might be a timestamp (e.g.
1780   *              yyyymmdd) if a managed version is not available. There is also
1781   *              no expectation that versions can be placed in a lexicographical
1782   *              sequence. To provide a version consistent with the Decision
1783   *              Support Service specification, use the format
1784   *              Major.Minor.Revision (e.g. 1.0.0). For more information on
1785   *              versioning knowledge assets, refer to the Decision Support
1786   *              Service specification. Note that a version is required for
1787   *              non-experimental active assets.
1788   */
1789  public ChargeItemDefinition setVersion(String value) {
1790    if (Utilities.noString(value))
1791      this.version = null;
1792    else {
1793      if (this.version == null)
1794        this.version = new StringType();
1795      this.version.setValue(value);
1796    }
1797    return this;
1798  }
1799
1800  /**
1801   * @return {@link #title} (A short, descriptive, user-friendly title for the
1802   *         charge item definition.). This is the underlying object with id,
1803   *         value and extensions. The accessor "getTitle" gives direct access to
1804   *         the value
1805   */
1806  public StringType getTitleElement() {
1807    if (this.title == null)
1808      if (Configuration.errorOnAutoCreate())
1809        throw new Error("Attempt to auto-create ChargeItemDefinition.title");
1810      else if (Configuration.doAutoCreate())
1811        this.title = new StringType(); // bb
1812    return this.title;
1813  }
1814
1815  public boolean hasTitleElement() {
1816    return this.title != null && !this.title.isEmpty();
1817  }
1818
1819  public boolean hasTitle() {
1820    return this.title != null && !this.title.isEmpty();
1821  }
1822
1823  /**
1824   * @param value {@link #title} (A short, descriptive, user-friendly title for
1825   *              the charge item definition.). This is the underlying object with
1826   *              id, value and extensions. The accessor "getTitle" gives direct
1827   *              access to the value
1828   */
1829  public ChargeItemDefinition setTitleElement(StringType value) {
1830    this.title = value;
1831    return this;
1832  }
1833
1834  /**
1835   * @return A short, descriptive, user-friendly title for the charge item
1836   *         definition.
1837   */
1838  public String getTitle() {
1839    return this.title == null ? null : this.title.getValue();
1840  }
1841
1842  /**
1843   * @param value A short, descriptive, user-friendly title for the charge item
1844   *              definition.
1845   */
1846  public ChargeItemDefinition setTitle(String value) {
1847    if (Utilities.noString(value))
1848      this.title = null;
1849    else {
1850      if (this.title == null)
1851        this.title = new StringType();
1852      this.title.setValue(value);
1853    }
1854    return this;
1855  }
1856
1857  /**
1858   * @return {@link #derivedFromUri} (The URL pointing to an externally-defined
1859   *         charge item definition that is adhered to in whole or in part by this
1860   *         definition.)
1861   */
1862  public List<UriType> getDerivedFromUri() {
1863    if (this.derivedFromUri == null)
1864      this.derivedFromUri = new ArrayList<UriType>();
1865    return this.derivedFromUri;
1866  }
1867
1868  /**
1869   * @return Returns a reference to <code>this</code> for easy method chaining
1870   */
1871  public ChargeItemDefinition setDerivedFromUri(List<UriType> theDerivedFromUri) {
1872    this.derivedFromUri = theDerivedFromUri;
1873    return this;
1874  }
1875
1876  public boolean hasDerivedFromUri() {
1877    if (this.derivedFromUri == null)
1878      return false;
1879    for (UriType item : this.derivedFromUri)
1880      if (!item.isEmpty())
1881        return true;
1882    return false;
1883  }
1884
1885  /**
1886   * @return {@link #derivedFromUri} (The URL pointing to an externally-defined
1887   *         charge item definition that is adhered to in whole or in part by this
1888   *         definition.)
1889   */
1890  public UriType addDerivedFromUriElement() {// 2
1891    UriType t = new UriType();
1892    if (this.derivedFromUri == null)
1893      this.derivedFromUri = new ArrayList<UriType>();
1894    this.derivedFromUri.add(t);
1895    return t;
1896  }
1897
1898  /**
1899   * @param value {@link #derivedFromUri} (The URL pointing to an
1900   *              externally-defined charge item definition that is adhered to in
1901   *              whole or in part by this definition.)
1902   */
1903  public ChargeItemDefinition addDerivedFromUri(String value) { // 1
1904    UriType t = new UriType();
1905    t.setValue(value);
1906    if (this.derivedFromUri == null)
1907      this.derivedFromUri = new ArrayList<UriType>();
1908    this.derivedFromUri.add(t);
1909    return this;
1910  }
1911
1912  /**
1913   * @param value {@link #derivedFromUri} (The URL pointing to an
1914   *              externally-defined charge item definition that is adhered to in
1915   *              whole or in part by this definition.)
1916   */
1917  public boolean hasDerivedFromUri(String value) {
1918    if (this.derivedFromUri == null)
1919      return false;
1920    for (UriType v : this.derivedFromUri)
1921      if (v.getValue().equals(value)) // uri
1922        return true;
1923    return false;
1924  }
1925
1926  /**
1927   * @return {@link #partOf} (A larger definition of which this particular
1928   *         definition is a component or step.)
1929   */
1930  public List<CanonicalType> getPartOf() {
1931    if (this.partOf == null)
1932      this.partOf = new ArrayList<CanonicalType>();
1933    return this.partOf;
1934  }
1935
1936  /**
1937   * @return Returns a reference to <code>this</code> for easy method chaining
1938   */
1939  public ChargeItemDefinition setPartOf(List<CanonicalType> thePartOf) {
1940    this.partOf = thePartOf;
1941    return this;
1942  }
1943
1944  public boolean hasPartOf() {
1945    if (this.partOf == null)
1946      return false;
1947    for (CanonicalType item : this.partOf)
1948      if (!item.isEmpty())
1949        return true;
1950    return false;
1951  }
1952
1953  /**
1954   * @return {@link #partOf} (A larger definition of which this particular
1955   *         definition is a component or step.)
1956   */
1957  public CanonicalType addPartOfElement() {// 2
1958    CanonicalType t = new CanonicalType();
1959    if (this.partOf == null)
1960      this.partOf = new ArrayList<CanonicalType>();
1961    this.partOf.add(t);
1962    return t;
1963  }
1964
1965  /**
1966   * @param value {@link #partOf} (A larger definition of which this particular
1967   *              definition is a component or step.)
1968   */
1969  public ChargeItemDefinition addPartOf(String value) { // 1
1970    CanonicalType t = new CanonicalType();
1971    t.setValue(value);
1972    if (this.partOf == null)
1973      this.partOf = new ArrayList<CanonicalType>();
1974    this.partOf.add(t);
1975    return this;
1976  }
1977
1978  /**
1979   * @param value {@link #partOf} (A larger definition of which this particular
1980   *              definition is a component or step.)
1981   */
1982  public boolean hasPartOf(String value) {
1983    if (this.partOf == null)
1984      return false;
1985    for (CanonicalType v : this.partOf)
1986      if (v.getValue().equals(value)) // canonical(ChargeItemDefinition)
1987        return true;
1988    return false;
1989  }
1990
1991  /**
1992   * @return {@link #replaces} (As new versions of a protocol or guideline are
1993   *         defined, allows identification of what versions are replaced by a new
1994   *         instance.)
1995   */
1996  public List<CanonicalType> getReplaces() {
1997    if (this.replaces == null)
1998      this.replaces = new ArrayList<CanonicalType>();
1999    return this.replaces;
2000  }
2001
2002  /**
2003   * @return Returns a reference to <code>this</code> for easy method chaining
2004   */
2005  public ChargeItemDefinition setReplaces(List<CanonicalType> theReplaces) {
2006    this.replaces = theReplaces;
2007    return this;
2008  }
2009
2010  public boolean hasReplaces() {
2011    if (this.replaces == null)
2012      return false;
2013    for (CanonicalType item : this.replaces)
2014      if (!item.isEmpty())
2015        return true;
2016    return false;
2017  }
2018
2019  /**
2020   * @return {@link #replaces} (As new versions of a protocol or guideline are
2021   *         defined, allows identification of what versions are replaced by a new
2022   *         instance.)
2023   */
2024  public CanonicalType addReplacesElement() {// 2
2025    CanonicalType t = new CanonicalType();
2026    if (this.replaces == null)
2027      this.replaces = new ArrayList<CanonicalType>();
2028    this.replaces.add(t);
2029    return t;
2030  }
2031
2032  /**
2033   * @param value {@link #replaces} (As new versions of a protocol or guideline
2034   *              are defined, allows identification of what versions are replaced
2035   *              by a new instance.)
2036   */
2037  public ChargeItemDefinition addReplaces(String value) { // 1
2038    CanonicalType t = new CanonicalType();
2039    t.setValue(value);
2040    if (this.replaces == null)
2041      this.replaces = new ArrayList<CanonicalType>();
2042    this.replaces.add(t);
2043    return this;
2044  }
2045
2046  /**
2047   * @param value {@link #replaces} (As new versions of a protocol or guideline
2048   *              are defined, allows identification of what versions are replaced
2049   *              by a new instance.)
2050   */
2051  public boolean hasReplaces(String value) {
2052    if (this.replaces == null)
2053      return false;
2054    for (CanonicalType v : this.replaces)
2055      if (v.getValue().equals(value)) // canonical(ChargeItemDefinition)
2056        return true;
2057    return false;
2058  }
2059
2060  /**
2061   * @return {@link #status} (The current state of the ChargeItemDefinition.).
2062   *         This is the underlying object with id, value and extensions. The
2063   *         accessor "getStatus" gives direct access to the value
2064   */
2065  public Enumeration<PublicationStatus> getStatusElement() {
2066    if (this.status == null)
2067      if (Configuration.errorOnAutoCreate())
2068        throw new Error("Attempt to auto-create ChargeItemDefinition.status");
2069      else if (Configuration.doAutoCreate())
2070        this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2071    return this.status;
2072  }
2073
2074  public boolean hasStatusElement() {
2075    return this.status != null && !this.status.isEmpty();
2076  }
2077
2078  public boolean hasStatus() {
2079    return this.status != null && !this.status.isEmpty();
2080  }
2081
2082  /**
2083   * @param value {@link #status} (The current state of the
2084   *              ChargeItemDefinition.). This is the underlying object with id,
2085   *              value and extensions. The accessor "getStatus" gives direct
2086   *              access to the value
2087   */
2088  public ChargeItemDefinition setStatusElement(Enumeration<PublicationStatus> value) {
2089    this.status = value;
2090    return this;
2091  }
2092
2093  /**
2094   * @return The current state of the ChargeItemDefinition.
2095   */
2096  public PublicationStatus getStatus() {
2097    return this.status == null ? null : this.status.getValue();
2098  }
2099
2100  /**
2101   * @param value The current state of the ChargeItemDefinition.
2102   */
2103  public ChargeItemDefinition setStatus(PublicationStatus value) {
2104    if (this.status == null)
2105      this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2106    this.status.setValue(value);
2107    return this;
2108  }
2109
2110  /**
2111   * @return {@link #experimental} (A Boolean value to indicate that this charge
2112   *         item definition is authored for testing purposes (or
2113   *         education/evaluation/marketing) and is not intended to be used for
2114   *         genuine usage.). This is the underlying object with id, value and
2115   *         extensions. The accessor "getExperimental" gives direct access to the
2116   *         value
2117   */
2118  public BooleanType getExperimentalElement() {
2119    if (this.experimental == null)
2120      if (Configuration.errorOnAutoCreate())
2121        throw new Error("Attempt to auto-create ChargeItemDefinition.experimental");
2122      else if (Configuration.doAutoCreate())
2123        this.experimental = new BooleanType(); // bb
2124    return this.experimental;
2125  }
2126
2127  public boolean hasExperimentalElement() {
2128    return this.experimental != null && !this.experimental.isEmpty();
2129  }
2130
2131  public boolean hasExperimental() {
2132    return this.experimental != null && !this.experimental.isEmpty();
2133  }
2134
2135  /**
2136   * @param value {@link #experimental} (A Boolean value to indicate that this
2137   *              charge item definition is authored for testing purposes (or
2138   *              education/evaluation/marketing) and is not intended to be used
2139   *              for genuine usage.). This is the underlying object with id,
2140   *              value and extensions. The accessor "getExperimental" gives
2141   *              direct access to the value
2142   */
2143  public ChargeItemDefinition setExperimentalElement(BooleanType value) {
2144    this.experimental = value;
2145    return this;
2146  }
2147
2148  /**
2149   * @return A Boolean value to indicate that this charge item definition is
2150   *         authored for testing purposes (or education/evaluation/marketing) and
2151   *         is not intended to be used for genuine usage.
2152   */
2153  public boolean getExperimental() {
2154    return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
2155  }
2156
2157  /**
2158   * @param value A Boolean value to indicate that this charge item definition is
2159   *              authored for testing purposes (or
2160   *              education/evaluation/marketing) and is not intended to be used
2161   *              for genuine usage.
2162   */
2163  public ChargeItemDefinition setExperimental(boolean value) {
2164    if (this.experimental == null)
2165      this.experimental = new BooleanType();
2166    this.experimental.setValue(value);
2167    return this;
2168  }
2169
2170  /**
2171   * @return {@link #date} (The date (and optionally time) when the charge item
2172   *         definition was published. The date must change when the business
2173   *         version changes and it must change if the status code changes. In
2174   *         addition, it should change when the substantive content of the charge
2175   *         item definition changes.). This is the underlying object with id,
2176   *         value and extensions. The accessor "getDate" gives direct access to
2177   *         the value
2178   */
2179  public DateTimeType getDateElement() {
2180    if (this.date == null)
2181      if (Configuration.errorOnAutoCreate())
2182        throw new Error("Attempt to auto-create ChargeItemDefinition.date");
2183      else if (Configuration.doAutoCreate())
2184        this.date = new DateTimeType(); // bb
2185    return this.date;
2186  }
2187
2188  public boolean hasDateElement() {
2189    return this.date != null && !this.date.isEmpty();
2190  }
2191
2192  public boolean hasDate() {
2193    return this.date != null && !this.date.isEmpty();
2194  }
2195
2196  /**
2197   * @param value {@link #date} (The date (and optionally time) when the charge
2198   *              item definition was published. The date must change when the
2199   *              business version changes and it must change if the status code
2200   *              changes. In addition, it should change when the substantive
2201   *              content of the charge item definition changes.). This is the
2202   *              underlying object with id, value and extensions. The accessor
2203   *              "getDate" gives direct access to the value
2204   */
2205  public ChargeItemDefinition setDateElement(DateTimeType value) {
2206    this.date = value;
2207    return this;
2208  }
2209
2210  /**
2211   * @return The date (and optionally time) when the charge item definition was
2212   *         published. The date must change when the business version changes and
2213   *         it must change if the status code changes. In addition, it should
2214   *         change when the substantive content of the charge item definition
2215   *         changes.
2216   */
2217  public Date getDate() {
2218    return this.date == null ? null : this.date.getValue();
2219  }
2220
2221  /**
2222   * @param value The date (and optionally time) when the charge item definition
2223   *              was published. The date must change when the business version
2224   *              changes and it must change if the status code changes. In
2225   *              addition, it should change when the substantive content of the
2226   *              charge item definition changes.
2227   */
2228  public ChargeItemDefinition setDate(Date value) {
2229    if (value == null)
2230      this.date = null;
2231    else {
2232      if (this.date == null)
2233        this.date = new DateTimeType();
2234      this.date.setValue(value);
2235    }
2236    return this;
2237  }
2238
2239  /**
2240   * @return {@link #publisher} (The name of the organization or individual that
2241   *         published the charge item definition.). This is the underlying object
2242   *         with id, value and extensions. The accessor "getPublisher" gives
2243   *         direct access to the value
2244   */
2245  public StringType getPublisherElement() {
2246    if (this.publisher == null)
2247      if (Configuration.errorOnAutoCreate())
2248        throw new Error("Attempt to auto-create ChargeItemDefinition.publisher");
2249      else if (Configuration.doAutoCreate())
2250        this.publisher = new StringType(); // bb
2251    return this.publisher;
2252  }
2253
2254  public boolean hasPublisherElement() {
2255    return this.publisher != null && !this.publisher.isEmpty();
2256  }
2257
2258  public boolean hasPublisher() {
2259    return this.publisher != null && !this.publisher.isEmpty();
2260  }
2261
2262  /**
2263   * @param value {@link #publisher} (The name of the organization or individual
2264   *              that published the charge item definition.). This is the
2265   *              underlying object with id, value and extensions. The accessor
2266   *              "getPublisher" gives direct access to the value
2267   */
2268  public ChargeItemDefinition setPublisherElement(StringType value) {
2269    this.publisher = value;
2270    return this;
2271  }
2272
2273  /**
2274   * @return The name of the organization or individual that published the charge
2275   *         item definition.
2276   */
2277  public String getPublisher() {
2278    return this.publisher == null ? null : this.publisher.getValue();
2279  }
2280
2281  /**
2282   * @param value The name of the organization or individual that published the
2283   *              charge item definition.
2284   */
2285  public ChargeItemDefinition setPublisher(String value) {
2286    if (Utilities.noString(value))
2287      this.publisher = null;
2288    else {
2289      if (this.publisher == null)
2290        this.publisher = new StringType();
2291      this.publisher.setValue(value);
2292    }
2293    return this;
2294  }
2295
2296  /**
2297   * @return {@link #contact} (Contact details to assist a user in finding and
2298   *         communicating with the publisher.)
2299   */
2300  public List<ContactDetail> getContact() {
2301    if (this.contact == null)
2302      this.contact = new ArrayList<ContactDetail>();
2303    return this.contact;
2304  }
2305
2306  /**
2307   * @return Returns a reference to <code>this</code> for easy method chaining
2308   */
2309  public ChargeItemDefinition setContact(List<ContactDetail> theContact) {
2310    this.contact = theContact;
2311    return this;
2312  }
2313
2314  public boolean hasContact() {
2315    if (this.contact == null)
2316      return false;
2317    for (ContactDetail item : this.contact)
2318      if (!item.isEmpty())
2319        return true;
2320    return false;
2321  }
2322
2323  public ContactDetail addContact() { // 3
2324    ContactDetail t = new ContactDetail();
2325    if (this.contact == null)
2326      this.contact = new ArrayList<ContactDetail>();
2327    this.contact.add(t);
2328    return t;
2329  }
2330
2331  public ChargeItemDefinition addContact(ContactDetail t) { // 3
2332    if (t == null)
2333      return this;
2334    if (this.contact == null)
2335      this.contact = new ArrayList<ContactDetail>();
2336    this.contact.add(t);
2337    return this;
2338  }
2339
2340  /**
2341   * @return The first repetition of repeating field {@link #contact}, creating it
2342   *         if it does not already exist
2343   */
2344  public ContactDetail getContactFirstRep() {
2345    if (getContact().isEmpty()) {
2346      addContact();
2347    }
2348    return getContact().get(0);
2349  }
2350
2351  /**
2352   * @return {@link #description} (A free text natural language description of the
2353   *         charge item definition from a consumer's perspective.). This is the
2354   *         underlying object with id, value and extensions. The accessor
2355   *         "getDescription" gives direct access to the value
2356   */
2357  public MarkdownType getDescriptionElement() {
2358    if (this.description == null)
2359      if (Configuration.errorOnAutoCreate())
2360        throw new Error("Attempt to auto-create ChargeItemDefinition.description");
2361      else if (Configuration.doAutoCreate())
2362        this.description = new MarkdownType(); // bb
2363    return this.description;
2364  }
2365
2366  public boolean hasDescriptionElement() {
2367    return this.description != null && !this.description.isEmpty();
2368  }
2369
2370  public boolean hasDescription() {
2371    return this.description != null && !this.description.isEmpty();
2372  }
2373
2374  /**
2375   * @param value {@link #description} (A free text natural language description
2376   *              of the charge item definition from a consumer's perspective.).
2377   *              This is the underlying object with id, value and extensions. The
2378   *              accessor "getDescription" gives direct access to the value
2379   */
2380  public ChargeItemDefinition setDescriptionElement(MarkdownType value) {
2381    this.description = value;
2382    return this;
2383  }
2384
2385  /**
2386   * @return A free text natural language description of the charge item
2387   *         definition from a consumer's perspective.
2388   */
2389  public String getDescription() {
2390    return this.description == null ? null : this.description.getValue();
2391  }
2392
2393  /**
2394   * @param value A free text natural language description of the charge item
2395   *              definition from a consumer's perspective.
2396   */
2397  public ChargeItemDefinition setDescription(String value) {
2398    if (value == null)
2399      this.description = null;
2400    else {
2401      if (this.description == null)
2402        this.description = new MarkdownType();
2403      this.description.setValue(value);
2404    }
2405    return this;
2406  }
2407
2408  /**
2409   * @return {@link #useContext} (The content was developed with a focus and
2410   *         intent of supporting the contexts that are listed. These contexts may
2411   *         be general categories (gender, age, ...) or may be references to
2412   *         specific programs (insurance plans, studies, ...) and may be used to
2413   *         assist with indexing and searching for appropriate charge item
2414   *         definition instances.)
2415   */
2416  public List<UsageContext> getUseContext() {
2417    if (this.useContext == null)
2418      this.useContext = new ArrayList<UsageContext>();
2419    return this.useContext;
2420  }
2421
2422  /**
2423   * @return Returns a reference to <code>this</code> for easy method chaining
2424   */
2425  public ChargeItemDefinition setUseContext(List<UsageContext> theUseContext) {
2426    this.useContext = theUseContext;
2427    return this;
2428  }
2429
2430  public boolean hasUseContext() {
2431    if (this.useContext == null)
2432      return false;
2433    for (UsageContext item : this.useContext)
2434      if (!item.isEmpty())
2435        return true;
2436    return false;
2437  }
2438
2439  public UsageContext addUseContext() { // 3
2440    UsageContext t = new UsageContext();
2441    if (this.useContext == null)
2442      this.useContext = new ArrayList<UsageContext>();
2443    this.useContext.add(t);
2444    return t;
2445  }
2446
2447  public ChargeItemDefinition addUseContext(UsageContext t) { // 3
2448    if (t == null)
2449      return this;
2450    if (this.useContext == null)
2451      this.useContext = new ArrayList<UsageContext>();
2452    this.useContext.add(t);
2453    return this;
2454  }
2455
2456  /**
2457   * @return The first repetition of repeating field {@link #useContext}, creating
2458   *         it if it does not already exist
2459   */
2460  public UsageContext getUseContextFirstRep() {
2461    if (getUseContext().isEmpty()) {
2462      addUseContext();
2463    }
2464    return getUseContext().get(0);
2465  }
2466
2467  /**
2468   * @return {@link #jurisdiction} (A legal or geographic region in which the
2469   *         charge item definition is intended to be used.)
2470   */
2471  public List<CodeableConcept> getJurisdiction() {
2472    if (this.jurisdiction == null)
2473      this.jurisdiction = new ArrayList<CodeableConcept>();
2474    return this.jurisdiction;
2475  }
2476
2477  /**
2478   * @return Returns a reference to <code>this</code> for easy method chaining
2479   */
2480  public ChargeItemDefinition setJurisdiction(List<CodeableConcept> theJurisdiction) {
2481    this.jurisdiction = theJurisdiction;
2482    return this;
2483  }
2484
2485  public boolean hasJurisdiction() {
2486    if (this.jurisdiction == null)
2487      return false;
2488    for (CodeableConcept item : this.jurisdiction)
2489      if (!item.isEmpty())
2490        return true;
2491    return false;
2492  }
2493
2494  public CodeableConcept addJurisdiction() { // 3
2495    CodeableConcept t = new CodeableConcept();
2496    if (this.jurisdiction == null)
2497      this.jurisdiction = new ArrayList<CodeableConcept>();
2498    this.jurisdiction.add(t);
2499    return t;
2500  }
2501
2502  public ChargeItemDefinition addJurisdiction(CodeableConcept t) { // 3
2503    if (t == null)
2504      return this;
2505    if (this.jurisdiction == null)
2506      this.jurisdiction = new ArrayList<CodeableConcept>();
2507    this.jurisdiction.add(t);
2508    return this;
2509  }
2510
2511  /**
2512   * @return The first repetition of repeating field {@link #jurisdiction},
2513   *         creating it if it does not already exist
2514   */
2515  public CodeableConcept getJurisdictionFirstRep() {
2516    if (getJurisdiction().isEmpty()) {
2517      addJurisdiction();
2518    }
2519    return getJurisdiction().get(0);
2520  }
2521
2522  /**
2523   * @return {@link #copyright} (A copyright statement relating to the charge item
2524   *         definition and/or its contents. Copyright statements are generally
2525   *         legal restrictions on the use and publishing of the charge item
2526   *         definition.). This is the underlying object with id, value and
2527   *         extensions. The accessor "getCopyright" gives direct access to the
2528   *         value
2529   */
2530  public MarkdownType getCopyrightElement() {
2531    if (this.copyright == null)
2532      if (Configuration.errorOnAutoCreate())
2533        throw new Error("Attempt to auto-create ChargeItemDefinition.copyright");
2534      else if (Configuration.doAutoCreate())
2535        this.copyright = new MarkdownType(); // bb
2536    return this.copyright;
2537  }
2538
2539  public boolean hasCopyrightElement() {
2540    return this.copyright != null && !this.copyright.isEmpty();
2541  }
2542
2543  public boolean hasCopyright() {
2544    return this.copyright != null && !this.copyright.isEmpty();
2545  }
2546
2547  /**
2548   * @param value {@link #copyright} (A copyright statement relating to the charge
2549   *              item definition and/or its contents. Copyright statements are
2550   *              generally legal restrictions on the use and publishing of the
2551   *              charge item definition.). This is the underlying object with id,
2552   *              value and extensions. The accessor "getCopyright" gives direct
2553   *              access to the value
2554   */
2555  public ChargeItemDefinition setCopyrightElement(MarkdownType value) {
2556    this.copyright = value;
2557    return this;
2558  }
2559
2560  /**
2561   * @return A copyright statement relating to the charge item definition and/or
2562   *         its contents. Copyright statements are generally legal restrictions
2563   *         on the use and publishing of the charge item definition.
2564   */
2565  public String getCopyright() {
2566    return this.copyright == null ? null : this.copyright.getValue();
2567  }
2568
2569  /**
2570   * @param value A copyright statement relating to the charge item definition
2571   *              and/or its contents. Copyright statements are generally legal
2572   *              restrictions on the use and publishing of the charge item
2573   *              definition.
2574   */
2575  public ChargeItemDefinition setCopyright(String value) {
2576    if (value == null)
2577      this.copyright = null;
2578    else {
2579      if (this.copyright == null)
2580        this.copyright = new MarkdownType();
2581      this.copyright.setValue(value);
2582    }
2583    return this;
2584  }
2585
2586  /**
2587   * @return {@link #approvalDate} (The date on which the resource content was
2588   *         approved by the publisher. Approval happens once when the content is
2589   *         officially approved for usage.). This is the underlying object with
2590   *         id, value and extensions. The accessor "getApprovalDate" gives direct
2591   *         access to the value
2592   */
2593  public DateType getApprovalDateElement() {
2594    if (this.approvalDate == null)
2595      if (Configuration.errorOnAutoCreate())
2596        throw new Error("Attempt to auto-create ChargeItemDefinition.approvalDate");
2597      else if (Configuration.doAutoCreate())
2598        this.approvalDate = new DateType(); // bb
2599    return this.approvalDate;
2600  }
2601
2602  public boolean hasApprovalDateElement() {
2603    return this.approvalDate != null && !this.approvalDate.isEmpty();
2604  }
2605
2606  public boolean hasApprovalDate() {
2607    return this.approvalDate != null && !this.approvalDate.isEmpty();
2608  }
2609
2610  /**
2611   * @param value {@link #approvalDate} (The date on which the resource content
2612   *              was approved by the publisher. Approval happens once when the
2613   *              content is officially approved for usage.). This is the
2614   *              underlying object with id, value and extensions. The accessor
2615   *              "getApprovalDate" gives direct access to the value
2616   */
2617  public ChargeItemDefinition setApprovalDateElement(DateType value) {
2618    this.approvalDate = value;
2619    return this;
2620  }
2621
2622  /**
2623   * @return The date on which the resource content was approved by the publisher.
2624   *         Approval happens once when the content is officially approved for
2625   *         usage.
2626   */
2627  public Date getApprovalDate() {
2628    return this.approvalDate == null ? null : this.approvalDate.getValue();
2629  }
2630
2631  /**
2632   * @param value The date on which the resource content was approved by the
2633   *              publisher. Approval happens once when the content is officially
2634   *              approved for usage.
2635   */
2636  public ChargeItemDefinition setApprovalDate(Date value) {
2637    if (value == null)
2638      this.approvalDate = null;
2639    else {
2640      if (this.approvalDate == null)
2641        this.approvalDate = new DateType();
2642      this.approvalDate.setValue(value);
2643    }
2644    return this;
2645  }
2646
2647  /**
2648   * @return {@link #lastReviewDate} (The date on which the resource content was
2649   *         last reviewed. Review happens periodically after approval but does
2650   *         not change the original approval date.). This is the underlying
2651   *         object with id, value and extensions. The accessor
2652   *         "getLastReviewDate" gives direct access to the value
2653   */
2654  public DateType getLastReviewDateElement() {
2655    if (this.lastReviewDate == null)
2656      if (Configuration.errorOnAutoCreate())
2657        throw new Error("Attempt to auto-create ChargeItemDefinition.lastReviewDate");
2658      else if (Configuration.doAutoCreate())
2659        this.lastReviewDate = new DateType(); // bb
2660    return this.lastReviewDate;
2661  }
2662
2663  public boolean hasLastReviewDateElement() {
2664    return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2665  }
2666
2667  public boolean hasLastReviewDate() {
2668    return this.lastReviewDate != null && !this.lastReviewDate.isEmpty();
2669  }
2670
2671  /**
2672   * @param value {@link #lastReviewDate} (The date on which the resource content
2673   *              was last reviewed. Review happens periodically after approval
2674   *              but does not change the original approval date.). This is the
2675   *              underlying object with id, value and extensions. The accessor
2676   *              "getLastReviewDate" gives direct access to the value
2677   */
2678  public ChargeItemDefinition setLastReviewDateElement(DateType value) {
2679    this.lastReviewDate = value;
2680    return this;
2681  }
2682
2683  /**
2684   * @return The date on which the resource content was last reviewed. Review
2685   *         happens periodically after approval but does not change the original
2686   *         approval date.
2687   */
2688  public Date getLastReviewDate() {
2689    return this.lastReviewDate == null ? null : this.lastReviewDate.getValue();
2690  }
2691
2692  /**
2693   * @param value The date on which the resource content was last reviewed. Review
2694   *              happens periodically after approval but does not change the
2695   *              original approval date.
2696   */
2697  public ChargeItemDefinition setLastReviewDate(Date value) {
2698    if (value == null)
2699      this.lastReviewDate = null;
2700    else {
2701      if (this.lastReviewDate == null)
2702        this.lastReviewDate = new DateType();
2703      this.lastReviewDate.setValue(value);
2704    }
2705    return this;
2706  }
2707
2708  /**
2709   * @return {@link #effectivePeriod} (The period during which the charge item
2710   *         definition content was or is planned to be in active use.)
2711   */
2712  public Period getEffectivePeriod() {
2713    if (this.effectivePeriod == null)
2714      if (Configuration.errorOnAutoCreate())
2715        throw new Error("Attempt to auto-create ChargeItemDefinition.effectivePeriod");
2716      else if (Configuration.doAutoCreate())
2717        this.effectivePeriod = new Period(); // cc
2718    return this.effectivePeriod;
2719  }
2720
2721  public boolean hasEffectivePeriod() {
2722    return this.effectivePeriod != null && !this.effectivePeriod.isEmpty();
2723  }
2724
2725  /**
2726   * @param value {@link #effectivePeriod} (The period during which the charge
2727   *              item definition content was or is planned to be in active use.)
2728   */
2729  public ChargeItemDefinition setEffectivePeriod(Period value) {
2730    this.effectivePeriod = value;
2731    return this;
2732  }
2733
2734  /**
2735   * @return {@link #code} (The defined billing details in this resource pertain
2736   *         to the given billing code.)
2737   */
2738  public CodeableConcept getCode() {
2739    if (this.code == null)
2740      if (Configuration.errorOnAutoCreate())
2741        throw new Error("Attempt to auto-create ChargeItemDefinition.code");
2742      else if (Configuration.doAutoCreate())
2743        this.code = new CodeableConcept(); // cc
2744    return this.code;
2745  }
2746
2747  public boolean hasCode() {
2748    return this.code != null && !this.code.isEmpty();
2749  }
2750
2751  /**
2752   * @param value {@link #code} (The defined billing details in this resource
2753   *              pertain to the given billing code.)
2754   */
2755  public ChargeItemDefinition setCode(CodeableConcept value) {
2756    this.code = value;
2757    return this;
2758  }
2759
2760  /**
2761   * @return {@link #instance} (The defined billing details in this resource
2762   *         pertain to the given product instance(s).)
2763   */
2764  public List<Reference> getInstance() {
2765    if (this.instance == null)
2766      this.instance = new ArrayList<Reference>();
2767    return this.instance;
2768  }
2769
2770  /**
2771   * @return Returns a reference to <code>this</code> for easy method chaining
2772   */
2773  public ChargeItemDefinition setInstance(List<Reference> theInstance) {
2774    this.instance = theInstance;
2775    return this;
2776  }
2777
2778  public boolean hasInstance() {
2779    if (this.instance == null)
2780      return false;
2781    for (Reference item : this.instance)
2782      if (!item.isEmpty())
2783        return true;
2784    return false;
2785  }
2786
2787  public Reference addInstance() { // 3
2788    Reference t = new Reference();
2789    if (this.instance == null)
2790      this.instance = new ArrayList<Reference>();
2791    this.instance.add(t);
2792    return t;
2793  }
2794
2795  public ChargeItemDefinition addInstance(Reference t) { // 3
2796    if (t == null)
2797      return this;
2798    if (this.instance == null)
2799      this.instance = new ArrayList<Reference>();
2800    this.instance.add(t);
2801    return this;
2802  }
2803
2804  /**
2805   * @return The first repetition of repeating field {@link #instance}, creating
2806   *         it if it does not already exist
2807   */
2808  public Reference getInstanceFirstRep() {
2809    if (getInstance().isEmpty()) {
2810      addInstance();
2811    }
2812    return getInstance().get(0);
2813  }
2814
2815  /**
2816   * @deprecated Use Reference#setResource(IBaseResource) instead
2817   */
2818  @Deprecated
2819  public List<Resource> getInstanceTarget() {
2820    if (this.instanceTarget == null)
2821      this.instanceTarget = new ArrayList<Resource>();
2822    return this.instanceTarget;
2823  }
2824
2825  /**
2826   * @return {@link #applicability} (Expressions that describe applicability
2827   *         criteria for the billing code.)
2828   */
2829  public List<ChargeItemDefinitionApplicabilityComponent> getApplicability() {
2830    if (this.applicability == null)
2831      this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
2832    return this.applicability;
2833  }
2834
2835  /**
2836   * @return Returns a reference to <code>this</code> for easy method chaining
2837   */
2838  public ChargeItemDefinition setApplicability(List<ChargeItemDefinitionApplicabilityComponent> theApplicability) {
2839    this.applicability = theApplicability;
2840    return this;
2841  }
2842
2843  public boolean hasApplicability() {
2844    if (this.applicability == null)
2845      return false;
2846    for (ChargeItemDefinitionApplicabilityComponent item : this.applicability)
2847      if (!item.isEmpty())
2848        return true;
2849    return false;
2850  }
2851
2852  public ChargeItemDefinitionApplicabilityComponent addApplicability() { // 3
2853    ChargeItemDefinitionApplicabilityComponent t = new ChargeItemDefinitionApplicabilityComponent();
2854    if (this.applicability == null)
2855      this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
2856    this.applicability.add(t);
2857    return t;
2858  }
2859
2860  public ChargeItemDefinition addApplicability(ChargeItemDefinitionApplicabilityComponent t) { // 3
2861    if (t == null)
2862      return this;
2863    if (this.applicability == null)
2864      this.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
2865    this.applicability.add(t);
2866    return this;
2867  }
2868
2869  /**
2870   * @return The first repetition of repeating field {@link #applicability},
2871   *         creating it if it does not already exist
2872   */
2873  public ChargeItemDefinitionApplicabilityComponent getApplicabilityFirstRep() {
2874    if (getApplicability().isEmpty()) {
2875      addApplicability();
2876    }
2877    return getApplicability().get(0);
2878  }
2879
2880  /**
2881   * @return {@link #propertyGroup} (Group of properties which are applicable
2882   *         under the same conditions. If no applicability rules are established
2883   *         for the group, then all properties always apply.)
2884   */
2885  public List<ChargeItemDefinitionPropertyGroupComponent> getPropertyGroup() {
2886    if (this.propertyGroup == null)
2887      this.propertyGroup = new ArrayList<ChargeItemDefinitionPropertyGroupComponent>();
2888    return this.propertyGroup;
2889  }
2890
2891  /**
2892   * @return Returns a reference to <code>this</code> for easy method chaining
2893   */
2894  public ChargeItemDefinition setPropertyGroup(List<ChargeItemDefinitionPropertyGroupComponent> thePropertyGroup) {
2895    this.propertyGroup = thePropertyGroup;
2896    return this;
2897  }
2898
2899  public boolean hasPropertyGroup() {
2900    if (this.propertyGroup == null)
2901      return false;
2902    for (ChargeItemDefinitionPropertyGroupComponent item : this.propertyGroup)
2903      if (!item.isEmpty())
2904        return true;
2905    return false;
2906  }
2907
2908  public ChargeItemDefinitionPropertyGroupComponent addPropertyGroup() { // 3
2909    ChargeItemDefinitionPropertyGroupComponent t = new ChargeItemDefinitionPropertyGroupComponent();
2910    if (this.propertyGroup == null)
2911      this.propertyGroup = new ArrayList<ChargeItemDefinitionPropertyGroupComponent>();
2912    this.propertyGroup.add(t);
2913    return t;
2914  }
2915
2916  public ChargeItemDefinition addPropertyGroup(ChargeItemDefinitionPropertyGroupComponent t) { // 3
2917    if (t == null)
2918      return this;
2919    if (this.propertyGroup == null)
2920      this.propertyGroup = new ArrayList<ChargeItemDefinitionPropertyGroupComponent>();
2921    this.propertyGroup.add(t);
2922    return this;
2923  }
2924
2925  /**
2926   * @return The first repetition of repeating field {@link #propertyGroup},
2927   *         creating it if it does not already exist
2928   */
2929  public ChargeItemDefinitionPropertyGroupComponent getPropertyGroupFirstRep() {
2930    if (getPropertyGroup().isEmpty()) {
2931      addPropertyGroup();
2932    }
2933    return getPropertyGroup().get(0);
2934  }
2935
2936  protected void listChildren(List<Property> children) {
2937    super.listChildren(children);
2938    children.add(new Property("url", "uri",
2939        "An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers.",
2940        0, 1, url));
2941    children.add(new Property("identifier", "Identifier",
2942        "A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance.",
2943        0, java.lang.Integer.MAX_VALUE, identifier));
2944    children.add(new Property("version", "string",
2945        "The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.",
2946        0, 1, version));
2947    children.add(new Property("title", "string",
2948        "A short, descriptive, user-friendly title for the charge item definition.", 0, 1, title));
2949    children.add(new Property("derivedFromUri", "uri",
2950        "The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition.",
2951        0, java.lang.Integer.MAX_VALUE, derivedFromUri));
2952    children.add(new Property("partOf", "canonical(ChargeItemDefinition)",
2953        "A larger definition of which this particular definition is a component or step.", 0,
2954        java.lang.Integer.MAX_VALUE, partOf));
2955    children.add(new Property("replaces", "canonical(ChargeItemDefinition)",
2956        "As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance.",
2957        0, java.lang.Integer.MAX_VALUE, replaces));
2958    children.add(new Property("status", "code", "The current state of the ChargeItemDefinition.", 0, 1, status));
2959    children.add(new Property("experimental", "boolean",
2960        "A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
2961        0, 1, experimental));
2962    children.add(new Property("date", "dateTime",
2963        "The date  (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes.",
2964        0, 1, date));
2965    children.add(new Property("publisher", "string",
2966        "The name of the organization or individual that published the charge item definition.", 0, 1, publisher));
2967    children.add(new Property("contact", "ContactDetail",
2968        "Contact details to assist a user in finding and communicating with the publisher.", 0,
2969        java.lang.Integer.MAX_VALUE, contact));
2970    children.add(new Property("description", "markdown",
2971        "A free text natural language description of the charge item definition from a consumer's perspective.", 0, 1,
2972        description));
2973    children.add(new Property("useContext", "UsageContext",
2974        "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances.",
2975        0, java.lang.Integer.MAX_VALUE, useContext));
2976    children.add(new Property("jurisdiction", "CodeableConcept",
2977        "A legal or geographic region in which the charge item definition is intended to be used.", 0,
2978        java.lang.Integer.MAX_VALUE, jurisdiction));
2979    children.add(new Property("copyright", "markdown",
2980        "A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition.",
2981        0, 1, copyright));
2982    children.add(new Property("approvalDate", "date",
2983        "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.",
2984        0, 1, approvalDate));
2985    children.add(new Property("lastReviewDate", "date",
2986        "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.",
2987        0, 1, lastReviewDate));
2988    children.add(new Property("effectivePeriod", "Period",
2989        "The period during which the charge item definition content was or is planned to be in active use.", 0, 1,
2990        effectivePeriod));
2991    children.add(new Property("code", "CodeableConcept",
2992        "The defined billing details in this resource pertain to the given billing code.", 0, 1, code));
2993    children.add(new Property("instance", "Reference(Medication|Substance|Device)",
2994        "The defined billing details in this resource pertain to the given product instance(s).", 0,
2995        java.lang.Integer.MAX_VALUE, instance));
2996    children
2997        .add(new Property("applicability", "", "Expressions that describe applicability criteria for the billing code.",
2998            0, java.lang.Integer.MAX_VALUE, applicability));
2999    children.add(new Property("propertyGroup", "",
3000        "Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply.",
3001        0, java.lang.Integer.MAX_VALUE, propertyGroup));
3002  }
3003
3004  @Override
3005  public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3006    switch (_hash) {
3007    case 116079:
3008      /* url */ return new Property("url", "uri",
3009          "An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers.",
3010          0, 1, url);
3011    case -1618432855:
3012      /* identifier */ return new Property("identifier", "Identifier",
3013          "A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance.",
3014          0, java.lang.Integer.MAX_VALUE, identifier);
3015    case 351608024:
3016      /* version */ return new Property("version", "string",
3017          "The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.",
3018          0, 1, version);
3019    case 110371416:
3020      /* title */ return new Property("title", "string",
3021          "A short, descriptive, user-friendly title for the charge item definition.", 0, 1, title);
3022    case -1076333435:
3023      /* derivedFromUri */ return new Property("derivedFromUri", "uri",
3024          "The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition.",
3025          0, java.lang.Integer.MAX_VALUE, derivedFromUri);
3026    case -995410646:
3027      /* partOf */ return new Property("partOf", "canonical(ChargeItemDefinition)",
3028          "A larger definition of which this particular definition is a component or step.", 0,
3029          java.lang.Integer.MAX_VALUE, partOf);
3030    case -430332865:
3031      /* replaces */ return new Property("replaces", "canonical(ChargeItemDefinition)",
3032          "As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance.",
3033          0, java.lang.Integer.MAX_VALUE, replaces);
3034    case -892481550:
3035      /* status */ return new Property("status", "code", "The current state of the ChargeItemDefinition.", 0, 1,
3036          status);
3037    case -404562712:
3038      /* experimental */ return new Property("experimental", "boolean",
3039          "A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.",
3040          0, 1, experimental);
3041    case 3076014:
3042      /* date */ return new Property("date", "dateTime",
3043          "The date  (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes.",
3044          0, 1, date);
3045    case 1447404028:
3046      /* publisher */ return new Property("publisher", "string",
3047          "The name of the organization or individual that published the charge item definition.", 0, 1, publisher);
3048    case 951526432:
3049      /* contact */ return new Property("contact", "ContactDetail",
3050          "Contact details to assist a user in finding and communicating with the publisher.", 0,
3051          java.lang.Integer.MAX_VALUE, contact);
3052    case -1724546052:
3053      /* description */ return new Property("description", "markdown",
3054          "A free text natural language description of the charge item definition from a consumer's perspective.", 0, 1,
3055          description);
3056    case -669707736:
3057      /* useContext */ return new Property("useContext", "UsageContext",
3058          "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances.",
3059          0, java.lang.Integer.MAX_VALUE, useContext);
3060    case -507075711:
3061      /* jurisdiction */ return new Property("jurisdiction", "CodeableConcept",
3062          "A legal or geographic region in which the charge item definition is intended to be used.", 0,
3063          java.lang.Integer.MAX_VALUE, jurisdiction);
3064    case 1522889671:
3065      /* copyright */ return new Property("copyright", "markdown",
3066          "A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition.",
3067          0, 1, copyright);
3068    case 223539345:
3069      /* approvalDate */ return new Property("approvalDate", "date",
3070          "The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.",
3071          0, 1, approvalDate);
3072    case -1687512484:
3073      /* lastReviewDate */ return new Property("lastReviewDate", "date",
3074          "The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.",
3075          0, 1, lastReviewDate);
3076    case -403934648:
3077      /* effectivePeriod */ return new Property("effectivePeriod", "Period",
3078          "The period during which the charge item definition content was or is planned to be in active use.", 0, 1,
3079          effectivePeriod);
3080    case 3059181:
3081      /* code */ return new Property("code", "CodeableConcept",
3082          "The defined billing details in this resource pertain to the given billing code.", 0, 1, code);
3083    case 555127957:
3084      /* instance */ return new Property("instance", "Reference(Medication|Substance|Device)",
3085          "The defined billing details in this resource pertain to the given product instance(s).", 0,
3086          java.lang.Integer.MAX_VALUE, instance);
3087    case -1526770491:
3088      /* applicability */ return new Property("applicability", "",
3089          "Expressions that describe applicability criteria for the billing code.", 0, java.lang.Integer.MAX_VALUE,
3090          applicability);
3091    case -1041594966:
3092      /* propertyGroup */ return new Property("propertyGroup", "",
3093          "Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply.",
3094          0, java.lang.Integer.MAX_VALUE, propertyGroup);
3095    default:
3096      return super.getNamedProperty(_hash, _name, _checkValid);
3097    }
3098
3099  }
3100
3101  @Override
3102  public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3103    switch (hash) {
3104    case 116079:
3105      /* url */ return this.url == null ? new Base[0] : new Base[] { this.url }; // UriType
3106    case -1618432855:
3107      /* identifier */ return this.identifier == null ? new Base[0]
3108          : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3109    case 351608024:
3110      /* version */ return this.version == null ? new Base[0] : new Base[] { this.version }; // StringType
3111    case 110371416:
3112      /* title */ return this.title == null ? new Base[0] : new Base[] { this.title }; // StringType
3113    case -1076333435:
3114      /* derivedFromUri */ return this.derivedFromUri == null ? new Base[0]
3115          : this.derivedFromUri.toArray(new Base[this.derivedFromUri.size()]); // UriType
3116    case -995410646:
3117      /* partOf */ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // CanonicalType
3118    case -430332865:
3119      /* replaces */ return this.replaces == null ? new Base[0] : this.replaces.toArray(new Base[this.replaces.size()]); // CanonicalType
3120    case -892481550:
3121      /* status */ return this.status == null ? new Base[0] : new Base[] { this.status }; // Enumeration<PublicationStatus>
3122    case -404562712:
3123      /* experimental */ return this.experimental == null ? new Base[0] : new Base[] { this.experimental }; // BooleanType
3124    case 3076014:
3125      /* date */ return this.date == null ? new Base[0] : new Base[] { this.date }; // DateTimeType
3126    case 1447404028:
3127      /* publisher */ return this.publisher == null ? new Base[0] : new Base[] { this.publisher }; // StringType
3128    case 951526432:
3129      /* contact */ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3130    case -1724546052:
3131      /* description */ return this.description == null ? new Base[0] : new Base[] { this.description }; // MarkdownType
3132    case -669707736:
3133      /* useContext */ return this.useContext == null ? new Base[0]
3134          : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3135    case -507075711:
3136      /* jurisdiction */ return this.jurisdiction == null ? new Base[0]
3137          : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
3138    case 1522889671:
3139      /* copyright */ return this.copyright == null ? new Base[0] : new Base[] { this.copyright }; // MarkdownType
3140    case 223539345:
3141      /* approvalDate */ return this.approvalDate == null ? new Base[0] : new Base[] { this.approvalDate }; // DateType
3142    case -1687512484:
3143      /* lastReviewDate */ return this.lastReviewDate == null ? new Base[0] : new Base[] { this.lastReviewDate }; // DateType
3144    case -403934648:
3145      /* effectivePeriod */ return this.effectivePeriod == null ? new Base[0] : new Base[] { this.effectivePeriod }; // Period
3146    case 3059181:
3147      /* code */ return this.code == null ? new Base[0] : new Base[] { this.code }; // CodeableConcept
3148    case 555127957:
3149      /* instance */ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // Reference
3150    case -1526770491:
3151      /* applicability */ return this.applicability == null ? new Base[0]
3152          : this.applicability.toArray(new Base[this.applicability.size()]); // ChargeItemDefinitionApplicabilityComponent
3153    case -1041594966:
3154      /* propertyGroup */ return this.propertyGroup == null ? new Base[0]
3155          : this.propertyGroup.toArray(new Base[this.propertyGroup.size()]); // ChargeItemDefinitionPropertyGroupComponent
3156    default:
3157      return super.getProperty(hash, name, checkValid);
3158    }
3159
3160  }
3161
3162  @Override
3163  public Base setProperty(int hash, String name, Base value) throws FHIRException {
3164    switch (hash) {
3165    case 116079: // url
3166      this.url = castToUri(value); // UriType
3167      return value;
3168    case -1618432855: // identifier
3169      this.getIdentifier().add(castToIdentifier(value)); // Identifier
3170      return value;
3171    case 351608024: // version
3172      this.version = castToString(value); // StringType
3173      return value;
3174    case 110371416: // title
3175      this.title = castToString(value); // StringType
3176      return value;
3177    case -1076333435: // derivedFromUri
3178      this.getDerivedFromUri().add(castToUri(value)); // UriType
3179      return value;
3180    case -995410646: // partOf
3181      this.getPartOf().add(castToCanonical(value)); // CanonicalType
3182      return value;
3183    case -430332865: // replaces
3184      this.getReplaces().add(castToCanonical(value)); // CanonicalType
3185      return value;
3186    case -892481550: // status
3187      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3188      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3189      return value;
3190    case -404562712: // experimental
3191      this.experimental = castToBoolean(value); // BooleanType
3192      return value;
3193    case 3076014: // date
3194      this.date = castToDateTime(value); // DateTimeType
3195      return value;
3196    case 1447404028: // publisher
3197      this.publisher = castToString(value); // StringType
3198      return value;
3199    case 951526432: // contact
3200      this.getContact().add(castToContactDetail(value)); // ContactDetail
3201      return value;
3202    case -1724546052: // description
3203      this.description = castToMarkdown(value); // MarkdownType
3204      return value;
3205    case -669707736: // useContext
3206      this.getUseContext().add(castToUsageContext(value)); // UsageContext
3207      return value;
3208    case -507075711: // jurisdiction
3209      this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
3210      return value;
3211    case 1522889671: // copyright
3212      this.copyright = castToMarkdown(value); // MarkdownType
3213      return value;
3214    case 223539345: // approvalDate
3215      this.approvalDate = castToDate(value); // DateType
3216      return value;
3217    case -1687512484: // lastReviewDate
3218      this.lastReviewDate = castToDate(value); // DateType
3219      return value;
3220    case -403934648: // effectivePeriod
3221      this.effectivePeriod = castToPeriod(value); // Period
3222      return value;
3223    case 3059181: // code
3224      this.code = castToCodeableConcept(value); // CodeableConcept
3225      return value;
3226    case 555127957: // instance
3227      this.getInstance().add(castToReference(value)); // Reference
3228      return value;
3229    case -1526770491: // applicability
3230      this.getApplicability().add((ChargeItemDefinitionApplicabilityComponent) value); // ChargeItemDefinitionApplicabilityComponent
3231      return value;
3232    case -1041594966: // propertyGroup
3233      this.getPropertyGroup().add((ChargeItemDefinitionPropertyGroupComponent) value); // ChargeItemDefinitionPropertyGroupComponent
3234      return value;
3235    default:
3236      return super.setProperty(hash, name, value);
3237    }
3238
3239  }
3240
3241  @Override
3242  public Base setProperty(String name, Base value) throws FHIRException {
3243    if (name.equals("url")) {
3244      this.url = castToUri(value); // UriType
3245    } else if (name.equals("identifier")) {
3246      this.getIdentifier().add(castToIdentifier(value));
3247    } else if (name.equals("version")) {
3248      this.version = castToString(value); // StringType
3249    } else if (name.equals("title")) {
3250      this.title = castToString(value); // StringType
3251    } else if (name.equals("derivedFromUri")) {
3252      this.getDerivedFromUri().add(castToUri(value));
3253    } else if (name.equals("partOf")) {
3254      this.getPartOf().add(castToCanonical(value));
3255    } else if (name.equals("replaces")) {
3256      this.getReplaces().add(castToCanonical(value));
3257    } else if (name.equals("status")) {
3258      value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3259      this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3260    } else if (name.equals("experimental")) {
3261      this.experimental = castToBoolean(value); // BooleanType
3262    } else if (name.equals("date")) {
3263      this.date = castToDateTime(value); // DateTimeType
3264    } else if (name.equals("publisher")) {
3265      this.publisher = castToString(value); // StringType
3266    } else if (name.equals("contact")) {
3267      this.getContact().add(castToContactDetail(value));
3268    } else if (name.equals("description")) {
3269      this.description = castToMarkdown(value); // MarkdownType
3270    } else if (name.equals("useContext")) {
3271      this.getUseContext().add(castToUsageContext(value));
3272    } else if (name.equals("jurisdiction")) {
3273      this.getJurisdiction().add(castToCodeableConcept(value));
3274    } else if (name.equals("copyright")) {
3275      this.copyright = castToMarkdown(value); // MarkdownType
3276    } else if (name.equals("approvalDate")) {
3277      this.approvalDate = castToDate(value); // DateType
3278    } else if (name.equals("lastReviewDate")) {
3279      this.lastReviewDate = castToDate(value); // DateType
3280    } else if (name.equals("effectivePeriod")) {
3281      this.effectivePeriod = castToPeriod(value); // Period
3282    } else if (name.equals("code")) {
3283      this.code = castToCodeableConcept(value); // CodeableConcept
3284    } else if (name.equals("instance")) {
3285      this.getInstance().add(castToReference(value));
3286    } else if (name.equals("applicability")) {
3287      this.getApplicability().add((ChargeItemDefinitionApplicabilityComponent) value);
3288    } else if (name.equals("propertyGroup")) {
3289      this.getPropertyGroup().add((ChargeItemDefinitionPropertyGroupComponent) value);
3290    } else
3291      return super.setProperty(name, value);
3292    return value;
3293  }
3294
3295  @Override
3296  public void removeChild(String name, Base value) throws FHIRException {
3297    if (name.equals("url")) {
3298      this.url = null;
3299    } else if (name.equals("identifier")) {
3300      this.getIdentifier().remove(castToIdentifier(value));
3301    } else if (name.equals("version")) {
3302      this.version = null;
3303    } else if (name.equals("title")) {
3304      this.title = null;
3305    } else if (name.equals("derivedFromUri")) {
3306      this.getDerivedFromUri().remove(castToUri(value));
3307    } else if (name.equals("partOf")) {
3308      this.getPartOf().remove(castToCanonical(value));
3309    } else if (name.equals("replaces")) {
3310      this.getReplaces().remove(castToCanonical(value));
3311    } else if (name.equals("status")) {
3312      this.status = null;
3313    } else if (name.equals("experimental")) {
3314      this.experimental = null;
3315    } else if (name.equals("date")) {
3316      this.date = null;
3317    } else if (name.equals("publisher")) {
3318      this.publisher = null;
3319    } else if (name.equals("contact")) {
3320      this.getContact().remove(castToContactDetail(value));
3321    } else if (name.equals("description")) {
3322      this.description = null;
3323    } else if (name.equals("useContext")) {
3324      this.getUseContext().remove(castToUsageContext(value));
3325    } else if (name.equals("jurisdiction")) {
3326      this.getJurisdiction().remove(castToCodeableConcept(value));
3327    } else if (name.equals("copyright")) {
3328      this.copyright = null;
3329    } else if (name.equals("approvalDate")) {
3330      this.approvalDate = null;
3331    } else if (name.equals("lastReviewDate")) {
3332      this.lastReviewDate = null;
3333    } else if (name.equals("effectivePeriod")) {
3334      this.effectivePeriod = null;
3335    } else if (name.equals("code")) {
3336      this.code = null;
3337    } else if (name.equals("instance")) {
3338      this.getInstance().remove(castToReference(value));
3339    } else if (name.equals("applicability")) {
3340      this.getApplicability().remove((ChargeItemDefinitionApplicabilityComponent) value);
3341    } else if (name.equals("propertyGroup")) {
3342      this.getPropertyGroup().remove((ChargeItemDefinitionPropertyGroupComponent) value);
3343    } else
3344      super.removeChild(name, value);
3345    
3346  }
3347
3348  @Override
3349  public Base makeProperty(int hash, String name) throws FHIRException {
3350    switch (hash) {
3351    case 116079:
3352      return getUrlElement();
3353    case -1618432855:
3354      return addIdentifier();
3355    case 351608024:
3356      return getVersionElement();
3357    case 110371416:
3358      return getTitleElement();
3359    case -1076333435:
3360      return addDerivedFromUriElement();
3361    case -995410646:
3362      return addPartOfElement();
3363    case -430332865:
3364      return addReplacesElement();
3365    case -892481550:
3366      return getStatusElement();
3367    case -404562712:
3368      return getExperimentalElement();
3369    case 3076014:
3370      return getDateElement();
3371    case 1447404028:
3372      return getPublisherElement();
3373    case 951526432:
3374      return addContact();
3375    case -1724546052:
3376      return getDescriptionElement();
3377    case -669707736:
3378      return addUseContext();
3379    case -507075711:
3380      return addJurisdiction();
3381    case 1522889671:
3382      return getCopyrightElement();
3383    case 223539345:
3384      return getApprovalDateElement();
3385    case -1687512484:
3386      return getLastReviewDateElement();
3387    case -403934648:
3388      return getEffectivePeriod();
3389    case 3059181:
3390      return getCode();
3391    case 555127957:
3392      return addInstance();
3393    case -1526770491:
3394      return addApplicability();
3395    case -1041594966:
3396      return addPropertyGroup();
3397    default:
3398      return super.makeProperty(hash, name);
3399    }
3400
3401  }
3402
3403  @Override
3404  public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3405    switch (hash) {
3406    case 116079:
3407      /* url */ return new String[] { "uri" };
3408    case -1618432855:
3409      /* identifier */ return new String[] { "Identifier" };
3410    case 351608024:
3411      /* version */ return new String[] { "string" };
3412    case 110371416:
3413      /* title */ return new String[] { "string" };
3414    case -1076333435:
3415      /* derivedFromUri */ return new String[] { "uri" };
3416    case -995410646:
3417      /* partOf */ return new String[] { "canonical" };
3418    case -430332865:
3419      /* replaces */ return new String[] { "canonical" };
3420    case -892481550:
3421      /* status */ return new String[] { "code" };
3422    case -404562712:
3423      /* experimental */ return new String[] { "boolean" };
3424    case 3076014:
3425      /* date */ return new String[] { "dateTime" };
3426    case 1447404028:
3427      /* publisher */ return new String[] { "string" };
3428    case 951526432:
3429      /* contact */ return new String[] { "ContactDetail" };
3430    case -1724546052:
3431      /* description */ return new String[] { "markdown" };
3432    case -669707736:
3433      /* useContext */ return new String[] { "UsageContext" };
3434    case -507075711:
3435      /* jurisdiction */ return new String[] { "CodeableConcept" };
3436    case 1522889671:
3437      /* copyright */ return new String[] { "markdown" };
3438    case 223539345:
3439      /* approvalDate */ return new String[] { "date" };
3440    case -1687512484:
3441      /* lastReviewDate */ return new String[] { "date" };
3442    case -403934648:
3443      /* effectivePeriod */ return new String[] { "Period" };
3444    case 3059181:
3445      /* code */ return new String[] { "CodeableConcept" };
3446    case 555127957:
3447      /* instance */ return new String[] { "Reference" };
3448    case -1526770491:
3449      /* applicability */ return new String[] {};
3450    case -1041594966:
3451      /* propertyGroup */ return new String[] {};
3452    default:
3453      return super.getTypesForProperty(hash, name);
3454    }
3455
3456  }
3457
3458  @Override
3459  public Base addChild(String name) throws FHIRException {
3460    if (name.equals("url")) {
3461      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.url");
3462    } else if (name.equals("identifier")) {
3463      return addIdentifier();
3464    } else if (name.equals("version")) {
3465      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.version");
3466    } else if (name.equals("title")) {
3467      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.title");
3468    } else if (name.equals("derivedFromUri")) {
3469      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.derivedFromUri");
3470    } else if (name.equals("partOf")) {
3471      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.partOf");
3472    } else if (name.equals("replaces")) {
3473      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.replaces");
3474    } else if (name.equals("status")) {
3475      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.status");
3476    } else if (name.equals("experimental")) {
3477      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.experimental");
3478    } else if (name.equals("date")) {
3479      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.date");
3480    } else if (name.equals("publisher")) {
3481      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.publisher");
3482    } else if (name.equals("contact")) {
3483      return addContact();
3484    } else if (name.equals("description")) {
3485      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.description");
3486    } else if (name.equals("useContext")) {
3487      return addUseContext();
3488    } else if (name.equals("jurisdiction")) {
3489      return addJurisdiction();
3490    } else if (name.equals("copyright")) {
3491      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.copyright");
3492    } else if (name.equals("approvalDate")) {
3493      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.approvalDate");
3494    } else if (name.equals("lastReviewDate")) {
3495      throw new FHIRException("Cannot call addChild on a singleton property ChargeItemDefinition.lastReviewDate");
3496    } else if (name.equals("effectivePeriod")) {
3497      this.effectivePeriod = new Period();
3498      return this.effectivePeriod;
3499    } else if (name.equals("code")) {
3500      this.code = new CodeableConcept();
3501      return this.code;
3502    } else if (name.equals("instance")) {
3503      return addInstance();
3504    } else if (name.equals("applicability")) {
3505      return addApplicability();
3506    } else if (name.equals("propertyGroup")) {
3507      return addPropertyGroup();
3508    } else
3509      return super.addChild(name);
3510  }
3511
3512  public String fhirType() {
3513    return "ChargeItemDefinition";
3514
3515  }
3516
3517  public ChargeItemDefinition copy() {
3518    ChargeItemDefinition dst = new ChargeItemDefinition();
3519    copyValues(dst);
3520    return dst;
3521  }
3522
3523  public void copyValues(ChargeItemDefinition dst) {
3524    super.copyValues(dst);
3525    dst.url = url == null ? null : url.copy();
3526    if (identifier != null) {
3527      dst.identifier = new ArrayList<Identifier>();
3528      for (Identifier i : identifier)
3529        dst.identifier.add(i.copy());
3530    }
3531    ;
3532    dst.version = version == null ? null : version.copy();
3533    dst.title = title == null ? null : title.copy();
3534    if (derivedFromUri != null) {
3535      dst.derivedFromUri = new ArrayList<UriType>();
3536      for (UriType i : derivedFromUri)
3537        dst.derivedFromUri.add(i.copy());
3538    }
3539    ;
3540    if (partOf != null) {
3541      dst.partOf = new ArrayList<CanonicalType>();
3542      for (CanonicalType i : partOf)
3543        dst.partOf.add(i.copy());
3544    }
3545    ;
3546    if (replaces != null) {
3547      dst.replaces = new ArrayList<CanonicalType>();
3548      for (CanonicalType i : replaces)
3549        dst.replaces.add(i.copy());
3550    }
3551    ;
3552    dst.status = status == null ? null : status.copy();
3553    dst.experimental = experimental == null ? null : experimental.copy();
3554    dst.date = date == null ? null : date.copy();
3555    dst.publisher = publisher == null ? null : publisher.copy();
3556    if (contact != null) {
3557      dst.contact = new ArrayList<ContactDetail>();
3558      for (ContactDetail i : contact)
3559        dst.contact.add(i.copy());
3560    }
3561    ;
3562    dst.description = description == null ? null : description.copy();
3563    if (useContext != null) {
3564      dst.useContext = new ArrayList<UsageContext>();
3565      for (UsageContext i : useContext)
3566        dst.useContext.add(i.copy());
3567    }
3568    ;
3569    if (jurisdiction != null) {
3570      dst.jurisdiction = new ArrayList<CodeableConcept>();
3571      for (CodeableConcept i : jurisdiction)
3572        dst.jurisdiction.add(i.copy());
3573    }
3574    ;
3575    dst.copyright = copyright == null ? null : copyright.copy();
3576    dst.approvalDate = approvalDate == null ? null : approvalDate.copy();
3577    dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy();
3578    dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy();
3579    dst.code = code == null ? null : code.copy();
3580    if (instance != null) {
3581      dst.instance = new ArrayList<Reference>();
3582      for (Reference i : instance)
3583        dst.instance.add(i.copy());
3584    }
3585    ;
3586    if (applicability != null) {
3587      dst.applicability = new ArrayList<ChargeItemDefinitionApplicabilityComponent>();
3588      for (ChargeItemDefinitionApplicabilityComponent i : applicability)
3589        dst.applicability.add(i.copy());
3590    }
3591    ;
3592    if (propertyGroup != null) {
3593      dst.propertyGroup = new ArrayList<ChargeItemDefinitionPropertyGroupComponent>();
3594      for (ChargeItemDefinitionPropertyGroupComponent i : propertyGroup)
3595        dst.propertyGroup.add(i.copy());
3596    }
3597    ;
3598  }
3599
3600  protected ChargeItemDefinition typedCopy() {
3601    return copy();
3602  }
3603
3604  @Override
3605  public boolean equalsDeep(Base other_) {
3606    if (!super.equalsDeep(other_))
3607      return false;
3608    if (!(other_ instanceof ChargeItemDefinition))
3609      return false;
3610    ChargeItemDefinition o = (ChargeItemDefinition) other_;
3611    return compareDeep(identifier, o.identifier, true) && compareDeep(derivedFromUri, o.derivedFromUri, true)
3612        && compareDeep(partOf, o.partOf, true) && compareDeep(replaces, o.replaces, true)
3613        && compareDeep(copyright, o.copyright, true) && compareDeep(approvalDate, o.approvalDate, true)
3614        && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true)
3615        && compareDeep(code, o.code, true) && compareDeep(instance, o.instance, true)
3616        && compareDeep(applicability, o.applicability, true) && compareDeep(propertyGroup, o.propertyGroup, true);
3617  }
3618
3619  @Override
3620  public boolean equalsShallow(Base other_) {
3621    if (!super.equalsShallow(other_))
3622      return false;
3623    if (!(other_ instanceof ChargeItemDefinition))
3624      return false;
3625    ChargeItemDefinition o = (ChargeItemDefinition) other_;
3626    return compareValues(derivedFromUri, o.derivedFromUri, true) && compareValues(copyright, o.copyright, true)
3627        && compareValues(approvalDate, o.approvalDate, true) && compareValues(lastReviewDate, o.lastReviewDate, true);
3628  }
3629
3630  public boolean isEmpty() {
3631    return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, derivedFromUri, partOf, replaces,
3632        copyright, approvalDate, lastReviewDate, effectivePeriod, code, instance, applicability, propertyGroup);
3633  }
3634
3635  @Override
3636  public ResourceType getResourceType() {
3637    return ResourceType.ChargeItemDefinition;
3638  }
3639
3640  /**
3641   * Search parameter: <b>date</b>
3642   * <p>
3643   * Description: <b>The charge item definition publication date</b><br>
3644   * Type: <b>date</b><br>
3645   * Path: <b>ChargeItemDefinition.date</b><br>
3646   * </p>
3647   */
3648  @SearchParamDefinition(name = "date", path = "ChargeItemDefinition.date", description = "The charge item definition publication date", type = "date")
3649  public static final String SP_DATE = "date";
3650  /**
3651   * <b>Fluent Client</b> search parameter constant for <b>date</b>
3652   * <p>
3653   * Description: <b>The charge item definition publication date</b><br>
3654   * Type: <b>date</b><br>
3655   * Path: <b>ChargeItemDefinition.date</b><br>
3656   * </p>
3657   */
3658  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(
3659      SP_DATE);
3660
3661  /**
3662   * Search parameter: <b>identifier</b>
3663   * <p>
3664   * Description: <b>External identifier for the charge item definition</b><br>
3665   * Type: <b>token</b><br>
3666   * Path: <b>ChargeItemDefinition.identifier</b><br>
3667   * </p>
3668   */
3669  @SearchParamDefinition(name = "identifier", path = "ChargeItemDefinition.identifier", description = "External identifier for the charge item definition", type = "token")
3670  public static final String SP_IDENTIFIER = "identifier";
3671  /**
3672   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3673   * <p>
3674   * Description: <b>External identifier for the charge item definition</b><br>
3675   * Type: <b>token</b><br>
3676   * Path: <b>ChargeItemDefinition.identifier</b><br>
3677   * </p>
3678   */
3679  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3680      SP_IDENTIFIER);
3681
3682  /**
3683   * Search parameter: <b>context-type-value</b>
3684   * <p>
3685   * Description: <b>A use context type and value assigned to the charge item
3686   * definition</b><br>
3687   * Type: <b>composite</b><br>
3688   * Path: <b></b><br>
3689   * </p>
3690   */
3691  @SearchParamDefinition(name = "context-type-value", path = "ChargeItemDefinition.useContext", description = "A use context type and value assigned to the charge item definition", type = "composite", compositeOf = {
3692      "context-type", "context" })
3693  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
3694  /**
3695   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
3696   * <p>
3697   * Description: <b>A use context type and value assigned to the charge item
3698   * definition</b><br>
3699   * Type: <b>composite</b><br>
3700   * Path: <b></b><br>
3701   * </p>
3702   */
3703  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(
3704      SP_CONTEXT_TYPE_VALUE);
3705
3706  /**
3707   * Search parameter: <b>jurisdiction</b>
3708   * <p>
3709   * Description: <b>Intended jurisdiction for the charge item definition</b><br>
3710   * Type: <b>token</b><br>
3711   * Path: <b>ChargeItemDefinition.jurisdiction</b><br>
3712   * </p>
3713   */
3714  @SearchParamDefinition(name = "jurisdiction", path = "ChargeItemDefinition.jurisdiction", description = "Intended jurisdiction for the charge item definition", type = "token")
3715  public static final String SP_JURISDICTION = "jurisdiction";
3716  /**
3717   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
3718   * <p>
3719   * Description: <b>Intended jurisdiction for the charge item definition</b><br>
3720   * Type: <b>token</b><br>
3721   * Path: <b>ChargeItemDefinition.jurisdiction</b><br>
3722   * </p>
3723   */
3724  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3725      SP_JURISDICTION);
3726
3727  /**
3728   * Search parameter: <b>description</b>
3729   * <p>
3730   * Description: <b>The description of the charge item definition</b><br>
3731   * Type: <b>string</b><br>
3732   * Path: <b>ChargeItemDefinition.description</b><br>
3733   * </p>
3734   */
3735  @SearchParamDefinition(name = "description", path = "ChargeItemDefinition.description", description = "The description of the charge item definition", type = "string")
3736  public static final String SP_DESCRIPTION = "description";
3737  /**
3738   * <b>Fluent Client</b> search parameter constant for <b>description</b>
3739   * <p>
3740   * Description: <b>The description of the charge item definition</b><br>
3741   * Type: <b>string</b><br>
3742   * Path: <b>ChargeItemDefinition.description</b><br>
3743   * </p>
3744   */
3745  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(
3746      SP_DESCRIPTION);
3747
3748  /**
3749   * Search parameter: <b>context-type</b>
3750   * <p>
3751   * Description: <b>A type of use context assigned to the charge item
3752   * definition</b><br>
3753   * Type: <b>token</b><br>
3754   * Path: <b>ChargeItemDefinition.useContext.code</b><br>
3755   * </p>
3756   */
3757  @SearchParamDefinition(name = "context-type", path = "ChargeItemDefinition.useContext.code", description = "A type of use context assigned to the charge item definition", type = "token")
3758  public static final String SP_CONTEXT_TYPE = "context-type";
3759  /**
3760   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
3761   * <p>
3762   * Description: <b>A type of use context assigned to the charge item
3763   * definition</b><br>
3764   * Type: <b>token</b><br>
3765   * Path: <b>ChargeItemDefinition.useContext.code</b><br>
3766   * </p>
3767   */
3768  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3769      SP_CONTEXT_TYPE);
3770
3771  /**
3772   * Search parameter: <b>title</b>
3773   * <p>
3774   * Description: <b>The human-friendly name of the charge item definition</b><br>
3775   * Type: <b>string</b><br>
3776   * Path: <b>ChargeItemDefinition.title</b><br>
3777   * </p>
3778   */
3779  @SearchParamDefinition(name = "title", path = "ChargeItemDefinition.title", description = "The human-friendly name of the charge item definition", type = "string")
3780  public static final String SP_TITLE = "title";
3781  /**
3782   * <b>Fluent Client</b> search parameter constant for <b>title</b>
3783   * <p>
3784   * Description: <b>The human-friendly name of the charge item definition</b><br>
3785   * Type: <b>string</b><br>
3786   * Path: <b>ChargeItemDefinition.title</b><br>
3787   * </p>
3788   */
3789  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(
3790      SP_TITLE);
3791
3792  /**
3793   * Search parameter: <b>version</b>
3794   * <p>
3795   * Description: <b>The business version of the charge item definition</b><br>
3796   * Type: <b>token</b><br>
3797   * Path: <b>ChargeItemDefinition.version</b><br>
3798   * </p>
3799   */
3800  @SearchParamDefinition(name = "version", path = "ChargeItemDefinition.version", description = "The business version of the charge item definition", type = "token")
3801  public static final String SP_VERSION = "version";
3802  /**
3803   * <b>Fluent Client</b> search parameter constant for <b>version</b>
3804   * <p>
3805   * Description: <b>The business version of the charge item definition</b><br>
3806   * Type: <b>token</b><br>
3807   * Path: <b>ChargeItemDefinition.version</b><br>
3808   * </p>
3809   */
3810  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3811      SP_VERSION);
3812
3813  /**
3814   * Search parameter: <b>url</b>
3815   * <p>
3816   * Description: <b>The uri that identifies the charge item definition</b><br>
3817   * Type: <b>uri</b><br>
3818   * Path: <b>ChargeItemDefinition.url</b><br>
3819   * </p>
3820   */
3821  @SearchParamDefinition(name = "url", path = "ChargeItemDefinition.url", description = "The uri that identifies the charge item definition", type = "uri")
3822  public static final String SP_URL = "url";
3823  /**
3824   * <b>Fluent Client</b> search parameter constant for <b>url</b>
3825   * <p>
3826   * Description: <b>The uri that identifies the charge item definition</b><br>
3827   * Type: <b>uri</b><br>
3828   * Path: <b>ChargeItemDefinition.url</b><br>
3829   * </p>
3830   */
3831  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
3832
3833  /**
3834   * Search parameter: <b>context-quantity</b>
3835   * <p>
3836   * Description: <b>A quantity- or range-valued use context assigned to the
3837   * charge item definition</b><br>
3838   * Type: <b>quantity</b><br>
3839   * Path: <b>ChargeItemDefinition.useContext.valueQuantity,
3840   * ChargeItemDefinition.useContext.valueRange</b><br>
3841   * </p>
3842   */
3843  @SearchParamDefinition(name = "context-quantity", path = "(ChargeItemDefinition.useContext.value as Quantity) | (ChargeItemDefinition.useContext.value as Range)", description = "A quantity- or range-valued use context assigned to the charge item definition", type = "quantity")
3844  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
3845  /**
3846   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
3847   * <p>
3848   * Description: <b>A quantity- or range-valued use context assigned to the
3849   * charge item definition</b><br>
3850   * Type: <b>quantity</b><br>
3851   * Path: <b>ChargeItemDefinition.useContext.valueQuantity,
3852   * ChargeItemDefinition.useContext.valueRange</b><br>
3853   * </p>
3854   */
3855  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(
3856      SP_CONTEXT_QUANTITY);
3857
3858  /**
3859   * Search parameter: <b>effective</b>
3860   * <p>
3861   * Description: <b>The time during which the charge item definition is intended
3862   * to be in use</b><br>
3863   * Type: <b>date</b><br>
3864   * Path: <b>ChargeItemDefinition.effectivePeriod</b><br>
3865   * </p>
3866   */
3867  @SearchParamDefinition(name = "effective", path = "ChargeItemDefinition.effectivePeriod", description = "The time during which the charge item definition is intended to be in use", type = "date")
3868  public static final String SP_EFFECTIVE = "effective";
3869  /**
3870   * <b>Fluent Client</b> search parameter constant for <b>effective</b>
3871   * <p>
3872   * Description: <b>The time during which the charge item definition is intended
3873   * to be in use</b><br>
3874   * Type: <b>date</b><br>
3875   * Path: <b>ChargeItemDefinition.effectivePeriod</b><br>
3876   * </p>
3877   */
3878  public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(
3879      SP_EFFECTIVE);
3880
3881  /**
3882   * Search parameter: <b>context</b>
3883   * <p>
3884   * Description: <b>A use context assigned to the charge item definition</b><br>
3885   * Type: <b>token</b><br>
3886   * Path: <b>ChargeItemDefinition.useContext.valueCodeableConcept</b><br>
3887   * </p>
3888   */
3889  @SearchParamDefinition(name = "context", path = "(ChargeItemDefinition.useContext.value as CodeableConcept)", description = "A use context assigned to the charge item definition", type = "token")
3890  public static final String SP_CONTEXT = "context";
3891  /**
3892   * <b>Fluent Client</b> search parameter constant for <b>context</b>
3893   * <p>
3894   * Description: <b>A use context assigned to the charge item definition</b><br>
3895   * Type: <b>token</b><br>
3896   * Path: <b>ChargeItemDefinition.useContext.valueCodeableConcept</b><br>
3897   * </p>
3898   */
3899  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3900      SP_CONTEXT);
3901
3902  /**
3903   * Search parameter: <b>publisher</b>
3904   * <p>
3905   * Description: <b>Name of the publisher of the charge item definition</b><br>
3906   * Type: <b>string</b><br>
3907   * Path: <b>ChargeItemDefinition.publisher</b><br>
3908   * </p>
3909   */
3910  @SearchParamDefinition(name = "publisher", path = "ChargeItemDefinition.publisher", description = "Name of the publisher of the charge item definition", type = "string")
3911  public static final String SP_PUBLISHER = "publisher";
3912  /**
3913   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
3914   * <p>
3915   * Description: <b>Name of the publisher of the charge item definition</b><br>
3916   * Type: <b>string</b><br>
3917   * Path: <b>ChargeItemDefinition.publisher</b><br>
3918   * </p>
3919   */
3920  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(
3921      SP_PUBLISHER);
3922
3923  /**
3924   * Search parameter: <b>context-type-quantity</b>
3925   * <p>
3926   * Description: <b>A use context type and quantity- or range-based value
3927   * assigned to the charge item definition</b><br>
3928   * Type: <b>composite</b><br>
3929   * Path: <b></b><br>
3930   * </p>
3931   */
3932  @SearchParamDefinition(name = "context-type-quantity", path = "ChargeItemDefinition.useContext", description = "A use context type and quantity- or range-based value assigned to the charge item definition", type = "composite", compositeOf = {
3933      "context-type", "context-quantity" })
3934  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
3935  /**
3936   * <b>Fluent Client</b> search parameter constant for
3937   * <b>context-type-quantity</b>
3938   * <p>
3939   * Description: <b>A use context type and quantity- or range-based value
3940   * assigned to the charge item definition</b><br>
3941   * Type: <b>composite</b><br>
3942   * Path: <b></b><br>
3943   * </p>
3944   */
3945  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(
3946      SP_CONTEXT_TYPE_QUANTITY);
3947
3948  /**
3949   * Search parameter: <b>status</b>
3950   * <p>
3951   * Description: <b>The current status of the charge item definition</b><br>
3952   * Type: <b>token</b><br>
3953   * Path: <b>ChargeItemDefinition.status</b><br>
3954   * </p>
3955   */
3956  @SearchParamDefinition(name = "status", path = "ChargeItemDefinition.status", description = "The current status of the charge item definition", type = "token")
3957  public static final String SP_STATUS = "status";
3958  /**
3959   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3960   * <p>
3961   * Description: <b>The current status of the charge item definition</b><br>
3962   * Type: <b>token</b><br>
3963   * Path: <b>ChargeItemDefinition.status</b><br>
3964   * </p>
3965   */
3966  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(
3967      SP_STATUS);
3968
3969}