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