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