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