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