001package org.hl7.fhir.r4.model;
002
003
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
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import java.math.*;
040import org.hl7.fhir.utilities.Utilities;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.
051 */
052@ResourceDef(name="ChargeItem", profile="http://hl7.org/fhir/StructureDefinition/ChargeItem")
053public class ChargeItem extends DomainResource {
054
055    public enum ChargeItemStatus {
056        /**
057         * The charge item has been entered, but the charged service is not  yet complete, so it shall not be billed yet but might be used in the context of pre-authorization.
058         */
059        PLANNED, 
060        /**
061         * The charge item is ready for billing.
062         */
063        BILLABLE, 
064        /**
065         * The charge item has been determined to be not billable (e.g. due to rules associated with the billing code).
066         */
067        NOTBILLABLE, 
068        /**
069         * The processing of the charge was aborted.
070         */
071        ABORTED, 
072        /**
073         * The charge item has been billed (e.g. a billing engine has generated financial transactions by applying the associated ruled for the charge item to the context of the Encounter, and placed them into Claims/Invoices.
074         */
075        BILLED, 
076        /**
077         * The charge item has been entered in error and should not be processed for billing.
078         */
079        ENTEREDINERROR, 
080        /**
081         * The authoring system does not know which of the status values currently applies for this charge item  Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply, it's just not known which one.
082         */
083        UNKNOWN, 
084        /**
085         * added to help the parsers with the generic types
086         */
087        NULL;
088        public static ChargeItemStatus fromCode(String codeString) throws FHIRException {
089            if (codeString == null || "".equals(codeString))
090                return null;
091        if ("planned".equals(codeString))
092          return PLANNED;
093        if ("billable".equals(codeString))
094          return BILLABLE;
095        if ("not-billable".equals(codeString))
096          return NOTBILLABLE;
097        if ("aborted".equals(codeString))
098          return ABORTED;
099        if ("billed".equals(codeString))
100          return BILLED;
101        if ("entered-in-error".equals(codeString))
102          return ENTEREDINERROR;
103        if ("unknown".equals(codeString))
104          return UNKNOWN;
105        if (Configuration.isAcceptInvalidEnums())
106          return null;
107        else
108          throw new FHIRException("Unknown ChargeItemStatus code '"+codeString+"'");
109        }
110        public String toCode() {
111          switch (this) {
112            case PLANNED: return "planned";
113            case BILLABLE: return "billable";
114            case NOTBILLABLE: return "not-billable";
115            case ABORTED: return "aborted";
116            case BILLED: return "billed";
117            case ENTEREDINERROR: return "entered-in-error";
118            case UNKNOWN: return "unknown";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getSystem() {
124          switch (this) {
125            case PLANNED: return "http://hl7.org/fhir/chargeitem-status";
126            case BILLABLE: return "http://hl7.org/fhir/chargeitem-status";
127            case NOTBILLABLE: return "http://hl7.org/fhir/chargeitem-status";
128            case ABORTED: return "http://hl7.org/fhir/chargeitem-status";
129            case BILLED: return "http://hl7.org/fhir/chargeitem-status";
130            case ENTEREDINERROR: return "http://hl7.org/fhir/chargeitem-status";
131            case UNKNOWN: return "http://hl7.org/fhir/chargeitem-status";
132            case NULL: return null;
133            default: return "?";
134          }
135        }
136        public String getDefinition() {
137          switch (this) {
138            case PLANNED: return "The charge item has been entered, but the charged service is not  yet complete, so it shall not be billed yet but might be used in the context of pre-authorization.";
139            case BILLABLE: return "The charge item is ready for billing.";
140            case NOTBILLABLE: return "The charge item has been determined to be not billable (e.g. due to rules associated with the billing code).";
141            case ABORTED: return "The processing of the charge was aborted.";
142            case BILLED: return "The charge item has been billed (e.g. a billing engine has generated financial transactions by applying the associated ruled for the charge item to the context of the Encounter, and placed them into Claims/Invoices.";
143            case ENTEREDINERROR: return "The charge item has been entered in error and should not be processed for billing.";
144            case UNKNOWN: return "The authoring system does not know which of the status values currently applies for this charge item  Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, it's just not known which one.";
145            case NULL: return null;
146            default: return "?";
147          }
148        }
149        public String getDisplay() {
150          switch (this) {
151            case PLANNED: return "Planned";
152            case BILLABLE: return "Billable";
153            case NOTBILLABLE: return "Not billable";
154            case ABORTED: return "Aborted";
155            case BILLED: return "Billed";
156            case ENTEREDINERROR: return "Entered in Error";
157            case UNKNOWN: return "Unknown";
158            case NULL: return null;
159            default: return "?";
160          }
161        }
162    }
163
164  public static class ChargeItemStatusEnumFactory implements EnumFactory<ChargeItemStatus> {
165    public ChargeItemStatus fromCode(String codeString) throws IllegalArgumentException {
166      if (codeString == null || "".equals(codeString))
167            if (codeString == null || "".equals(codeString))
168                return null;
169        if ("planned".equals(codeString))
170          return ChargeItemStatus.PLANNED;
171        if ("billable".equals(codeString))
172          return ChargeItemStatus.BILLABLE;
173        if ("not-billable".equals(codeString))
174          return ChargeItemStatus.NOTBILLABLE;
175        if ("aborted".equals(codeString))
176          return ChargeItemStatus.ABORTED;
177        if ("billed".equals(codeString))
178          return ChargeItemStatus.BILLED;
179        if ("entered-in-error".equals(codeString))
180          return ChargeItemStatus.ENTEREDINERROR;
181        if ("unknown".equals(codeString))
182          return ChargeItemStatus.UNKNOWN;
183        throw new IllegalArgumentException("Unknown ChargeItemStatus code '"+codeString+"'");
184        }
185        public Enumeration<ChargeItemStatus> fromType(Base code) throws FHIRException {
186          if (code == null)
187            return null;
188          if (code.isEmpty())
189            return new Enumeration<ChargeItemStatus>(this);
190          String codeString = ((PrimitiveType) code).asStringValue();
191          if (codeString == null || "".equals(codeString))
192            return null;
193        if ("planned".equals(codeString))
194          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.PLANNED);
195        if ("billable".equals(codeString))
196          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.BILLABLE);
197        if ("not-billable".equals(codeString))
198          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.NOTBILLABLE);
199        if ("aborted".equals(codeString))
200          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.ABORTED);
201        if ("billed".equals(codeString))
202          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.BILLED);
203        if ("entered-in-error".equals(codeString))
204          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.ENTEREDINERROR);
205        if ("unknown".equals(codeString))
206          return new Enumeration<ChargeItemStatus>(this, ChargeItemStatus.UNKNOWN);
207        throw new FHIRException("Unknown ChargeItemStatus code '"+codeString+"'");
208        }
209    public String toCode(ChargeItemStatus code) {
210      if (code == ChargeItemStatus.PLANNED)
211        return "planned";
212      if (code == ChargeItemStatus.BILLABLE)
213        return "billable";
214      if (code == ChargeItemStatus.NOTBILLABLE)
215        return "not-billable";
216      if (code == ChargeItemStatus.ABORTED)
217        return "aborted";
218      if (code == ChargeItemStatus.BILLED)
219        return "billed";
220      if (code == ChargeItemStatus.ENTEREDINERROR)
221        return "entered-in-error";
222      if (code == ChargeItemStatus.UNKNOWN)
223        return "unknown";
224      return "?";
225      }
226    public String toSystem(ChargeItemStatus code) {
227      return code.getSystem();
228      }
229    }
230
231    @Block()
232    public static class ChargeItemPerformerComponent extends BackboneElement implements IBaseBackboneElement {
233        /**
234         * Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).
235         */
236        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
237        @Description(shortDefinition="What type of performance was done", formalDefinition="Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.)." )
238        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/performer-role")
239        protected CodeableConcept function;
240
241        /**
242         * The device, practitioner, etc. who performed or participated in the service.
243         */
244        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class, Patient.class, Device.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false)
245        @Description(shortDefinition="Individual who was performing", formalDefinition="The device, practitioner, etc. who performed or participated in the service." )
246        protected Reference actor;
247
248        /**
249         * The actual object that is the target of the reference (The device, practitioner, etc. who performed or participated in the service.)
250         */
251        protected Resource actorTarget;
252
253        private static final long serialVersionUID = 1424001049L;
254
255    /**
256     * Constructor
257     */
258      public ChargeItemPerformerComponent() {
259        super();
260      }
261
262    /**
263     * Constructor
264     */
265      public ChargeItemPerformerComponent(Reference actor) {
266        super();
267        this.actor = actor;
268      }
269
270        /**
271         * @return {@link #function} (Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).)
272         */
273        public CodeableConcept getFunction() { 
274          if (this.function == null)
275            if (Configuration.errorOnAutoCreate())
276              throw new Error("Attempt to auto-create ChargeItemPerformerComponent.function");
277            else if (Configuration.doAutoCreate())
278              this.function = new CodeableConcept(); // cc
279          return this.function;
280        }
281
282        public boolean hasFunction() { 
283          return this.function != null && !this.function.isEmpty();
284        }
285
286        /**
287         * @param value {@link #function} (Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).)
288         */
289        public ChargeItemPerformerComponent setFunction(CodeableConcept value) { 
290          this.function = value;
291          return this;
292        }
293
294        /**
295         * @return {@link #actor} (The device, practitioner, etc. who performed or participated in the service.)
296         */
297        public Reference getActor() { 
298          if (this.actor == null)
299            if (Configuration.errorOnAutoCreate())
300              throw new Error("Attempt to auto-create ChargeItemPerformerComponent.actor");
301            else if (Configuration.doAutoCreate())
302              this.actor = new Reference(); // cc
303          return this.actor;
304        }
305
306        public boolean hasActor() { 
307          return this.actor != null && !this.actor.isEmpty();
308        }
309
310        /**
311         * @param value {@link #actor} (The device, practitioner, etc. who performed or participated in the service.)
312         */
313        public ChargeItemPerformerComponent setActor(Reference value) { 
314          this.actor = value;
315          return this;
316        }
317
318        /**
319         * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device, practitioner, etc. who performed or participated in the service.)
320         */
321        public Resource getActorTarget() { 
322          return this.actorTarget;
323        }
324
325        /**
326         * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device, practitioner, etc. who performed or participated in the service.)
327         */
328        public ChargeItemPerformerComponent setActorTarget(Resource value) { 
329          this.actorTarget = value;
330          return this;
331        }
332
333        protected void listChildren(List<Property> children) {
334          super.listChildren(children);
335          children.add(new Property("function", "CodeableConcept", "Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).", 0, 1, function));
336          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)", "The device, practitioner, etc. who performed or participated in the service.", 0, 1, actor));
337        }
338
339        @Override
340        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
341          switch (_hash) {
342          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).", 0, 1, function);
343          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Organization|CareTeam|Patient|Device|RelatedPerson)", "The device, practitioner, etc. who performed or participated in the service.", 0, 1, actor);
344          default: return super.getNamedProperty(_hash, _name, _checkValid);
345          }
346
347        }
348
349      @Override
350      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
351        switch (hash) {
352        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
353        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
354        default: return super.getProperty(hash, name, checkValid);
355        }
356
357      }
358
359      @Override
360      public Base setProperty(int hash, String name, Base value) throws FHIRException {
361        switch (hash) {
362        case 1380938712: // function
363          this.function = castToCodeableConcept(value); // CodeableConcept
364          return value;
365        case 92645877: // actor
366          this.actor = castToReference(value); // Reference
367          return value;
368        default: return super.setProperty(hash, name, value);
369        }
370
371      }
372
373      @Override
374      public Base setProperty(String name, Base value) throws FHIRException {
375        if (name.equals("function")) {
376          this.function = castToCodeableConcept(value); // CodeableConcept
377        } else if (name.equals("actor")) {
378          this.actor = castToReference(value); // Reference
379        } else
380          return super.setProperty(name, value);
381        return value;
382      }
383
384      @Override
385      public Base makeProperty(int hash, String name) throws FHIRException {
386        switch (hash) {
387        case 1380938712:  return getFunction(); 
388        case 92645877:  return getActor(); 
389        default: return super.makeProperty(hash, name);
390        }
391
392      }
393
394      @Override
395      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
396        switch (hash) {
397        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
398        case 92645877: /*actor*/ return new String[] {"Reference"};
399        default: return super.getTypesForProperty(hash, name);
400        }
401
402      }
403
404      @Override
405      public Base addChild(String name) throws FHIRException {
406        if (name.equals("function")) {
407          this.function = new CodeableConcept();
408          return this.function;
409        }
410        else if (name.equals("actor")) {
411          this.actor = new Reference();
412          return this.actor;
413        }
414        else
415          return super.addChild(name);
416      }
417
418      public ChargeItemPerformerComponent copy() {
419        ChargeItemPerformerComponent dst = new ChargeItemPerformerComponent();
420        copyValues(dst);
421        return dst;
422      }
423
424      public void copyValues(ChargeItemPerformerComponent dst) {
425        super.copyValues(dst);
426        dst.function = function == null ? null : function.copy();
427        dst.actor = actor == null ? null : actor.copy();
428      }
429
430      @Override
431      public boolean equalsDeep(Base other_) {
432        if (!super.equalsDeep(other_))
433          return false;
434        if (!(other_ instanceof ChargeItemPerformerComponent))
435          return false;
436        ChargeItemPerformerComponent o = (ChargeItemPerformerComponent) other_;
437        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
438      }
439
440      @Override
441      public boolean equalsShallow(Base other_) {
442        if (!super.equalsShallow(other_))
443          return false;
444        if (!(other_ instanceof ChargeItemPerformerComponent))
445          return false;
446        ChargeItemPerformerComponent o = (ChargeItemPerformerComponent) other_;
447        return true;
448      }
449
450      public boolean isEmpty() {
451        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
452      }
453
454  public String fhirType() {
455    return "ChargeItem.performer";
456
457  }
458
459  }
460
461    /**
462     * Identifiers assigned to this event performer or other systems.
463     */
464    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
465    @Description(shortDefinition="Business Identifier for item", formalDefinition="Identifiers assigned to this event performer or other systems." )
466    protected List<Identifier> identifier;
467
468    /**
469     * References the (external) source of pricing information, rules of application for the code this ChargeItem uses.
470     */
471    @Child(name = "definitionUri", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
472    @Description(shortDefinition="Defining information about the code of this charge item", formalDefinition="References the (external) source of pricing information, rules of application for the code this ChargeItem uses." )
473    protected List<UriType> definitionUri;
474
475    /**
476     * References the source of pricing information, rules of application for the code this ChargeItem uses.
477     */
478    @Child(name = "definitionCanonical", type = {CanonicalType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
479    @Description(shortDefinition="Resource defining the code of this ChargeItem", formalDefinition="References the source of pricing information, rules of application for the code this ChargeItem uses." )
480    protected List<CanonicalType> definitionCanonical;
481
482    /**
483     * The current state of the ChargeItem.
484     */
485    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
486    @Description(shortDefinition="planned | billable | not-billable | aborted | billed | entered-in-error | unknown", formalDefinition="The current state of the ChargeItem." )
487    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/chargeitem-status")
488    protected Enumeration<ChargeItemStatus> status;
489
490    /**
491     * ChargeItems can be grouped to larger ChargeItems covering the whole set.
492     */
493    @Child(name = "partOf", type = {ChargeItem.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
494    @Description(shortDefinition="Part of referenced ChargeItem", formalDefinition="ChargeItems can be grouped to larger ChargeItems covering the whole set." )
495    protected List<Reference> partOf;
496    /**
497     * The actual objects that are the target of the reference (ChargeItems can be grouped to larger ChargeItems covering the whole set.)
498     */
499    protected List<ChargeItem> partOfTarget;
500
501
502    /**
503     * A code that identifies the charge, like a billing code.
504     */
505    @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true)
506    @Description(shortDefinition="A code that identifies the charge, like a billing code", formalDefinition="A code that identifies the charge, like a billing code." )
507    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/chargeitem-billingcodes")
508    protected CodeableConcept code;
509
510    /**
511     * The individual or set of individuals the action is being or was performed on.
512     */
513    @Child(name = "subject", type = {Patient.class, Group.class}, order=6, min=1, max=1, modifier=false, summary=true)
514    @Description(shortDefinition="Individual service was done for/to", formalDefinition="The individual or set of individuals the action is being or was performed on." )
515    protected Reference subject;
516
517    /**
518     * The actual object that is the target of the reference (The individual or set of individuals the action is being or was performed on.)
519     */
520    protected Resource subjectTarget;
521
522    /**
523     * The encounter or episode of care that establishes the context for this event.
524     */
525    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=7, min=0, max=1, modifier=false, summary=true)
526    @Description(shortDefinition="Encounter / Episode associated with event", formalDefinition="The encounter or episode of care that establishes the context for this event." )
527    protected Reference context;
528
529    /**
530     * The actual object that is the target of the reference (The encounter or episode of care that establishes the context for this event.)
531     */
532    protected Resource contextTarget;
533
534    /**
535     * Date/time(s) or duration when the charged service was applied.
536     */
537    @Child(name = "occurrence", type = {DateTimeType.class, Period.class, Timing.class}, order=8, min=0, max=1, modifier=false, summary=true)
538    @Description(shortDefinition="When the charged service was applied", formalDefinition="Date/time(s) or duration when the charged service was applied." )
539    protected Type occurrence;
540
541    /**
542     * Indicates who or what performed or participated in the charged service.
543     */
544    @Child(name = "performer", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
545    @Description(shortDefinition="Who performed charged service", formalDefinition="Indicates who or what performed or participated in the charged service." )
546    protected List<ChargeItemPerformerComponent> performer;
547
548    /**
549     * The organization requesting the service.
550     */
551    @Child(name = "performingOrganization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false)
552    @Description(shortDefinition="Organization providing the charged service", formalDefinition="The organization requesting the service." )
553    protected Reference performingOrganization;
554
555    /**
556     * The actual object that is the target of the reference (The organization requesting the service.)
557     */
558    protected Organization performingOrganizationTarget;
559
560    /**
561     * The organization performing the service.
562     */
563    @Child(name = "requestingOrganization", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false)
564    @Description(shortDefinition="Organization requesting the charged service", formalDefinition="The organization performing the service." )
565    protected Reference requestingOrganization;
566
567    /**
568     * The actual object that is the target of the reference (The organization performing the service.)
569     */
570    protected Organization requestingOrganizationTarget;
571
572    /**
573     * The financial cost center permits the tracking of charge attribution.
574     */
575    @Child(name = "costCenter", type = {Organization.class}, order=12, min=0, max=1, modifier=false, summary=false)
576    @Description(shortDefinition="Organization that has ownership of the (potential, future) revenue", formalDefinition="The financial cost center permits the tracking of charge attribution." )
577    protected Reference costCenter;
578
579    /**
580     * The actual object that is the target of the reference (The financial cost center permits the tracking of charge attribution.)
581     */
582    protected Organization costCenterTarget;
583
584    /**
585     * Quantity of which the charge item has been serviced.
586     */
587    @Child(name = "quantity", type = {Quantity.class}, order=13, min=0, max=1, modifier=false, summary=true)
588    @Description(shortDefinition="Quantity of which the charge item has been serviced", formalDefinition="Quantity of which the charge item has been serviced." )
589    protected Quantity quantity;
590
591    /**
592     * The anatomical location where the related service has been applied.
593     */
594    @Child(name = "bodysite", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
595    @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where the related service has been applied." )
596    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/body-site")
597    protected List<CodeableConcept> bodysite;
598
599    /**
600     * Factor overriding the factor determined by the rules associated with the code.
601     */
602    @Child(name = "factorOverride", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=false)
603    @Description(shortDefinition="Factor overriding the associated rules", formalDefinition="Factor overriding the factor determined by the rules associated with the code." )
604    protected DecimalType factorOverride;
605
606    /**
607     * Total price of the charge overriding the list price associated with the code.
608     */
609    @Child(name = "priceOverride", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=false)
610    @Description(shortDefinition="Price overriding the associated rules", formalDefinition="Total price of the charge overriding the list price associated with the code." )
611    protected Money priceOverride;
612
613    /**
614     * If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.
615     */
616    @Child(name = "overrideReason", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
617    @Description(shortDefinition="Reason for overriding the list price/factor", formalDefinition="If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action." )
618    protected StringType overrideReason;
619
620    /**
621     * The device, practitioner, etc. who entered the charge item.
622     */
623    @Child(name = "enterer", type = {Practitioner.class, PractitionerRole.class, Organization.class, Patient.class, Device.class, RelatedPerson.class}, order=18, min=0, max=1, modifier=false, summary=true)
624    @Description(shortDefinition="Individual who was entering", formalDefinition="The device, practitioner, etc. who entered the charge item." )
625    protected Reference enterer;
626
627    /**
628     * The actual object that is the target of the reference (The device, practitioner, etc. who entered the charge item.)
629     */
630    protected Resource entererTarget;
631
632    /**
633     * Date the charge item was entered.
634     */
635    @Child(name = "enteredDate", type = {DateTimeType.class}, order=19, min=0, max=1, modifier=false, summary=true)
636    @Description(shortDefinition="Date the charge item was entered", formalDefinition="Date the charge item was entered." )
637    protected DateTimeType enteredDate;
638
639    /**
640     * Describes why the event occurred in coded or textual form.
641     */
642    @Child(name = "reason", type = {CodeableConcept.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
643    @Description(shortDefinition="Why was the charged  service rendered?", formalDefinition="Describes why the event occurred in coded or textual form." )
644    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10")
645    protected List<CodeableConcept> reason;
646
647    /**
648     * Indicated the rendered service that caused this charge.
649     */
650    @Child(name = "service", type = {DiagnosticReport.class, ImagingStudy.class, Immunization.class, MedicationAdministration.class, MedicationDispense.class, Observation.class, Procedure.class, SupplyDelivery.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
651    @Description(shortDefinition="Which rendered service is being charged?", formalDefinition="Indicated the rendered service that caused this charge." )
652    protected List<Reference> service;
653    /**
654     * The actual objects that are the target of the reference (Indicated the rendered service that caused this charge.)
655     */
656    protected List<Resource> serviceTarget;
657
658
659    /**
660     * Identifies the device, food, drug or other product being charged either by type code or reference to an instance.
661     */
662    @Child(name = "product", type = {Device.class, Medication.class, Substance.class, CodeableConcept.class}, order=22, min=0, max=1, modifier=false, summary=false)
663    @Description(shortDefinition="Product charged", formalDefinition="Identifies the device, food, drug or other product being charged either by type code or reference to an instance." )
664    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/device-kind")
665    protected Type product;
666
667    /**
668     * Account into which this ChargeItems belongs.
669     */
670    @Child(name = "account", type = {Account.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
671    @Description(shortDefinition="Account to place this charge", formalDefinition="Account into which this ChargeItems belongs." )
672    protected List<Reference> account;
673    /**
674     * The actual objects that are the target of the reference (Account into which this ChargeItems belongs.)
675     */
676    protected List<Account> accountTarget;
677
678
679    /**
680     * Comments made about the event by the performer, subject or other participants.
681     */
682    @Child(name = "note", type = {Annotation.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
683    @Description(shortDefinition="Comments made about the ChargeItem", formalDefinition="Comments made about the event by the performer, subject or other participants." )
684    protected List<Annotation> note;
685
686    /**
687     * Further information supporting this charge.
688     */
689    @Child(name = "supportingInformation", type = {Reference.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
690    @Description(shortDefinition="Further information supporting this charge", formalDefinition="Further information supporting this charge." )
691    protected List<Reference> supportingInformation;
692    /**
693     * The actual objects that are the target of the reference (Further information supporting this charge.)
694     */
695    protected List<Resource> supportingInformationTarget;
696
697
698    private static final long serialVersionUID = 1748644267L;
699
700  /**
701   * Constructor
702   */
703    public ChargeItem() {
704      super();
705    }
706
707  /**
708   * Constructor
709   */
710    public ChargeItem(Enumeration<ChargeItemStatus> status, CodeableConcept code, Reference subject) {
711      super();
712      this.status = status;
713      this.code = code;
714      this.subject = subject;
715    }
716
717    /**
718     * @return {@link #identifier} (Identifiers assigned to this event performer or other systems.)
719     */
720    public List<Identifier> getIdentifier() { 
721      if (this.identifier == null)
722        this.identifier = new ArrayList<Identifier>();
723      return this.identifier;
724    }
725
726    /**
727     * @return Returns a reference to <code>this</code> for easy method chaining
728     */
729    public ChargeItem setIdentifier(List<Identifier> theIdentifier) { 
730      this.identifier = theIdentifier;
731      return this;
732    }
733
734    public boolean hasIdentifier() { 
735      if (this.identifier == null)
736        return false;
737      for (Identifier item : this.identifier)
738        if (!item.isEmpty())
739          return true;
740      return false;
741    }
742
743    public Identifier addIdentifier() { //3
744      Identifier t = new Identifier();
745      if (this.identifier == null)
746        this.identifier = new ArrayList<Identifier>();
747      this.identifier.add(t);
748      return t;
749    }
750
751    public ChargeItem addIdentifier(Identifier t) { //3
752      if (t == null)
753        return this;
754      if (this.identifier == null)
755        this.identifier = new ArrayList<Identifier>();
756      this.identifier.add(t);
757      return this;
758    }
759
760    /**
761     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
762     */
763    public Identifier getIdentifierFirstRep() { 
764      if (getIdentifier().isEmpty()) {
765        addIdentifier();
766      }
767      return getIdentifier().get(0);
768    }
769
770    /**
771     * @return {@link #definitionUri} (References the (external) source of pricing information, rules of application for the code this ChargeItem uses.)
772     */
773    public List<UriType> getDefinitionUri() { 
774      if (this.definitionUri == null)
775        this.definitionUri = new ArrayList<UriType>();
776      return this.definitionUri;
777    }
778
779    /**
780     * @return Returns a reference to <code>this</code> for easy method chaining
781     */
782    public ChargeItem setDefinitionUri(List<UriType> theDefinitionUri) { 
783      this.definitionUri = theDefinitionUri;
784      return this;
785    }
786
787    public boolean hasDefinitionUri() { 
788      if (this.definitionUri == null)
789        return false;
790      for (UriType item : this.definitionUri)
791        if (!item.isEmpty())
792          return true;
793      return false;
794    }
795
796    /**
797     * @return {@link #definitionUri} (References the (external) source of pricing information, rules of application for the code this ChargeItem uses.)
798     */
799    public UriType addDefinitionUriElement() {//2 
800      UriType t = new UriType();
801      if (this.definitionUri == null)
802        this.definitionUri = new ArrayList<UriType>();
803      this.definitionUri.add(t);
804      return t;
805    }
806
807    /**
808     * @param value {@link #definitionUri} (References the (external) source of pricing information, rules of application for the code this ChargeItem uses.)
809     */
810    public ChargeItem addDefinitionUri(String value) { //1
811      UriType t = new UriType();
812      t.setValue(value);
813      if (this.definitionUri == null)
814        this.definitionUri = new ArrayList<UriType>();
815      this.definitionUri.add(t);
816      return this;
817    }
818
819    /**
820     * @param value {@link #definitionUri} (References the (external) source of pricing information, rules of application for the code this ChargeItem uses.)
821     */
822    public boolean hasDefinitionUri(String value) { 
823      if (this.definitionUri == null)
824        return false;
825      for (UriType v : this.definitionUri)
826        if (v.getValue().equals(value)) // uri
827          return true;
828      return false;
829    }
830
831    /**
832     * @return {@link #definitionCanonical} (References the source of pricing information, rules of application for the code this ChargeItem uses.)
833     */
834    public List<CanonicalType> getDefinitionCanonical() { 
835      if (this.definitionCanonical == null)
836        this.definitionCanonical = new ArrayList<CanonicalType>();
837      return this.definitionCanonical;
838    }
839
840    /**
841     * @return Returns a reference to <code>this</code> for easy method chaining
842     */
843    public ChargeItem setDefinitionCanonical(List<CanonicalType> theDefinitionCanonical) { 
844      this.definitionCanonical = theDefinitionCanonical;
845      return this;
846    }
847
848    public boolean hasDefinitionCanonical() { 
849      if (this.definitionCanonical == null)
850        return false;
851      for (CanonicalType item : this.definitionCanonical)
852        if (!item.isEmpty())
853          return true;
854      return false;
855    }
856
857    /**
858     * @return {@link #definitionCanonical} (References the source of pricing information, rules of application for the code this ChargeItem uses.)
859     */
860    public CanonicalType addDefinitionCanonicalElement() {//2 
861      CanonicalType t = new CanonicalType();
862      if (this.definitionCanonical == null)
863        this.definitionCanonical = new ArrayList<CanonicalType>();
864      this.definitionCanonical.add(t);
865      return t;
866    }
867
868    /**
869     * @param value {@link #definitionCanonical} (References the source of pricing information, rules of application for the code this ChargeItem uses.)
870     */
871    public ChargeItem addDefinitionCanonical(String value) { //1
872      CanonicalType t = new CanonicalType();
873      t.setValue(value);
874      if (this.definitionCanonical == null)
875        this.definitionCanonical = new ArrayList<CanonicalType>();
876      this.definitionCanonical.add(t);
877      return this;
878    }
879
880    /**
881     * @param value {@link #definitionCanonical} (References the source of pricing information, rules of application for the code this ChargeItem uses.)
882     */
883    public boolean hasDefinitionCanonical(String value) { 
884      if (this.definitionCanonical == null)
885        return false;
886      for (CanonicalType v : this.definitionCanonical)
887        if (v.getValue().equals(value)) // canonical(ChargeItemDefinition)
888          return true;
889      return false;
890    }
891
892    /**
893     * @return {@link #status} (The current state of the ChargeItem.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
894     */
895    public Enumeration<ChargeItemStatus> getStatusElement() { 
896      if (this.status == null)
897        if (Configuration.errorOnAutoCreate())
898          throw new Error("Attempt to auto-create ChargeItem.status");
899        else if (Configuration.doAutoCreate())
900          this.status = new Enumeration<ChargeItemStatus>(new ChargeItemStatusEnumFactory()); // bb
901      return this.status;
902    }
903
904    public boolean hasStatusElement() { 
905      return this.status != null && !this.status.isEmpty();
906    }
907
908    public boolean hasStatus() { 
909      return this.status != null && !this.status.isEmpty();
910    }
911
912    /**
913     * @param value {@link #status} (The current state of the ChargeItem.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
914     */
915    public ChargeItem setStatusElement(Enumeration<ChargeItemStatus> value) { 
916      this.status = value;
917      return this;
918    }
919
920    /**
921     * @return The current state of the ChargeItem.
922     */
923    public ChargeItemStatus getStatus() { 
924      return this.status == null ? null : this.status.getValue();
925    }
926
927    /**
928     * @param value The current state of the ChargeItem.
929     */
930    public ChargeItem setStatus(ChargeItemStatus value) { 
931        if (this.status == null)
932          this.status = new Enumeration<ChargeItemStatus>(new ChargeItemStatusEnumFactory());
933        this.status.setValue(value);
934      return this;
935    }
936
937    /**
938     * @return {@link #partOf} (ChargeItems can be grouped to larger ChargeItems covering the whole set.)
939     */
940    public List<Reference> getPartOf() { 
941      if (this.partOf == null)
942        this.partOf = new ArrayList<Reference>();
943      return this.partOf;
944    }
945
946    /**
947     * @return Returns a reference to <code>this</code> for easy method chaining
948     */
949    public ChargeItem setPartOf(List<Reference> thePartOf) { 
950      this.partOf = thePartOf;
951      return this;
952    }
953
954    public boolean hasPartOf() { 
955      if (this.partOf == null)
956        return false;
957      for (Reference item : this.partOf)
958        if (!item.isEmpty())
959          return true;
960      return false;
961    }
962
963    public Reference addPartOf() { //3
964      Reference t = new Reference();
965      if (this.partOf == null)
966        this.partOf = new ArrayList<Reference>();
967      this.partOf.add(t);
968      return t;
969    }
970
971    public ChargeItem addPartOf(Reference t) { //3
972      if (t == null)
973        return this;
974      if (this.partOf == null)
975        this.partOf = new ArrayList<Reference>();
976      this.partOf.add(t);
977      return this;
978    }
979
980    /**
981     * @return The first repetition of repeating field {@link #partOf}, creating it if it does not already exist
982     */
983    public Reference getPartOfFirstRep() { 
984      if (getPartOf().isEmpty()) {
985        addPartOf();
986      }
987      return getPartOf().get(0);
988    }
989
990    /**
991     * @deprecated Use Reference#setResource(IBaseResource) instead
992     */
993    @Deprecated
994    public List<ChargeItem> getPartOfTarget() { 
995      if (this.partOfTarget == null)
996        this.partOfTarget = new ArrayList<ChargeItem>();
997      return this.partOfTarget;
998    }
999
1000    /**
1001     * @deprecated Use Reference#setResource(IBaseResource) instead
1002     */
1003    @Deprecated
1004    public ChargeItem addPartOfTarget() { 
1005      ChargeItem r = new ChargeItem();
1006      if (this.partOfTarget == null)
1007        this.partOfTarget = new ArrayList<ChargeItem>();
1008      this.partOfTarget.add(r);
1009      return r;
1010    }
1011
1012    /**
1013     * @return {@link #code} (A code that identifies the charge, like a billing code.)
1014     */
1015    public CodeableConcept getCode() { 
1016      if (this.code == null)
1017        if (Configuration.errorOnAutoCreate())
1018          throw new Error("Attempt to auto-create ChargeItem.code");
1019        else if (Configuration.doAutoCreate())
1020          this.code = new CodeableConcept(); // cc
1021      return this.code;
1022    }
1023
1024    public boolean hasCode() { 
1025      return this.code != null && !this.code.isEmpty();
1026    }
1027
1028    /**
1029     * @param value {@link #code} (A code that identifies the charge, like a billing code.)
1030     */
1031    public ChargeItem setCode(CodeableConcept value) { 
1032      this.code = value;
1033      return this;
1034    }
1035
1036    /**
1037     * @return {@link #subject} (The individual or set of individuals the action is being or was performed on.)
1038     */
1039    public Reference getSubject() { 
1040      if (this.subject == null)
1041        if (Configuration.errorOnAutoCreate())
1042          throw new Error("Attempt to auto-create ChargeItem.subject");
1043        else if (Configuration.doAutoCreate())
1044          this.subject = new Reference(); // cc
1045      return this.subject;
1046    }
1047
1048    public boolean hasSubject() { 
1049      return this.subject != null && !this.subject.isEmpty();
1050    }
1051
1052    /**
1053     * @param value {@link #subject} (The individual or set of individuals the action is being or was performed on.)
1054     */
1055    public ChargeItem setSubject(Reference value) { 
1056      this.subject = value;
1057      return this;
1058    }
1059
1060    /**
1061     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual or set of individuals the action is being or was performed on.)
1062     */
1063    public Resource getSubjectTarget() { 
1064      return this.subjectTarget;
1065    }
1066
1067    /**
1068     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual or set of individuals the action is being or was performed on.)
1069     */
1070    public ChargeItem setSubjectTarget(Resource value) { 
1071      this.subjectTarget = value;
1072      return this;
1073    }
1074
1075    /**
1076     * @return {@link #context} (The encounter or episode of care that establishes the context for this event.)
1077     */
1078    public Reference getContext() { 
1079      if (this.context == null)
1080        if (Configuration.errorOnAutoCreate())
1081          throw new Error("Attempt to auto-create ChargeItem.context");
1082        else if (Configuration.doAutoCreate())
1083          this.context = new Reference(); // cc
1084      return this.context;
1085    }
1086
1087    public boolean hasContext() { 
1088      return this.context != null && !this.context.isEmpty();
1089    }
1090
1091    /**
1092     * @param value {@link #context} (The encounter or episode of care that establishes the context for this event.)
1093     */
1094    public ChargeItem setContext(Reference value) { 
1095      this.context = value;
1096      return this;
1097    }
1098
1099    /**
1100     * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter or episode of care that establishes the context for this event.)
1101     */
1102    public Resource getContextTarget() { 
1103      return this.contextTarget;
1104    }
1105
1106    /**
1107     * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter or episode of care that establishes the context for this event.)
1108     */
1109    public ChargeItem setContextTarget(Resource value) { 
1110      this.contextTarget = value;
1111      return this;
1112    }
1113
1114    /**
1115     * @return {@link #occurrence} (Date/time(s) or duration when the charged service was applied.)
1116     */
1117    public Type getOccurrence() { 
1118      return this.occurrence;
1119    }
1120
1121    /**
1122     * @return {@link #occurrence} (Date/time(s) or duration when the charged service was applied.)
1123     */
1124    public DateTimeType getOccurrenceDateTimeType() throws FHIRException { 
1125      if (this.occurrence == null)
1126        this.occurrence = new DateTimeType();
1127      if (!(this.occurrence instanceof DateTimeType))
1128        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1129      return (DateTimeType) this.occurrence;
1130    }
1131
1132    public boolean hasOccurrenceDateTimeType() { 
1133      return this != null && this.occurrence instanceof DateTimeType;
1134    }
1135
1136    /**
1137     * @return {@link #occurrence} (Date/time(s) or duration when the charged service was applied.)
1138     */
1139    public Period getOccurrencePeriod() throws FHIRException { 
1140      if (this.occurrence == null)
1141        this.occurrence = new Period();
1142      if (!(this.occurrence instanceof Period))
1143        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1144      return (Period) this.occurrence;
1145    }
1146
1147    public boolean hasOccurrencePeriod() { 
1148      return this != null && this.occurrence instanceof Period;
1149    }
1150
1151    /**
1152     * @return {@link #occurrence} (Date/time(s) or duration when the charged service was applied.)
1153     */
1154    public Timing getOccurrenceTiming() throws FHIRException { 
1155      if (this.occurrence == null)
1156        this.occurrence = new Timing();
1157      if (!(this.occurrence instanceof Timing))
1158        throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.occurrence.getClass().getName()+" was encountered");
1159      return (Timing) this.occurrence;
1160    }
1161
1162    public boolean hasOccurrenceTiming() { 
1163      return this != null && this.occurrence instanceof Timing;
1164    }
1165
1166    public boolean hasOccurrence() { 
1167      return this.occurrence != null && !this.occurrence.isEmpty();
1168    }
1169
1170    /**
1171     * @param value {@link #occurrence} (Date/time(s) or duration when the charged service was applied.)
1172     */
1173    public ChargeItem setOccurrence(Type value) { 
1174      if (value != null && !(value instanceof DateTimeType || value instanceof Period || value instanceof Timing))
1175        throw new Error("Not the right type for ChargeItem.occurrence[x]: "+value.fhirType());
1176      this.occurrence = value;
1177      return this;
1178    }
1179
1180    /**
1181     * @return {@link #performer} (Indicates who or what performed or participated in the charged service.)
1182     */
1183    public List<ChargeItemPerformerComponent> getPerformer() { 
1184      if (this.performer == null)
1185        this.performer = new ArrayList<ChargeItemPerformerComponent>();
1186      return this.performer;
1187    }
1188
1189    /**
1190     * @return Returns a reference to <code>this</code> for easy method chaining
1191     */
1192    public ChargeItem setPerformer(List<ChargeItemPerformerComponent> thePerformer) { 
1193      this.performer = thePerformer;
1194      return this;
1195    }
1196
1197    public boolean hasPerformer() { 
1198      if (this.performer == null)
1199        return false;
1200      for (ChargeItemPerformerComponent item : this.performer)
1201        if (!item.isEmpty())
1202          return true;
1203      return false;
1204    }
1205
1206    public ChargeItemPerformerComponent addPerformer() { //3
1207      ChargeItemPerformerComponent t = new ChargeItemPerformerComponent();
1208      if (this.performer == null)
1209        this.performer = new ArrayList<ChargeItemPerformerComponent>();
1210      this.performer.add(t);
1211      return t;
1212    }
1213
1214    public ChargeItem addPerformer(ChargeItemPerformerComponent t) { //3
1215      if (t == null)
1216        return this;
1217      if (this.performer == null)
1218        this.performer = new ArrayList<ChargeItemPerformerComponent>();
1219      this.performer.add(t);
1220      return this;
1221    }
1222
1223    /**
1224     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
1225     */
1226    public ChargeItemPerformerComponent getPerformerFirstRep() { 
1227      if (getPerformer().isEmpty()) {
1228        addPerformer();
1229      }
1230      return getPerformer().get(0);
1231    }
1232
1233    /**
1234     * @return {@link #performingOrganization} (The organization requesting the service.)
1235     */
1236    public Reference getPerformingOrganization() { 
1237      if (this.performingOrganization == null)
1238        if (Configuration.errorOnAutoCreate())
1239          throw new Error("Attempt to auto-create ChargeItem.performingOrganization");
1240        else if (Configuration.doAutoCreate())
1241          this.performingOrganization = new Reference(); // cc
1242      return this.performingOrganization;
1243    }
1244
1245    public boolean hasPerformingOrganization() { 
1246      return this.performingOrganization != null && !this.performingOrganization.isEmpty();
1247    }
1248
1249    /**
1250     * @param value {@link #performingOrganization} (The organization requesting the service.)
1251     */
1252    public ChargeItem setPerformingOrganization(Reference value) { 
1253      this.performingOrganization = value;
1254      return this;
1255    }
1256
1257    /**
1258     * @return {@link #performingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization requesting the service.)
1259     */
1260    public Organization getPerformingOrganizationTarget() { 
1261      if (this.performingOrganizationTarget == null)
1262        if (Configuration.errorOnAutoCreate())
1263          throw new Error("Attempt to auto-create ChargeItem.performingOrganization");
1264        else if (Configuration.doAutoCreate())
1265          this.performingOrganizationTarget = new Organization(); // aa
1266      return this.performingOrganizationTarget;
1267    }
1268
1269    /**
1270     * @param value {@link #performingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization requesting the service.)
1271     */
1272    public ChargeItem setPerformingOrganizationTarget(Organization value) { 
1273      this.performingOrganizationTarget = value;
1274      return this;
1275    }
1276
1277    /**
1278     * @return {@link #requestingOrganization} (The organization performing the service.)
1279     */
1280    public Reference getRequestingOrganization() { 
1281      if (this.requestingOrganization == null)
1282        if (Configuration.errorOnAutoCreate())
1283          throw new Error("Attempt to auto-create ChargeItem.requestingOrganization");
1284        else if (Configuration.doAutoCreate())
1285          this.requestingOrganization = new Reference(); // cc
1286      return this.requestingOrganization;
1287    }
1288
1289    public boolean hasRequestingOrganization() { 
1290      return this.requestingOrganization != null && !this.requestingOrganization.isEmpty();
1291    }
1292
1293    /**
1294     * @param value {@link #requestingOrganization} (The organization performing the service.)
1295     */
1296    public ChargeItem setRequestingOrganization(Reference value) { 
1297      this.requestingOrganization = value;
1298      return this;
1299    }
1300
1301    /**
1302     * @return {@link #requestingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization performing the service.)
1303     */
1304    public Organization getRequestingOrganizationTarget() { 
1305      if (this.requestingOrganizationTarget == null)
1306        if (Configuration.errorOnAutoCreate())
1307          throw new Error("Attempt to auto-create ChargeItem.requestingOrganization");
1308        else if (Configuration.doAutoCreate())
1309          this.requestingOrganizationTarget = new Organization(); // aa
1310      return this.requestingOrganizationTarget;
1311    }
1312
1313    /**
1314     * @param value {@link #requestingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization performing the service.)
1315     */
1316    public ChargeItem setRequestingOrganizationTarget(Organization value) { 
1317      this.requestingOrganizationTarget = value;
1318      return this;
1319    }
1320
1321    /**
1322     * @return {@link #costCenter} (The financial cost center permits the tracking of charge attribution.)
1323     */
1324    public Reference getCostCenter() { 
1325      if (this.costCenter == null)
1326        if (Configuration.errorOnAutoCreate())
1327          throw new Error("Attempt to auto-create ChargeItem.costCenter");
1328        else if (Configuration.doAutoCreate())
1329          this.costCenter = new Reference(); // cc
1330      return this.costCenter;
1331    }
1332
1333    public boolean hasCostCenter() { 
1334      return this.costCenter != null && !this.costCenter.isEmpty();
1335    }
1336
1337    /**
1338     * @param value {@link #costCenter} (The financial cost center permits the tracking of charge attribution.)
1339     */
1340    public ChargeItem setCostCenter(Reference value) { 
1341      this.costCenter = value;
1342      return this;
1343    }
1344
1345    /**
1346     * @return {@link #costCenter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The financial cost center permits the tracking of charge attribution.)
1347     */
1348    public Organization getCostCenterTarget() { 
1349      if (this.costCenterTarget == null)
1350        if (Configuration.errorOnAutoCreate())
1351          throw new Error("Attempt to auto-create ChargeItem.costCenter");
1352        else if (Configuration.doAutoCreate())
1353          this.costCenterTarget = new Organization(); // aa
1354      return this.costCenterTarget;
1355    }
1356
1357    /**
1358     * @param value {@link #costCenter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The financial cost center permits the tracking of charge attribution.)
1359     */
1360    public ChargeItem setCostCenterTarget(Organization value) { 
1361      this.costCenterTarget = value;
1362      return this;
1363    }
1364
1365    /**
1366     * @return {@link #quantity} (Quantity of which the charge item has been serviced.)
1367     */
1368    public Quantity getQuantity() { 
1369      if (this.quantity == null)
1370        if (Configuration.errorOnAutoCreate())
1371          throw new Error("Attempt to auto-create ChargeItem.quantity");
1372        else if (Configuration.doAutoCreate())
1373          this.quantity = new Quantity(); // cc
1374      return this.quantity;
1375    }
1376
1377    public boolean hasQuantity() { 
1378      return this.quantity != null && !this.quantity.isEmpty();
1379    }
1380
1381    /**
1382     * @param value {@link #quantity} (Quantity of which the charge item has been serviced.)
1383     */
1384    public ChargeItem setQuantity(Quantity value) { 
1385      this.quantity = value;
1386      return this;
1387    }
1388
1389    /**
1390     * @return {@link #bodysite} (The anatomical location where the related service has been applied.)
1391     */
1392    public List<CodeableConcept> getBodysite() { 
1393      if (this.bodysite == null)
1394        this.bodysite = new ArrayList<CodeableConcept>();
1395      return this.bodysite;
1396    }
1397
1398    /**
1399     * @return Returns a reference to <code>this</code> for easy method chaining
1400     */
1401    public ChargeItem setBodysite(List<CodeableConcept> theBodysite) { 
1402      this.bodysite = theBodysite;
1403      return this;
1404    }
1405
1406    public boolean hasBodysite() { 
1407      if (this.bodysite == null)
1408        return false;
1409      for (CodeableConcept item : this.bodysite)
1410        if (!item.isEmpty())
1411          return true;
1412      return false;
1413    }
1414
1415    public CodeableConcept addBodysite() { //3
1416      CodeableConcept t = new CodeableConcept();
1417      if (this.bodysite == null)
1418        this.bodysite = new ArrayList<CodeableConcept>();
1419      this.bodysite.add(t);
1420      return t;
1421    }
1422
1423    public ChargeItem addBodysite(CodeableConcept t) { //3
1424      if (t == null)
1425        return this;
1426      if (this.bodysite == null)
1427        this.bodysite = new ArrayList<CodeableConcept>();
1428      this.bodysite.add(t);
1429      return this;
1430    }
1431
1432    /**
1433     * @return The first repetition of repeating field {@link #bodysite}, creating it if it does not already exist
1434     */
1435    public CodeableConcept getBodysiteFirstRep() { 
1436      if (getBodysite().isEmpty()) {
1437        addBodysite();
1438      }
1439      return getBodysite().get(0);
1440    }
1441
1442    /**
1443     * @return {@link #factorOverride} (Factor overriding the factor determined by the rules associated with the code.). This is the underlying object with id, value and extensions. The accessor "getFactorOverride" gives direct access to the value
1444     */
1445    public DecimalType getFactorOverrideElement() { 
1446      if (this.factorOverride == null)
1447        if (Configuration.errorOnAutoCreate())
1448          throw new Error("Attempt to auto-create ChargeItem.factorOverride");
1449        else if (Configuration.doAutoCreate())
1450          this.factorOverride = new DecimalType(); // bb
1451      return this.factorOverride;
1452    }
1453
1454    public boolean hasFactorOverrideElement() { 
1455      return this.factorOverride != null && !this.factorOverride.isEmpty();
1456    }
1457
1458    public boolean hasFactorOverride() { 
1459      return this.factorOverride != null && !this.factorOverride.isEmpty();
1460    }
1461
1462    /**
1463     * @param value {@link #factorOverride} (Factor overriding the factor determined by the rules associated with the code.). This is the underlying object with id, value and extensions. The accessor "getFactorOverride" gives direct access to the value
1464     */
1465    public ChargeItem setFactorOverrideElement(DecimalType value) { 
1466      this.factorOverride = value;
1467      return this;
1468    }
1469
1470    /**
1471     * @return Factor overriding the factor determined by the rules associated with the code.
1472     */
1473    public BigDecimal getFactorOverride() { 
1474      return this.factorOverride == null ? null : this.factorOverride.getValue();
1475    }
1476
1477    /**
1478     * @param value Factor overriding the factor determined by the rules associated with the code.
1479     */
1480    public ChargeItem setFactorOverride(BigDecimal value) { 
1481      if (value == null)
1482        this.factorOverride = null;
1483      else {
1484        if (this.factorOverride == null)
1485          this.factorOverride = new DecimalType();
1486        this.factorOverride.setValue(value);
1487      }
1488      return this;
1489    }
1490
1491    /**
1492     * @param value Factor overriding the factor determined by the rules associated with the code.
1493     */
1494    public ChargeItem setFactorOverride(long value) { 
1495          this.factorOverride = new DecimalType();
1496        this.factorOverride.setValue(value);
1497      return this;
1498    }
1499
1500    /**
1501     * @param value Factor overriding the factor determined by the rules associated with the code.
1502     */
1503    public ChargeItem setFactorOverride(double value) { 
1504          this.factorOverride = new DecimalType();
1505        this.factorOverride.setValue(value);
1506      return this;
1507    }
1508
1509    /**
1510     * @return {@link #priceOverride} (Total price of the charge overriding the list price associated with the code.)
1511     */
1512    public Money getPriceOverride() { 
1513      if (this.priceOverride == null)
1514        if (Configuration.errorOnAutoCreate())
1515          throw new Error("Attempt to auto-create ChargeItem.priceOverride");
1516        else if (Configuration.doAutoCreate())
1517          this.priceOverride = new Money(); // cc
1518      return this.priceOverride;
1519    }
1520
1521    public boolean hasPriceOverride() { 
1522      return this.priceOverride != null && !this.priceOverride.isEmpty();
1523    }
1524
1525    /**
1526     * @param value {@link #priceOverride} (Total price of the charge overriding the list price associated with the code.)
1527     */
1528    public ChargeItem setPriceOverride(Money value) { 
1529      this.priceOverride = value;
1530      return this;
1531    }
1532
1533    /**
1534     * @return {@link #overrideReason} (If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.). This is the underlying object with id, value and extensions. The accessor "getOverrideReason" gives direct access to the value
1535     */
1536    public StringType getOverrideReasonElement() { 
1537      if (this.overrideReason == null)
1538        if (Configuration.errorOnAutoCreate())
1539          throw new Error("Attempt to auto-create ChargeItem.overrideReason");
1540        else if (Configuration.doAutoCreate())
1541          this.overrideReason = new StringType(); // bb
1542      return this.overrideReason;
1543    }
1544
1545    public boolean hasOverrideReasonElement() { 
1546      return this.overrideReason != null && !this.overrideReason.isEmpty();
1547    }
1548
1549    public boolean hasOverrideReason() { 
1550      return this.overrideReason != null && !this.overrideReason.isEmpty();
1551    }
1552
1553    /**
1554     * @param value {@link #overrideReason} (If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.). This is the underlying object with id, value and extensions. The accessor "getOverrideReason" gives direct access to the value
1555     */
1556    public ChargeItem setOverrideReasonElement(StringType value) { 
1557      this.overrideReason = value;
1558      return this;
1559    }
1560
1561    /**
1562     * @return If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.
1563     */
1564    public String getOverrideReason() { 
1565      return this.overrideReason == null ? null : this.overrideReason.getValue();
1566    }
1567
1568    /**
1569     * @param value If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.
1570     */
1571    public ChargeItem setOverrideReason(String value) { 
1572      if (Utilities.noString(value))
1573        this.overrideReason = null;
1574      else {
1575        if (this.overrideReason == null)
1576          this.overrideReason = new StringType();
1577        this.overrideReason.setValue(value);
1578      }
1579      return this;
1580    }
1581
1582    /**
1583     * @return {@link #enterer} (The device, practitioner, etc. who entered the charge item.)
1584     */
1585    public Reference getEnterer() { 
1586      if (this.enterer == null)
1587        if (Configuration.errorOnAutoCreate())
1588          throw new Error("Attempt to auto-create ChargeItem.enterer");
1589        else if (Configuration.doAutoCreate())
1590          this.enterer = new Reference(); // cc
1591      return this.enterer;
1592    }
1593
1594    public boolean hasEnterer() { 
1595      return this.enterer != null && !this.enterer.isEmpty();
1596    }
1597
1598    /**
1599     * @param value {@link #enterer} (The device, practitioner, etc. who entered the charge item.)
1600     */
1601    public ChargeItem setEnterer(Reference value) { 
1602      this.enterer = value;
1603      return this;
1604    }
1605
1606    /**
1607     * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device, practitioner, etc. who entered the charge item.)
1608     */
1609    public Resource getEntererTarget() { 
1610      return this.entererTarget;
1611    }
1612
1613    /**
1614     * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device, practitioner, etc. who entered the charge item.)
1615     */
1616    public ChargeItem setEntererTarget(Resource value) { 
1617      this.entererTarget = value;
1618      return this;
1619    }
1620
1621    /**
1622     * @return {@link #enteredDate} (Date the charge item was entered.). This is the underlying object with id, value and extensions. The accessor "getEnteredDate" gives direct access to the value
1623     */
1624    public DateTimeType getEnteredDateElement() { 
1625      if (this.enteredDate == null)
1626        if (Configuration.errorOnAutoCreate())
1627          throw new Error("Attempt to auto-create ChargeItem.enteredDate");
1628        else if (Configuration.doAutoCreate())
1629          this.enteredDate = new DateTimeType(); // bb
1630      return this.enteredDate;
1631    }
1632
1633    public boolean hasEnteredDateElement() { 
1634      return this.enteredDate != null && !this.enteredDate.isEmpty();
1635    }
1636
1637    public boolean hasEnteredDate() { 
1638      return this.enteredDate != null && !this.enteredDate.isEmpty();
1639    }
1640
1641    /**
1642     * @param value {@link #enteredDate} (Date the charge item was entered.). This is the underlying object with id, value and extensions. The accessor "getEnteredDate" gives direct access to the value
1643     */
1644    public ChargeItem setEnteredDateElement(DateTimeType value) { 
1645      this.enteredDate = value;
1646      return this;
1647    }
1648
1649    /**
1650     * @return Date the charge item was entered.
1651     */
1652    public Date getEnteredDate() { 
1653      return this.enteredDate == null ? null : this.enteredDate.getValue();
1654    }
1655
1656    /**
1657     * @param value Date the charge item was entered.
1658     */
1659    public ChargeItem setEnteredDate(Date value) { 
1660      if (value == null)
1661        this.enteredDate = null;
1662      else {
1663        if (this.enteredDate == null)
1664          this.enteredDate = new DateTimeType();
1665        this.enteredDate.setValue(value);
1666      }
1667      return this;
1668    }
1669
1670    /**
1671     * @return {@link #reason} (Describes why the event occurred in coded or textual form.)
1672     */
1673    public List<CodeableConcept> getReason() { 
1674      if (this.reason == null)
1675        this.reason = new ArrayList<CodeableConcept>();
1676      return this.reason;
1677    }
1678
1679    /**
1680     * @return Returns a reference to <code>this</code> for easy method chaining
1681     */
1682    public ChargeItem setReason(List<CodeableConcept> theReason) { 
1683      this.reason = theReason;
1684      return this;
1685    }
1686
1687    public boolean hasReason() { 
1688      if (this.reason == null)
1689        return false;
1690      for (CodeableConcept item : this.reason)
1691        if (!item.isEmpty())
1692          return true;
1693      return false;
1694    }
1695
1696    public CodeableConcept addReason() { //3
1697      CodeableConcept t = new CodeableConcept();
1698      if (this.reason == null)
1699        this.reason = new ArrayList<CodeableConcept>();
1700      this.reason.add(t);
1701      return t;
1702    }
1703
1704    public ChargeItem addReason(CodeableConcept t) { //3
1705      if (t == null)
1706        return this;
1707      if (this.reason == null)
1708        this.reason = new ArrayList<CodeableConcept>();
1709      this.reason.add(t);
1710      return this;
1711    }
1712
1713    /**
1714     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist
1715     */
1716    public CodeableConcept getReasonFirstRep() { 
1717      if (getReason().isEmpty()) {
1718        addReason();
1719      }
1720      return getReason().get(0);
1721    }
1722
1723    /**
1724     * @return {@link #service} (Indicated the rendered service that caused this charge.)
1725     */
1726    public List<Reference> getService() { 
1727      if (this.service == null)
1728        this.service = new ArrayList<Reference>();
1729      return this.service;
1730    }
1731
1732    /**
1733     * @return Returns a reference to <code>this</code> for easy method chaining
1734     */
1735    public ChargeItem setService(List<Reference> theService) { 
1736      this.service = theService;
1737      return this;
1738    }
1739
1740    public boolean hasService() { 
1741      if (this.service == null)
1742        return false;
1743      for (Reference item : this.service)
1744        if (!item.isEmpty())
1745          return true;
1746      return false;
1747    }
1748
1749    public Reference addService() { //3
1750      Reference t = new Reference();
1751      if (this.service == null)
1752        this.service = new ArrayList<Reference>();
1753      this.service.add(t);
1754      return t;
1755    }
1756
1757    public ChargeItem addService(Reference t) { //3
1758      if (t == null)
1759        return this;
1760      if (this.service == null)
1761        this.service = new ArrayList<Reference>();
1762      this.service.add(t);
1763      return this;
1764    }
1765
1766    /**
1767     * @return The first repetition of repeating field {@link #service}, creating it if it does not already exist
1768     */
1769    public Reference getServiceFirstRep() { 
1770      if (getService().isEmpty()) {
1771        addService();
1772      }
1773      return getService().get(0);
1774    }
1775
1776    /**
1777     * @deprecated Use Reference#setResource(IBaseResource) instead
1778     */
1779    @Deprecated
1780    public List<Resource> getServiceTarget() { 
1781      if (this.serviceTarget == null)
1782        this.serviceTarget = new ArrayList<Resource>();
1783      return this.serviceTarget;
1784    }
1785
1786    /**
1787     * @return {@link #product} (Identifies the device, food, drug or other product being charged either by type code or reference to an instance.)
1788     */
1789    public Type getProduct() { 
1790      return this.product;
1791    }
1792
1793    /**
1794     * @return {@link #product} (Identifies the device, food, drug or other product being charged either by type code or reference to an instance.)
1795     */
1796    public Reference getProductReference() throws FHIRException { 
1797      if (this.product == null)
1798        this.product = new Reference();
1799      if (!(this.product instanceof Reference))
1800        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.product.getClass().getName()+" was encountered");
1801      return (Reference) this.product;
1802    }
1803
1804    public boolean hasProductReference() { 
1805      return this != null && this.product instanceof Reference;
1806    }
1807
1808    /**
1809     * @return {@link #product} (Identifies the device, food, drug or other product being charged either by type code or reference to an instance.)
1810     */
1811    public CodeableConcept getProductCodeableConcept() throws FHIRException { 
1812      if (this.product == null)
1813        this.product = new CodeableConcept();
1814      if (!(this.product instanceof CodeableConcept))
1815        throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.product.getClass().getName()+" was encountered");
1816      return (CodeableConcept) this.product;
1817    }
1818
1819    public boolean hasProductCodeableConcept() { 
1820      return this != null && this.product instanceof CodeableConcept;
1821    }
1822
1823    public boolean hasProduct() { 
1824      return this.product != null && !this.product.isEmpty();
1825    }
1826
1827    /**
1828     * @param value {@link #product} (Identifies the device, food, drug or other product being charged either by type code or reference to an instance.)
1829     */
1830    public ChargeItem setProduct(Type value) { 
1831      if (value != null && !(value instanceof Reference || value instanceof CodeableConcept))
1832        throw new Error("Not the right type for ChargeItem.product[x]: "+value.fhirType());
1833      this.product = value;
1834      return this;
1835    }
1836
1837    /**
1838     * @return {@link #account} (Account into which this ChargeItems belongs.)
1839     */
1840    public List<Reference> getAccount() { 
1841      if (this.account == null)
1842        this.account = new ArrayList<Reference>();
1843      return this.account;
1844    }
1845
1846    /**
1847     * @return Returns a reference to <code>this</code> for easy method chaining
1848     */
1849    public ChargeItem setAccount(List<Reference> theAccount) { 
1850      this.account = theAccount;
1851      return this;
1852    }
1853
1854    public boolean hasAccount() { 
1855      if (this.account == null)
1856        return false;
1857      for (Reference item : this.account)
1858        if (!item.isEmpty())
1859          return true;
1860      return false;
1861    }
1862
1863    public Reference addAccount() { //3
1864      Reference t = new Reference();
1865      if (this.account == null)
1866        this.account = new ArrayList<Reference>();
1867      this.account.add(t);
1868      return t;
1869    }
1870
1871    public ChargeItem addAccount(Reference t) { //3
1872      if (t == null)
1873        return this;
1874      if (this.account == null)
1875        this.account = new ArrayList<Reference>();
1876      this.account.add(t);
1877      return this;
1878    }
1879
1880    /**
1881     * @return The first repetition of repeating field {@link #account}, creating it if it does not already exist
1882     */
1883    public Reference getAccountFirstRep() { 
1884      if (getAccount().isEmpty()) {
1885        addAccount();
1886      }
1887      return getAccount().get(0);
1888    }
1889
1890    /**
1891     * @deprecated Use Reference#setResource(IBaseResource) instead
1892     */
1893    @Deprecated
1894    public List<Account> getAccountTarget() { 
1895      if (this.accountTarget == null)
1896        this.accountTarget = new ArrayList<Account>();
1897      return this.accountTarget;
1898    }
1899
1900    /**
1901     * @deprecated Use Reference#setResource(IBaseResource) instead
1902     */
1903    @Deprecated
1904    public Account addAccountTarget() { 
1905      Account r = new Account();
1906      if (this.accountTarget == null)
1907        this.accountTarget = new ArrayList<Account>();
1908      this.accountTarget.add(r);
1909      return r;
1910    }
1911
1912    /**
1913     * @return {@link #note} (Comments made about the event by the performer, subject or other participants.)
1914     */
1915    public List<Annotation> getNote() { 
1916      if (this.note == null)
1917        this.note = new ArrayList<Annotation>();
1918      return this.note;
1919    }
1920
1921    /**
1922     * @return Returns a reference to <code>this</code> for easy method chaining
1923     */
1924    public ChargeItem setNote(List<Annotation> theNote) { 
1925      this.note = theNote;
1926      return this;
1927    }
1928
1929    public boolean hasNote() { 
1930      if (this.note == null)
1931        return false;
1932      for (Annotation item : this.note)
1933        if (!item.isEmpty())
1934          return true;
1935      return false;
1936    }
1937
1938    public Annotation addNote() { //3
1939      Annotation t = new Annotation();
1940      if (this.note == null)
1941        this.note = new ArrayList<Annotation>();
1942      this.note.add(t);
1943      return t;
1944    }
1945
1946    public ChargeItem addNote(Annotation t) { //3
1947      if (t == null)
1948        return this;
1949      if (this.note == null)
1950        this.note = new ArrayList<Annotation>();
1951      this.note.add(t);
1952      return this;
1953    }
1954
1955    /**
1956     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1957     */
1958    public Annotation getNoteFirstRep() { 
1959      if (getNote().isEmpty()) {
1960        addNote();
1961      }
1962      return getNote().get(0);
1963    }
1964
1965    /**
1966     * @return {@link #supportingInformation} (Further information supporting this charge.)
1967     */
1968    public List<Reference> getSupportingInformation() { 
1969      if (this.supportingInformation == null)
1970        this.supportingInformation = new ArrayList<Reference>();
1971      return this.supportingInformation;
1972    }
1973
1974    /**
1975     * @return Returns a reference to <code>this</code> for easy method chaining
1976     */
1977    public ChargeItem setSupportingInformation(List<Reference> theSupportingInformation) { 
1978      this.supportingInformation = theSupportingInformation;
1979      return this;
1980    }
1981
1982    public boolean hasSupportingInformation() { 
1983      if (this.supportingInformation == null)
1984        return false;
1985      for (Reference item : this.supportingInformation)
1986        if (!item.isEmpty())
1987          return true;
1988      return false;
1989    }
1990
1991    public Reference addSupportingInformation() { //3
1992      Reference t = new Reference();
1993      if (this.supportingInformation == null)
1994        this.supportingInformation = new ArrayList<Reference>();
1995      this.supportingInformation.add(t);
1996      return t;
1997    }
1998
1999    public ChargeItem addSupportingInformation(Reference t) { //3
2000      if (t == null)
2001        return this;
2002      if (this.supportingInformation == null)
2003        this.supportingInformation = new ArrayList<Reference>();
2004      this.supportingInformation.add(t);
2005      return this;
2006    }
2007
2008    /**
2009     * @return The first repetition of repeating field {@link #supportingInformation}, creating it if it does not already exist
2010     */
2011    public Reference getSupportingInformationFirstRep() { 
2012      if (getSupportingInformation().isEmpty()) {
2013        addSupportingInformation();
2014      }
2015      return getSupportingInformation().get(0);
2016    }
2017
2018    /**
2019     * @deprecated Use Reference#setResource(IBaseResource) instead
2020     */
2021    @Deprecated
2022    public List<Resource> getSupportingInformationTarget() { 
2023      if (this.supportingInformationTarget == null)
2024        this.supportingInformationTarget = new ArrayList<Resource>();
2025      return this.supportingInformationTarget;
2026    }
2027
2028      protected void listChildren(List<Property> children) {
2029        super.listChildren(children);
2030        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this event performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
2031        children.add(new Property("definitionUri", "uri", "References the (external) source of pricing information, rules of application for the code this ChargeItem uses.", 0, java.lang.Integer.MAX_VALUE, definitionUri));
2032        children.add(new Property("definitionCanonical", "canonical(ChargeItemDefinition)", "References the source of pricing information, rules of application for the code this ChargeItem uses.", 0, java.lang.Integer.MAX_VALUE, definitionCanonical));
2033        children.add(new Property("status", "code", "The current state of the ChargeItem.", 0, 1, status));
2034        children.add(new Property("partOf", "Reference(ChargeItem)", "ChargeItems can be grouped to larger ChargeItems covering the whole set.", 0, java.lang.Integer.MAX_VALUE, partOf));
2035        children.add(new Property("code", "CodeableConcept", "A code that identifies the charge, like a billing code.", 0, 1, code));
2036        children.add(new Property("subject", "Reference(Patient|Group)", "The individual or set of individuals the action is being or was performed on.", 0, 1, subject));
2037        children.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter or episode of care that establishes the context for this event.", 0, 1, context));
2038        children.add(new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence));
2039        children.add(new Property("performer", "", "Indicates who or what performed or participated in the charged service.", 0, java.lang.Integer.MAX_VALUE, performer));
2040        children.add(new Property("performingOrganization", "Reference(Organization)", "The organization requesting the service.", 0, 1, performingOrganization));
2041        children.add(new Property("requestingOrganization", "Reference(Organization)", "The organization performing the service.", 0, 1, requestingOrganization));
2042        children.add(new Property("costCenter", "Reference(Organization)", "The financial cost center permits the tracking of charge attribution.", 0, 1, costCenter));
2043        children.add(new Property("quantity", "Quantity", "Quantity of which the charge item has been serviced.", 0, 1, quantity));
2044        children.add(new Property("bodysite", "CodeableConcept", "The anatomical location where the related service has been applied.", 0, java.lang.Integer.MAX_VALUE, bodysite));
2045        children.add(new Property("factorOverride", "decimal", "Factor overriding the factor determined by the rules associated with the code.", 0, 1, factorOverride));
2046        children.add(new Property("priceOverride", "Money", "Total price of the charge overriding the list price associated with the code.", 0, 1, priceOverride));
2047        children.add(new Property("overrideReason", "string", "If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.", 0, 1, overrideReason));
2048        children.add(new Property("enterer", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson)", "The device, practitioner, etc. who entered the charge item.", 0, 1, enterer));
2049        children.add(new Property("enteredDate", "dateTime", "Date the charge item was entered.", 0, 1, enteredDate));
2050        children.add(new Property("reason", "CodeableConcept", "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reason));
2051        children.add(new Property("service", "Reference(DiagnosticReport|ImagingStudy|Immunization|MedicationAdministration|MedicationDispense|Observation|Procedure|SupplyDelivery)", "Indicated the rendered service that caused this charge.", 0, java.lang.Integer.MAX_VALUE, service));
2052        children.add(new Property("product[x]", "Reference(Device|Medication|Substance)|CodeableConcept", "Identifies the device, food, drug or other product being charged either by type code or reference to an instance.", 0, 1, product));
2053        children.add(new Property("account", "Reference(Account)", "Account into which this ChargeItems belongs.", 0, java.lang.Integer.MAX_VALUE, account));
2054        children.add(new Property("note", "Annotation", "Comments made about the event by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note));
2055        children.add(new Property("supportingInformation", "Reference(Any)", "Further information supporting this charge.", 0, java.lang.Integer.MAX_VALUE, supportingInformation));
2056      }
2057
2058      @Override
2059      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2060        switch (_hash) {
2061        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this event performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
2062        case -1139428583: /*definitionUri*/  return new Property("definitionUri", "uri", "References the (external) source of pricing information, rules of application for the code this ChargeItem uses.", 0, java.lang.Integer.MAX_VALUE, definitionUri);
2063        case 933485793: /*definitionCanonical*/  return new Property("definitionCanonical", "canonical(ChargeItemDefinition)", "References the source of pricing information, rules of application for the code this ChargeItem uses.", 0, java.lang.Integer.MAX_VALUE, definitionCanonical);
2064        case -892481550: /*status*/  return new Property("status", "code", "The current state of the ChargeItem.", 0, 1, status);
2065        case -995410646: /*partOf*/  return new Property("partOf", "Reference(ChargeItem)", "ChargeItems can be grouped to larger ChargeItems covering the whole set.", 0, java.lang.Integer.MAX_VALUE, partOf);
2066        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code that identifies the charge, like a billing code.", 0, 1, code);
2067        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The individual or set of individuals the action is being or was performed on.", 0, 1, subject);
2068        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter or episode of care that establishes the context for this event.", 0, 1, context);
2069        case -2022646513: /*occurrence[x]*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence);
2070        case 1687874001: /*occurrence*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence);
2071        case -298443636: /*occurrenceDateTime*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence);
2072        case 1397156594: /*occurrencePeriod*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence);
2073        case 1515218299: /*occurrenceTiming*/  return new Property("occurrence[x]", "dateTime|Period|Timing", "Date/time(s) or duration when the charged service was applied.", 0, 1, occurrence);
2074        case 481140686: /*performer*/  return new Property("performer", "", "Indicates who or what performed or participated in the charged service.", 0, java.lang.Integer.MAX_VALUE, performer);
2075        case 1273192628: /*performingOrganization*/  return new Property("performingOrganization", "Reference(Organization)", "The organization requesting the service.", 0, 1, performingOrganization);
2076        case 1279054790: /*requestingOrganization*/  return new Property("requestingOrganization", "Reference(Organization)", "The organization performing the service.", 0, 1, requestingOrganization);
2077        case -593192318: /*costCenter*/  return new Property("costCenter", "Reference(Organization)", "The financial cost center permits the tracking of charge attribution.", 0, 1, costCenter);
2078        case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "Quantity of which the charge item has been serviced.", 0, 1, quantity);
2079        case 1703573481: /*bodysite*/  return new Property("bodysite", "CodeableConcept", "The anatomical location where the related service has been applied.", 0, java.lang.Integer.MAX_VALUE, bodysite);
2080        case -451233221: /*factorOverride*/  return new Property("factorOverride", "decimal", "Factor overriding the factor determined by the rules associated with the code.", 0, 1, factorOverride);
2081        case -216803275: /*priceOverride*/  return new Property("priceOverride", "Money", "Total price of the charge overriding the list price associated with the code.", 0, 1, priceOverride);
2082        case -742878928: /*overrideReason*/  return new Property("overrideReason", "string", "If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.", 0, 1, overrideReason);
2083        case -1591951995: /*enterer*/  return new Property("enterer", "Reference(Practitioner|PractitionerRole|Organization|Patient|Device|RelatedPerson)", "The device, practitioner, etc. who entered the charge item.", 0, 1, enterer);
2084        case 555978181: /*enteredDate*/  return new Property("enteredDate", "dateTime", "Date the charge item was entered.", 0, 1, enteredDate);
2085        case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "Describes why the event occurred in coded or textual form.", 0, java.lang.Integer.MAX_VALUE, reason);
2086        case 1984153269: /*service*/  return new Property("service", "Reference(DiagnosticReport|ImagingStudy|Immunization|MedicationAdministration|MedicationDispense|Observation|Procedure|SupplyDelivery)", "Indicated the rendered service that caused this charge.", 0, java.lang.Integer.MAX_VALUE, service);
2087        case 1753005361: /*product[x]*/  return new Property("product[x]", "Reference(Device|Medication|Substance)|CodeableConcept", "Identifies the device, food, drug or other product being charged either by type code or reference to an instance.", 0, 1, product);
2088        case -309474065: /*product*/  return new Property("product[x]", "Reference(Device|Medication|Substance)|CodeableConcept", "Identifies the device, food, drug or other product being charged either by type code or reference to an instance.", 0, 1, product);
2089        case -669667556: /*productReference*/  return new Property("product[x]", "Reference(Device|Medication|Substance)|CodeableConcept", "Identifies the device, food, drug or other product being charged either by type code or reference to an instance.", 0, 1, product);
2090        case 906854066: /*productCodeableConcept*/  return new Property("product[x]", "Reference(Device|Medication|Substance)|CodeableConcept", "Identifies the device, food, drug or other product being charged either by type code or reference to an instance.", 0, 1, product);
2091        case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "Account into which this ChargeItems belongs.", 0, java.lang.Integer.MAX_VALUE, account);
2092        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the event by the performer, subject or other participants.", 0, java.lang.Integer.MAX_VALUE, note);
2093        case -1248768647: /*supportingInformation*/  return new Property("supportingInformation", "Reference(Any)", "Further information supporting this charge.", 0, java.lang.Integer.MAX_VALUE, supportingInformation);
2094        default: return super.getNamedProperty(_hash, _name, _checkValid);
2095        }
2096
2097      }
2098
2099      @Override
2100      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2101        switch (hash) {
2102        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2103        case -1139428583: /*definitionUri*/ return this.definitionUri == null ? new Base[0] : this.definitionUri.toArray(new Base[this.definitionUri.size()]); // UriType
2104        case 933485793: /*definitionCanonical*/ return this.definitionCanonical == null ? new Base[0] : this.definitionCanonical.toArray(new Base[this.definitionCanonical.size()]); // CanonicalType
2105        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<ChargeItemStatus>
2106        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : this.partOf.toArray(new Base[this.partOf.size()]); // Reference
2107        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2108        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
2109        case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference
2110        case 1687874001: /*occurrence*/ return this.occurrence == null ? new Base[0] : new Base[] {this.occurrence}; // Type
2111        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ChargeItemPerformerComponent
2112        case 1273192628: /*performingOrganization*/ return this.performingOrganization == null ? new Base[0] : new Base[] {this.performingOrganization}; // Reference
2113        case 1279054790: /*requestingOrganization*/ return this.requestingOrganization == null ? new Base[0] : new Base[] {this.requestingOrganization}; // Reference
2114        case -593192318: /*costCenter*/ return this.costCenter == null ? new Base[0] : new Base[] {this.costCenter}; // Reference
2115        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
2116        case 1703573481: /*bodysite*/ return this.bodysite == null ? new Base[0] : this.bodysite.toArray(new Base[this.bodysite.size()]); // CodeableConcept
2117        case -451233221: /*factorOverride*/ return this.factorOverride == null ? new Base[0] : new Base[] {this.factorOverride}; // DecimalType
2118        case -216803275: /*priceOverride*/ return this.priceOverride == null ? new Base[0] : new Base[] {this.priceOverride}; // Money
2119        case -742878928: /*overrideReason*/ return this.overrideReason == null ? new Base[0] : new Base[] {this.overrideReason}; // StringType
2120        case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference
2121        case 555978181: /*enteredDate*/ return this.enteredDate == null ? new Base[0] : new Base[] {this.enteredDate}; // DateTimeType
2122        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept
2123        case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // Reference
2124        case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type
2125        case -1177318867: /*account*/ return this.account == null ? new Base[0] : this.account.toArray(new Base[this.account.size()]); // Reference
2126        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2127        case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference
2128        default: return super.getProperty(hash, name, checkValid);
2129        }
2130
2131      }
2132
2133      @Override
2134      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2135        switch (hash) {
2136        case -1618432855: // identifier
2137          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2138          return value;
2139        case -1139428583: // definitionUri
2140          this.getDefinitionUri().add(castToUri(value)); // UriType
2141          return value;
2142        case 933485793: // definitionCanonical
2143          this.getDefinitionCanonical().add(castToCanonical(value)); // CanonicalType
2144          return value;
2145        case -892481550: // status
2146          value = new ChargeItemStatusEnumFactory().fromType(castToCode(value));
2147          this.status = (Enumeration) value; // Enumeration<ChargeItemStatus>
2148          return value;
2149        case -995410646: // partOf
2150          this.getPartOf().add(castToReference(value)); // Reference
2151          return value;
2152        case 3059181: // code
2153          this.code = castToCodeableConcept(value); // CodeableConcept
2154          return value;
2155        case -1867885268: // subject
2156          this.subject = castToReference(value); // Reference
2157          return value;
2158        case 951530927: // context
2159          this.context = castToReference(value); // Reference
2160          return value;
2161        case 1687874001: // occurrence
2162          this.occurrence = castToType(value); // Type
2163          return value;
2164        case 481140686: // performer
2165          this.getPerformer().add((ChargeItemPerformerComponent) value); // ChargeItemPerformerComponent
2166          return value;
2167        case 1273192628: // performingOrganization
2168          this.performingOrganization = castToReference(value); // Reference
2169          return value;
2170        case 1279054790: // requestingOrganization
2171          this.requestingOrganization = castToReference(value); // Reference
2172          return value;
2173        case -593192318: // costCenter
2174          this.costCenter = castToReference(value); // Reference
2175          return value;
2176        case -1285004149: // quantity
2177          this.quantity = castToQuantity(value); // Quantity
2178          return value;
2179        case 1703573481: // bodysite
2180          this.getBodysite().add(castToCodeableConcept(value)); // CodeableConcept
2181          return value;
2182        case -451233221: // factorOverride
2183          this.factorOverride = castToDecimal(value); // DecimalType
2184          return value;
2185        case -216803275: // priceOverride
2186          this.priceOverride = castToMoney(value); // Money
2187          return value;
2188        case -742878928: // overrideReason
2189          this.overrideReason = castToString(value); // StringType
2190          return value;
2191        case -1591951995: // enterer
2192          this.enterer = castToReference(value); // Reference
2193          return value;
2194        case 555978181: // enteredDate
2195          this.enteredDate = castToDateTime(value); // DateTimeType
2196          return value;
2197        case -934964668: // reason
2198          this.getReason().add(castToCodeableConcept(value)); // CodeableConcept
2199          return value;
2200        case 1984153269: // service
2201          this.getService().add(castToReference(value)); // Reference
2202          return value;
2203        case -309474065: // product
2204          this.product = castToType(value); // Type
2205          return value;
2206        case -1177318867: // account
2207          this.getAccount().add(castToReference(value)); // Reference
2208          return value;
2209        case 3387378: // note
2210          this.getNote().add(castToAnnotation(value)); // Annotation
2211          return value;
2212        case -1248768647: // supportingInformation
2213          this.getSupportingInformation().add(castToReference(value)); // Reference
2214          return value;
2215        default: return super.setProperty(hash, name, value);
2216        }
2217
2218      }
2219
2220      @Override
2221      public Base setProperty(String name, Base value) throws FHIRException {
2222        if (name.equals("identifier")) {
2223          this.getIdentifier().add(castToIdentifier(value));
2224        } else if (name.equals("definitionUri")) {
2225          this.getDefinitionUri().add(castToUri(value));
2226        } else if (name.equals("definitionCanonical")) {
2227          this.getDefinitionCanonical().add(castToCanonical(value));
2228        } else if (name.equals("status")) {
2229          value = new ChargeItemStatusEnumFactory().fromType(castToCode(value));
2230          this.status = (Enumeration) value; // Enumeration<ChargeItemStatus>
2231        } else if (name.equals("partOf")) {
2232          this.getPartOf().add(castToReference(value));
2233        } else if (name.equals("code")) {
2234          this.code = castToCodeableConcept(value); // CodeableConcept
2235        } else if (name.equals("subject")) {
2236          this.subject = castToReference(value); // Reference
2237        } else if (name.equals("context")) {
2238          this.context = castToReference(value); // Reference
2239        } else if (name.equals("occurrence[x]")) {
2240          this.occurrence = castToType(value); // Type
2241        } else if (name.equals("performer")) {
2242          this.getPerformer().add((ChargeItemPerformerComponent) value);
2243        } else if (name.equals("performingOrganization")) {
2244          this.performingOrganization = castToReference(value); // Reference
2245        } else if (name.equals("requestingOrganization")) {
2246          this.requestingOrganization = castToReference(value); // Reference
2247        } else if (name.equals("costCenter")) {
2248          this.costCenter = castToReference(value); // Reference
2249        } else if (name.equals("quantity")) {
2250          this.quantity = castToQuantity(value); // Quantity
2251        } else if (name.equals("bodysite")) {
2252          this.getBodysite().add(castToCodeableConcept(value));
2253        } else if (name.equals("factorOverride")) {
2254          this.factorOverride = castToDecimal(value); // DecimalType
2255        } else if (name.equals("priceOverride")) {
2256          this.priceOverride = castToMoney(value); // Money
2257        } else if (name.equals("overrideReason")) {
2258          this.overrideReason = castToString(value); // StringType
2259        } else if (name.equals("enterer")) {
2260          this.enterer = castToReference(value); // Reference
2261        } else if (name.equals("enteredDate")) {
2262          this.enteredDate = castToDateTime(value); // DateTimeType
2263        } else if (name.equals("reason")) {
2264          this.getReason().add(castToCodeableConcept(value));
2265        } else if (name.equals("service")) {
2266          this.getService().add(castToReference(value));
2267        } else if (name.equals("product[x]")) {
2268          this.product = castToType(value); // Type
2269        } else if (name.equals("account")) {
2270          this.getAccount().add(castToReference(value));
2271        } else if (name.equals("note")) {
2272          this.getNote().add(castToAnnotation(value));
2273        } else if (name.equals("supportingInformation")) {
2274          this.getSupportingInformation().add(castToReference(value));
2275        } else
2276          return super.setProperty(name, value);
2277        return value;
2278      }
2279
2280      @Override
2281      public Base makeProperty(int hash, String name) throws FHIRException {
2282        switch (hash) {
2283        case -1618432855:  return addIdentifier(); 
2284        case -1139428583:  return addDefinitionUriElement();
2285        case 933485793:  return addDefinitionCanonicalElement();
2286        case -892481550:  return getStatusElement();
2287        case -995410646:  return addPartOf(); 
2288        case 3059181:  return getCode(); 
2289        case -1867885268:  return getSubject(); 
2290        case 951530927:  return getContext(); 
2291        case -2022646513:  return getOccurrence(); 
2292        case 1687874001:  return getOccurrence(); 
2293        case 481140686:  return addPerformer(); 
2294        case 1273192628:  return getPerformingOrganization(); 
2295        case 1279054790:  return getRequestingOrganization(); 
2296        case -593192318:  return getCostCenter(); 
2297        case -1285004149:  return getQuantity(); 
2298        case 1703573481:  return addBodysite(); 
2299        case -451233221:  return getFactorOverrideElement();
2300        case -216803275:  return getPriceOverride(); 
2301        case -742878928:  return getOverrideReasonElement();
2302        case -1591951995:  return getEnterer(); 
2303        case 555978181:  return getEnteredDateElement();
2304        case -934964668:  return addReason(); 
2305        case 1984153269:  return addService(); 
2306        case 1753005361:  return getProduct(); 
2307        case -309474065:  return getProduct(); 
2308        case -1177318867:  return addAccount(); 
2309        case 3387378:  return addNote(); 
2310        case -1248768647:  return addSupportingInformation(); 
2311        default: return super.makeProperty(hash, name);
2312        }
2313
2314      }
2315
2316      @Override
2317      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2318        switch (hash) {
2319        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2320        case -1139428583: /*definitionUri*/ return new String[] {"uri"};
2321        case 933485793: /*definitionCanonical*/ return new String[] {"canonical"};
2322        case -892481550: /*status*/ return new String[] {"code"};
2323        case -995410646: /*partOf*/ return new String[] {"Reference"};
2324        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2325        case -1867885268: /*subject*/ return new String[] {"Reference"};
2326        case 951530927: /*context*/ return new String[] {"Reference"};
2327        case 1687874001: /*occurrence*/ return new String[] {"dateTime", "Period", "Timing"};
2328        case 481140686: /*performer*/ return new String[] {};
2329        case 1273192628: /*performingOrganization*/ return new String[] {"Reference"};
2330        case 1279054790: /*requestingOrganization*/ return new String[] {"Reference"};
2331        case -593192318: /*costCenter*/ return new String[] {"Reference"};
2332        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
2333        case 1703573481: /*bodysite*/ return new String[] {"CodeableConcept"};
2334        case -451233221: /*factorOverride*/ return new String[] {"decimal"};
2335        case -216803275: /*priceOverride*/ return new String[] {"Money"};
2336        case -742878928: /*overrideReason*/ return new String[] {"string"};
2337        case -1591951995: /*enterer*/ return new String[] {"Reference"};
2338        case 555978181: /*enteredDate*/ return new String[] {"dateTime"};
2339        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
2340        case 1984153269: /*service*/ return new String[] {"Reference"};
2341        case -309474065: /*product*/ return new String[] {"Reference", "CodeableConcept"};
2342        case -1177318867: /*account*/ return new String[] {"Reference"};
2343        case 3387378: /*note*/ return new String[] {"Annotation"};
2344        case -1248768647: /*supportingInformation*/ return new String[] {"Reference"};
2345        default: return super.getTypesForProperty(hash, name);
2346        }
2347
2348      }
2349
2350      @Override
2351      public Base addChild(String name) throws FHIRException {
2352        if (name.equals("identifier")) {
2353          return addIdentifier();
2354        }
2355        else if (name.equals("definitionUri")) {
2356          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.definitionUri");
2357        }
2358        else if (name.equals("definitionCanonical")) {
2359          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.definitionCanonical");
2360        }
2361        else if (name.equals("status")) {
2362          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.status");
2363        }
2364        else if (name.equals("partOf")) {
2365          return addPartOf();
2366        }
2367        else if (name.equals("code")) {
2368          this.code = new CodeableConcept();
2369          return this.code;
2370        }
2371        else if (name.equals("subject")) {
2372          this.subject = new Reference();
2373          return this.subject;
2374        }
2375        else if (name.equals("context")) {
2376          this.context = new Reference();
2377          return this.context;
2378        }
2379        else if (name.equals("occurrenceDateTime")) {
2380          this.occurrence = new DateTimeType();
2381          return this.occurrence;
2382        }
2383        else if (name.equals("occurrencePeriod")) {
2384          this.occurrence = new Period();
2385          return this.occurrence;
2386        }
2387        else if (name.equals("occurrenceTiming")) {
2388          this.occurrence = new Timing();
2389          return this.occurrence;
2390        }
2391        else if (name.equals("performer")) {
2392          return addPerformer();
2393        }
2394        else if (name.equals("performingOrganization")) {
2395          this.performingOrganization = new Reference();
2396          return this.performingOrganization;
2397        }
2398        else if (name.equals("requestingOrganization")) {
2399          this.requestingOrganization = new Reference();
2400          return this.requestingOrganization;
2401        }
2402        else if (name.equals("costCenter")) {
2403          this.costCenter = new Reference();
2404          return this.costCenter;
2405        }
2406        else if (name.equals("quantity")) {
2407          this.quantity = new Quantity();
2408          return this.quantity;
2409        }
2410        else if (name.equals("bodysite")) {
2411          return addBodysite();
2412        }
2413        else if (name.equals("factorOverride")) {
2414          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.factorOverride");
2415        }
2416        else if (name.equals("priceOverride")) {
2417          this.priceOverride = new Money();
2418          return this.priceOverride;
2419        }
2420        else if (name.equals("overrideReason")) {
2421          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.overrideReason");
2422        }
2423        else if (name.equals("enterer")) {
2424          this.enterer = new Reference();
2425          return this.enterer;
2426        }
2427        else if (name.equals("enteredDate")) {
2428          throw new FHIRException("Cannot call addChild on a primitive type ChargeItem.enteredDate");
2429        }
2430        else if (name.equals("reason")) {
2431          return addReason();
2432        }
2433        else if (name.equals("service")) {
2434          return addService();
2435        }
2436        else if (name.equals("productReference")) {
2437          this.product = new Reference();
2438          return this.product;
2439        }
2440        else if (name.equals("productCodeableConcept")) {
2441          this.product = new CodeableConcept();
2442          return this.product;
2443        }
2444        else if (name.equals("account")) {
2445          return addAccount();
2446        }
2447        else if (name.equals("note")) {
2448          return addNote();
2449        }
2450        else if (name.equals("supportingInformation")) {
2451          return addSupportingInformation();
2452        }
2453        else
2454          return super.addChild(name);
2455      }
2456
2457  public String fhirType() {
2458    return "ChargeItem";
2459
2460  }
2461
2462      public ChargeItem copy() {
2463        ChargeItem dst = new ChargeItem();
2464        copyValues(dst);
2465        return dst;
2466      }
2467
2468      public void copyValues(ChargeItem dst) {
2469        super.copyValues(dst);
2470        if (identifier != null) {
2471          dst.identifier = new ArrayList<Identifier>();
2472          for (Identifier i : identifier)
2473            dst.identifier.add(i.copy());
2474        };
2475        if (definitionUri != null) {
2476          dst.definitionUri = new ArrayList<UriType>();
2477          for (UriType i : definitionUri)
2478            dst.definitionUri.add(i.copy());
2479        };
2480        if (definitionCanonical != null) {
2481          dst.definitionCanonical = new ArrayList<CanonicalType>();
2482          for (CanonicalType i : definitionCanonical)
2483            dst.definitionCanonical.add(i.copy());
2484        };
2485        dst.status = status == null ? null : status.copy();
2486        if (partOf != null) {
2487          dst.partOf = new ArrayList<Reference>();
2488          for (Reference i : partOf)
2489            dst.partOf.add(i.copy());
2490        };
2491        dst.code = code == null ? null : code.copy();
2492        dst.subject = subject == null ? null : subject.copy();
2493        dst.context = context == null ? null : context.copy();
2494        dst.occurrence = occurrence == null ? null : occurrence.copy();
2495        if (performer != null) {
2496          dst.performer = new ArrayList<ChargeItemPerformerComponent>();
2497          for (ChargeItemPerformerComponent i : performer)
2498            dst.performer.add(i.copy());
2499        };
2500        dst.performingOrganization = performingOrganization == null ? null : performingOrganization.copy();
2501        dst.requestingOrganization = requestingOrganization == null ? null : requestingOrganization.copy();
2502        dst.costCenter = costCenter == null ? null : costCenter.copy();
2503        dst.quantity = quantity == null ? null : quantity.copy();
2504        if (bodysite != null) {
2505          dst.bodysite = new ArrayList<CodeableConcept>();
2506          for (CodeableConcept i : bodysite)
2507            dst.bodysite.add(i.copy());
2508        };
2509        dst.factorOverride = factorOverride == null ? null : factorOverride.copy();
2510        dst.priceOverride = priceOverride == null ? null : priceOverride.copy();
2511        dst.overrideReason = overrideReason == null ? null : overrideReason.copy();
2512        dst.enterer = enterer == null ? null : enterer.copy();
2513        dst.enteredDate = enteredDate == null ? null : enteredDate.copy();
2514        if (reason != null) {
2515          dst.reason = new ArrayList<CodeableConcept>();
2516          for (CodeableConcept i : reason)
2517            dst.reason.add(i.copy());
2518        };
2519        if (service != null) {
2520          dst.service = new ArrayList<Reference>();
2521          for (Reference i : service)
2522            dst.service.add(i.copy());
2523        };
2524        dst.product = product == null ? null : product.copy();
2525        if (account != null) {
2526          dst.account = new ArrayList<Reference>();
2527          for (Reference i : account)
2528            dst.account.add(i.copy());
2529        };
2530        if (note != null) {
2531          dst.note = new ArrayList<Annotation>();
2532          for (Annotation i : note)
2533            dst.note.add(i.copy());
2534        };
2535        if (supportingInformation != null) {
2536          dst.supportingInformation = new ArrayList<Reference>();
2537          for (Reference i : supportingInformation)
2538            dst.supportingInformation.add(i.copy());
2539        };
2540      }
2541
2542      protected ChargeItem typedCopy() {
2543        return copy();
2544      }
2545
2546      @Override
2547      public boolean equalsDeep(Base other_) {
2548        if (!super.equalsDeep(other_))
2549          return false;
2550        if (!(other_ instanceof ChargeItem))
2551          return false;
2552        ChargeItem o = (ChargeItem) other_;
2553        return compareDeep(identifier, o.identifier, true) && compareDeep(definitionUri, o.definitionUri, true)
2554           && compareDeep(definitionCanonical, o.definitionCanonical, true) && compareDeep(status, o.status, true)
2555           && compareDeep(partOf, o.partOf, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true)
2556           && compareDeep(context, o.context, true) && compareDeep(occurrence, o.occurrence, true) && compareDeep(performer, o.performer, true)
2557           && compareDeep(performingOrganization, o.performingOrganization, true) && compareDeep(requestingOrganization, o.requestingOrganization, true)
2558           && compareDeep(costCenter, o.costCenter, true) && compareDeep(quantity, o.quantity, true) && compareDeep(bodysite, o.bodysite, true)
2559           && compareDeep(factorOverride, o.factorOverride, true) && compareDeep(priceOverride, o.priceOverride, true)
2560           && compareDeep(overrideReason, o.overrideReason, true) && compareDeep(enterer, o.enterer, true)
2561           && compareDeep(enteredDate, o.enteredDate, true) && compareDeep(reason, o.reason, true) && compareDeep(service, o.service, true)
2562           && compareDeep(product, o.product, true) && compareDeep(account, o.account, true) && compareDeep(note, o.note, true)
2563           && compareDeep(supportingInformation, o.supportingInformation, true);
2564      }
2565
2566      @Override
2567      public boolean equalsShallow(Base other_) {
2568        if (!super.equalsShallow(other_))
2569          return false;
2570        if (!(other_ instanceof ChargeItem))
2571          return false;
2572        ChargeItem o = (ChargeItem) other_;
2573        return compareValues(definitionUri, o.definitionUri, true) && compareValues(status, o.status, true)
2574           && compareValues(factorOverride, o.factorOverride, true) && compareValues(overrideReason, o.overrideReason, true)
2575           && compareValues(enteredDate, o.enteredDate, true);
2576      }
2577
2578      public boolean isEmpty() {
2579        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, definitionUri
2580          , definitionCanonical, status, partOf, code, subject, context, occurrence, performer
2581          , performingOrganization, requestingOrganization, costCenter, quantity, bodysite, factorOverride
2582          , priceOverride, overrideReason, enterer, enteredDate, reason, service, product
2583          , account, note, supportingInformation);
2584      }
2585
2586  @Override
2587  public ResourceType getResourceType() {
2588    return ResourceType.ChargeItem;
2589   }
2590
2591 /**
2592   * Search parameter: <b>identifier</b>
2593   * <p>
2594   * Description: <b>Business Identifier for item</b><br>
2595   * Type: <b>token</b><br>
2596   * Path: <b>ChargeItem.identifier</b><br>
2597   * </p>
2598   */
2599  @SearchParamDefinition(name="identifier", path="ChargeItem.identifier", description="Business Identifier for item", type="token" )
2600  public static final String SP_IDENTIFIER = "identifier";
2601 /**
2602   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2603   * <p>
2604   * Description: <b>Business Identifier for item</b><br>
2605   * Type: <b>token</b><br>
2606   * Path: <b>ChargeItem.identifier</b><br>
2607   * </p>
2608   */
2609  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2610
2611 /**
2612   * Search parameter: <b>performing-organization</b>
2613   * <p>
2614   * Description: <b>Organization providing the charged service</b><br>
2615   * Type: <b>reference</b><br>
2616   * Path: <b>ChargeItem.performingOrganization</b><br>
2617   * </p>
2618   */
2619  @SearchParamDefinition(name="performing-organization", path="ChargeItem.performingOrganization", description="Organization providing the charged service", type="reference", target={Organization.class } )
2620  public static final String SP_PERFORMING_ORGANIZATION = "performing-organization";
2621 /**
2622   * <b>Fluent Client</b> search parameter constant for <b>performing-organization</b>
2623   * <p>
2624   * Description: <b>Organization providing the charged service</b><br>
2625   * Type: <b>reference</b><br>
2626   * Path: <b>ChargeItem.performingOrganization</b><br>
2627   * </p>
2628   */
2629  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMING_ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMING_ORGANIZATION);
2630
2631/**
2632   * Constant for fluent queries to be used to add include statements. Specifies
2633   * the path value of "<b>ChargeItem:performing-organization</b>".
2634   */
2635  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMING_ORGANIZATION = new ca.uhn.fhir.model.api.Include("ChargeItem:performing-organization").toLocked();
2636
2637 /**
2638   * Search parameter: <b>code</b>
2639   * <p>
2640   * Description: <b>A code that identifies the charge, like a billing code</b><br>
2641   * Type: <b>token</b><br>
2642   * Path: <b>ChargeItem.code</b><br>
2643   * </p>
2644   */
2645  @SearchParamDefinition(name="code", path="ChargeItem.code", description="A code that identifies the charge, like a billing code", type="token" )
2646  public static final String SP_CODE = "code";
2647 /**
2648   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2649   * <p>
2650   * Description: <b>A code that identifies the charge, like a billing code</b><br>
2651   * Type: <b>token</b><br>
2652   * Path: <b>ChargeItem.code</b><br>
2653   * </p>
2654   */
2655  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2656
2657 /**
2658   * Search parameter: <b>quantity</b>
2659   * <p>
2660   * Description: <b>Quantity of which the charge item has been serviced</b><br>
2661   * Type: <b>quantity</b><br>
2662   * Path: <b>ChargeItem.quantity</b><br>
2663   * </p>
2664   */
2665  @SearchParamDefinition(name="quantity", path="ChargeItem.quantity", description="Quantity of which the charge item has been serviced", type="quantity" )
2666  public static final String SP_QUANTITY = "quantity";
2667 /**
2668   * <b>Fluent Client</b> search parameter constant for <b>quantity</b>
2669   * <p>
2670   * Description: <b>Quantity of which the charge item has been serviced</b><br>
2671   * Type: <b>quantity</b><br>
2672   * Path: <b>ChargeItem.quantity</b><br>
2673   * </p>
2674   */
2675  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_QUANTITY);
2676
2677 /**
2678   * Search parameter: <b>subject</b>
2679   * <p>
2680   * Description: <b>Individual service was done for/to</b><br>
2681   * Type: <b>reference</b><br>
2682   * Path: <b>ChargeItem.subject</b><br>
2683   * </p>
2684   */
2685  @SearchParamDefinition(name="subject", path="ChargeItem.subject", description="Individual service was done for/to", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Group.class, Patient.class } )
2686  public static final String SP_SUBJECT = "subject";
2687 /**
2688   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2689   * <p>
2690   * Description: <b>Individual service was done for/to</b><br>
2691   * Type: <b>reference</b><br>
2692   * Path: <b>ChargeItem.subject</b><br>
2693   * </p>
2694   */
2695  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2696
2697/**
2698   * Constant for fluent queries to be used to add include statements. Specifies
2699   * the path value of "<b>ChargeItem:subject</b>".
2700   */
2701  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ChargeItem:subject").toLocked();
2702
2703 /**
2704   * Search parameter: <b>occurrence</b>
2705   * <p>
2706   * Description: <b>When the charged service was applied</b><br>
2707   * Type: <b>date</b><br>
2708   * Path: <b>ChargeItem.occurrence[x]</b><br>
2709   * </p>
2710   */
2711  @SearchParamDefinition(name="occurrence", path="ChargeItem.occurrence", description="When the charged service was applied", type="date" )
2712  public static final String SP_OCCURRENCE = "occurrence";
2713 /**
2714   * <b>Fluent Client</b> search parameter constant for <b>occurrence</b>
2715   * <p>
2716   * Description: <b>When the charged service was applied</b><br>
2717   * Type: <b>date</b><br>
2718   * Path: <b>ChargeItem.occurrence[x]</b><br>
2719   * </p>
2720   */
2721  public static final ca.uhn.fhir.rest.gclient.DateClientParam OCCURRENCE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_OCCURRENCE);
2722
2723 /**
2724   * Search parameter: <b>entered-date</b>
2725   * <p>
2726   * Description: <b>Date the charge item was entered</b><br>
2727   * Type: <b>date</b><br>
2728   * Path: <b>ChargeItem.enteredDate</b><br>
2729   * </p>
2730   */
2731  @SearchParamDefinition(name="entered-date", path="ChargeItem.enteredDate", description="Date the charge item was entered", type="date" )
2732  public static final String SP_ENTERED_DATE = "entered-date";
2733 /**
2734   * <b>Fluent Client</b> search parameter constant for <b>entered-date</b>
2735   * <p>
2736   * Description: <b>Date the charge item was entered</b><br>
2737   * Type: <b>date</b><br>
2738   * Path: <b>ChargeItem.enteredDate</b><br>
2739   * </p>
2740   */
2741  public static final ca.uhn.fhir.rest.gclient.DateClientParam ENTERED_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ENTERED_DATE);
2742
2743 /**
2744   * Search parameter: <b>performer-function</b>
2745   * <p>
2746   * Description: <b>What type of performance was done</b><br>
2747   * Type: <b>token</b><br>
2748   * Path: <b>ChargeItem.performer.function</b><br>
2749   * </p>
2750   */
2751  @SearchParamDefinition(name="performer-function", path="ChargeItem.performer.function", description="What type of performance was done", type="token" )
2752  public static final String SP_PERFORMER_FUNCTION = "performer-function";
2753 /**
2754   * <b>Fluent Client</b> search parameter constant for <b>performer-function</b>
2755   * <p>
2756   * Description: <b>What type of performance was done</b><br>
2757   * Type: <b>token</b><br>
2758   * Path: <b>ChargeItem.performer.function</b><br>
2759   * </p>
2760   */
2761  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER_FUNCTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER_FUNCTION);
2762
2763 /**
2764   * Search parameter: <b>patient</b>
2765   * <p>
2766   * Description: <b>Individual service was done for/to</b><br>
2767   * Type: <b>reference</b><br>
2768   * Path: <b>ChargeItem.subject</b><br>
2769   * </p>
2770   */
2771  @SearchParamDefinition(name="patient", path="ChargeItem.subject.where(resolve() is Patient)", description="Individual service was done for/to", type="reference", target={Patient.class } )
2772  public static final String SP_PATIENT = "patient";
2773 /**
2774   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2775   * <p>
2776   * Description: <b>Individual service was done for/to</b><br>
2777   * Type: <b>reference</b><br>
2778   * Path: <b>ChargeItem.subject</b><br>
2779   * </p>
2780   */
2781  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2782
2783/**
2784   * Constant for fluent queries to be used to add include statements. Specifies
2785   * the path value of "<b>ChargeItem:patient</b>".
2786   */
2787  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ChargeItem:patient").toLocked();
2788
2789 /**
2790   * Search parameter: <b>factor-override</b>
2791   * <p>
2792   * Description: <b>Factor overriding the associated rules</b><br>
2793   * Type: <b>number</b><br>
2794   * Path: <b>ChargeItem.factorOverride</b><br>
2795   * </p>
2796   */
2797  @SearchParamDefinition(name="factor-override", path="ChargeItem.factorOverride", description="Factor overriding the associated rules", type="number" )
2798  public static final String SP_FACTOR_OVERRIDE = "factor-override";
2799 /**
2800   * <b>Fluent Client</b> search parameter constant for <b>factor-override</b>
2801   * <p>
2802   * Description: <b>Factor overriding the associated rules</b><br>
2803   * Type: <b>number</b><br>
2804   * Path: <b>ChargeItem.factorOverride</b><br>
2805   * </p>
2806   */
2807  public static final ca.uhn.fhir.rest.gclient.NumberClientParam FACTOR_OVERRIDE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_FACTOR_OVERRIDE);
2808
2809 /**
2810   * Search parameter: <b>service</b>
2811   * <p>
2812   * Description: <b>Which rendered service is being charged?</b><br>
2813   * Type: <b>reference</b><br>
2814   * Path: <b>ChargeItem.service</b><br>
2815   * </p>
2816   */
2817  @SearchParamDefinition(name="service", path="ChargeItem.service", description="Which rendered service is being charged?", type="reference", target={DiagnosticReport.class, ImagingStudy.class, Immunization.class, MedicationAdministration.class, MedicationDispense.class, Observation.class, Procedure.class, SupplyDelivery.class } )
2818  public static final String SP_SERVICE = "service";
2819 /**
2820   * <b>Fluent Client</b> search parameter constant for <b>service</b>
2821   * <p>
2822   * Description: <b>Which rendered service is being charged?</b><br>
2823   * Type: <b>reference</b><br>
2824   * Path: <b>ChargeItem.service</b><br>
2825   * </p>
2826   */
2827  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SERVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SERVICE);
2828
2829/**
2830   * Constant for fluent queries to be used to add include statements. Specifies
2831   * the path value of "<b>ChargeItem:service</b>".
2832   */
2833  public static final ca.uhn.fhir.model.api.Include INCLUDE_SERVICE = new ca.uhn.fhir.model.api.Include("ChargeItem:service").toLocked();
2834
2835 /**
2836   * Search parameter: <b>price-override</b>
2837   * <p>
2838   * Description: <b>Price overriding the associated rules</b><br>
2839   * Type: <b>quantity</b><br>
2840   * Path: <b>ChargeItem.priceOverride</b><br>
2841   * </p>
2842   */
2843  @SearchParamDefinition(name="price-override", path="ChargeItem.priceOverride", description="Price overriding the associated rules", type="quantity" )
2844  public static final String SP_PRICE_OVERRIDE = "price-override";
2845 /**
2846   * <b>Fluent Client</b> search parameter constant for <b>price-override</b>
2847   * <p>
2848   * Description: <b>Price overriding the associated rules</b><br>
2849   * Type: <b>quantity</b><br>
2850   * Path: <b>ChargeItem.priceOverride</b><br>
2851   * </p>
2852   */
2853  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam PRICE_OVERRIDE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_PRICE_OVERRIDE);
2854
2855 /**
2856   * Search parameter: <b>context</b>
2857   * <p>
2858   * Description: <b>Encounter / Episode associated with event</b><br>
2859   * Type: <b>reference</b><br>
2860   * Path: <b>ChargeItem.context</b><br>
2861   * </p>
2862   */
2863  @SearchParamDefinition(name="context", path="ChargeItem.context", description="Encounter / Episode associated with event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class, EpisodeOfCare.class } )
2864  public static final String SP_CONTEXT = "context";
2865 /**
2866   * <b>Fluent Client</b> search parameter constant for <b>context</b>
2867   * <p>
2868   * Description: <b>Encounter / Episode associated with event</b><br>
2869   * Type: <b>reference</b><br>
2870   * Path: <b>ChargeItem.context</b><br>
2871   * </p>
2872   */
2873  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT);
2874
2875/**
2876   * Constant for fluent queries to be used to add include statements. Specifies
2877   * the path value of "<b>ChargeItem:context</b>".
2878   */
2879  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("ChargeItem:context").toLocked();
2880
2881 /**
2882   * Search parameter: <b>enterer</b>
2883   * <p>
2884   * Description: <b>Individual who was entering</b><br>
2885   * Type: <b>reference</b><br>
2886   * Path: <b>ChargeItem.enterer</b><br>
2887   * </p>
2888   */
2889  @SearchParamDefinition(name="enterer", path="ChargeItem.enterer", description="Individual who was entering", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2890  public static final String SP_ENTERER = "enterer";
2891 /**
2892   * <b>Fluent Client</b> search parameter constant for <b>enterer</b>
2893   * <p>
2894   * Description: <b>Individual who was entering</b><br>
2895   * Type: <b>reference</b><br>
2896   * Path: <b>ChargeItem.enterer</b><br>
2897   * </p>
2898   */
2899  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTERER);
2900
2901/**
2902   * Constant for fluent queries to be used to add include statements. Specifies
2903   * the path value of "<b>ChargeItem:enterer</b>".
2904   */
2905  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTERER = new ca.uhn.fhir.model.api.Include("ChargeItem:enterer").toLocked();
2906
2907 /**
2908   * Search parameter: <b>performer-actor</b>
2909   * <p>
2910   * Description: <b>Individual who was performing</b><br>
2911   * Type: <b>reference</b><br>
2912   * Path: <b>ChargeItem.performer.actor</b><br>
2913   * </p>
2914   */
2915  @SearchParamDefinition(name="performer-actor", path="ChargeItem.performer.actor", description="Individual who was performing", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2916  public static final String SP_PERFORMER_ACTOR = "performer-actor";
2917 /**
2918   * <b>Fluent Client</b> search parameter constant for <b>performer-actor</b>
2919   * <p>
2920   * Description: <b>Individual who was performing</b><br>
2921   * Type: <b>reference</b><br>
2922   * Path: <b>ChargeItem.performer.actor</b><br>
2923   * </p>
2924   */
2925  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER_ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER_ACTOR);
2926
2927/**
2928   * Constant for fluent queries to be used to add include statements. Specifies
2929   * the path value of "<b>ChargeItem:performer-actor</b>".
2930   */
2931  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER_ACTOR = new ca.uhn.fhir.model.api.Include("ChargeItem:performer-actor").toLocked();
2932
2933 /**
2934   * Search parameter: <b>account</b>
2935   * <p>
2936   * Description: <b>Account to place this charge</b><br>
2937   * Type: <b>reference</b><br>
2938   * Path: <b>ChargeItem.account</b><br>
2939   * </p>
2940   */
2941  @SearchParamDefinition(name="account", path="ChargeItem.account", description="Account to place this charge", type="reference", target={Account.class } )
2942  public static final String SP_ACCOUNT = "account";
2943 /**
2944   * <b>Fluent Client</b> search parameter constant for <b>account</b>
2945   * <p>
2946   * Description: <b>Account to place this charge</b><br>
2947   * Type: <b>reference</b><br>
2948   * Path: <b>ChargeItem.account</b><br>
2949   * </p>
2950   */
2951  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACCOUNT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACCOUNT);
2952
2953/**
2954   * Constant for fluent queries to be used to add include statements. Specifies
2955   * the path value of "<b>ChargeItem:account</b>".
2956   */
2957  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACCOUNT = new ca.uhn.fhir.model.api.Include("ChargeItem:account").toLocked();
2958
2959 /**
2960   * Search parameter: <b>requesting-organization</b>
2961   * <p>
2962   * Description: <b>Organization requesting the charged service</b><br>
2963   * Type: <b>reference</b><br>
2964   * Path: <b>ChargeItem.requestingOrganization</b><br>
2965   * </p>
2966   */
2967  @SearchParamDefinition(name="requesting-organization", path="ChargeItem.requestingOrganization", description="Organization requesting the charged service", type="reference", target={Organization.class } )
2968  public static final String SP_REQUESTING_ORGANIZATION = "requesting-organization";
2969 /**
2970   * <b>Fluent Client</b> search parameter constant for <b>requesting-organization</b>
2971   * <p>
2972   * Description: <b>Organization requesting the charged service</b><br>
2973   * Type: <b>reference</b><br>
2974   * Path: <b>ChargeItem.requestingOrganization</b><br>
2975   * </p>
2976   */
2977  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTING_ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTING_ORGANIZATION);
2978
2979/**
2980   * Constant for fluent queries to be used to add include statements. Specifies
2981   * the path value of "<b>ChargeItem:requesting-organization</b>".
2982   */
2983  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTING_ORGANIZATION = new ca.uhn.fhir.model.api.Include("ChargeItem:requesting-organization").toLocked();
2984
2985
2986}