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