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