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