001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import java.math.*;
038import org.hl7.fhir.utilities.Utilities;
039import org.hl7.fhir.r5.model.Enumerations.*;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.ICompositeType;
043import ca.uhn.fhir.model.api.annotation.ResourceDef;
044import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
045import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.Block;
050
051/**
052 * This resource provides the adjudication details from the processing of a Claim resource.
053 */
054@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/StructureDefinition/ClaimResponse")
055public class ClaimResponse extends DomainResource {
056
057    @Block()
058    public static class ItemComponent extends BackboneElement implements IBaseBackboneElement {
059        /**
060         * A number to uniquely reference the claim item entries.
061         */
062        @Child(name = "itemSequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false)
063        @Description(shortDefinition="Claim item instance identifier", formalDefinition="A number to uniquely reference the claim item entries." )
064        protected PositiveIntType itemSequence;
065
066        /**
067         * The numbers associated with notes below which apply to the adjudication of this item.
068         */
069        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
070        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
071        protected List<PositiveIntType> noteNumber;
072
073        /**
074         * The result of the claim, predetermination, or preauthorization adjudication.
075         */
076        @Child(name = "decision", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
077        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
078        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
079        protected CodeableConcept decision;
080
081        /**
082         * If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.
083         */
084        @Child(name = "adjudication", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
085        @Description(shortDefinition="Adjudication details", formalDefinition="If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item." )
086        protected List<AdjudicationComponent> adjudication;
087
088        /**
089         * A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.
090         */
091        @Child(name = "detail", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
092        @Description(shortDefinition="Adjudication for claim details", formalDefinition="A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items." )
093        protected List<ItemDetailComponent> detail;
094
095        private static final long serialVersionUID = 820014025L;
096
097    /**
098     * Constructor
099     */
100      public ItemComponent() {
101        super();
102      }
103
104    /**
105     * Constructor
106     */
107      public ItemComponent(int itemSequence) {
108        super();
109        this.setItemSequence(itemSequence);
110      }
111
112        /**
113         * @return {@link #itemSequence} (A number to uniquely reference the claim item entries.). This is the underlying object with id, value and extensions. The accessor "getItemSequence" gives direct access to the value
114         */
115        public PositiveIntType getItemSequenceElement() { 
116          if (this.itemSequence == null)
117            if (Configuration.errorOnAutoCreate())
118              throw new Error("Attempt to auto-create ItemComponent.itemSequence");
119            else if (Configuration.doAutoCreate())
120              this.itemSequence = new PositiveIntType(); // bb
121          return this.itemSequence;
122        }
123
124        public boolean hasItemSequenceElement() { 
125          return this.itemSequence != null && !this.itemSequence.isEmpty();
126        }
127
128        public boolean hasItemSequence() { 
129          return this.itemSequence != null && !this.itemSequence.isEmpty();
130        }
131
132        /**
133         * @param value {@link #itemSequence} (A number to uniquely reference the claim item entries.). This is the underlying object with id, value and extensions. The accessor "getItemSequence" gives direct access to the value
134         */
135        public ItemComponent setItemSequenceElement(PositiveIntType value) { 
136          this.itemSequence = value;
137          return this;
138        }
139
140        /**
141         * @return A number to uniquely reference the claim item entries.
142         */
143        public int getItemSequence() { 
144          return this.itemSequence == null || this.itemSequence.isEmpty() ? 0 : this.itemSequence.getValue();
145        }
146
147        /**
148         * @param value A number to uniquely reference the claim item entries.
149         */
150        public ItemComponent setItemSequence(int value) { 
151            if (this.itemSequence == null)
152              this.itemSequence = new PositiveIntType();
153            this.itemSequence.setValue(value);
154          return this;
155        }
156
157        /**
158         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
159         */
160        public List<PositiveIntType> getNoteNumber() { 
161          if (this.noteNumber == null)
162            this.noteNumber = new ArrayList<PositiveIntType>();
163          return this.noteNumber;
164        }
165
166        /**
167         * @return Returns a reference to <code>this</code> for easy method chaining
168         */
169        public ItemComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
170          this.noteNumber = theNoteNumber;
171          return this;
172        }
173
174        public boolean hasNoteNumber() { 
175          if (this.noteNumber == null)
176            return false;
177          for (PositiveIntType item : this.noteNumber)
178            if (!item.isEmpty())
179              return true;
180          return false;
181        }
182
183        /**
184         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
185         */
186        public PositiveIntType addNoteNumberElement() {//2 
187          PositiveIntType t = new PositiveIntType();
188          if (this.noteNumber == null)
189            this.noteNumber = new ArrayList<PositiveIntType>();
190          this.noteNumber.add(t);
191          return t;
192        }
193
194        /**
195         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
196         */
197        public ItemComponent addNoteNumber(int value) { //1
198          PositiveIntType t = new PositiveIntType();
199          t.setValue(value);
200          if (this.noteNumber == null)
201            this.noteNumber = new ArrayList<PositiveIntType>();
202          this.noteNumber.add(t);
203          return this;
204        }
205
206        /**
207         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
208         */
209        public boolean hasNoteNumber(int value) { 
210          if (this.noteNumber == null)
211            return false;
212          for (PositiveIntType v : this.noteNumber)
213            if (v.getValue().equals(value)) // positiveInt
214              return true;
215          return false;
216        }
217
218        /**
219         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
220         */
221        public CodeableConcept getDecision() { 
222          if (this.decision == null)
223            if (Configuration.errorOnAutoCreate())
224              throw new Error("Attempt to auto-create ItemComponent.decision");
225            else if (Configuration.doAutoCreate())
226              this.decision = new CodeableConcept(); // cc
227          return this.decision;
228        }
229
230        public boolean hasDecision() { 
231          return this.decision != null && !this.decision.isEmpty();
232        }
233
234        /**
235         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
236         */
237        public ItemComponent setDecision(CodeableConcept value) { 
238          this.decision = value;
239          return this;
240        }
241
242        /**
243         * @return {@link #adjudication} (If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.)
244         */
245        public List<AdjudicationComponent> getAdjudication() { 
246          if (this.adjudication == null)
247            this.adjudication = new ArrayList<AdjudicationComponent>();
248          return this.adjudication;
249        }
250
251        /**
252         * @return Returns a reference to <code>this</code> for easy method chaining
253         */
254        public ItemComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
255          this.adjudication = theAdjudication;
256          return this;
257        }
258
259        public boolean hasAdjudication() { 
260          if (this.adjudication == null)
261            return false;
262          for (AdjudicationComponent item : this.adjudication)
263            if (!item.isEmpty())
264              return true;
265          return false;
266        }
267
268        public AdjudicationComponent addAdjudication() { //3
269          AdjudicationComponent t = new AdjudicationComponent();
270          if (this.adjudication == null)
271            this.adjudication = new ArrayList<AdjudicationComponent>();
272          this.adjudication.add(t);
273          return t;
274        }
275
276        public ItemComponent addAdjudication(AdjudicationComponent t) { //3
277          if (t == null)
278            return this;
279          if (this.adjudication == null)
280            this.adjudication = new ArrayList<AdjudicationComponent>();
281          this.adjudication.add(t);
282          return this;
283        }
284
285        /**
286         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
287         */
288        public AdjudicationComponent getAdjudicationFirstRep() { 
289          if (getAdjudication().isEmpty()) {
290            addAdjudication();
291          }
292          return getAdjudication().get(0);
293        }
294
295        /**
296         * @return {@link #detail} (A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.)
297         */
298        public List<ItemDetailComponent> getDetail() { 
299          if (this.detail == null)
300            this.detail = new ArrayList<ItemDetailComponent>();
301          return this.detail;
302        }
303
304        /**
305         * @return Returns a reference to <code>this</code> for easy method chaining
306         */
307        public ItemComponent setDetail(List<ItemDetailComponent> theDetail) { 
308          this.detail = theDetail;
309          return this;
310        }
311
312        public boolean hasDetail() { 
313          if (this.detail == null)
314            return false;
315          for (ItemDetailComponent item : this.detail)
316            if (!item.isEmpty())
317              return true;
318          return false;
319        }
320
321        public ItemDetailComponent addDetail() { //3
322          ItemDetailComponent t = new ItemDetailComponent();
323          if (this.detail == null)
324            this.detail = new ArrayList<ItemDetailComponent>();
325          this.detail.add(t);
326          return t;
327        }
328
329        public ItemComponent addDetail(ItemDetailComponent t) { //3
330          if (t == null)
331            return this;
332          if (this.detail == null)
333            this.detail = new ArrayList<ItemDetailComponent>();
334          this.detail.add(t);
335          return this;
336        }
337
338        /**
339         * @return The first repetition of repeating field {@link #detail}, creating it if it does not already exist {3}
340         */
341        public ItemDetailComponent getDetailFirstRep() { 
342          if (getDetail().isEmpty()) {
343            addDetail();
344          }
345          return getDetail().get(0);
346        }
347
348        protected void listChildren(List<Property> children) {
349          super.listChildren(children);
350          children.add(new Property("itemSequence", "positiveInt", "A number to uniquely reference the claim item entries.", 0, 1, itemSequence));
351          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
352          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
353          children.add(new Property("adjudication", "", "If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, adjudication));
354          children.add(new Property("detail", "", "A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.", 0, java.lang.Integer.MAX_VALUE, detail));
355        }
356
357        @Override
358        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
359          switch (_hash) {
360          case 1977979892: /*itemSequence*/  return new Property("itemSequence", "positiveInt", "A number to uniquely reference the claim item entries.", 0, 1, itemSequence);
361          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
362          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
363          case -231349275: /*adjudication*/  return new Property("adjudication", "", "If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, adjudication);
364          case -1335224239: /*detail*/  return new Property("detail", "", "A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.", 0, java.lang.Integer.MAX_VALUE, detail);
365          default: return super.getNamedProperty(_hash, _name, _checkValid);
366          }
367
368        }
369
370      @Override
371      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
372        switch (hash) {
373        case 1977979892: /*itemSequence*/ return this.itemSequence == null ? new Base[0] : new Base[] {this.itemSequence}; // PositiveIntType
374        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
375        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
376        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
377        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // ItemDetailComponent
378        default: return super.getProperty(hash, name, checkValid);
379        }
380
381      }
382
383      @Override
384      public Base setProperty(int hash, String name, Base value) throws FHIRException {
385        switch (hash) {
386        case 1977979892: // itemSequence
387          this.itemSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
388          return value;
389        case -1110033957: // noteNumber
390          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
391          return value;
392        case 565719004: // decision
393          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
394          return value;
395        case -231349275: // adjudication
396          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
397          return value;
398        case -1335224239: // detail
399          this.getDetail().add((ItemDetailComponent) value); // ItemDetailComponent
400          return value;
401        default: return super.setProperty(hash, name, value);
402        }
403
404      }
405
406      @Override
407      public Base setProperty(String name, Base value) throws FHIRException {
408        if (name.equals("itemSequence")) {
409          this.itemSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
410        } else if (name.equals("noteNumber")) {
411          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
412        } else if (name.equals("decision")) {
413          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
414        } else if (name.equals("adjudication")) {
415          this.getAdjudication().add((AdjudicationComponent) value);
416        } else if (name.equals("detail")) {
417          this.getDetail().add((ItemDetailComponent) value);
418        } else
419          return super.setProperty(name, value);
420        return value;
421      }
422
423      @Override
424      public Base makeProperty(int hash, String name) throws FHIRException {
425        switch (hash) {
426        case 1977979892:  return getItemSequenceElement();
427        case -1110033957:  return addNoteNumberElement();
428        case 565719004:  return getDecision();
429        case -231349275:  return addAdjudication(); 
430        case -1335224239:  return addDetail(); 
431        default: return super.makeProperty(hash, name);
432        }
433
434      }
435
436      @Override
437      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
438        switch (hash) {
439        case 1977979892: /*itemSequence*/ return new String[] {"positiveInt"};
440        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
441        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
442        case -231349275: /*adjudication*/ return new String[] {};
443        case -1335224239: /*detail*/ return new String[] {};
444        default: return super.getTypesForProperty(hash, name);
445        }
446
447      }
448
449      @Override
450      public Base addChild(String name) throws FHIRException {
451        if (name.equals("itemSequence")) {
452          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.itemSequence");
453        }
454        else if (name.equals("noteNumber")) {
455          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.noteNumber");
456        }
457        else if (name.equals("decision")) {
458          this.decision = new CodeableConcept();
459          return this.decision;
460        }
461        else if (name.equals("adjudication")) {
462          return addAdjudication();
463        }
464        else if (name.equals("detail")) {
465          return addDetail();
466        }
467        else
468          return super.addChild(name);
469      }
470
471      public ItemComponent copy() {
472        ItemComponent dst = new ItemComponent();
473        copyValues(dst);
474        return dst;
475      }
476
477      public void copyValues(ItemComponent dst) {
478        super.copyValues(dst);
479        dst.itemSequence = itemSequence == null ? null : itemSequence.copy();
480        if (noteNumber != null) {
481          dst.noteNumber = new ArrayList<PositiveIntType>();
482          for (PositiveIntType i : noteNumber)
483            dst.noteNumber.add(i.copy());
484        };
485        dst.decision = decision == null ? null : decision.copy();
486        if (adjudication != null) {
487          dst.adjudication = new ArrayList<AdjudicationComponent>();
488          for (AdjudicationComponent i : adjudication)
489            dst.adjudication.add(i.copy());
490        };
491        if (detail != null) {
492          dst.detail = new ArrayList<ItemDetailComponent>();
493          for (ItemDetailComponent i : detail)
494            dst.detail.add(i.copy());
495        };
496      }
497
498      @Override
499      public boolean equalsDeep(Base other_) {
500        if (!super.equalsDeep(other_))
501          return false;
502        if (!(other_ instanceof ItemComponent))
503          return false;
504        ItemComponent o = (ItemComponent) other_;
505        return compareDeep(itemSequence, o.itemSequence, true) && compareDeep(noteNumber, o.noteNumber, true)
506           && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true)
507          ;
508      }
509
510      @Override
511      public boolean equalsShallow(Base other_) {
512        if (!super.equalsShallow(other_))
513          return false;
514        if (!(other_ instanceof ItemComponent))
515          return false;
516        ItemComponent o = (ItemComponent) other_;
517        return compareValues(itemSequence, o.itemSequence, true) && compareValues(noteNumber, o.noteNumber, true)
518          ;
519      }
520
521      public boolean isEmpty() {
522        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(itemSequence, noteNumber, decision
523          , adjudication, detail);
524      }
525
526  public String fhirType() {
527    return "ClaimResponse.item";
528
529  }
530
531  }
532
533    @Block()
534    public static class AdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
535        /**
536         * A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.
537         */
538        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
539        @Description(shortDefinition="Type of adjudication information", formalDefinition="A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item." )
540        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication")
541        protected CodeableConcept category;
542
543        /**
544         * A code supporting the understanding of the adjudication result and explaining variance from expected amount.
545         */
546        @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
547        @Description(shortDefinition="Explanation of adjudication outcome", formalDefinition="A code supporting the understanding of the adjudication result and explaining variance from expected amount." )
548        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-reason")
549        protected CodeableConcept reason;
550
551        /**
552         * Monetary amount associated with the category.
553         */
554        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=false)
555        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the category." )
556        protected Money amount;
557
558        /**
559         * A non-monetary value associated with the category. Mutually exclusive to the amount element above.
560         */
561        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=false)
562        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value associated with the category. Mutually exclusive to the amount element above." )
563        protected DecimalType value;
564
565        private static final long serialVersionUID = 1559898786L;
566
567    /**
568     * Constructor
569     */
570      public AdjudicationComponent() {
571        super();
572      }
573
574    /**
575     * Constructor
576     */
577      public AdjudicationComponent(CodeableConcept category) {
578        super();
579        this.setCategory(category);
580      }
581
582        /**
583         * @return {@link #category} (A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.)
584         */
585        public CodeableConcept getCategory() { 
586          if (this.category == null)
587            if (Configuration.errorOnAutoCreate())
588              throw new Error("Attempt to auto-create AdjudicationComponent.category");
589            else if (Configuration.doAutoCreate())
590              this.category = new CodeableConcept(); // cc
591          return this.category;
592        }
593
594        public boolean hasCategory() { 
595          return this.category != null && !this.category.isEmpty();
596        }
597
598        /**
599         * @param value {@link #category} (A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.)
600         */
601        public AdjudicationComponent setCategory(CodeableConcept value) { 
602          this.category = value;
603          return this;
604        }
605
606        /**
607         * @return {@link #reason} (A code supporting the understanding of the adjudication result and explaining variance from expected amount.)
608         */
609        public CodeableConcept getReason() { 
610          if (this.reason == null)
611            if (Configuration.errorOnAutoCreate())
612              throw new Error("Attempt to auto-create AdjudicationComponent.reason");
613            else if (Configuration.doAutoCreate())
614              this.reason = new CodeableConcept(); // cc
615          return this.reason;
616        }
617
618        public boolean hasReason() { 
619          return this.reason != null && !this.reason.isEmpty();
620        }
621
622        /**
623         * @param value {@link #reason} (A code supporting the understanding of the adjudication result and explaining variance from expected amount.)
624         */
625        public AdjudicationComponent setReason(CodeableConcept value) { 
626          this.reason = value;
627          return this;
628        }
629
630        /**
631         * @return {@link #amount} (Monetary amount associated with the category.)
632         */
633        public Money getAmount() { 
634          if (this.amount == null)
635            if (Configuration.errorOnAutoCreate())
636              throw new Error("Attempt to auto-create AdjudicationComponent.amount");
637            else if (Configuration.doAutoCreate())
638              this.amount = new Money(); // cc
639          return this.amount;
640        }
641
642        public boolean hasAmount() { 
643          return this.amount != null && !this.amount.isEmpty();
644        }
645
646        /**
647         * @param value {@link #amount} (Monetary amount associated with the category.)
648         */
649        public AdjudicationComponent setAmount(Money value) { 
650          this.amount = value;
651          return this;
652        }
653
654        /**
655         * @return {@link #value} (A non-monetary value associated with the category. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
656         */
657        public DecimalType getValueElement() { 
658          if (this.value == null)
659            if (Configuration.errorOnAutoCreate())
660              throw new Error("Attempt to auto-create AdjudicationComponent.value");
661            else if (Configuration.doAutoCreate())
662              this.value = new DecimalType(); // bb
663          return this.value;
664        }
665
666        public boolean hasValueElement() { 
667          return this.value != null && !this.value.isEmpty();
668        }
669
670        public boolean hasValue() { 
671          return this.value != null && !this.value.isEmpty();
672        }
673
674        /**
675         * @param value {@link #value} (A non-monetary value associated with the category. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
676         */
677        public AdjudicationComponent setValueElement(DecimalType value) { 
678          this.value = value;
679          return this;
680        }
681
682        /**
683         * @return A non-monetary value associated with the category. Mutually exclusive to the amount element above.
684         */
685        public BigDecimal getValue() { 
686          return this.value == null ? null : this.value.getValue();
687        }
688
689        /**
690         * @param value A non-monetary value associated with the category. Mutually exclusive to the amount element above.
691         */
692        public AdjudicationComponent setValue(BigDecimal value) { 
693          if (value == null)
694            this.value = null;
695          else {
696            if (this.value == null)
697              this.value = new DecimalType();
698            this.value.setValue(value);
699          }
700          return this;
701        }
702
703        /**
704         * @param value A non-monetary value associated with the category. Mutually exclusive to the amount element above.
705         */
706        public AdjudicationComponent setValue(long value) { 
707              this.value = new DecimalType();
708            this.value.setValue(value);
709          return this;
710        }
711
712        /**
713         * @param value A non-monetary value associated with the category. Mutually exclusive to the amount element above.
714         */
715        public AdjudicationComponent setValue(double value) { 
716              this.value = new DecimalType();
717            this.value.setValue(value);
718          return this;
719        }
720
721        protected void listChildren(List<Property> children) {
722          super.listChildren(children);
723          children.add(new Property("category", "CodeableConcept", "A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.", 0, 1, category));
724          children.add(new Property("reason", "CodeableConcept", "A code supporting the understanding of the adjudication result and explaining variance from expected amount.", 0, 1, reason));
725          children.add(new Property("amount", "Money", "Monetary amount associated with the category.", 0, 1, amount));
726          children.add(new Property("value", "decimal", "A non-monetary value associated with the category. Mutually exclusive to the amount element above.", 0, 1, value));
727        }
728
729        @Override
730        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
731          switch (_hash) {
732          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.", 0, 1, category);
733          case -934964668: /*reason*/  return new Property("reason", "CodeableConcept", "A code supporting the understanding of the adjudication result and explaining variance from expected amount.", 0, 1, reason);
734          case -1413853096: /*amount*/  return new Property("amount", "Money", "Monetary amount associated with the category.", 0, 1, amount);
735          case 111972721: /*value*/  return new Property("value", "decimal", "A non-monetary value associated with the category. Mutually exclusive to the amount element above.", 0, 1, value);
736          default: return super.getNamedProperty(_hash, _name, _checkValid);
737          }
738
739        }
740
741      @Override
742      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
743        switch (hash) {
744        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
745        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept
746        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
747        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
748        default: return super.getProperty(hash, name, checkValid);
749        }
750
751      }
752
753      @Override
754      public Base setProperty(int hash, String name, Base value) throws FHIRException {
755        switch (hash) {
756        case 50511102: // category
757          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
758          return value;
759        case -934964668: // reason
760          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
761          return value;
762        case -1413853096: // amount
763          this.amount = TypeConvertor.castToMoney(value); // Money
764          return value;
765        case 111972721: // value
766          this.value = TypeConvertor.castToDecimal(value); // DecimalType
767          return value;
768        default: return super.setProperty(hash, name, value);
769        }
770
771      }
772
773      @Override
774      public Base setProperty(String name, Base value) throws FHIRException {
775        if (name.equals("category")) {
776          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
777        } else if (name.equals("reason")) {
778          this.reason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
779        } else if (name.equals("amount")) {
780          this.amount = TypeConvertor.castToMoney(value); // Money
781        } else if (name.equals("value")) {
782          this.value = TypeConvertor.castToDecimal(value); // DecimalType
783        } else
784          return super.setProperty(name, value);
785        return value;
786      }
787
788      @Override
789      public Base makeProperty(int hash, String name) throws FHIRException {
790        switch (hash) {
791        case 50511102:  return getCategory();
792        case -934964668:  return getReason();
793        case -1413853096:  return getAmount();
794        case 111972721:  return getValueElement();
795        default: return super.makeProperty(hash, name);
796        }
797
798      }
799
800      @Override
801      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
802        switch (hash) {
803        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
804        case -934964668: /*reason*/ return new String[] {"CodeableConcept"};
805        case -1413853096: /*amount*/ return new String[] {"Money"};
806        case 111972721: /*value*/ return new String[] {"decimal"};
807        default: return super.getTypesForProperty(hash, name);
808        }
809
810      }
811
812      @Override
813      public Base addChild(String name) throws FHIRException {
814        if (name.equals("category")) {
815          this.category = new CodeableConcept();
816          return this.category;
817        }
818        else if (name.equals("reason")) {
819          this.reason = new CodeableConcept();
820          return this.reason;
821        }
822        else if (name.equals("amount")) {
823          this.amount = new Money();
824          return this.amount;
825        }
826        else if (name.equals("value")) {
827          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.adjudication.value");
828        }
829        else
830          return super.addChild(name);
831      }
832
833      public AdjudicationComponent copy() {
834        AdjudicationComponent dst = new AdjudicationComponent();
835        copyValues(dst);
836        return dst;
837      }
838
839      public void copyValues(AdjudicationComponent dst) {
840        super.copyValues(dst);
841        dst.category = category == null ? null : category.copy();
842        dst.reason = reason == null ? null : reason.copy();
843        dst.amount = amount == null ? null : amount.copy();
844        dst.value = value == null ? null : value.copy();
845      }
846
847      @Override
848      public boolean equalsDeep(Base other_) {
849        if (!super.equalsDeep(other_))
850          return false;
851        if (!(other_ instanceof AdjudicationComponent))
852          return false;
853        AdjudicationComponent o = (AdjudicationComponent) other_;
854        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
855           && compareDeep(value, o.value, true);
856      }
857
858      @Override
859      public boolean equalsShallow(Base other_) {
860        if (!super.equalsShallow(other_))
861          return false;
862        if (!(other_ instanceof AdjudicationComponent))
863          return false;
864        AdjudicationComponent o = (AdjudicationComponent) other_;
865        return compareValues(value, o.value, true);
866      }
867
868      public boolean isEmpty() {
869        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, reason, amount
870          , value);
871      }
872
873  public String fhirType() {
874    return "ClaimResponse.item.adjudication";
875
876  }
877
878  }
879
880    @Block()
881    public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement {
882        /**
883         * A number to uniquely reference the claim detail entry.
884         */
885        @Child(name = "detailSequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false)
886        @Description(shortDefinition="Claim detail instance identifier", formalDefinition="A number to uniquely reference the claim detail entry." )
887        protected PositiveIntType detailSequence;
888
889        /**
890         * The numbers associated with notes below which apply to the adjudication of this item.
891         */
892        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
893        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
894        protected List<PositiveIntType> noteNumber;
895
896        /**
897         * The result of the claim, predetermination, or preauthorization adjudication.
898         */
899        @Child(name = "decision", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
900        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
901        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
902        protected CodeableConcept decision;
903
904        /**
905         * The adjudication results.
906         */
907        @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
908        @Description(shortDefinition="Detail level adjudication details", formalDefinition="The adjudication results." )
909        protected List<AdjudicationComponent> adjudication;
910
911        /**
912         * A sub-detail adjudication of a simple product or service.
913         */
914        @Child(name = "subDetail", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
915        @Description(shortDefinition="Adjudication for claim sub-details", formalDefinition="A sub-detail adjudication of a simple product or service." )
916        protected List<SubDetailComponent> subDetail;
917
918        private static final long serialVersionUID = -271758028L;
919
920    /**
921     * Constructor
922     */
923      public ItemDetailComponent() {
924        super();
925      }
926
927    /**
928     * Constructor
929     */
930      public ItemDetailComponent(int detailSequence) {
931        super();
932        this.setDetailSequence(detailSequence);
933      }
934
935        /**
936         * @return {@link #detailSequence} (A number to uniquely reference the claim detail entry.). This is the underlying object with id, value and extensions. The accessor "getDetailSequence" gives direct access to the value
937         */
938        public PositiveIntType getDetailSequenceElement() { 
939          if (this.detailSequence == null)
940            if (Configuration.errorOnAutoCreate())
941              throw new Error("Attempt to auto-create ItemDetailComponent.detailSequence");
942            else if (Configuration.doAutoCreate())
943              this.detailSequence = new PositiveIntType(); // bb
944          return this.detailSequence;
945        }
946
947        public boolean hasDetailSequenceElement() { 
948          return this.detailSequence != null && !this.detailSequence.isEmpty();
949        }
950
951        public boolean hasDetailSequence() { 
952          return this.detailSequence != null && !this.detailSequence.isEmpty();
953        }
954
955        /**
956         * @param value {@link #detailSequence} (A number to uniquely reference the claim detail entry.). This is the underlying object with id, value and extensions. The accessor "getDetailSequence" gives direct access to the value
957         */
958        public ItemDetailComponent setDetailSequenceElement(PositiveIntType value) { 
959          this.detailSequence = value;
960          return this;
961        }
962
963        /**
964         * @return A number to uniquely reference the claim detail entry.
965         */
966        public int getDetailSequence() { 
967          return this.detailSequence == null || this.detailSequence.isEmpty() ? 0 : this.detailSequence.getValue();
968        }
969
970        /**
971         * @param value A number to uniquely reference the claim detail entry.
972         */
973        public ItemDetailComponent setDetailSequence(int value) { 
974            if (this.detailSequence == null)
975              this.detailSequence = new PositiveIntType();
976            this.detailSequence.setValue(value);
977          return this;
978        }
979
980        /**
981         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
982         */
983        public List<PositiveIntType> getNoteNumber() { 
984          if (this.noteNumber == null)
985            this.noteNumber = new ArrayList<PositiveIntType>();
986          return this.noteNumber;
987        }
988
989        /**
990         * @return Returns a reference to <code>this</code> for easy method chaining
991         */
992        public ItemDetailComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
993          this.noteNumber = theNoteNumber;
994          return this;
995        }
996
997        public boolean hasNoteNumber() { 
998          if (this.noteNumber == null)
999            return false;
1000          for (PositiveIntType item : this.noteNumber)
1001            if (!item.isEmpty())
1002              return true;
1003          return false;
1004        }
1005
1006        /**
1007         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1008         */
1009        public PositiveIntType addNoteNumberElement() {//2 
1010          PositiveIntType t = new PositiveIntType();
1011          if (this.noteNumber == null)
1012            this.noteNumber = new ArrayList<PositiveIntType>();
1013          this.noteNumber.add(t);
1014          return t;
1015        }
1016
1017        /**
1018         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1019         */
1020        public ItemDetailComponent addNoteNumber(int value) { //1
1021          PositiveIntType t = new PositiveIntType();
1022          t.setValue(value);
1023          if (this.noteNumber == null)
1024            this.noteNumber = new ArrayList<PositiveIntType>();
1025          this.noteNumber.add(t);
1026          return this;
1027        }
1028
1029        /**
1030         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1031         */
1032        public boolean hasNoteNumber(int value) { 
1033          if (this.noteNumber == null)
1034            return false;
1035          for (PositiveIntType v : this.noteNumber)
1036            if (v.getValue().equals(value)) // positiveInt
1037              return true;
1038          return false;
1039        }
1040
1041        /**
1042         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
1043         */
1044        public CodeableConcept getDecision() { 
1045          if (this.decision == null)
1046            if (Configuration.errorOnAutoCreate())
1047              throw new Error("Attempt to auto-create ItemDetailComponent.decision");
1048            else if (Configuration.doAutoCreate())
1049              this.decision = new CodeableConcept(); // cc
1050          return this.decision;
1051        }
1052
1053        public boolean hasDecision() { 
1054          return this.decision != null && !this.decision.isEmpty();
1055        }
1056
1057        /**
1058         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
1059         */
1060        public ItemDetailComponent setDecision(CodeableConcept value) { 
1061          this.decision = value;
1062          return this;
1063        }
1064
1065        /**
1066         * @return {@link #adjudication} (The adjudication results.)
1067         */
1068        public List<AdjudicationComponent> getAdjudication() { 
1069          if (this.adjudication == null)
1070            this.adjudication = new ArrayList<AdjudicationComponent>();
1071          return this.adjudication;
1072        }
1073
1074        /**
1075         * @return Returns a reference to <code>this</code> for easy method chaining
1076         */
1077        public ItemDetailComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
1078          this.adjudication = theAdjudication;
1079          return this;
1080        }
1081
1082        public boolean hasAdjudication() { 
1083          if (this.adjudication == null)
1084            return false;
1085          for (AdjudicationComponent item : this.adjudication)
1086            if (!item.isEmpty())
1087              return true;
1088          return false;
1089        }
1090
1091        public AdjudicationComponent addAdjudication() { //3
1092          AdjudicationComponent t = new AdjudicationComponent();
1093          if (this.adjudication == null)
1094            this.adjudication = new ArrayList<AdjudicationComponent>();
1095          this.adjudication.add(t);
1096          return t;
1097        }
1098
1099        public ItemDetailComponent addAdjudication(AdjudicationComponent t) { //3
1100          if (t == null)
1101            return this;
1102          if (this.adjudication == null)
1103            this.adjudication = new ArrayList<AdjudicationComponent>();
1104          this.adjudication.add(t);
1105          return this;
1106        }
1107
1108        /**
1109         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
1110         */
1111        public AdjudicationComponent getAdjudicationFirstRep() { 
1112          if (getAdjudication().isEmpty()) {
1113            addAdjudication();
1114          }
1115          return getAdjudication().get(0);
1116        }
1117
1118        /**
1119         * @return {@link #subDetail} (A sub-detail adjudication of a simple product or service.)
1120         */
1121        public List<SubDetailComponent> getSubDetail() { 
1122          if (this.subDetail == null)
1123            this.subDetail = new ArrayList<SubDetailComponent>();
1124          return this.subDetail;
1125        }
1126
1127        /**
1128         * @return Returns a reference to <code>this</code> for easy method chaining
1129         */
1130        public ItemDetailComponent setSubDetail(List<SubDetailComponent> theSubDetail) { 
1131          this.subDetail = theSubDetail;
1132          return this;
1133        }
1134
1135        public boolean hasSubDetail() { 
1136          if (this.subDetail == null)
1137            return false;
1138          for (SubDetailComponent item : this.subDetail)
1139            if (!item.isEmpty())
1140              return true;
1141          return false;
1142        }
1143
1144        public SubDetailComponent addSubDetail() { //3
1145          SubDetailComponent t = new SubDetailComponent();
1146          if (this.subDetail == null)
1147            this.subDetail = new ArrayList<SubDetailComponent>();
1148          this.subDetail.add(t);
1149          return t;
1150        }
1151
1152        public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3
1153          if (t == null)
1154            return this;
1155          if (this.subDetail == null)
1156            this.subDetail = new ArrayList<SubDetailComponent>();
1157          this.subDetail.add(t);
1158          return this;
1159        }
1160
1161        /**
1162         * @return The first repetition of repeating field {@link #subDetail}, creating it if it does not already exist {3}
1163         */
1164        public SubDetailComponent getSubDetailFirstRep() { 
1165          if (getSubDetail().isEmpty()) {
1166            addSubDetail();
1167          }
1168          return getSubDetail().get(0);
1169        }
1170
1171        protected void listChildren(List<Property> children) {
1172          super.listChildren(children);
1173          children.add(new Property("detailSequence", "positiveInt", "A number to uniquely reference the claim detail entry.", 0, 1, detailSequence));
1174          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
1175          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
1176          children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
1177          children.add(new Property("subDetail", "", "A sub-detail adjudication of a simple product or service.", 0, java.lang.Integer.MAX_VALUE, subDetail));
1178        }
1179
1180        @Override
1181        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1182          switch (_hash) {
1183          case 1321472818: /*detailSequence*/  return new Property("detailSequence", "positiveInt", "A number to uniquely reference the claim detail entry.", 0, 1, detailSequence);
1184          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
1185          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
1186          case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication);
1187          case -828829007: /*subDetail*/  return new Property("subDetail", "", "A sub-detail adjudication of a simple product or service.", 0, java.lang.Integer.MAX_VALUE, subDetail);
1188          default: return super.getNamedProperty(_hash, _name, _checkValid);
1189          }
1190
1191        }
1192
1193      @Override
1194      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1195        switch (hash) {
1196        case 1321472818: /*detailSequence*/ return this.detailSequence == null ? new Base[0] : new Base[] {this.detailSequence}; // PositiveIntType
1197        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
1198        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
1199        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
1200        case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent
1201        default: return super.getProperty(hash, name, checkValid);
1202        }
1203
1204      }
1205
1206      @Override
1207      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1208        switch (hash) {
1209        case 1321472818: // detailSequence
1210          this.detailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1211          return value;
1212        case -1110033957: // noteNumber
1213          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
1214          return value;
1215        case 565719004: // decision
1216          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1217          return value;
1218        case -231349275: // adjudication
1219          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
1220          return value;
1221        case -828829007: // subDetail
1222          this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent
1223          return value;
1224        default: return super.setProperty(hash, name, value);
1225        }
1226
1227      }
1228
1229      @Override
1230      public Base setProperty(String name, Base value) throws FHIRException {
1231        if (name.equals("detailSequence")) {
1232          this.detailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1233        } else if (name.equals("noteNumber")) {
1234          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
1235        } else if (name.equals("decision")) {
1236          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1237        } else if (name.equals("adjudication")) {
1238          this.getAdjudication().add((AdjudicationComponent) value);
1239        } else if (name.equals("subDetail")) {
1240          this.getSubDetail().add((SubDetailComponent) value);
1241        } else
1242          return super.setProperty(name, value);
1243        return value;
1244      }
1245
1246      @Override
1247      public Base makeProperty(int hash, String name) throws FHIRException {
1248        switch (hash) {
1249        case 1321472818:  return getDetailSequenceElement();
1250        case -1110033957:  return addNoteNumberElement();
1251        case 565719004:  return getDecision();
1252        case -231349275:  return addAdjudication(); 
1253        case -828829007:  return addSubDetail(); 
1254        default: return super.makeProperty(hash, name);
1255        }
1256
1257      }
1258
1259      @Override
1260      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1261        switch (hash) {
1262        case 1321472818: /*detailSequence*/ return new String[] {"positiveInt"};
1263        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
1264        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
1265        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
1266        case -828829007: /*subDetail*/ return new String[] {};
1267        default: return super.getTypesForProperty(hash, name);
1268        }
1269
1270      }
1271
1272      @Override
1273      public Base addChild(String name) throws FHIRException {
1274        if (name.equals("detailSequence")) {
1275          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.detail.detailSequence");
1276        }
1277        else if (name.equals("noteNumber")) {
1278          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.detail.noteNumber");
1279        }
1280        else if (name.equals("decision")) {
1281          this.decision = new CodeableConcept();
1282          return this.decision;
1283        }
1284        else if (name.equals("adjudication")) {
1285          return addAdjudication();
1286        }
1287        else if (name.equals("subDetail")) {
1288          return addSubDetail();
1289        }
1290        else
1291          return super.addChild(name);
1292      }
1293
1294      public ItemDetailComponent copy() {
1295        ItemDetailComponent dst = new ItemDetailComponent();
1296        copyValues(dst);
1297        return dst;
1298      }
1299
1300      public void copyValues(ItemDetailComponent dst) {
1301        super.copyValues(dst);
1302        dst.detailSequence = detailSequence == null ? null : detailSequence.copy();
1303        if (noteNumber != null) {
1304          dst.noteNumber = new ArrayList<PositiveIntType>();
1305          for (PositiveIntType i : noteNumber)
1306            dst.noteNumber.add(i.copy());
1307        };
1308        dst.decision = decision == null ? null : decision.copy();
1309        if (adjudication != null) {
1310          dst.adjudication = new ArrayList<AdjudicationComponent>();
1311          for (AdjudicationComponent i : adjudication)
1312            dst.adjudication.add(i.copy());
1313        };
1314        if (subDetail != null) {
1315          dst.subDetail = new ArrayList<SubDetailComponent>();
1316          for (SubDetailComponent i : subDetail)
1317            dst.subDetail.add(i.copy());
1318        };
1319      }
1320
1321      @Override
1322      public boolean equalsDeep(Base other_) {
1323        if (!super.equalsDeep(other_))
1324          return false;
1325        if (!(other_ instanceof ItemDetailComponent))
1326          return false;
1327        ItemDetailComponent o = (ItemDetailComponent) other_;
1328        return compareDeep(detailSequence, o.detailSequence, true) && compareDeep(noteNumber, o.noteNumber, true)
1329           && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(subDetail, o.subDetail, true)
1330          ;
1331      }
1332
1333      @Override
1334      public boolean equalsShallow(Base other_) {
1335        if (!super.equalsShallow(other_))
1336          return false;
1337        if (!(other_ instanceof ItemDetailComponent))
1338          return false;
1339        ItemDetailComponent o = (ItemDetailComponent) other_;
1340        return compareValues(detailSequence, o.detailSequence, true) && compareValues(noteNumber, o.noteNumber, true)
1341          ;
1342      }
1343
1344      public boolean isEmpty() {
1345        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(detailSequence, noteNumber
1346          , decision, adjudication, subDetail);
1347      }
1348
1349  public String fhirType() {
1350    return "ClaimResponse.item.detail";
1351
1352  }
1353
1354  }
1355
1356    @Block()
1357    public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement {
1358        /**
1359         * A number to uniquely reference the claim sub-detail entry.
1360         */
1361        @Child(name = "subDetailSequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1362        @Description(shortDefinition="Claim sub-detail instance identifier", formalDefinition="A number to uniquely reference the claim sub-detail entry." )
1363        protected PositiveIntType subDetailSequence;
1364
1365        /**
1366         * The numbers associated with notes below which apply to the adjudication of this item.
1367         */
1368        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1369        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
1370        protected List<PositiveIntType> noteNumber;
1371
1372        /**
1373         * The result of the claim, predetermination, or preauthorization adjudication.
1374         */
1375        @Child(name = "decision", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1376        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
1377        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
1378        protected CodeableConcept decision;
1379
1380        /**
1381         * The adjudication results.
1382         */
1383        @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1384        @Description(shortDefinition="Subdetail level adjudication details", formalDefinition="The adjudication results." )
1385        protected List<AdjudicationComponent> adjudication;
1386
1387        private static final long serialVersionUID = 861687209L;
1388
1389    /**
1390     * Constructor
1391     */
1392      public SubDetailComponent() {
1393        super();
1394      }
1395
1396    /**
1397     * Constructor
1398     */
1399      public SubDetailComponent(int subDetailSequence) {
1400        super();
1401        this.setSubDetailSequence(subDetailSequence);
1402      }
1403
1404        /**
1405         * @return {@link #subDetailSequence} (A number to uniquely reference the claim sub-detail entry.). This is the underlying object with id, value and extensions. The accessor "getSubDetailSequence" gives direct access to the value
1406         */
1407        public PositiveIntType getSubDetailSequenceElement() { 
1408          if (this.subDetailSequence == null)
1409            if (Configuration.errorOnAutoCreate())
1410              throw new Error("Attempt to auto-create SubDetailComponent.subDetailSequence");
1411            else if (Configuration.doAutoCreate())
1412              this.subDetailSequence = new PositiveIntType(); // bb
1413          return this.subDetailSequence;
1414        }
1415
1416        public boolean hasSubDetailSequenceElement() { 
1417          return this.subDetailSequence != null && !this.subDetailSequence.isEmpty();
1418        }
1419
1420        public boolean hasSubDetailSequence() { 
1421          return this.subDetailSequence != null && !this.subDetailSequence.isEmpty();
1422        }
1423
1424        /**
1425         * @param value {@link #subDetailSequence} (A number to uniquely reference the claim sub-detail entry.). This is the underlying object with id, value and extensions. The accessor "getSubDetailSequence" gives direct access to the value
1426         */
1427        public SubDetailComponent setSubDetailSequenceElement(PositiveIntType value) { 
1428          this.subDetailSequence = value;
1429          return this;
1430        }
1431
1432        /**
1433         * @return A number to uniquely reference the claim sub-detail entry.
1434         */
1435        public int getSubDetailSequence() { 
1436          return this.subDetailSequence == null || this.subDetailSequence.isEmpty() ? 0 : this.subDetailSequence.getValue();
1437        }
1438
1439        /**
1440         * @param value A number to uniquely reference the claim sub-detail entry.
1441         */
1442        public SubDetailComponent setSubDetailSequence(int value) { 
1443            if (this.subDetailSequence == null)
1444              this.subDetailSequence = new PositiveIntType();
1445            this.subDetailSequence.setValue(value);
1446          return this;
1447        }
1448
1449        /**
1450         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1451         */
1452        public List<PositiveIntType> getNoteNumber() { 
1453          if (this.noteNumber == null)
1454            this.noteNumber = new ArrayList<PositiveIntType>();
1455          return this.noteNumber;
1456        }
1457
1458        /**
1459         * @return Returns a reference to <code>this</code> for easy method chaining
1460         */
1461        public SubDetailComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
1462          this.noteNumber = theNoteNumber;
1463          return this;
1464        }
1465
1466        public boolean hasNoteNumber() { 
1467          if (this.noteNumber == null)
1468            return false;
1469          for (PositiveIntType item : this.noteNumber)
1470            if (!item.isEmpty())
1471              return true;
1472          return false;
1473        }
1474
1475        /**
1476         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1477         */
1478        public PositiveIntType addNoteNumberElement() {//2 
1479          PositiveIntType t = new PositiveIntType();
1480          if (this.noteNumber == null)
1481            this.noteNumber = new ArrayList<PositiveIntType>();
1482          this.noteNumber.add(t);
1483          return t;
1484        }
1485
1486        /**
1487         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1488         */
1489        public SubDetailComponent addNoteNumber(int value) { //1
1490          PositiveIntType t = new PositiveIntType();
1491          t.setValue(value);
1492          if (this.noteNumber == null)
1493            this.noteNumber = new ArrayList<PositiveIntType>();
1494          this.noteNumber.add(t);
1495          return this;
1496        }
1497
1498        /**
1499         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
1500         */
1501        public boolean hasNoteNumber(int value) { 
1502          if (this.noteNumber == null)
1503            return false;
1504          for (PositiveIntType v : this.noteNumber)
1505            if (v.getValue().equals(value)) // positiveInt
1506              return true;
1507          return false;
1508        }
1509
1510        /**
1511         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
1512         */
1513        public CodeableConcept getDecision() { 
1514          if (this.decision == null)
1515            if (Configuration.errorOnAutoCreate())
1516              throw new Error("Attempt to auto-create SubDetailComponent.decision");
1517            else if (Configuration.doAutoCreate())
1518              this.decision = new CodeableConcept(); // cc
1519          return this.decision;
1520        }
1521
1522        public boolean hasDecision() { 
1523          return this.decision != null && !this.decision.isEmpty();
1524        }
1525
1526        /**
1527         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
1528         */
1529        public SubDetailComponent setDecision(CodeableConcept value) { 
1530          this.decision = value;
1531          return this;
1532        }
1533
1534        /**
1535         * @return {@link #adjudication} (The adjudication results.)
1536         */
1537        public List<AdjudicationComponent> getAdjudication() { 
1538          if (this.adjudication == null)
1539            this.adjudication = new ArrayList<AdjudicationComponent>();
1540          return this.adjudication;
1541        }
1542
1543        /**
1544         * @return Returns a reference to <code>this</code> for easy method chaining
1545         */
1546        public SubDetailComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
1547          this.adjudication = theAdjudication;
1548          return this;
1549        }
1550
1551        public boolean hasAdjudication() { 
1552          if (this.adjudication == null)
1553            return false;
1554          for (AdjudicationComponent item : this.adjudication)
1555            if (!item.isEmpty())
1556              return true;
1557          return false;
1558        }
1559
1560        public AdjudicationComponent addAdjudication() { //3
1561          AdjudicationComponent t = new AdjudicationComponent();
1562          if (this.adjudication == null)
1563            this.adjudication = new ArrayList<AdjudicationComponent>();
1564          this.adjudication.add(t);
1565          return t;
1566        }
1567
1568        public SubDetailComponent addAdjudication(AdjudicationComponent t) { //3
1569          if (t == null)
1570            return this;
1571          if (this.adjudication == null)
1572            this.adjudication = new ArrayList<AdjudicationComponent>();
1573          this.adjudication.add(t);
1574          return this;
1575        }
1576
1577        /**
1578         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
1579         */
1580        public AdjudicationComponent getAdjudicationFirstRep() { 
1581          if (getAdjudication().isEmpty()) {
1582            addAdjudication();
1583          }
1584          return getAdjudication().get(0);
1585        }
1586
1587        protected void listChildren(List<Property> children) {
1588          super.listChildren(children);
1589          children.add(new Property("subDetailSequence", "positiveInt", "A number to uniquely reference the claim sub-detail entry.", 0, 1, subDetailSequence));
1590          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
1591          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
1592          children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
1593        }
1594
1595        @Override
1596        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1597          switch (_hash) {
1598          case -855462510: /*subDetailSequence*/  return new Property("subDetailSequence", "positiveInt", "A number to uniquely reference the claim sub-detail entry.", 0, 1, subDetailSequence);
1599          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
1600          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
1601          case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication);
1602          default: return super.getNamedProperty(_hash, _name, _checkValid);
1603          }
1604
1605        }
1606
1607      @Override
1608      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1609        switch (hash) {
1610        case -855462510: /*subDetailSequence*/ return this.subDetailSequence == null ? new Base[0] : new Base[] {this.subDetailSequence}; // PositiveIntType
1611        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
1612        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
1613        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
1614        default: return super.getProperty(hash, name, checkValid);
1615        }
1616
1617      }
1618
1619      @Override
1620      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1621        switch (hash) {
1622        case -855462510: // subDetailSequence
1623          this.subDetailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1624          return value;
1625        case -1110033957: // noteNumber
1626          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
1627          return value;
1628        case 565719004: // decision
1629          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1630          return value;
1631        case -231349275: // adjudication
1632          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
1633          return value;
1634        default: return super.setProperty(hash, name, value);
1635        }
1636
1637      }
1638
1639      @Override
1640      public Base setProperty(String name, Base value) throws FHIRException {
1641        if (name.equals("subDetailSequence")) {
1642          this.subDetailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1643        } else if (name.equals("noteNumber")) {
1644          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
1645        } else if (name.equals("decision")) {
1646          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1647        } else if (name.equals("adjudication")) {
1648          this.getAdjudication().add((AdjudicationComponent) value);
1649        } else
1650          return super.setProperty(name, value);
1651        return value;
1652      }
1653
1654      @Override
1655      public Base makeProperty(int hash, String name) throws FHIRException {
1656        switch (hash) {
1657        case -855462510:  return getSubDetailSequenceElement();
1658        case -1110033957:  return addNoteNumberElement();
1659        case 565719004:  return getDecision();
1660        case -231349275:  return addAdjudication(); 
1661        default: return super.makeProperty(hash, name);
1662        }
1663
1664      }
1665
1666      @Override
1667      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1668        switch (hash) {
1669        case -855462510: /*subDetailSequence*/ return new String[] {"positiveInt"};
1670        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
1671        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
1672        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
1673        default: return super.getTypesForProperty(hash, name);
1674        }
1675
1676      }
1677
1678      @Override
1679      public Base addChild(String name) throws FHIRException {
1680        if (name.equals("subDetailSequence")) {
1681          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.detail.subDetail.subDetailSequence");
1682        }
1683        else if (name.equals("noteNumber")) {
1684          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.item.detail.subDetail.noteNumber");
1685        }
1686        else if (name.equals("decision")) {
1687          this.decision = new CodeableConcept();
1688          return this.decision;
1689        }
1690        else if (name.equals("adjudication")) {
1691          return addAdjudication();
1692        }
1693        else
1694          return super.addChild(name);
1695      }
1696
1697      public SubDetailComponent copy() {
1698        SubDetailComponent dst = new SubDetailComponent();
1699        copyValues(dst);
1700        return dst;
1701      }
1702
1703      public void copyValues(SubDetailComponent dst) {
1704        super.copyValues(dst);
1705        dst.subDetailSequence = subDetailSequence == null ? null : subDetailSequence.copy();
1706        if (noteNumber != null) {
1707          dst.noteNumber = new ArrayList<PositiveIntType>();
1708          for (PositiveIntType i : noteNumber)
1709            dst.noteNumber.add(i.copy());
1710        };
1711        dst.decision = decision == null ? null : decision.copy();
1712        if (adjudication != null) {
1713          dst.adjudication = new ArrayList<AdjudicationComponent>();
1714          for (AdjudicationComponent i : adjudication)
1715            dst.adjudication.add(i.copy());
1716        };
1717      }
1718
1719      @Override
1720      public boolean equalsDeep(Base other_) {
1721        if (!super.equalsDeep(other_))
1722          return false;
1723        if (!(other_ instanceof SubDetailComponent))
1724          return false;
1725        SubDetailComponent o = (SubDetailComponent) other_;
1726        return compareDeep(subDetailSequence, o.subDetailSequence, true) && compareDeep(noteNumber, o.noteNumber, true)
1727           && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true);
1728      }
1729
1730      @Override
1731      public boolean equalsShallow(Base other_) {
1732        if (!super.equalsShallow(other_))
1733          return false;
1734        if (!(other_ instanceof SubDetailComponent))
1735          return false;
1736        SubDetailComponent o = (SubDetailComponent) other_;
1737        return compareValues(subDetailSequence, o.subDetailSequence, true) && compareValues(noteNumber, o.noteNumber, true)
1738          ;
1739      }
1740
1741      public boolean isEmpty() {
1742        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(subDetailSequence, noteNumber
1743          , decision, adjudication);
1744      }
1745
1746  public String fhirType() {
1747    return "ClaimResponse.item.detail.subDetail";
1748
1749  }
1750
1751  }
1752
1753    @Block()
1754    public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement {
1755        /**
1756         * Claim items which this service line is intended to replace.
1757         */
1758        @Child(name = "itemSequence", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1759        @Description(shortDefinition="Item sequence number", formalDefinition="Claim items which this service line is intended to replace." )
1760        protected List<PositiveIntType> itemSequence;
1761
1762        /**
1763         * The sequence number of the details within the claim item which this line is intended to replace.
1764         */
1765        @Child(name = "detailSequence", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1766        @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the details within the claim item which this line is intended to replace." )
1767        protected List<PositiveIntType> detailSequence;
1768
1769        /**
1770         * The sequence number of the sub-details within the details within the claim item which this line is intended to replace.
1771         */
1772        @Child(name = "subdetailSequence", type = {PositiveIntType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1773        @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the sub-details within the details within the claim item which this line is intended to replace." )
1774        protected List<PositiveIntType> subdetailSequence;
1775
1776        /**
1777         * The providers who are authorized for the services rendered to the patient.
1778         */
1779        @Child(name = "provider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1780        @Description(shortDefinition="Authorized providers", formalDefinition="The providers who are authorized for the services rendered to the patient." )
1781        protected List<Reference> provider;
1782
1783        /**
1784         * The type of revenue or cost center providing the product and/or service.
1785         */
1786        @Child(name = "revenue", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
1787        @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of revenue or cost center providing the product and/or service." )
1788        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center")
1789        protected CodeableConcept revenue;
1790
1791        /**
1792         * When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.
1793         */
1794        @Child(name = "productOrService", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
1795        @Description(shortDefinition="Billing, service, product, or drug code", formalDefinition="When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used." )
1796        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
1797        protected CodeableConcept productOrService;
1798
1799        /**
1800         * This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.
1801         */
1802        @Child(name = "productOrServiceEnd", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
1803        @Description(shortDefinition="End of a range of codes", formalDefinition="This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims." )
1804        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
1805        protected CodeableConcept productOrServiceEnd;
1806
1807        /**
1808         * Item typification or modifiers codes to convey additional context for the product or service.
1809         */
1810        @Child(name = "modifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1811        @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes to convey additional context for the product or service." )
1812        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers")
1813        protected List<CodeableConcept> modifier;
1814
1815        /**
1816         * Identifies the program under which this may be recovered.
1817         */
1818        @Child(name = "programCode", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1819        @Description(shortDefinition="Program the product or service is provided under", formalDefinition="Identifies the program under which this may be recovered." )
1820        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-program-code")
1821        protected List<CodeableConcept> programCode;
1822
1823        /**
1824         * The date or dates when the service or product was supplied, performed or completed.
1825         */
1826        @Child(name = "serviced", type = {DateType.class, Period.class}, order=10, min=0, max=1, modifier=false, summary=false)
1827        @Description(shortDefinition="Date or dates of service or product delivery", formalDefinition="The date or dates when the service or product was supplied, performed or completed." )
1828        protected DataType serviced;
1829
1830        /**
1831         * Where the product or service was provided.
1832         */
1833        @Child(name = "location", type = {CodeableConcept.class, Address.class, Location.class}, order=11, min=0, max=1, modifier=false, summary=false)
1834        @Description(shortDefinition="Place of service or where product was supplied", formalDefinition="Where the product or service was provided." )
1835        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-place")
1836        protected DataType location;
1837
1838        /**
1839         * The number of repetitions of a service or product.
1840         */
1841        @Child(name = "quantity", type = {Quantity.class}, order=12, min=0, max=1, modifier=false, summary=false)
1842        @Description(shortDefinition="Count of products or services", formalDefinition="The number of repetitions of a service or product." )
1843        protected Quantity quantity;
1844
1845        /**
1846         * If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.
1847         */
1848        @Child(name = "unitPrice", type = {Money.class}, order=13, min=0, max=1, modifier=false, summary=false)
1849        @Description(shortDefinition="Fee, charge or cost per item", formalDefinition="If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group." )
1850        protected Money unitPrice;
1851
1852        /**
1853         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
1854         */
1855        @Child(name = "factor", type = {DecimalType.class}, order=14, min=0, max=1, modifier=false, summary=false)
1856        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
1857        protected DecimalType factor;
1858
1859        /**
1860         * The total of taxes applicable for this product or service.
1861         */
1862        @Child(name = "tax", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=false)
1863        @Description(shortDefinition="Total tax", formalDefinition="The total of taxes applicable for this product or service." )
1864        protected Money tax;
1865
1866        /**
1867         * The quantity times the unit price for an additional service or product or charge.
1868         */
1869        @Child(name = "net", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=false)
1870        @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an additional service or product or charge." )
1871        protected Money net;
1872
1873        /**
1874         * Physical location where the service is performed or applies.
1875         */
1876        @Child(name = "bodySite", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1877        @Description(shortDefinition="Anatomical location", formalDefinition="Physical location where the service is performed or applies." )
1878        protected List<BodySiteComponent> bodySite;
1879
1880        /**
1881         * The numbers associated with notes below which apply to the adjudication of this item.
1882         */
1883        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1884        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
1885        protected List<PositiveIntType> noteNumber;
1886
1887        /**
1888         * The result of the claim, predetermination, or preauthorization adjudication.
1889         */
1890        @Child(name = "decision", type = {CodeableConcept.class}, order=19, min=0, max=1, modifier=false, summary=false)
1891        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
1892        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
1893        protected CodeableConcept decision;
1894
1895        /**
1896         * The adjudication results.
1897         */
1898        @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1899        @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudication results." )
1900        protected List<AdjudicationComponent> adjudication;
1901
1902        /**
1903         * The second-tier service adjudications for payor added services.
1904         */
1905        @Child(name = "detail", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1906        @Description(shortDefinition="Insurer added line details", formalDefinition="The second-tier service adjudications for payor added services." )
1907        protected List<AddedItemDetailComponent> detail;
1908
1909        private static final long serialVersionUID = 1717713947L;
1910
1911    /**
1912     * Constructor
1913     */
1914      public AddedItemComponent() {
1915        super();
1916      }
1917
1918        /**
1919         * @return {@link #itemSequence} (Claim items which this service line is intended to replace.)
1920         */
1921        public List<PositiveIntType> getItemSequence() { 
1922          if (this.itemSequence == null)
1923            this.itemSequence = new ArrayList<PositiveIntType>();
1924          return this.itemSequence;
1925        }
1926
1927        /**
1928         * @return Returns a reference to <code>this</code> for easy method chaining
1929         */
1930        public AddedItemComponent setItemSequence(List<PositiveIntType> theItemSequence) { 
1931          this.itemSequence = theItemSequence;
1932          return this;
1933        }
1934
1935        public boolean hasItemSequence() { 
1936          if (this.itemSequence == null)
1937            return false;
1938          for (PositiveIntType item : this.itemSequence)
1939            if (!item.isEmpty())
1940              return true;
1941          return false;
1942        }
1943
1944        /**
1945         * @return {@link #itemSequence} (Claim items which this service line is intended to replace.)
1946         */
1947        public PositiveIntType addItemSequenceElement() {//2 
1948          PositiveIntType t = new PositiveIntType();
1949          if (this.itemSequence == null)
1950            this.itemSequence = new ArrayList<PositiveIntType>();
1951          this.itemSequence.add(t);
1952          return t;
1953        }
1954
1955        /**
1956         * @param value {@link #itemSequence} (Claim items which this service line is intended to replace.)
1957         */
1958        public AddedItemComponent addItemSequence(int value) { //1
1959          PositiveIntType t = new PositiveIntType();
1960          t.setValue(value);
1961          if (this.itemSequence == null)
1962            this.itemSequence = new ArrayList<PositiveIntType>();
1963          this.itemSequence.add(t);
1964          return this;
1965        }
1966
1967        /**
1968         * @param value {@link #itemSequence} (Claim items which this service line is intended to replace.)
1969         */
1970        public boolean hasItemSequence(int value) { 
1971          if (this.itemSequence == null)
1972            return false;
1973          for (PositiveIntType v : this.itemSequence)
1974            if (v.getValue().equals(value)) // positiveInt
1975              return true;
1976          return false;
1977        }
1978
1979        /**
1980         * @return {@link #detailSequence} (The sequence number of the details within the claim item which this line is intended to replace.)
1981         */
1982        public List<PositiveIntType> getDetailSequence() { 
1983          if (this.detailSequence == null)
1984            this.detailSequence = new ArrayList<PositiveIntType>();
1985          return this.detailSequence;
1986        }
1987
1988        /**
1989         * @return Returns a reference to <code>this</code> for easy method chaining
1990         */
1991        public AddedItemComponent setDetailSequence(List<PositiveIntType> theDetailSequence) { 
1992          this.detailSequence = theDetailSequence;
1993          return this;
1994        }
1995
1996        public boolean hasDetailSequence() { 
1997          if (this.detailSequence == null)
1998            return false;
1999          for (PositiveIntType item : this.detailSequence)
2000            if (!item.isEmpty())
2001              return true;
2002          return false;
2003        }
2004
2005        /**
2006         * @return {@link #detailSequence} (The sequence number of the details within the claim item which this line is intended to replace.)
2007         */
2008        public PositiveIntType addDetailSequenceElement() {//2 
2009          PositiveIntType t = new PositiveIntType();
2010          if (this.detailSequence == null)
2011            this.detailSequence = new ArrayList<PositiveIntType>();
2012          this.detailSequence.add(t);
2013          return t;
2014        }
2015
2016        /**
2017         * @param value {@link #detailSequence} (The sequence number of the details within the claim item which this line is intended to replace.)
2018         */
2019        public AddedItemComponent addDetailSequence(int value) { //1
2020          PositiveIntType t = new PositiveIntType();
2021          t.setValue(value);
2022          if (this.detailSequence == null)
2023            this.detailSequence = new ArrayList<PositiveIntType>();
2024          this.detailSequence.add(t);
2025          return this;
2026        }
2027
2028        /**
2029         * @param value {@link #detailSequence} (The sequence number of the details within the claim item which this line is intended to replace.)
2030         */
2031        public boolean hasDetailSequence(int value) { 
2032          if (this.detailSequence == null)
2033            return false;
2034          for (PositiveIntType v : this.detailSequence)
2035            if (v.getValue().equals(value)) // positiveInt
2036              return true;
2037          return false;
2038        }
2039
2040        /**
2041         * @return {@link #subdetailSequence} (The sequence number of the sub-details within the details within the claim item which this line is intended to replace.)
2042         */
2043        public List<PositiveIntType> getSubdetailSequence() { 
2044          if (this.subdetailSequence == null)
2045            this.subdetailSequence = new ArrayList<PositiveIntType>();
2046          return this.subdetailSequence;
2047        }
2048
2049        /**
2050         * @return Returns a reference to <code>this</code> for easy method chaining
2051         */
2052        public AddedItemComponent setSubdetailSequence(List<PositiveIntType> theSubdetailSequence) { 
2053          this.subdetailSequence = theSubdetailSequence;
2054          return this;
2055        }
2056
2057        public boolean hasSubdetailSequence() { 
2058          if (this.subdetailSequence == null)
2059            return false;
2060          for (PositiveIntType item : this.subdetailSequence)
2061            if (!item.isEmpty())
2062              return true;
2063          return false;
2064        }
2065
2066        /**
2067         * @return {@link #subdetailSequence} (The sequence number of the sub-details within the details within the claim item which this line is intended to replace.)
2068         */
2069        public PositiveIntType addSubdetailSequenceElement() {//2 
2070          PositiveIntType t = new PositiveIntType();
2071          if (this.subdetailSequence == null)
2072            this.subdetailSequence = new ArrayList<PositiveIntType>();
2073          this.subdetailSequence.add(t);
2074          return t;
2075        }
2076
2077        /**
2078         * @param value {@link #subdetailSequence} (The sequence number of the sub-details within the details within the claim item which this line is intended to replace.)
2079         */
2080        public AddedItemComponent addSubdetailSequence(int value) { //1
2081          PositiveIntType t = new PositiveIntType();
2082          t.setValue(value);
2083          if (this.subdetailSequence == null)
2084            this.subdetailSequence = new ArrayList<PositiveIntType>();
2085          this.subdetailSequence.add(t);
2086          return this;
2087        }
2088
2089        /**
2090         * @param value {@link #subdetailSequence} (The sequence number of the sub-details within the details within the claim item which this line is intended to replace.)
2091         */
2092        public boolean hasSubdetailSequence(int value) { 
2093          if (this.subdetailSequence == null)
2094            return false;
2095          for (PositiveIntType v : this.subdetailSequence)
2096            if (v.getValue().equals(value)) // positiveInt
2097              return true;
2098          return false;
2099        }
2100
2101        /**
2102         * @return {@link #provider} (The providers who are authorized for the services rendered to the patient.)
2103         */
2104        public List<Reference> getProvider() { 
2105          if (this.provider == null)
2106            this.provider = new ArrayList<Reference>();
2107          return this.provider;
2108        }
2109
2110        /**
2111         * @return Returns a reference to <code>this</code> for easy method chaining
2112         */
2113        public AddedItemComponent setProvider(List<Reference> theProvider) { 
2114          this.provider = theProvider;
2115          return this;
2116        }
2117
2118        public boolean hasProvider() { 
2119          if (this.provider == null)
2120            return false;
2121          for (Reference item : this.provider)
2122            if (!item.isEmpty())
2123              return true;
2124          return false;
2125        }
2126
2127        public Reference addProvider() { //3
2128          Reference t = new Reference();
2129          if (this.provider == null)
2130            this.provider = new ArrayList<Reference>();
2131          this.provider.add(t);
2132          return t;
2133        }
2134
2135        public AddedItemComponent addProvider(Reference t) { //3
2136          if (t == null)
2137            return this;
2138          if (this.provider == null)
2139            this.provider = new ArrayList<Reference>();
2140          this.provider.add(t);
2141          return this;
2142        }
2143
2144        /**
2145         * @return The first repetition of repeating field {@link #provider}, creating it if it does not already exist {3}
2146         */
2147        public Reference getProviderFirstRep() { 
2148          if (getProvider().isEmpty()) {
2149            addProvider();
2150          }
2151          return getProvider().get(0);
2152        }
2153
2154        /**
2155         * @return {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
2156         */
2157        public CodeableConcept getRevenue() { 
2158          if (this.revenue == null)
2159            if (Configuration.errorOnAutoCreate())
2160              throw new Error("Attempt to auto-create AddedItemComponent.revenue");
2161            else if (Configuration.doAutoCreate())
2162              this.revenue = new CodeableConcept(); // cc
2163          return this.revenue;
2164        }
2165
2166        public boolean hasRevenue() { 
2167          return this.revenue != null && !this.revenue.isEmpty();
2168        }
2169
2170        /**
2171         * @param value {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
2172         */
2173        public AddedItemComponent setRevenue(CodeableConcept value) { 
2174          this.revenue = value;
2175          return this;
2176        }
2177
2178        /**
2179         * @return {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
2180         */
2181        public CodeableConcept getProductOrService() { 
2182          if (this.productOrService == null)
2183            if (Configuration.errorOnAutoCreate())
2184              throw new Error("Attempt to auto-create AddedItemComponent.productOrService");
2185            else if (Configuration.doAutoCreate())
2186              this.productOrService = new CodeableConcept(); // cc
2187          return this.productOrService;
2188        }
2189
2190        public boolean hasProductOrService() { 
2191          return this.productOrService != null && !this.productOrService.isEmpty();
2192        }
2193
2194        /**
2195         * @param value {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
2196         */
2197        public AddedItemComponent setProductOrService(CodeableConcept value) { 
2198          this.productOrService = value;
2199          return this;
2200        }
2201
2202        /**
2203         * @return {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
2204         */
2205        public CodeableConcept getProductOrServiceEnd() { 
2206          if (this.productOrServiceEnd == null)
2207            if (Configuration.errorOnAutoCreate())
2208              throw new Error("Attempt to auto-create AddedItemComponent.productOrServiceEnd");
2209            else if (Configuration.doAutoCreate())
2210              this.productOrServiceEnd = new CodeableConcept(); // cc
2211          return this.productOrServiceEnd;
2212        }
2213
2214        public boolean hasProductOrServiceEnd() { 
2215          return this.productOrServiceEnd != null && !this.productOrServiceEnd.isEmpty();
2216        }
2217
2218        /**
2219         * @param value {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
2220         */
2221        public AddedItemComponent setProductOrServiceEnd(CodeableConcept value) { 
2222          this.productOrServiceEnd = value;
2223          return this;
2224        }
2225
2226        /**
2227         * @return {@link #modifier} (Item typification or modifiers codes to convey additional context for the product or service.)
2228         */
2229        public List<CodeableConcept> getModifier() { 
2230          if (this.modifier == null)
2231            this.modifier = new ArrayList<CodeableConcept>();
2232          return this.modifier;
2233        }
2234
2235        /**
2236         * @return Returns a reference to <code>this</code> for easy method chaining
2237         */
2238        public AddedItemComponent setModifier(List<CodeableConcept> theModifier) { 
2239          this.modifier = theModifier;
2240          return this;
2241        }
2242
2243        public boolean hasModifier() { 
2244          if (this.modifier == null)
2245            return false;
2246          for (CodeableConcept item : this.modifier)
2247            if (!item.isEmpty())
2248              return true;
2249          return false;
2250        }
2251
2252        public CodeableConcept addModifier() { //3
2253          CodeableConcept t = new CodeableConcept();
2254          if (this.modifier == null)
2255            this.modifier = new ArrayList<CodeableConcept>();
2256          this.modifier.add(t);
2257          return t;
2258        }
2259
2260        public AddedItemComponent addModifier(CodeableConcept t) { //3
2261          if (t == null)
2262            return this;
2263          if (this.modifier == null)
2264            this.modifier = new ArrayList<CodeableConcept>();
2265          this.modifier.add(t);
2266          return this;
2267        }
2268
2269        /**
2270         * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist {3}
2271         */
2272        public CodeableConcept getModifierFirstRep() { 
2273          if (getModifier().isEmpty()) {
2274            addModifier();
2275          }
2276          return getModifier().get(0);
2277        }
2278
2279        /**
2280         * @return {@link #programCode} (Identifies the program under which this may be recovered.)
2281         */
2282        public List<CodeableConcept> getProgramCode() { 
2283          if (this.programCode == null)
2284            this.programCode = new ArrayList<CodeableConcept>();
2285          return this.programCode;
2286        }
2287
2288        /**
2289         * @return Returns a reference to <code>this</code> for easy method chaining
2290         */
2291        public AddedItemComponent setProgramCode(List<CodeableConcept> theProgramCode) { 
2292          this.programCode = theProgramCode;
2293          return this;
2294        }
2295
2296        public boolean hasProgramCode() { 
2297          if (this.programCode == null)
2298            return false;
2299          for (CodeableConcept item : this.programCode)
2300            if (!item.isEmpty())
2301              return true;
2302          return false;
2303        }
2304
2305        public CodeableConcept addProgramCode() { //3
2306          CodeableConcept t = new CodeableConcept();
2307          if (this.programCode == null)
2308            this.programCode = new ArrayList<CodeableConcept>();
2309          this.programCode.add(t);
2310          return t;
2311        }
2312
2313        public AddedItemComponent addProgramCode(CodeableConcept t) { //3
2314          if (t == null)
2315            return this;
2316          if (this.programCode == null)
2317            this.programCode = new ArrayList<CodeableConcept>();
2318          this.programCode.add(t);
2319          return this;
2320        }
2321
2322        /**
2323         * @return The first repetition of repeating field {@link #programCode}, creating it if it does not already exist {3}
2324         */
2325        public CodeableConcept getProgramCodeFirstRep() { 
2326          if (getProgramCode().isEmpty()) {
2327            addProgramCode();
2328          }
2329          return getProgramCode().get(0);
2330        }
2331
2332        /**
2333         * @return {@link #serviced} (The date or dates when the service or product was supplied, performed or completed.)
2334         */
2335        public DataType getServiced() { 
2336          return this.serviced;
2337        }
2338
2339        /**
2340         * @return {@link #serviced} (The date or dates when the service or product was supplied, performed or completed.)
2341         */
2342        public DateType getServicedDateType() throws FHIRException { 
2343          if (this.serviced == null)
2344            this.serviced = new DateType();
2345          if (!(this.serviced instanceof DateType))
2346            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered");
2347          return (DateType) this.serviced;
2348        }
2349
2350        public boolean hasServicedDateType() { 
2351          return this != null && this.serviced instanceof DateType;
2352        }
2353
2354        /**
2355         * @return {@link #serviced} (The date or dates when the service or product was supplied, performed or completed.)
2356         */
2357        public Period getServicedPeriod() throws FHIRException { 
2358          if (this.serviced == null)
2359            this.serviced = new Period();
2360          if (!(this.serviced instanceof Period))
2361            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered");
2362          return (Period) this.serviced;
2363        }
2364
2365        public boolean hasServicedPeriod() { 
2366          return this != null && this.serviced instanceof Period;
2367        }
2368
2369        public boolean hasServiced() { 
2370          return this.serviced != null && !this.serviced.isEmpty();
2371        }
2372
2373        /**
2374         * @param value {@link #serviced} (The date or dates when the service or product was supplied, performed or completed.)
2375         */
2376        public AddedItemComponent setServiced(DataType value) { 
2377          if (value != null && !(value instanceof DateType || value instanceof Period))
2378            throw new Error("Not the right type for ClaimResponse.addItem.serviced[x]: "+value.fhirType());
2379          this.serviced = value;
2380          return this;
2381        }
2382
2383        /**
2384         * @return {@link #location} (Where the product or service was provided.)
2385         */
2386        public DataType getLocation() { 
2387          return this.location;
2388        }
2389
2390        /**
2391         * @return {@link #location} (Where the product or service was provided.)
2392         */
2393        public CodeableConcept getLocationCodeableConcept() throws FHIRException { 
2394          if (this.location == null)
2395            this.location = new CodeableConcept();
2396          if (!(this.location instanceof CodeableConcept))
2397            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.location.getClass().getName()+" was encountered");
2398          return (CodeableConcept) this.location;
2399        }
2400
2401        public boolean hasLocationCodeableConcept() { 
2402          return this != null && this.location instanceof CodeableConcept;
2403        }
2404
2405        /**
2406         * @return {@link #location} (Where the product or service was provided.)
2407         */
2408        public Address getLocationAddress() throws FHIRException { 
2409          if (this.location == null)
2410            this.location = new Address();
2411          if (!(this.location instanceof Address))
2412            throw new FHIRException("Type mismatch: the type Address was expected, but "+this.location.getClass().getName()+" was encountered");
2413          return (Address) this.location;
2414        }
2415
2416        public boolean hasLocationAddress() { 
2417          return this != null && this.location instanceof Address;
2418        }
2419
2420        /**
2421         * @return {@link #location} (Where the product or service was provided.)
2422         */
2423        public Reference getLocationReference() throws FHIRException { 
2424          if (this.location == null)
2425            this.location = new Reference();
2426          if (!(this.location instanceof Reference))
2427            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.location.getClass().getName()+" was encountered");
2428          return (Reference) this.location;
2429        }
2430
2431        public boolean hasLocationReference() { 
2432          return this != null && this.location instanceof Reference;
2433        }
2434
2435        public boolean hasLocation() { 
2436          return this.location != null && !this.location.isEmpty();
2437        }
2438
2439        /**
2440         * @param value {@link #location} (Where the product or service was provided.)
2441         */
2442        public AddedItemComponent setLocation(DataType value) { 
2443          if (value != null && !(value instanceof CodeableConcept || value instanceof Address || value instanceof Reference))
2444            throw new Error("Not the right type for ClaimResponse.addItem.location[x]: "+value.fhirType());
2445          this.location = value;
2446          return this;
2447        }
2448
2449        /**
2450         * @return {@link #quantity} (The number of repetitions of a service or product.)
2451         */
2452        public Quantity getQuantity() { 
2453          if (this.quantity == null)
2454            if (Configuration.errorOnAutoCreate())
2455              throw new Error("Attempt to auto-create AddedItemComponent.quantity");
2456            else if (Configuration.doAutoCreate())
2457              this.quantity = new Quantity(); // cc
2458          return this.quantity;
2459        }
2460
2461        public boolean hasQuantity() { 
2462          return this.quantity != null && !this.quantity.isEmpty();
2463        }
2464
2465        /**
2466         * @param value {@link #quantity} (The number of repetitions of a service or product.)
2467         */
2468        public AddedItemComponent setQuantity(Quantity value) { 
2469          this.quantity = value;
2470          return this;
2471        }
2472
2473        /**
2474         * @return {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
2475         */
2476        public Money getUnitPrice() { 
2477          if (this.unitPrice == null)
2478            if (Configuration.errorOnAutoCreate())
2479              throw new Error("Attempt to auto-create AddedItemComponent.unitPrice");
2480            else if (Configuration.doAutoCreate())
2481              this.unitPrice = new Money(); // cc
2482          return this.unitPrice;
2483        }
2484
2485        public boolean hasUnitPrice() { 
2486          return this.unitPrice != null && !this.unitPrice.isEmpty();
2487        }
2488
2489        /**
2490         * @param value {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
2491         */
2492        public AddedItemComponent setUnitPrice(Money value) { 
2493          this.unitPrice = value;
2494          return this;
2495        }
2496
2497        /**
2498         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
2499         */
2500        public DecimalType getFactorElement() { 
2501          if (this.factor == null)
2502            if (Configuration.errorOnAutoCreate())
2503              throw new Error("Attempt to auto-create AddedItemComponent.factor");
2504            else if (Configuration.doAutoCreate())
2505              this.factor = new DecimalType(); // bb
2506          return this.factor;
2507        }
2508
2509        public boolean hasFactorElement() { 
2510          return this.factor != null && !this.factor.isEmpty();
2511        }
2512
2513        public boolean hasFactor() { 
2514          return this.factor != null && !this.factor.isEmpty();
2515        }
2516
2517        /**
2518         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
2519         */
2520        public AddedItemComponent setFactorElement(DecimalType value) { 
2521          this.factor = value;
2522          return this;
2523        }
2524
2525        /**
2526         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2527         */
2528        public BigDecimal getFactor() { 
2529          return this.factor == null ? null : this.factor.getValue();
2530        }
2531
2532        /**
2533         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2534         */
2535        public AddedItemComponent setFactor(BigDecimal value) { 
2536          if (value == null)
2537            this.factor = null;
2538          else {
2539            if (this.factor == null)
2540              this.factor = new DecimalType();
2541            this.factor.setValue(value);
2542          }
2543          return this;
2544        }
2545
2546        /**
2547         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2548         */
2549        public AddedItemComponent setFactor(long value) { 
2550              this.factor = new DecimalType();
2551            this.factor.setValue(value);
2552          return this;
2553        }
2554
2555        /**
2556         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2557         */
2558        public AddedItemComponent setFactor(double value) { 
2559              this.factor = new DecimalType();
2560            this.factor.setValue(value);
2561          return this;
2562        }
2563
2564        /**
2565         * @return {@link #tax} (The total of taxes applicable for this product or service.)
2566         */
2567        public Money getTax() { 
2568          if (this.tax == null)
2569            if (Configuration.errorOnAutoCreate())
2570              throw new Error("Attempt to auto-create AddedItemComponent.tax");
2571            else if (Configuration.doAutoCreate())
2572              this.tax = new Money(); // cc
2573          return this.tax;
2574        }
2575
2576        public boolean hasTax() { 
2577          return this.tax != null && !this.tax.isEmpty();
2578        }
2579
2580        /**
2581         * @param value {@link #tax} (The total of taxes applicable for this product or service.)
2582         */
2583        public AddedItemComponent setTax(Money value) { 
2584          this.tax = value;
2585          return this;
2586        }
2587
2588        /**
2589         * @return {@link #net} (The quantity times the unit price for an additional service or product or charge.)
2590         */
2591        public Money getNet() { 
2592          if (this.net == null)
2593            if (Configuration.errorOnAutoCreate())
2594              throw new Error("Attempt to auto-create AddedItemComponent.net");
2595            else if (Configuration.doAutoCreate())
2596              this.net = new Money(); // cc
2597          return this.net;
2598        }
2599
2600        public boolean hasNet() { 
2601          return this.net != null && !this.net.isEmpty();
2602        }
2603
2604        /**
2605         * @param value {@link #net} (The quantity times the unit price for an additional service or product or charge.)
2606         */
2607        public AddedItemComponent setNet(Money value) { 
2608          this.net = value;
2609          return this;
2610        }
2611
2612        /**
2613         * @return {@link #bodySite} (Physical location where the service is performed or applies.)
2614         */
2615        public List<BodySiteComponent> getBodySite() { 
2616          if (this.bodySite == null)
2617            this.bodySite = new ArrayList<BodySiteComponent>();
2618          return this.bodySite;
2619        }
2620
2621        /**
2622         * @return Returns a reference to <code>this</code> for easy method chaining
2623         */
2624        public AddedItemComponent setBodySite(List<BodySiteComponent> theBodySite) { 
2625          this.bodySite = theBodySite;
2626          return this;
2627        }
2628
2629        public boolean hasBodySite() { 
2630          if (this.bodySite == null)
2631            return false;
2632          for (BodySiteComponent item : this.bodySite)
2633            if (!item.isEmpty())
2634              return true;
2635          return false;
2636        }
2637
2638        public BodySiteComponent addBodySite() { //3
2639          BodySiteComponent t = new BodySiteComponent();
2640          if (this.bodySite == null)
2641            this.bodySite = new ArrayList<BodySiteComponent>();
2642          this.bodySite.add(t);
2643          return t;
2644        }
2645
2646        public AddedItemComponent addBodySite(BodySiteComponent t) { //3
2647          if (t == null)
2648            return this;
2649          if (this.bodySite == null)
2650            this.bodySite = new ArrayList<BodySiteComponent>();
2651          this.bodySite.add(t);
2652          return this;
2653        }
2654
2655        /**
2656         * @return The first repetition of repeating field {@link #bodySite}, creating it if it does not already exist {3}
2657         */
2658        public BodySiteComponent getBodySiteFirstRep() { 
2659          if (getBodySite().isEmpty()) {
2660            addBodySite();
2661          }
2662          return getBodySite().get(0);
2663        }
2664
2665        /**
2666         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
2667         */
2668        public List<PositiveIntType> getNoteNumber() { 
2669          if (this.noteNumber == null)
2670            this.noteNumber = new ArrayList<PositiveIntType>();
2671          return this.noteNumber;
2672        }
2673
2674        /**
2675         * @return Returns a reference to <code>this</code> for easy method chaining
2676         */
2677        public AddedItemComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
2678          this.noteNumber = theNoteNumber;
2679          return this;
2680        }
2681
2682        public boolean hasNoteNumber() { 
2683          if (this.noteNumber == null)
2684            return false;
2685          for (PositiveIntType item : this.noteNumber)
2686            if (!item.isEmpty())
2687              return true;
2688          return false;
2689        }
2690
2691        /**
2692         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
2693         */
2694        public PositiveIntType addNoteNumberElement() {//2 
2695          PositiveIntType t = new PositiveIntType();
2696          if (this.noteNumber == null)
2697            this.noteNumber = new ArrayList<PositiveIntType>();
2698          this.noteNumber.add(t);
2699          return t;
2700        }
2701
2702        /**
2703         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
2704         */
2705        public AddedItemComponent addNoteNumber(int value) { //1
2706          PositiveIntType t = new PositiveIntType();
2707          t.setValue(value);
2708          if (this.noteNumber == null)
2709            this.noteNumber = new ArrayList<PositiveIntType>();
2710          this.noteNumber.add(t);
2711          return this;
2712        }
2713
2714        /**
2715         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
2716         */
2717        public boolean hasNoteNumber(int value) { 
2718          if (this.noteNumber == null)
2719            return false;
2720          for (PositiveIntType v : this.noteNumber)
2721            if (v.getValue().equals(value)) // positiveInt
2722              return true;
2723          return false;
2724        }
2725
2726        /**
2727         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
2728         */
2729        public CodeableConcept getDecision() { 
2730          if (this.decision == null)
2731            if (Configuration.errorOnAutoCreate())
2732              throw new Error("Attempt to auto-create AddedItemComponent.decision");
2733            else if (Configuration.doAutoCreate())
2734              this.decision = new CodeableConcept(); // cc
2735          return this.decision;
2736        }
2737
2738        public boolean hasDecision() { 
2739          return this.decision != null && !this.decision.isEmpty();
2740        }
2741
2742        /**
2743         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
2744         */
2745        public AddedItemComponent setDecision(CodeableConcept value) { 
2746          this.decision = value;
2747          return this;
2748        }
2749
2750        /**
2751         * @return {@link #adjudication} (The adjudication results.)
2752         */
2753        public List<AdjudicationComponent> getAdjudication() { 
2754          if (this.adjudication == null)
2755            this.adjudication = new ArrayList<AdjudicationComponent>();
2756          return this.adjudication;
2757        }
2758
2759        /**
2760         * @return Returns a reference to <code>this</code> for easy method chaining
2761         */
2762        public AddedItemComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
2763          this.adjudication = theAdjudication;
2764          return this;
2765        }
2766
2767        public boolean hasAdjudication() { 
2768          if (this.adjudication == null)
2769            return false;
2770          for (AdjudicationComponent item : this.adjudication)
2771            if (!item.isEmpty())
2772              return true;
2773          return false;
2774        }
2775
2776        public AdjudicationComponent addAdjudication() { //3
2777          AdjudicationComponent t = new AdjudicationComponent();
2778          if (this.adjudication == null)
2779            this.adjudication = new ArrayList<AdjudicationComponent>();
2780          this.adjudication.add(t);
2781          return t;
2782        }
2783
2784        public AddedItemComponent addAdjudication(AdjudicationComponent t) { //3
2785          if (t == null)
2786            return this;
2787          if (this.adjudication == null)
2788            this.adjudication = new ArrayList<AdjudicationComponent>();
2789          this.adjudication.add(t);
2790          return this;
2791        }
2792
2793        /**
2794         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
2795         */
2796        public AdjudicationComponent getAdjudicationFirstRep() { 
2797          if (getAdjudication().isEmpty()) {
2798            addAdjudication();
2799          }
2800          return getAdjudication().get(0);
2801        }
2802
2803        /**
2804         * @return {@link #detail} (The second-tier service adjudications for payor added services.)
2805         */
2806        public List<AddedItemDetailComponent> getDetail() { 
2807          if (this.detail == null)
2808            this.detail = new ArrayList<AddedItemDetailComponent>();
2809          return this.detail;
2810        }
2811
2812        /**
2813         * @return Returns a reference to <code>this</code> for easy method chaining
2814         */
2815        public AddedItemComponent setDetail(List<AddedItemDetailComponent> theDetail) { 
2816          this.detail = theDetail;
2817          return this;
2818        }
2819
2820        public boolean hasDetail() { 
2821          if (this.detail == null)
2822            return false;
2823          for (AddedItemDetailComponent item : this.detail)
2824            if (!item.isEmpty())
2825              return true;
2826          return false;
2827        }
2828
2829        public AddedItemDetailComponent addDetail() { //3
2830          AddedItemDetailComponent t = new AddedItemDetailComponent();
2831          if (this.detail == null)
2832            this.detail = new ArrayList<AddedItemDetailComponent>();
2833          this.detail.add(t);
2834          return t;
2835        }
2836
2837        public AddedItemComponent addDetail(AddedItemDetailComponent t) { //3
2838          if (t == null)
2839            return this;
2840          if (this.detail == null)
2841            this.detail = new ArrayList<AddedItemDetailComponent>();
2842          this.detail.add(t);
2843          return this;
2844        }
2845
2846        /**
2847         * @return The first repetition of repeating field {@link #detail}, creating it if it does not already exist {3}
2848         */
2849        public AddedItemDetailComponent getDetailFirstRep() { 
2850          if (getDetail().isEmpty()) {
2851            addDetail();
2852          }
2853          return getDetail().get(0);
2854        }
2855
2856        protected void listChildren(List<Property> children) {
2857          super.listChildren(children);
2858          children.add(new Property("itemSequence", "positiveInt", "Claim items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, itemSequence));
2859          children.add(new Property("detailSequence", "positiveInt", "The sequence number of the details within the claim item which this line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, detailSequence));
2860          children.add(new Property("subdetailSequence", "positiveInt", "The sequence number of the sub-details within the details within the claim item which this line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, subdetailSequence));
2861          children.add(new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The providers who are authorized for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
2862          children.add(new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue));
2863          children.add(new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService));
2864          children.add(new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd));
2865          children.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier));
2866          children.add(new Property("programCode", "CodeableConcept", "Identifies the program under which this may be recovered.", 0, java.lang.Integer.MAX_VALUE, programCode));
2867          children.add(new Property("serviced[x]", "date|Period", "The date or dates when the service or product was supplied, performed or completed.", 0, 1, serviced));
2868          children.add(new Property("location[x]", "CodeableConcept|Address|Reference(Location)", "Where the product or service was provided.", 0, 1, location));
2869          children.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity));
2870          children.add(new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice));
2871          children.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor));
2872          children.add(new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax));
2873          children.add(new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net));
2874          children.add(new Property("bodySite", "", "Physical location where the service is performed or applies.", 0, java.lang.Integer.MAX_VALUE, bodySite));
2875          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
2876          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
2877          children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
2878          children.add(new Property("detail", "", "The second-tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail));
2879        }
2880
2881        @Override
2882        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2883          switch (_hash) {
2884          case 1977979892: /*itemSequence*/  return new Property("itemSequence", "positiveInt", "Claim items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, itemSequence);
2885          case 1321472818: /*detailSequence*/  return new Property("detailSequence", "positiveInt", "The sequence number of the details within the claim item which this line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, detailSequence);
2886          case 146530674: /*subdetailSequence*/  return new Property("subdetailSequence", "positiveInt", "The sequence number of the sub-details within the details within the claim item which this line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, subdetailSequence);
2887          case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The providers who are authorized for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider);
2888          case 1099842588: /*revenue*/  return new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue);
2889          case 1957227299: /*productOrService*/  return new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService);
2890          case -717476168: /*productOrServiceEnd*/  return new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd);
2891          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier);
2892          case 1010065041: /*programCode*/  return new Property("programCode", "CodeableConcept", "Identifies the program under which this may be recovered.", 0, java.lang.Integer.MAX_VALUE, programCode);
2893          case -1927922223: /*serviced[x]*/  return new Property("serviced[x]", "date|Period", "The date or dates when the service or product was supplied, performed or completed.", 0, 1, serviced);
2894          case 1379209295: /*serviced*/  return new Property("serviced[x]", "date|Period", "The date or dates when the service or product was supplied, performed or completed.", 0, 1, serviced);
2895          case 363246749: /*servicedDate*/  return new Property("serviced[x]", "date", "The date or dates when the service or product was supplied, performed or completed.", 0, 1, serviced);
2896          case 1534966512: /*servicedPeriod*/  return new Property("serviced[x]", "Period", "The date or dates when the service or product was supplied, performed or completed.", 0, 1, serviced);
2897          case 552316075: /*location[x]*/  return new Property("location[x]", "CodeableConcept|Address|Reference(Location)", "Where the product or service was provided.", 0, 1, location);
2898          case 1901043637: /*location*/  return new Property("location[x]", "CodeableConcept|Address|Reference(Location)", "Where the product or service was provided.", 0, 1, location);
2899          case -1224800468: /*locationCodeableConcept*/  return new Property("location[x]", "CodeableConcept", "Where the product or service was provided.", 0, 1, location);
2900          case -1280020865: /*locationAddress*/  return new Property("location[x]", "Address", "Where the product or service was provided.", 0, 1, location);
2901          case 755866390: /*locationReference*/  return new Property("location[x]", "Reference(Location)", "Where the product or service was provided.", 0, 1, location);
2902          case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity);
2903          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice);
2904          case -1282148017: /*factor*/  return new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor);
2905          case 114603: /*tax*/  return new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax);
2906          case 108957: /*net*/  return new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net);
2907          case 1702620169: /*bodySite*/  return new Property("bodySite", "", "Physical location where the service is performed or applies.", 0, java.lang.Integer.MAX_VALUE, bodySite);
2908          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
2909          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
2910          case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication);
2911          case -1335224239: /*detail*/  return new Property("detail", "", "The second-tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail);
2912          default: return super.getNamedProperty(_hash, _name, _checkValid);
2913          }
2914
2915        }
2916
2917      @Override
2918      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2919        switch (hash) {
2920        case 1977979892: /*itemSequence*/ return this.itemSequence == null ? new Base[0] : this.itemSequence.toArray(new Base[this.itemSequence.size()]); // PositiveIntType
2921        case 1321472818: /*detailSequence*/ return this.detailSequence == null ? new Base[0] : this.detailSequence.toArray(new Base[this.detailSequence.size()]); // PositiveIntType
2922        case 146530674: /*subdetailSequence*/ return this.subdetailSequence == null ? new Base[0] : this.subdetailSequence.toArray(new Base[this.subdetailSequence.size()]); // PositiveIntType
2923        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : this.provider.toArray(new Base[this.provider.size()]); // Reference
2924        case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept
2925        case 1957227299: /*productOrService*/ return this.productOrService == null ? new Base[0] : new Base[] {this.productOrService}; // CodeableConcept
2926        case -717476168: /*productOrServiceEnd*/ return this.productOrServiceEnd == null ? new Base[0] : new Base[] {this.productOrServiceEnd}; // CodeableConcept
2927        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept
2928        case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // CodeableConcept
2929        case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // DataType
2930        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // DataType
2931        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
2932        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
2933        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
2934        case 114603: /*tax*/ return this.tax == null ? new Base[0] : new Base[] {this.tax}; // Money
2935        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
2936        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // BodySiteComponent
2937        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
2938        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
2939        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
2940        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemDetailComponent
2941        default: return super.getProperty(hash, name, checkValid);
2942        }
2943
2944      }
2945
2946      @Override
2947      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2948        switch (hash) {
2949        case 1977979892: // itemSequence
2950          this.getItemSequence().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
2951          return value;
2952        case 1321472818: // detailSequence
2953          this.getDetailSequence().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
2954          return value;
2955        case 146530674: // subdetailSequence
2956          this.getSubdetailSequence().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
2957          return value;
2958        case -987494927: // provider
2959          this.getProvider().add(TypeConvertor.castToReference(value)); // Reference
2960          return value;
2961        case 1099842588: // revenue
2962          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2963          return value;
2964        case 1957227299: // productOrService
2965          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2966          return value;
2967        case -717476168: // productOrServiceEnd
2968          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2969          return value;
2970        case -615513385: // modifier
2971          this.getModifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2972          return value;
2973        case 1010065041: // programCode
2974          this.getProgramCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2975          return value;
2976        case 1379209295: // serviced
2977          this.serviced = TypeConvertor.castToType(value); // DataType
2978          return value;
2979        case 1901043637: // location
2980          this.location = TypeConvertor.castToType(value); // DataType
2981          return value;
2982        case -1285004149: // quantity
2983          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
2984          return value;
2985        case -486196699: // unitPrice
2986          this.unitPrice = TypeConvertor.castToMoney(value); // Money
2987          return value;
2988        case -1282148017: // factor
2989          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
2990          return value;
2991        case 114603: // tax
2992          this.tax = TypeConvertor.castToMoney(value); // Money
2993          return value;
2994        case 108957: // net
2995          this.net = TypeConvertor.castToMoney(value); // Money
2996          return value;
2997        case 1702620169: // bodySite
2998          this.getBodySite().add((BodySiteComponent) value); // BodySiteComponent
2999          return value;
3000        case -1110033957: // noteNumber
3001          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
3002          return value;
3003        case 565719004: // decision
3004          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3005          return value;
3006        case -231349275: // adjudication
3007          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
3008          return value;
3009        case -1335224239: // detail
3010          this.getDetail().add((AddedItemDetailComponent) value); // AddedItemDetailComponent
3011          return value;
3012        default: return super.setProperty(hash, name, value);
3013        }
3014
3015      }
3016
3017      @Override
3018      public Base setProperty(String name, Base value) throws FHIRException {
3019        if (name.equals("itemSequence")) {
3020          this.getItemSequence().add(TypeConvertor.castToPositiveInt(value));
3021        } else if (name.equals("detailSequence")) {
3022          this.getDetailSequence().add(TypeConvertor.castToPositiveInt(value));
3023        } else if (name.equals("subdetailSequence")) {
3024          this.getSubdetailSequence().add(TypeConvertor.castToPositiveInt(value));
3025        } else if (name.equals("provider")) {
3026          this.getProvider().add(TypeConvertor.castToReference(value));
3027        } else if (name.equals("revenue")) {
3028          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3029        } else if (name.equals("productOrService")) {
3030          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3031        } else if (name.equals("productOrServiceEnd")) {
3032          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3033        } else if (name.equals("modifier")) {
3034          this.getModifier().add(TypeConvertor.castToCodeableConcept(value));
3035        } else if (name.equals("programCode")) {
3036          this.getProgramCode().add(TypeConvertor.castToCodeableConcept(value));
3037        } else if (name.equals("serviced[x]")) {
3038          this.serviced = TypeConvertor.castToType(value); // DataType
3039        } else if (name.equals("location[x]")) {
3040          this.location = TypeConvertor.castToType(value); // DataType
3041        } else if (name.equals("quantity")) {
3042          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
3043        } else if (name.equals("unitPrice")) {
3044          this.unitPrice = TypeConvertor.castToMoney(value); // Money
3045        } else if (name.equals("factor")) {
3046          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
3047        } else if (name.equals("tax")) {
3048          this.tax = TypeConvertor.castToMoney(value); // Money
3049        } else if (name.equals("net")) {
3050          this.net = TypeConvertor.castToMoney(value); // Money
3051        } else if (name.equals("bodySite")) {
3052          this.getBodySite().add((BodySiteComponent) value);
3053        } else if (name.equals("noteNumber")) {
3054          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
3055        } else if (name.equals("decision")) {
3056          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3057        } else if (name.equals("adjudication")) {
3058          this.getAdjudication().add((AdjudicationComponent) value);
3059        } else if (name.equals("detail")) {
3060          this.getDetail().add((AddedItemDetailComponent) value);
3061        } else
3062          return super.setProperty(name, value);
3063        return value;
3064      }
3065
3066      @Override
3067      public Base makeProperty(int hash, String name) throws FHIRException {
3068        switch (hash) {
3069        case 1977979892:  return addItemSequenceElement();
3070        case 1321472818:  return addDetailSequenceElement();
3071        case 146530674:  return addSubdetailSequenceElement();
3072        case -987494927:  return addProvider(); 
3073        case 1099842588:  return getRevenue();
3074        case 1957227299:  return getProductOrService();
3075        case -717476168:  return getProductOrServiceEnd();
3076        case -615513385:  return addModifier(); 
3077        case 1010065041:  return addProgramCode(); 
3078        case -1927922223:  return getServiced();
3079        case 1379209295:  return getServiced();
3080        case 552316075:  return getLocation();
3081        case 1901043637:  return getLocation();
3082        case -1285004149:  return getQuantity();
3083        case -486196699:  return getUnitPrice();
3084        case -1282148017:  return getFactorElement();
3085        case 114603:  return getTax();
3086        case 108957:  return getNet();
3087        case 1702620169:  return addBodySite(); 
3088        case -1110033957:  return addNoteNumberElement();
3089        case 565719004:  return getDecision();
3090        case -231349275:  return addAdjudication(); 
3091        case -1335224239:  return addDetail(); 
3092        default: return super.makeProperty(hash, name);
3093        }
3094
3095      }
3096
3097      @Override
3098      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3099        switch (hash) {
3100        case 1977979892: /*itemSequence*/ return new String[] {"positiveInt"};
3101        case 1321472818: /*detailSequence*/ return new String[] {"positiveInt"};
3102        case 146530674: /*subdetailSequence*/ return new String[] {"positiveInt"};
3103        case -987494927: /*provider*/ return new String[] {"Reference"};
3104        case 1099842588: /*revenue*/ return new String[] {"CodeableConcept"};
3105        case 1957227299: /*productOrService*/ return new String[] {"CodeableConcept"};
3106        case -717476168: /*productOrServiceEnd*/ return new String[] {"CodeableConcept"};
3107        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
3108        case 1010065041: /*programCode*/ return new String[] {"CodeableConcept"};
3109        case 1379209295: /*serviced*/ return new String[] {"date", "Period"};
3110        case 1901043637: /*location*/ return new String[] {"CodeableConcept", "Address", "Reference"};
3111        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
3112        case -486196699: /*unitPrice*/ return new String[] {"Money"};
3113        case -1282148017: /*factor*/ return new String[] {"decimal"};
3114        case 114603: /*tax*/ return new String[] {"Money"};
3115        case 108957: /*net*/ return new String[] {"Money"};
3116        case 1702620169: /*bodySite*/ return new String[] {};
3117        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
3118        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
3119        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
3120        case -1335224239: /*detail*/ return new String[] {};
3121        default: return super.getTypesForProperty(hash, name);
3122        }
3123
3124      }
3125
3126      @Override
3127      public Base addChild(String name) throws FHIRException {
3128        if (name.equals("itemSequence")) {
3129          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.itemSequence");
3130        }
3131        else if (name.equals("detailSequence")) {
3132          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.detailSequence");
3133        }
3134        else if (name.equals("subdetailSequence")) {
3135          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.subdetailSequence");
3136        }
3137        else if (name.equals("provider")) {
3138          return addProvider();
3139        }
3140        else if (name.equals("revenue")) {
3141          this.revenue = new CodeableConcept();
3142          return this.revenue;
3143        }
3144        else if (name.equals("productOrService")) {
3145          this.productOrService = new CodeableConcept();
3146          return this.productOrService;
3147        }
3148        else if (name.equals("productOrServiceEnd")) {
3149          this.productOrServiceEnd = new CodeableConcept();
3150          return this.productOrServiceEnd;
3151        }
3152        else if (name.equals("modifier")) {
3153          return addModifier();
3154        }
3155        else if (name.equals("programCode")) {
3156          return addProgramCode();
3157        }
3158        else if (name.equals("servicedDate")) {
3159          this.serviced = new DateType();
3160          return this.serviced;
3161        }
3162        else if (name.equals("servicedPeriod")) {
3163          this.serviced = new Period();
3164          return this.serviced;
3165        }
3166        else if (name.equals("locationCodeableConcept")) {
3167          this.location = new CodeableConcept();
3168          return this.location;
3169        }
3170        else if (name.equals("locationAddress")) {
3171          this.location = new Address();
3172          return this.location;
3173        }
3174        else if (name.equals("locationReference")) {
3175          this.location = new Reference();
3176          return this.location;
3177        }
3178        else if (name.equals("quantity")) {
3179          this.quantity = new Quantity();
3180          return this.quantity;
3181        }
3182        else if (name.equals("unitPrice")) {
3183          this.unitPrice = new Money();
3184          return this.unitPrice;
3185        }
3186        else if (name.equals("factor")) {
3187          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.factor");
3188        }
3189        else if (name.equals("tax")) {
3190          this.tax = new Money();
3191          return this.tax;
3192        }
3193        else if (name.equals("net")) {
3194          this.net = new Money();
3195          return this.net;
3196        }
3197        else if (name.equals("bodySite")) {
3198          return addBodySite();
3199        }
3200        else if (name.equals("noteNumber")) {
3201          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.noteNumber");
3202        }
3203        else if (name.equals("decision")) {
3204          this.decision = new CodeableConcept();
3205          return this.decision;
3206        }
3207        else if (name.equals("adjudication")) {
3208          return addAdjudication();
3209        }
3210        else if (name.equals("detail")) {
3211          return addDetail();
3212        }
3213        else
3214          return super.addChild(name);
3215      }
3216
3217      public AddedItemComponent copy() {
3218        AddedItemComponent dst = new AddedItemComponent();
3219        copyValues(dst);
3220        return dst;
3221      }
3222
3223      public void copyValues(AddedItemComponent dst) {
3224        super.copyValues(dst);
3225        if (itemSequence != null) {
3226          dst.itemSequence = new ArrayList<PositiveIntType>();
3227          for (PositiveIntType i : itemSequence)
3228            dst.itemSequence.add(i.copy());
3229        };
3230        if (detailSequence != null) {
3231          dst.detailSequence = new ArrayList<PositiveIntType>();
3232          for (PositiveIntType i : detailSequence)
3233            dst.detailSequence.add(i.copy());
3234        };
3235        if (subdetailSequence != null) {
3236          dst.subdetailSequence = new ArrayList<PositiveIntType>();
3237          for (PositiveIntType i : subdetailSequence)
3238            dst.subdetailSequence.add(i.copy());
3239        };
3240        if (provider != null) {
3241          dst.provider = new ArrayList<Reference>();
3242          for (Reference i : provider)
3243            dst.provider.add(i.copy());
3244        };
3245        dst.revenue = revenue == null ? null : revenue.copy();
3246        dst.productOrService = productOrService == null ? null : productOrService.copy();
3247        dst.productOrServiceEnd = productOrServiceEnd == null ? null : productOrServiceEnd.copy();
3248        if (modifier != null) {
3249          dst.modifier = new ArrayList<CodeableConcept>();
3250          for (CodeableConcept i : modifier)
3251            dst.modifier.add(i.copy());
3252        };
3253        if (programCode != null) {
3254          dst.programCode = new ArrayList<CodeableConcept>();
3255          for (CodeableConcept i : programCode)
3256            dst.programCode.add(i.copy());
3257        };
3258        dst.serviced = serviced == null ? null : serviced.copy();
3259        dst.location = location == null ? null : location.copy();
3260        dst.quantity = quantity == null ? null : quantity.copy();
3261        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
3262        dst.factor = factor == null ? null : factor.copy();
3263        dst.tax = tax == null ? null : tax.copy();
3264        dst.net = net == null ? null : net.copy();
3265        if (bodySite != null) {
3266          dst.bodySite = new ArrayList<BodySiteComponent>();
3267          for (BodySiteComponent i : bodySite)
3268            dst.bodySite.add(i.copy());
3269        };
3270        if (noteNumber != null) {
3271          dst.noteNumber = new ArrayList<PositiveIntType>();
3272          for (PositiveIntType i : noteNumber)
3273            dst.noteNumber.add(i.copy());
3274        };
3275        dst.decision = decision == null ? null : decision.copy();
3276        if (adjudication != null) {
3277          dst.adjudication = new ArrayList<AdjudicationComponent>();
3278          for (AdjudicationComponent i : adjudication)
3279            dst.adjudication.add(i.copy());
3280        };
3281        if (detail != null) {
3282          dst.detail = new ArrayList<AddedItemDetailComponent>();
3283          for (AddedItemDetailComponent i : detail)
3284            dst.detail.add(i.copy());
3285        };
3286      }
3287
3288      @Override
3289      public boolean equalsDeep(Base other_) {
3290        if (!super.equalsDeep(other_))
3291          return false;
3292        if (!(other_ instanceof AddedItemComponent))
3293          return false;
3294        AddedItemComponent o = (AddedItemComponent) other_;
3295        return compareDeep(itemSequence, o.itemSequence, true) && compareDeep(detailSequence, o.detailSequence, true)
3296           && compareDeep(subdetailSequence, o.subdetailSequence, true) && compareDeep(provider, o.provider, true)
3297           && compareDeep(revenue, o.revenue, true) && compareDeep(productOrService, o.productOrService, true)
3298           && compareDeep(productOrServiceEnd, o.productOrServiceEnd, true) && compareDeep(modifier, o.modifier, true)
3299           && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(location, o.location, true)
3300           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
3301           && compareDeep(tax, o.tax, true) && compareDeep(net, o.net, true) && compareDeep(bodySite, o.bodySite, true)
3302           && compareDeep(noteNumber, o.noteNumber, true) && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true)
3303           && compareDeep(detail, o.detail, true);
3304      }
3305
3306      @Override
3307      public boolean equalsShallow(Base other_) {
3308        if (!super.equalsShallow(other_))
3309          return false;
3310        if (!(other_ instanceof AddedItemComponent))
3311          return false;
3312        AddedItemComponent o = (AddedItemComponent) other_;
3313        return compareValues(itemSequence, o.itemSequence, true) && compareValues(detailSequence, o.detailSequence, true)
3314           && compareValues(subdetailSequence, o.subdetailSequence, true) && compareValues(factor, o.factor, true)
3315           && compareValues(noteNumber, o.noteNumber, true);
3316      }
3317
3318      public boolean isEmpty() {
3319        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(itemSequence, detailSequence
3320          , subdetailSequence, provider, revenue, productOrService, productOrServiceEnd, modifier
3321          , programCode, serviced, location, quantity, unitPrice, factor, tax, net, bodySite
3322          , noteNumber, decision, adjudication, detail);
3323      }
3324
3325  public String fhirType() {
3326    return "ClaimResponse.addItem";
3327
3328  }
3329
3330  }
3331
3332    @Block()
3333    public static class BodySiteComponent extends BackboneElement implements IBaseBackboneElement {
3334        /**
3335         * Physical service site on the patient (limb, tooth, etc.).
3336         */
3337        @Child(name = "site", type = {CodeableReference.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3338        @Description(shortDefinition="Location", formalDefinition="Physical service site on the patient (limb, tooth, etc.)." )
3339        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/tooth")
3340        protected List<CodeableReference> site;
3341
3342        /**
3343         * A region or surface of the bodySite, e.g. limb region or tooth surface(s).
3344         */
3345        @Child(name = "subSite", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3346        @Description(shortDefinition="Sub-location", formalDefinition="A region or surface of the bodySite, e.g. limb region or tooth surface(s)." )
3347        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/surface")
3348        protected List<CodeableConcept> subSite;
3349
3350        private static final long serialVersionUID = 1190632415L;
3351
3352    /**
3353     * Constructor
3354     */
3355      public BodySiteComponent() {
3356        super();
3357      }
3358
3359    /**
3360     * Constructor
3361     */
3362      public BodySiteComponent(CodeableReference site) {
3363        super();
3364        this.addSite(site);
3365      }
3366
3367        /**
3368         * @return {@link #site} (Physical service site on the patient (limb, tooth, etc.).)
3369         */
3370        public List<CodeableReference> getSite() { 
3371          if (this.site == null)
3372            this.site = new ArrayList<CodeableReference>();
3373          return this.site;
3374        }
3375
3376        /**
3377         * @return Returns a reference to <code>this</code> for easy method chaining
3378         */
3379        public BodySiteComponent setSite(List<CodeableReference> theSite) { 
3380          this.site = theSite;
3381          return this;
3382        }
3383
3384        public boolean hasSite() { 
3385          if (this.site == null)
3386            return false;
3387          for (CodeableReference item : this.site)
3388            if (!item.isEmpty())
3389              return true;
3390          return false;
3391        }
3392
3393        public CodeableReference addSite() { //3
3394          CodeableReference t = new CodeableReference();
3395          if (this.site == null)
3396            this.site = new ArrayList<CodeableReference>();
3397          this.site.add(t);
3398          return t;
3399        }
3400
3401        public BodySiteComponent addSite(CodeableReference t) { //3
3402          if (t == null)
3403            return this;
3404          if (this.site == null)
3405            this.site = new ArrayList<CodeableReference>();
3406          this.site.add(t);
3407          return this;
3408        }
3409
3410        /**
3411         * @return The first repetition of repeating field {@link #site}, creating it if it does not already exist {3}
3412         */
3413        public CodeableReference getSiteFirstRep() { 
3414          if (getSite().isEmpty()) {
3415            addSite();
3416          }
3417          return getSite().get(0);
3418        }
3419
3420        /**
3421         * @return {@link #subSite} (A region or surface of the bodySite, e.g. limb region or tooth surface(s).)
3422         */
3423        public List<CodeableConcept> getSubSite() { 
3424          if (this.subSite == null)
3425            this.subSite = new ArrayList<CodeableConcept>();
3426          return this.subSite;
3427        }
3428
3429        /**
3430         * @return Returns a reference to <code>this</code> for easy method chaining
3431         */
3432        public BodySiteComponent setSubSite(List<CodeableConcept> theSubSite) { 
3433          this.subSite = theSubSite;
3434          return this;
3435        }
3436
3437        public boolean hasSubSite() { 
3438          if (this.subSite == null)
3439            return false;
3440          for (CodeableConcept item : this.subSite)
3441            if (!item.isEmpty())
3442              return true;
3443          return false;
3444        }
3445
3446        public CodeableConcept addSubSite() { //3
3447          CodeableConcept t = new CodeableConcept();
3448          if (this.subSite == null)
3449            this.subSite = new ArrayList<CodeableConcept>();
3450          this.subSite.add(t);
3451          return t;
3452        }
3453
3454        public BodySiteComponent addSubSite(CodeableConcept t) { //3
3455          if (t == null)
3456            return this;
3457          if (this.subSite == null)
3458            this.subSite = new ArrayList<CodeableConcept>();
3459          this.subSite.add(t);
3460          return this;
3461        }
3462
3463        /**
3464         * @return The first repetition of repeating field {@link #subSite}, creating it if it does not already exist {3}
3465         */
3466        public CodeableConcept getSubSiteFirstRep() { 
3467          if (getSubSite().isEmpty()) {
3468            addSubSite();
3469          }
3470          return getSubSite().get(0);
3471        }
3472
3473        protected void listChildren(List<Property> children) {
3474          super.listChildren(children);
3475          children.add(new Property("site", "CodeableReference(BodyStructure)", "Physical service site on the patient (limb, tooth, etc.).", 0, java.lang.Integer.MAX_VALUE, site));
3476          children.add(new Property("subSite", "CodeableConcept", "A region or surface of the bodySite, e.g. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite));
3477        }
3478
3479        @Override
3480        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3481          switch (_hash) {
3482          case 3530567: /*site*/  return new Property("site", "CodeableReference(BodyStructure)", "Physical service site on the patient (limb, tooth, etc.).", 0, java.lang.Integer.MAX_VALUE, site);
3483          case -1868566105: /*subSite*/  return new Property("subSite", "CodeableConcept", "A region or surface of the bodySite, e.g. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite);
3484          default: return super.getNamedProperty(_hash, _name, _checkValid);
3485          }
3486
3487        }
3488
3489      @Override
3490      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3491        switch (hash) {
3492        case 3530567: /*site*/ return this.site == null ? new Base[0] : this.site.toArray(new Base[this.site.size()]); // CodeableReference
3493        case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // CodeableConcept
3494        default: return super.getProperty(hash, name, checkValid);
3495        }
3496
3497      }
3498
3499      @Override
3500      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3501        switch (hash) {
3502        case 3530567: // site
3503          this.getSite().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
3504          return value;
3505        case -1868566105: // subSite
3506          this.getSubSite().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3507          return value;
3508        default: return super.setProperty(hash, name, value);
3509        }
3510
3511      }
3512
3513      @Override
3514      public Base setProperty(String name, Base value) throws FHIRException {
3515        if (name.equals("site")) {
3516          this.getSite().add(TypeConvertor.castToCodeableReference(value));
3517        } else if (name.equals("subSite")) {
3518          this.getSubSite().add(TypeConvertor.castToCodeableConcept(value));
3519        } else
3520          return super.setProperty(name, value);
3521        return value;
3522      }
3523
3524      @Override
3525      public Base makeProperty(int hash, String name) throws FHIRException {
3526        switch (hash) {
3527        case 3530567:  return addSite(); 
3528        case -1868566105:  return addSubSite(); 
3529        default: return super.makeProperty(hash, name);
3530        }
3531
3532      }
3533
3534      @Override
3535      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3536        switch (hash) {
3537        case 3530567: /*site*/ return new String[] {"CodeableReference"};
3538        case -1868566105: /*subSite*/ return new String[] {"CodeableConcept"};
3539        default: return super.getTypesForProperty(hash, name);
3540        }
3541
3542      }
3543
3544      @Override
3545      public Base addChild(String name) throws FHIRException {
3546        if (name.equals("site")) {
3547          return addSite();
3548        }
3549        else if (name.equals("subSite")) {
3550          return addSubSite();
3551        }
3552        else
3553          return super.addChild(name);
3554      }
3555
3556      public BodySiteComponent copy() {
3557        BodySiteComponent dst = new BodySiteComponent();
3558        copyValues(dst);
3559        return dst;
3560      }
3561
3562      public void copyValues(BodySiteComponent dst) {
3563        super.copyValues(dst);
3564        if (site != null) {
3565          dst.site = new ArrayList<CodeableReference>();
3566          for (CodeableReference i : site)
3567            dst.site.add(i.copy());
3568        };
3569        if (subSite != null) {
3570          dst.subSite = new ArrayList<CodeableConcept>();
3571          for (CodeableConcept i : subSite)
3572            dst.subSite.add(i.copy());
3573        };
3574      }
3575
3576      @Override
3577      public boolean equalsDeep(Base other_) {
3578        if (!super.equalsDeep(other_))
3579          return false;
3580        if (!(other_ instanceof BodySiteComponent))
3581          return false;
3582        BodySiteComponent o = (BodySiteComponent) other_;
3583        return compareDeep(site, o.site, true) && compareDeep(subSite, o.subSite, true);
3584      }
3585
3586      @Override
3587      public boolean equalsShallow(Base other_) {
3588        if (!super.equalsShallow(other_))
3589          return false;
3590        if (!(other_ instanceof BodySiteComponent))
3591          return false;
3592        BodySiteComponent o = (BodySiteComponent) other_;
3593        return true;
3594      }
3595
3596      public boolean isEmpty() {
3597        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(site, subSite);
3598      }
3599
3600  public String fhirType() {
3601    return "ClaimResponse.addItem.bodySite";
3602
3603  }
3604
3605  }
3606
3607    @Block()
3608    public static class AddedItemDetailComponent extends BackboneElement implements IBaseBackboneElement {
3609        /**
3610         * The type of revenue or cost center providing the product and/or service.
3611         */
3612        @Child(name = "revenue", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
3613        @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of revenue or cost center providing the product and/or service." )
3614        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center")
3615        protected CodeableConcept revenue;
3616
3617        /**
3618         * When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.
3619         */
3620        @Child(name = "productOrService", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
3621        @Description(shortDefinition="Billing, service, product, or drug code", formalDefinition="When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used." )
3622        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
3623        protected CodeableConcept productOrService;
3624
3625        /**
3626         * This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.
3627         */
3628        @Child(name = "productOrServiceEnd", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
3629        @Description(shortDefinition="End of a range of codes", formalDefinition="This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims." )
3630        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
3631        protected CodeableConcept productOrServiceEnd;
3632
3633        /**
3634         * Item typification or modifiers codes to convey additional context for the product or service.
3635         */
3636        @Child(name = "modifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3637        @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes to convey additional context for the product or service." )
3638        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers")
3639        protected List<CodeableConcept> modifier;
3640
3641        /**
3642         * The number of repetitions of a service or product.
3643         */
3644        @Child(name = "quantity", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=false)
3645        @Description(shortDefinition="Count of products or services", formalDefinition="The number of repetitions of a service or product." )
3646        protected Quantity quantity;
3647
3648        /**
3649         * If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.
3650         */
3651        @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=false)
3652        @Description(shortDefinition="Fee, charge or cost per item", formalDefinition="If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group." )
3653        protected Money unitPrice;
3654
3655        /**
3656         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3657         */
3658        @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3659        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
3660        protected DecimalType factor;
3661
3662        /**
3663         * The total of taxes applicable for this product or service.
3664         */
3665        @Child(name = "tax", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false)
3666        @Description(shortDefinition="Total tax", formalDefinition="The total of taxes applicable for this product or service." )
3667        protected Money tax;
3668
3669        /**
3670         * The quantity times the unit price for an additional service or product or charge.
3671         */
3672        @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=false)
3673        @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an additional service or product or charge." )
3674        protected Money net;
3675
3676        /**
3677         * The numbers associated with notes below which apply to the adjudication of this item.
3678         */
3679        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3680        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
3681        protected List<PositiveIntType> noteNumber;
3682
3683        /**
3684         * The result of the claim, predetermination, or preauthorization adjudication.
3685         */
3686        @Child(name = "decision", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false)
3687        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
3688        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
3689        protected CodeableConcept decision;
3690
3691        /**
3692         * The adjudication results.
3693         */
3694        @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3695        @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudication results." )
3696        protected List<AdjudicationComponent> adjudication;
3697
3698        /**
3699         * The third-tier service adjudications for payor added services.
3700         */
3701        @Child(name = "subDetail", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3702        @Description(shortDefinition="Insurer added line items", formalDefinition="The third-tier service adjudications for payor added services." )
3703        protected List<AddedItemSubDetailComponent> subDetail;
3704
3705        private static final long serialVersionUID = -341633776L;
3706
3707    /**
3708     * Constructor
3709     */
3710      public AddedItemDetailComponent() {
3711        super();
3712      }
3713
3714        /**
3715         * @return {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
3716         */
3717        public CodeableConcept getRevenue() { 
3718          if (this.revenue == null)
3719            if (Configuration.errorOnAutoCreate())
3720              throw new Error("Attempt to auto-create AddedItemDetailComponent.revenue");
3721            else if (Configuration.doAutoCreate())
3722              this.revenue = new CodeableConcept(); // cc
3723          return this.revenue;
3724        }
3725
3726        public boolean hasRevenue() { 
3727          return this.revenue != null && !this.revenue.isEmpty();
3728        }
3729
3730        /**
3731         * @param value {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
3732         */
3733        public AddedItemDetailComponent setRevenue(CodeableConcept value) { 
3734          this.revenue = value;
3735          return this;
3736        }
3737
3738        /**
3739         * @return {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
3740         */
3741        public CodeableConcept getProductOrService() { 
3742          if (this.productOrService == null)
3743            if (Configuration.errorOnAutoCreate())
3744              throw new Error("Attempt to auto-create AddedItemDetailComponent.productOrService");
3745            else if (Configuration.doAutoCreate())
3746              this.productOrService = new CodeableConcept(); // cc
3747          return this.productOrService;
3748        }
3749
3750        public boolean hasProductOrService() { 
3751          return this.productOrService != null && !this.productOrService.isEmpty();
3752        }
3753
3754        /**
3755         * @param value {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
3756         */
3757        public AddedItemDetailComponent setProductOrService(CodeableConcept value) { 
3758          this.productOrService = value;
3759          return this;
3760        }
3761
3762        /**
3763         * @return {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
3764         */
3765        public CodeableConcept getProductOrServiceEnd() { 
3766          if (this.productOrServiceEnd == null)
3767            if (Configuration.errorOnAutoCreate())
3768              throw new Error("Attempt to auto-create AddedItemDetailComponent.productOrServiceEnd");
3769            else if (Configuration.doAutoCreate())
3770              this.productOrServiceEnd = new CodeableConcept(); // cc
3771          return this.productOrServiceEnd;
3772        }
3773
3774        public boolean hasProductOrServiceEnd() { 
3775          return this.productOrServiceEnd != null && !this.productOrServiceEnd.isEmpty();
3776        }
3777
3778        /**
3779         * @param value {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
3780         */
3781        public AddedItemDetailComponent setProductOrServiceEnd(CodeableConcept value) { 
3782          this.productOrServiceEnd = value;
3783          return this;
3784        }
3785
3786        /**
3787         * @return {@link #modifier} (Item typification or modifiers codes to convey additional context for the product or service.)
3788         */
3789        public List<CodeableConcept> getModifier() { 
3790          if (this.modifier == null)
3791            this.modifier = new ArrayList<CodeableConcept>();
3792          return this.modifier;
3793        }
3794
3795        /**
3796         * @return Returns a reference to <code>this</code> for easy method chaining
3797         */
3798        public AddedItemDetailComponent setModifier(List<CodeableConcept> theModifier) { 
3799          this.modifier = theModifier;
3800          return this;
3801        }
3802
3803        public boolean hasModifier() { 
3804          if (this.modifier == null)
3805            return false;
3806          for (CodeableConcept item : this.modifier)
3807            if (!item.isEmpty())
3808              return true;
3809          return false;
3810        }
3811
3812        public CodeableConcept addModifier() { //3
3813          CodeableConcept t = new CodeableConcept();
3814          if (this.modifier == null)
3815            this.modifier = new ArrayList<CodeableConcept>();
3816          this.modifier.add(t);
3817          return t;
3818        }
3819
3820        public AddedItemDetailComponent addModifier(CodeableConcept t) { //3
3821          if (t == null)
3822            return this;
3823          if (this.modifier == null)
3824            this.modifier = new ArrayList<CodeableConcept>();
3825          this.modifier.add(t);
3826          return this;
3827        }
3828
3829        /**
3830         * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist {3}
3831         */
3832        public CodeableConcept getModifierFirstRep() { 
3833          if (getModifier().isEmpty()) {
3834            addModifier();
3835          }
3836          return getModifier().get(0);
3837        }
3838
3839        /**
3840         * @return {@link #quantity} (The number of repetitions of a service or product.)
3841         */
3842        public Quantity getQuantity() { 
3843          if (this.quantity == null)
3844            if (Configuration.errorOnAutoCreate())
3845              throw new Error("Attempt to auto-create AddedItemDetailComponent.quantity");
3846            else if (Configuration.doAutoCreate())
3847              this.quantity = new Quantity(); // cc
3848          return this.quantity;
3849        }
3850
3851        public boolean hasQuantity() { 
3852          return this.quantity != null && !this.quantity.isEmpty();
3853        }
3854
3855        /**
3856         * @param value {@link #quantity} (The number of repetitions of a service or product.)
3857         */
3858        public AddedItemDetailComponent setQuantity(Quantity value) { 
3859          this.quantity = value;
3860          return this;
3861        }
3862
3863        /**
3864         * @return {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
3865         */
3866        public Money getUnitPrice() { 
3867          if (this.unitPrice == null)
3868            if (Configuration.errorOnAutoCreate())
3869              throw new Error("Attempt to auto-create AddedItemDetailComponent.unitPrice");
3870            else if (Configuration.doAutoCreate())
3871              this.unitPrice = new Money(); // cc
3872          return this.unitPrice;
3873        }
3874
3875        public boolean hasUnitPrice() { 
3876          return this.unitPrice != null && !this.unitPrice.isEmpty();
3877        }
3878
3879        /**
3880         * @param value {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
3881         */
3882        public AddedItemDetailComponent setUnitPrice(Money value) { 
3883          this.unitPrice = value;
3884          return this;
3885        }
3886
3887        /**
3888         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
3889         */
3890        public DecimalType getFactorElement() { 
3891          if (this.factor == null)
3892            if (Configuration.errorOnAutoCreate())
3893              throw new Error("Attempt to auto-create AddedItemDetailComponent.factor");
3894            else if (Configuration.doAutoCreate())
3895              this.factor = new DecimalType(); // bb
3896          return this.factor;
3897        }
3898
3899        public boolean hasFactorElement() { 
3900          return this.factor != null && !this.factor.isEmpty();
3901        }
3902
3903        public boolean hasFactor() { 
3904          return this.factor != null && !this.factor.isEmpty();
3905        }
3906
3907        /**
3908         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
3909         */
3910        public AddedItemDetailComponent setFactorElement(DecimalType value) { 
3911          this.factor = value;
3912          return this;
3913        }
3914
3915        /**
3916         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3917         */
3918        public BigDecimal getFactor() { 
3919          return this.factor == null ? null : this.factor.getValue();
3920        }
3921
3922        /**
3923         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3924         */
3925        public AddedItemDetailComponent setFactor(BigDecimal value) { 
3926          if (value == null)
3927            this.factor = null;
3928          else {
3929            if (this.factor == null)
3930              this.factor = new DecimalType();
3931            this.factor.setValue(value);
3932          }
3933          return this;
3934        }
3935
3936        /**
3937         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3938         */
3939        public AddedItemDetailComponent setFactor(long value) { 
3940              this.factor = new DecimalType();
3941            this.factor.setValue(value);
3942          return this;
3943        }
3944
3945        /**
3946         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3947         */
3948        public AddedItemDetailComponent setFactor(double value) { 
3949              this.factor = new DecimalType();
3950            this.factor.setValue(value);
3951          return this;
3952        }
3953
3954        /**
3955         * @return {@link #tax} (The total of taxes applicable for this product or service.)
3956         */
3957        public Money getTax() { 
3958          if (this.tax == null)
3959            if (Configuration.errorOnAutoCreate())
3960              throw new Error("Attempt to auto-create AddedItemDetailComponent.tax");
3961            else if (Configuration.doAutoCreate())
3962              this.tax = new Money(); // cc
3963          return this.tax;
3964        }
3965
3966        public boolean hasTax() { 
3967          return this.tax != null && !this.tax.isEmpty();
3968        }
3969
3970        /**
3971         * @param value {@link #tax} (The total of taxes applicable for this product or service.)
3972         */
3973        public AddedItemDetailComponent setTax(Money value) { 
3974          this.tax = value;
3975          return this;
3976        }
3977
3978        /**
3979         * @return {@link #net} (The quantity times the unit price for an additional service or product or charge.)
3980         */
3981        public Money getNet() { 
3982          if (this.net == null)
3983            if (Configuration.errorOnAutoCreate())
3984              throw new Error("Attempt to auto-create AddedItemDetailComponent.net");
3985            else if (Configuration.doAutoCreate())
3986              this.net = new Money(); // cc
3987          return this.net;
3988        }
3989
3990        public boolean hasNet() { 
3991          return this.net != null && !this.net.isEmpty();
3992        }
3993
3994        /**
3995         * @param value {@link #net} (The quantity times the unit price for an additional service or product or charge.)
3996         */
3997        public AddedItemDetailComponent setNet(Money value) { 
3998          this.net = value;
3999          return this;
4000        }
4001
4002        /**
4003         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4004         */
4005        public List<PositiveIntType> getNoteNumber() { 
4006          if (this.noteNumber == null)
4007            this.noteNumber = new ArrayList<PositiveIntType>();
4008          return this.noteNumber;
4009        }
4010
4011        /**
4012         * @return Returns a reference to <code>this</code> for easy method chaining
4013         */
4014        public AddedItemDetailComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
4015          this.noteNumber = theNoteNumber;
4016          return this;
4017        }
4018
4019        public boolean hasNoteNumber() { 
4020          if (this.noteNumber == null)
4021            return false;
4022          for (PositiveIntType item : this.noteNumber)
4023            if (!item.isEmpty())
4024              return true;
4025          return false;
4026        }
4027
4028        /**
4029         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4030         */
4031        public PositiveIntType addNoteNumberElement() {//2 
4032          PositiveIntType t = new PositiveIntType();
4033          if (this.noteNumber == null)
4034            this.noteNumber = new ArrayList<PositiveIntType>();
4035          this.noteNumber.add(t);
4036          return t;
4037        }
4038
4039        /**
4040         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4041         */
4042        public AddedItemDetailComponent addNoteNumber(int value) { //1
4043          PositiveIntType t = new PositiveIntType();
4044          t.setValue(value);
4045          if (this.noteNumber == null)
4046            this.noteNumber = new ArrayList<PositiveIntType>();
4047          this.noteNumber.add(t);
4048          return this;
4049        }
4050
4051        /**
4052         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4053         */
4054        public boolean hasNoteNumber(int value) { 
4055          if (this.noteNumber == null)
4056            return false;
4057          for (PositiveIntType v : this.noteNumber)
4058            if (v.getValue().equals(value)) // positiveInt
4059              return true;
4060          return false;
4061        }
4062
4063        /**
4064         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
4065         */
4066        public CodeableConcept getDecision() { 
4067          if (this.decision == null)
4068            if (Configuration.errorOnAutoCreate())
4069              throw new Error("Attempt to auto-create AddedItemDetailComponent.decision");
4070            else if (Configuration.doAutoCreate())
4071              this.decision = new CodeableConcept(); // cc
4072          return this.decision;
4073        }
4074
4075        public boolean hasDecision() { 
4076          return this.decision != null && !this.decision.isEmpty();
4077        }
4078
4079        /**
4080         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
4081         */
4082        public AddedItemDetailComponent setDecision(CodeableConcept value) { 
4083          this.decision = value;
4084          return this;
4085        }
4086
4087        /**
4088         * @return {@link #adjudication} (The adjudication results.)
4089         */
4090        public List<AdjudicationComponent> getAdjudication() { 
4091          if (this.adjudication == null)
4092            this.adjudication = new ArrayList<AdjudicationComponent>();
4093          return this.adjudication;
4094        }
4095
4096        /**
4097         * @return Returns a reference to <code>this</code> for easy method chaining
4098         */
4099        public AddedItemDetailComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
4100          this.adjudication = theAdjudication;
4101          return this;
4102        }
4103
4104        public boolean hasAdjudication() { 
4105          if (this.adjudication == null)
4106            return false;
4107          for (AdjudicationComponent item : this.adjudication)
4108            if (!item.isEmpty())
4109              return true;
4110          return false;
4111        }
4112
4113        public AdjudicationComponent addAdjudication() { //3
4114          AdjudicationComponent t = new AdjudicationComponent();
4115          if (this.adjudication == null)
4116            this.adjudication = new ArrayList<AdjudicationComponent>();
4117          this.adjudication.add(t);
4118          return t;
4119        }
4120
4121        public AddedItemDetailComponent addAdjudication(AdjudicationComponent t) { //3
4122          if (t == null)
4123            return this;
4124          if (this.adjudication == null)
4125            this.adjudication = new ArrayList<AdjudicationComponent>();
4126          this.adjudication.add(t);
4127          return this;
4128        }
4129
4130        /**
4131         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
4132         */
4133        public AdjudicationComponent getAdjudicationFirstRep() { 
4134          if (getAdjudication().isEmpty()) {
4135            addAdjudication();
4136          }
4137          return getAdjudication().get(0);
4138        }
4139
4140        /**
4141         * @return {@link #subDetail} (The third-tier service adjudications for payor added services.)
4142         */
4143        public List<AddedItemSubDetailComponent> getSubDetail() { 
4144          if (this.subDetail == null)
4145            this.subDetail = new ArrayList<AddedItemSubDetailComponent>();
4146          return this.subDetail;
4147        }
4148
4149        /**
4150         * @return Returns a reference to <code>this</code> for easy method chaining
4151         */
4152        public AddedItemDetailComponent setSubDetail(List<AddedItemSubDetailComponent> theSubDetail) { 
4153          this.subDetail = theSubDetail;
4154          return this;
4155        }
4156
4157        public boolean hasSubDetail() { 
4158          if (this.subDetail == null)
4159            return false;
4160          for (AddedItemSubDetailComponent item : this.subDetail)
4161            if (!item.isEmpty())
4162              return true;
4163          return false;
4164        }
4165
4166        public AddedItemSubDetailComponent addSubDetail() { //3
4167          AddedItemSubDetailComponent t = new AddedItemSubDetailComponent();
4168          if (this.subDetail == null)
4169            this.subDetail = new ArrayList<AddedItemSubDetailComponent>();
4170          this.subDetail.add(t);
4171          return t;
4172        }
4173
4174        public AddedItemDetailComponent addSubDetail(AddedItemSubDetailComponent t) { //3
4175          if (t == null)
4176            return this;
4177          if (this.subDetail == null)
4178            this.subDetail = new ArrayList<AddedItemSubDetailComponent>();
4179          this.subDetail.add(t);
4180          return this;
4181        }
4182
4183        /**
4184         * @return The first repetition of repeating field {@link #subDetail}, creating it if it does not already exist {3}
4185         */
4186        public AddedItemSubDetailComponent getSubDetailFirstRep() { 
4187          if (getSubDetail().isEmpty()) {
4188            addSubDetail();
4189          }
4190          return getSubDetail().get(0);
4191        }
4192
4193        protected void listChildren(List<Property> children) {
4194          super.listChildren(children);
4195          children.add(new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue));
4196          children.add(new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService));
4197          children.add(new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd));
4198          children.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier));
4199          children.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity));
4200          children.add(new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice));
4201          children.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor));
4202          children.add(new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax));
4203          children.add(new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net));
4204          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
4205          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
4206          children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
4207          children.add(new Property("subDetail", "", "The third-tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, subDetail));
4208        }
4209
4210        @Override
4211        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4212          switch (_hash) {
4213          case 1099842588: /*revenue*/  return new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue);
4214          case 1957227299: /*productOrService*/  return new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService);
4215          case -717476168: /*productOrServiceEnd*/  return new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd);
4216          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier);
4217          case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity);
4218          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice);
4219          case -1282148017: /*factor*/  return new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor);
4220          case 114603: /*tax*/  return new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax);
4221          case 108957: /*net*/  return new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net);
4222          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
4223          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
4224          case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication);
4225          case -828829007: /*subDetail*/  return new Property("subDetail", "", "The third-tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, subDetail);
4226          default: return super.getNamedProperty(_hash, _name, _checkValid);
4227          }
4228
4229        }
4230
4231      @Override
4232      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4233        switch (hash) {
4234        case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept
4235        case 1957227299: /*productOrService*/ return this.productOrService == null ? new Base[0] : new Base[] {this.productOrService}; // CodeableConcept
4236        case -717476168: /*productOrServiceEnd*/ return this.productOrServiceEnd == null ? new Base[0] : new Base[] {this.productOrServiceEnd}; // CodeableConcept
4237        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept
4238        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
4239        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
4240        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
4241        case 114603: /*tax*/ return this.tax == null ? new Base[0] : new Base[] {this.tax}; // Money
4242        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
4243        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
4244        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
4245        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
4246        case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // AddedItemSubDetailComponent
4247        default: return super.getProperty(hash, name, checkValid);
4248        }
4249
4250      }
4251
4252      @Override
4253      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4254        switch (hash) {
4255        case 1099842588: // revenue
4256          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4257          return value;
4258        case 1957227299: // productOrService
4259          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4260          return value;
4261        case -717476168: // productOrServiceEnd
4262          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4263          return value;
4264        case -615513385: // modifier
4265          this.getModifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
4266          return value;
4267        case -1285004149: // quantity
4268          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
4269          return value;
4270        case -486196699: // unitPrice
4271          this.unitPrice = TypeConvertor.castToMoney(value); // Money
4272          return value;
4273        case -1282148017: // factor
4274          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
4275          return value;
4276        case 114603: // tax
4277          this.tax = TypeConvertor.castToMoney(value); // Money
4278          return value;
4279        case 108957: // net
4280          this.net = TypeConvertor.castToMoney(value); // Money
4281          return value;
4282        case -1110033957: // noteNumber
4283          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
4284          return value;
4285        case 565719004: // decision
4286          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4287          return value;
4288        case -231349275: // adjudication
4289          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
4290          return value;
4291        case -828829007: // subDetail
4292          this.getSubDetail().add((AddedItemSubDetailComponent) value); // AddedItemSubDetailComponent
4293          return value;
4294        default: return super.setProperty(hash, name, value);
4295        }
4296
4297      }
4298
4299      @Override
4300      public Base setProperty(String name, Base value) throws FHIRException {
4301        if (name.equals("revenue")) {
4302          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4303        } else if (name.equals("productOrService")) {
4304          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4305        } else if (name.equals("productOrServiceEnd")) {
4306          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4307        } else if (name.equals("modifier")) {
4308          this.getModifier().add(TypeConvertor.castToCodeableConcept(value));
4309        } else if (name.equals("quantity")) {
4310          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
4311        } else if (name.equals("unitPrice")) {
4312          this.unitPrice = TypeConvertor.castToMoney(value); // Money
4313        } else if (name.equals("factor")) {
4314          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
4315        } else if (name.equals("tax")) {
4316          this.tax = TypeConvertor.castToMoney(value); // Money
4317        } else if (name.equals("net")) {
4318          this.net = TypeConvertor.castToMoney(value); // Money
4319        } else if (name.equals("noteNumber")) {
4320          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
4321        } else if (name.equals("decision")) {
4322          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4323        } else if (name.equals("adjudication")) {
4324          this.getAdjudication().add((AdjudicationComponent) value);
4325        } else if (name.equals("subDetail")) {
4326          this.getSubDetail().add((AddedItemSubDetailComponent) value);
4327        } else
4328          return super.setProperty(name, value);
4329        return value;
4330      }
4331
4332      @Override
4333      public Base makeProperty(int hash, String name) throws FHIRException {
4334        switch (hash) {
4335        case 1099842588:  return getRevenue();
4336        case 1957227299:  return getProductOrService();
4337        case -717476168:  return getProductOrServiceEnd();
4338        case -615513385:  return addModifier(); 
4339        case -1285004149:  return getQuantity();
4340        case -486196699:  return getUnitPrice();
4341        case -1282148017:  return getFactorElement();
4342        case 114603:  return getTax();
4343        case 108957:  return getNet();
4344        case -1110033957:  return addNoteNumberElement();
4345        case 565719004:  return getDecision();
4346        case -231349275:  return addAdjudication(); 
4347        case -828829007:  return addSubDetail(); 
4348        default: return super.makeProperty(hash, name);
4349        }
4350
4351      }
4352
4353      @Override
4354      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4355        switch (hash) {
4356        case 1099842588: /*revenue*/ return new String[] {"CodeableConcept"};
4357        case 1957227299: /*productOrService*/ return new String[] {"CodeableConcept"};
4358        case -717476168: /*productOrServiceEnd*/ return new String[] {"CodeableConcept"};
4359        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
4360        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
4361        case -486196699: /*unitPrice*/ return new String[] {"Money"};
4362        case -1282148017: /*factor*/ return new String[] {"decimal"};
4363        case 114603: /*tax*/ return new String[] {"Money"};
4364        case 108957: /*net*/ return new String[] {"Money"};
4365        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
4366        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
4367        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
4368        case -828829007: /*subDetail*/ return new String[] {};
4369        default: return super.getTypesForProperty(hash, name);
4370        }
4371
4372      }
4373
4374      @Override
4375      public Base addChild(String name) throws FHIRException {
4376        if (name.equals("revenue")) {
4377          this.revenue = new CodeableConcept();
4378          return this.revenue;
4379        }
4380        else if (name.equals("productOrService")) {
4381          this.productOrService = new CodeableConcept();
4382          return this.productOrService;
4383        }
4384        else if (name.equals("productOrServiceEnd")) {
4385          this.productOrServiceEnd = new CodeableConcept();
4386          return this.productOrServiceEnd;
4387        }
4388        else if (name.equals("modifier")) {
4389          return addModifier();
4390        }
4391        else if (name.equals("quantity")) {
4392          this.quantity = new Quantity();
4393          return this.quantity;
4394        }
4395        else if (name.equals("unitPrice")) {
4396          this.unitPrice = new Money();
4397          return this.unitPrice;
4398        }
4399        else if (name.equals("factor")) {
4400          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.detail.factor");
4401        }
4402        else if (name.equals("tax")) {
4403          this.tax = new Money();
4404          return this.tax;
4405        }
4406        else if (name.equals("net")) {
4407          this.net = new Money();
4408          return this.net;
4409        }
4410        else if (name.equals("noteNumber")) {
4411          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.detail.noteNumber");
4412        }
4413        else if (name.equals("decision")) {
4414          this.decision = new CodeableConcept();
4415          return this.decision;
4416        }
4417        else if (name.equals("adjudication")) {
4418          return addAdjudication();
4419        }
4420        else if (name.equals("subDetail")) {
4421          return addSubDetail();
4422        }
4423        else
4424          return super.addChild(name);
4425      }
4426
4427      public AddedItemDetailComponent copy() {
4428        AddedItemDetailComponent dst = new AddedItemDetailComponent();
4429        copyValues(dst);
4430        return dst;
4431      }
4432
4433      public void copyValues(AddedItemDetailComponent dst) {
4434        super.copyValues(dst);
4435        dst.revenue = revenue == null ? null : revenue.copy();
4436        dst.productOrService = productOrService == null ? null : productOrService.copy();
4437        dst.productOrServiceEnd = productOrServiceEnd == null ? null : productOrServiceEnd.copy();
4438        if (modifier != null) {
4439          dst.modifier = new ArrayList<CodeableConcept>();
4440          for (CodeableConcept i : modifier)
4441            dst.modifier.add(i.copy());
4442        };
4443        dst.quantity = quantity == null ? null : quantity.copy();
4444        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
4445        dst.factor = factor == null ? null : factor.copy();
4446        dst.tax = tax == null ? null : tax.copy();
4447        dst.net = net == null ? null : net.copy();
4448        if (noteNumber != null) {
4449          dst.noteNumber = new ArrayList<PositiveIntType>();
4450          for (PositiveIntType i : noteNumber)
4451            dst.noteNumber.add(i.copy());
4452        };
4453        dst.decision = decision == null ? null : decision.copy();
4454        if (adjudication != null) {
4455          dst.adjudication = new ArrayList<AdjudicationComponent>();
4456          for (AdjudicationComponent i : adjudication)
4457            dst.adjudication.add(i.copy());
4458        };
4459        if (subDetail != null) {
4460          dst.subDetail = new ArrayList<AddedItemSubDetailComponent>();
4461          for (AddedItemSubDetailComponent i : subDetail)
4462            dst.subDetail.add(i.copy());
4463        };
4464      }
4465
4466      @Override
4467      public boolean equalsDeep(Base other_) {
4468        if (!super.equalsDeep(other_))
4469          return false;
4470        if (!(other_ instanceof AddedItemDetailComponent))
4471          return false;
4472        AddedItemDetailComponent o = (AddedItemDetailComponent) other_;
4473        return compareDeep(revenue, o.revenue, true) && compareDeep(productOrService, o.productOrService, true)
4474           && compareDeep(productOrServiceEnd, o.productOrServiceEnd, true) && compareDeep(modifier, o.modifier, true)
4475           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
4476           && compareDeep(tax, o.tax, true) && compareDeep(net, o.net, true) && compareDeep(noteNumber, o.noteNumber, true)
4477           && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(subDetail, o.subDetail, true)
4478          ;
4479      }
4480
4481      @Override
4482      public boolean equalsShallow(Base other_) {
4483        if (!super.equalsShallow(other_))
4484          return false;
4485        if (!(other_ instanceof AddedItemDetailComponent))
4486          return false;
4487        AddedItemDetailComponent o = (AddedItemDetailComponent) other_;
4488        return compareValues(factor, o.factor, true) && compareValues(noteNumber, o.noteNumber, true);
4489      }
4490
4491      public boolean isEmpty() {
4492        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(revenue, productOrService
4493          , productOrServiceEnd, modifier, quantity, unitPrice, factor, tax, net, noteNumber
4494          , decision, adjudication, subDetail);
4495      }
4496
4497  public String fhirType() {
4498    return "ClaimResponse.addItem.detail";
4499
4500  }
4501
4502  }
4503
4504    @Block()
4505    public static class AddedItemSubDetailComponent extends BackboneElement implements IBaseBackboneElement {
4506        /**
4507         * The type of revenue or cost center providing the product and/or service.
4508         */
4509        @Child(name = "revenue", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
4510        @Description(shortDefinition="Revenue or cost center code", formalDefinition="The type of revenue or cost center providing the product and/or service." )
4511        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-revenue-center")
4512        protected CodeableConcept revenue;
4513
4514        /**
4515         * When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.
4516         */
4517        @Child(name = "productOrService", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
4518        @Description(shortDefinition="Billing, service, product, or drug code", formalDefinition="When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used." )
4519        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
4520        protected CodeableConcept productOrService;
4521
4522        /**
4523         * This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.
4524         */
4525        @Child(name = "productOrServiceEnd", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
4526        @Description(shortDefinition="End of a range of codes", formalDefinition="This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims." )
4527        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
4528        protected CodeableConcept productOrServiceEnd;
4529
4530        /**
4531         * Item typification or modifiers codes to convey additional context for the product or service.
4532         */
4533        @Child(name = "modifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4534        @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes to convey additional context for the product or service." )
4535        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers")
4536        protected List<CodeableConcept> modifier;
4537
4538        /**
4539         * The number of repetitions of a service or product.
4540         */
4541        @Child(name = "quantity", type = {Quantity.class}, order=5, min=0, max=1, modifier=false, summary=false)
4542        @Description(shortDefinition="Count of products or services", formalDefinition="The number of repetitions of a service or product." )
4543        protected Quantity quantity;
4544
4545        /**
4546         * If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.
4547         */
4548        @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=false)
4549        @Description(shortDefinition="Fee, charge or cost per item", formalDefinition="If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group." )
4550        protected Money unitPrice;
4551
4552        /**
4553         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4554         */
4555        @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false)
4556        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
4557        protected DecimalType factor;
4558
4559        /**
4560         * The total of taxes applicable for this product or service.
4561         */
4562        @Child(name = "tax", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false)
4563        @Description(shortDefinition="Total tax", formalDefinition="The total of taxes applicable for this product or service." )
4564        protected Money tax;
4565
4566        /**
4567         * The quantity times the unit price for an additional service or product or charge.
4568         */
4569        @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=false)
4570        @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an additional service or product or charge." )
4571        protected Money net;
4572
4573        /**
4574         * The numbers associated with notes below which apply to the adjudication of this item.
4575         */
4576        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4577        @Description(shortDefinition="Applicable note numbers", formalDefinition="The numbers associated with notes below which apply to the adjudication of this item." )
4578        protected List<PositiveIntType> noteNumber;
4579
4580        /**
4581         * The result of the claim, predetermination, or preauthorization adjudication.
4582         */
4583        @Child(name = "decision", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false)
4584        @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
4585        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
4586        protected CodeableConcept decision;
4587
4588        /**
4589         * The adjudication results.
4590         */
4591        @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4592        @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudication results." )
4593        protected List<AdjudicationComponent> adjudication;
4594
4595        private static final long serialVersionUID = 1259363316L;
4596
4597    /**
4598     * Constructor
4599     */
4600      public AddedItemSubDetailComponent() {
4601        super();
4602      }
4603
4604        /**
4605         * @return {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
4606         */
4607        public CodeableConcept getRevenue() { 
4608          if (this.revenue == null)
4609            if (Configuration.errorOnAutoCreate())
4610              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.revenue");
4611            else if (Configuration.doAutoCreate())
4612              this.revenue = new CodeableConcept(); // cc
4613          return this.revenue;
4614        }
4615
4616        public boolean hasRevenue() { 
4617          return this.revenue != null && !this.revenue.isEmpty();
4618        }
4619
4620        /**
4621         * @param value {@link #revenue} (The type of revenue or cost center providing the product and/or service.)
4622         */
4623        public AddedItemSubDetailComponent setRevenue(CodeableConcept value) { 
4624          this.revenue = value;
4625          return this;
4626        }
4627
4628        /**
4629         * @return {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
4630         */
4631        public CodeableConcept getProductOrService() { 
4632          if (this.productOrService == null)
4633            if (Configuration.errorOnAutoCreate())
4634              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.productOrService");
4635            else if (Configuration.doAutoCreate())
4636              this.productOrService = new CodeableConcept(); // cc
4637          return this.productOrService;
4638        }
4639
4640        public boolean hasProductOrService() { 
4641          return this.productOrService != null && !this.productOrService.isEmpty();
4642        }
4643
4644        /**
4645         * @param value {@link #productOrService} (When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.)
4646         */
4647        public AddedItemSubDetailComponent setProductOrService(CodeableConcept value) { 
4648          this.productOrService = value;
4649          return this;
4650        }
4651
4652        /**
4653         * @return {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
4654         */
4655        public CodeableConcept getProductOrServiceEnd() { 
4656          if (this.productOrServiceEnd == null)
4657            if (Configuration.errorOnAutoCreate())
4658              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.productOrServiceEnd");
4659            else if (Configuration.doAutoCreate())
4660              this.productOrServiceEnd = new CodeableConcept(); // cc
4661          return this.productOrServiceEnd;
4662        }
4663
4664        public boolean hasProductOrServiceEnd() { 
4665          return this.productOrServiceEnd != null && !this.productOrServiceEnd.isEmpty();
4666        }
4667
4668        /**
4669         * @param value {@link #productOrServiceEnd} (This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.)
4670         */
4671        public AddedItemSubDetailComponent setProductOrServiceEnd(CodeableConcept value) { 
4672          this.productOrServiceEnd = value;
4673          return this;
4674        }
4675
4676        /**
4677         * @return {@link #modifier} (Item typification or modifiers codes to convey additional context for the product or service.)
4678         */
4679        public List<CodeableConcept> getModifier() { 
4680          if (this.modifier == null)
4681            this.modifier = new ArrayList<CodeableConcept>();
4682          return this.modifier;
4683        }
4684
4685        /**
4686         * @return Returns a reference to <code>this</code> for easy method chaining
4687         */
4688        public AddedItemSubDetailComponent setModifier(List<CodeableConcept> theModifier) { 
4689          this.modifier = theModifier;
4690          return this;
4691        }
4692
4693        public boolean hasModifier() { 
4694          if (this.modifier == null)
4695            return false;
4696          for (CodeableConcept item : this.modifier)
4697            if (!item.isEmpty())
4698              return true;
4699          return false;
4700        }
4701
4702        public CodeableConcept addModifier() { //3
4703          CodeableConcept t = new CodeableConcept();
4704          if (this.modifier == null)
4705            this.modifier = new ArrayList<CodeableConcept>();
4706          this.modifier.add(t);
4707          return t;
4708        }
4709
4710        public AddedItemSubDetailComponent addModifier(CodeableConcept t) { //3
4711          if (t == null)
4712            return this;
4713          if (this.modifier == null)
4714            this.modifier = new ArrayList<CodeableConcept>();
4715          this.modifier.add(t);
4716          return this;
4717        }
4718
4719        /**
4720         * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist {3}
4721         */
4722        public CodeableConcept getModifierFirstRep() { 
4723          if (getModifier().isEmpty()) {
4724            addModifier();
4725          }
4726          return getModifier().get(0);
4727        }
4728
4729        /**
4730         * @return {@link #quantity} (The number of repetitions of a service or product.)
4731         */
4732        public Quantity getQuantity() { 
4733          if (this.quantity == null)
4734            if (Configuration.errorOnAutoCreate())
4735              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.quantity");
4736            else if (Configuration.doAutoCreate())
4737              this.quantity = new Quantity(); // cc
4738          return this.quantity;
4739        }
4740
4741        public boolean hasQuantity() { 
4742          return this.quantity != null && !this.quantity.isEmpty();
4743        }
4744
4745        /**
4746         * @param value {@link #quantity} (The number of repetitions of a service or product.)
4747         */
4748        public AddedItemSubDetailComponent setQuantity(Quantity value) { 
4749          this.quantity = value;
4750          return this;
4751        }
4752
4753        /**
4754         * @return {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
4755         */
4756        public Money getUnitPrice() { 
4757          if (this.unitPrice == null)
4758            if (Configuration.errorOnAutoCreate())
4759              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.unitPrice");
4760            else if (Configuration.doAutoCreate())
4761              this.unitPrice = new Money(); // cc
4762          return this.unitPrice;
4763        }
4764
4765        public boolean hasUnitPrice() { 
4766          return this.unitPrice != null && !this.unitPrice.isEmpty();
4767        }
4768
4769        /**
4770         * @param value {@link #unitPrice} (If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.)
4771         */
4772        public AddedItemSubDetailComponent setUnitPrice(Money value) { 
4773          this.unitPrice = value;
4774          return this;
4775        }
4776
4777        /**
4778         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
4779         */
4780        public DecimalType getFactorElement() { 
4781          if (this.factor == null)
4782            if (Configuration.errorOnAutoCreate())
4783              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.factor");
4784            else if (Configuration.doAutoCreate())
4785              this.factor = new DecimalType(); // bb
4786          return this.factor;
4787        }
4788
4789        public boolean hasFactorElement() { 
4790          return this.factor != null && !this.factor.isEmpty();
4791        }
4792
4793        public boolean hasFactor() { 
4794          return this.factor != null && !this.factor.isEmpty();
4795        }
4796
4797        /**
4798         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
4799         */
4800        public AddedItemSubDetailComponent setFactorElement(DecimalType value) { 
4801          this.factor = value;
4802          return this;
4803        }
4804
4805        /**
4806         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4807         */
4808        public BigDecimal getFactor() { 
4809          return this.factor == null ? null : this.factor.getValue();
4810        }
4811
4812        /**
4813         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4814         */
4815        public AddedItemSubDetailComponent setFactor(BigDecimal value) { 
4816          if (value == null)
4817            this.factor = null;
4818          else {
4819            if (this.factor == null)
4820              this.factor = new DecimalType();
4821            this.factor.setValue(value);
4822          }
4823          return this;
4824        }
4825
4826        /**
4827         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4828         */
4829        public AddedItemSubDetailComponent setFactor(long value) { 
4830              this.factor = new DecimalType();
4831            this.factor.setValue(value);
4832          return this;
4833        }
4834
4835        /**
4836         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4837         */
4838        public AddedItemSubDetailComponent setFactor(double value) { 
4839              this.factor = new DecimalType();
4840            this.factor.setValue(value);
4841          return this;
4842        }
4843
4844        /**
4845         * @return {@link #tax} (The total of taxes applicable for this product or service.)
4846         */
4847        public Money getTax() { 
4848          if (this.tax == null)
4849            if (Configuration.errorOnAutoCreate())
4850              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.tax");
4851            else if (Configuration.doAutoCreate())
4852              this.tax = new Money(); // cc
4853          return this.tax;
4854        }
4855
4856        public boolean hasTax() { 
4857          return this.tax != null && !this.tax.isEmpty();
4858        }
4859
4860        /**
4861         * @param value {@link #tax} (The total of taxes applicable for this product or service.)
4862         */
4863        public AddedItemSubDetailComponent setTax(Money value) { 
4864          this.tax = value;
4865          return this;
4866        }
4867
4868        /**
4869         * @return {@link #net} (The quantity times the unit price for an additional service or product or charge.)
4870         */
4871        public Money getNet() { 
4872          if (this.net == null)
4873            if (Configuration.errorOnAutoCreate())
4874              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.net");
4875            else if (Configuration.doAutoCreate())
4876              this.net = new Money(); // cc
4877          return this.net;
4878        }
4879
4880        public boolean hasNet() { 
4881          return this.net != null && !this.net.isEmpty();
4882        }
4883
4884        /**
4885         * @param value {@link #net} (The quantity times the unit price for an additional service or product or charge.)
4886         */
4887        public AddedItemSubDetailComponent setNet(Money value) { 
4888          this.net = value;
4889          return this;
4890        }
4891
4892        /**
4893         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4894         */
4895        public List<PositiveIntType> getNoteNumber() { 
4896          if (this.noteNumber == null)
4897            this.noteNumber = new ArrayList<PositiveIntType>();
4898          return this.noteNumber;
4899        }
4900
4901        /**
4902         * @return Returns a reference to <code>this</code> for easy method chaining
4903         */
4904        public AddedItemSubDetailComponent setNoteNumber(List<PositiveIntType> theNoteNumber) { 
4905          this.noteNumber = theNoteNumber;
4906          return this;
4907        }
4908
4909        public boolean hasNoteNumber() { 
4910          if (this.noteNumber == null)
4911            return false;
4912          for (PositiveIntType item : this.noteNumber)
4913            if (!item.isEmpty())
4914              return true;
4915          return false;
4916        }
4917
4918        /**
4919         * @return {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4920         */
4921        public PositiveIntType addNoteNumberElement() {//2 
4922          PositiveIntType t = new PositiveIntType();
4923          if (this.noteNumber == null)
4924            this.noteNumber = new ArrayList<PositiveIntType>();
4925          this.noteNumber.add(t);
4926          return t;
4927        }
4928
4929        /**
4930         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4931         */
4932        public AddedItemSubDetailComponent addNoteNumber(int value) { //1
4933          PositiveIntType t = new PositiveIntType();
4934          t.setValue(value);
4935          if (this.noteNumber == null)
4936            this.noteNumber = new ArrayList<PositiveIntType>();
4937          this.noteNumber.add(t);
4938          return this;
4939        }
4940
4941        /**
4942         * @param value {@link #noteNumber} (The numbers associated with notes below which apply to the adjudication of this item.)
4943         */
4944        public boolean hasNoteNumber(int value) { 
4945          if (this.noteNumber == null)
4946            return false;
4947          for (PositiveIntType v : this.noteNumber)
4948            if (v.getValue().equals(value)) // positiveInt
4949              return true;
4950          return false;
4951        }
4952
4953        /**
4954         * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
4955         */
4956        public CodeableConcept getDecision() { 
4957          if (this.decision == null)
4958            if (Configuration.errorOnAutoCreate())
4959              throw new Error("Attempt to auto-create AddedItemSubDetailComponent.decision");
4960            else if (Configuration.doAutoCreate())
4961              this.decision = new CodeableConcept(); // cc
4962          return this.decision;
4963        }
4964
4965        public boolean hasDecision() { 
4966          return this.decision != null && !this.decision.isEmpty();
4967        }
4968
4969        /**
4970         * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
4971         */
4972        public AddedItemSubDetailComponent setDecision(CodeableConcept value) { 
4973          this.decision = value;
4974          return this;
4975        }
4976
4977        /**
4978         * @return {@link #adjudication} (The adjudication results.)
4979         */
4980        public List<AdjudicationComponent> getAdjudication() { 
4981          if (this.adjudication == null)
4982            this.adjudication = new ArrayList<AdjudicationComponent>();
4983          return this.adjudication;
4984        }
4985
4986        /**
4987         * @return Returns a reference to <code>this</code> for easy method chaining
4988         */
4989        public AddedItemSubDetailComponent setAdjudication(List<AdjudicationComponent> theAdjudication) { 
4990          this.adjudication = theAdjudication;
4991          return this;
4992        }
4993
4994        public boolean hasAdjudication() { 
4995          if (this.adjudication == null)
4996            return false;
4997          for (AdjudicationComponent item : this.adjudication)
4998            if (!item.isEmpty())
4999              return true;
5000          return false;
5001        }
5002
5003        public AdjudicationComponent addAdjudication() { //3
5004          AdjudicationComponent t = new AdjudicationComponent();
5005          if (this.adjudication == null)
5006            this.adjudication = new ArrayList<AdjudicationComponent>();
5007          this.adjudication.add(t);
5008          return t;
5009        }
5010
5011        public AddedItemSubDetailComponent addAdjudication(AdjudicationComponent t) { //3
5012          if (t == null)
5013            return this;
5014          if (this.adjudication == null)
5015            this.adjudication = new ArrayList<AdjudicationComponent>();
5016          this.adjudication.add(t);
5017          return this;
5018        }
5019
5020        /**
5021         * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
5022         */
5023        public AdjudicationComponent getAdjudicationFirstRep() { 
5024          if (getAdjudication().isEmpty()) {
5025            addAdjudication();
5026          }
5027          return getAdjudication().get(0);
5028        }
5029
5030        protected void listChildren(List<Property> children) {
5031          super.listChildren(children);
5032          children.add(new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue));
5033          children.add(new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService));
5034          children.add(new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd));
5035          children.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier));
5036          children.add(new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity));
5037          children.add(new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice));
5038          children.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor));
5039          children.add(new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax));
5040          children.add(new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net));
5041          children.add(new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
5042          children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
5043          children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
5044        }
5045
5046        @Override
5047        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5048          switch (_hash) {
5049          case 1099842588: /*revenue*/  return new Property("revenue", "CodeableConcept", "The type of revenue or cost center providing the product and/or service.", 0, 1, revenue);
5050          case 1957227299: /*productOrService*/  return new Property("productOrService", "CodeableConcept", "When the value is a group code then this item collects a set of related item details, otherwise this contains the product, service, drug or other billing code for the item. This element may be the start of a range of .productOrService codes used in conjunction with .productOrServiceEnd or it may be a solo element where .productOrServiceEnd is not used.", 0, 1, productOrService);
5051          case -717476168: /*productOrServiceEnd*/  return new Property("productOrServiceEnd", "CodeableConcept", "This contains the end of a range of product, service, drug or other billing codes for the item. This element is not used when the .productOrService is a group code. This value may only be present when a .productOfService code has been provided to convey the start of the range. Typically this value may be used only with preauthorizations and not with claims.", 0, 1, productOrServiceEnd);
5052          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier);
5053          case -1285004149: /*quantity*/  return new Property("quantity", "Quantity", "The number of repetitions of a service or product.", 0, 1, quantity);
5054          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.", 0, 1, unitPrice);
5055          case -1282148017: /*factor*/  return new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, 1, factor);
5056          case 114603: /*tax*/  return new Property("tax", "Money", "The total of taxes applicable for this product or service.", 0, 1, tax);
5057          case 108957: /*net*/  return new Property("net", "Money", "The quantity times the unit price for an additional service or product or charge.", 0, 1, net);
5058          case -1110033957: /*noteNumber*/  return new Property("noteNumber", "positiveInt", "The numbers associated with notes below which apply to the adjudication of this item.", 0, java.lang.Integer.MAX_VALUE, noteNumber);
5059          case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
5060          case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results.", 0, java.lang.Integer.MAX_VALUE, adjudication);
5061          default: return super.getNamedProperty(_hash, _name, _checkValid);
5062          }
5063
5064        }
5065
5066      @Override
5067      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5068        switch (hash) {
5069        case 1099842588: /*revenue*/ return this.revenue == null ? new Base[0] : new Base[] {this.revenue}; // CodeableConcept
5070        case 1957227299: /*productOrService*/ return this.productOrService == null ? new Base[0] : new Base[] {this.productOrService}; // CodeableConcept
5071        case -717476168: /*productOrServiceEnd*/ return this.productOrServiceEnd == null ? new Base[0] : new Base[] {this.productOrServiceEnd}; // CodeableConcept
5072        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept
5073        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
5074        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
5075        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
5076        case 114603: /*tax*/ return this.tax == null ? new Base[0] : new Base[] {this.tax}; // Money
5077        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
5078        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
5079        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
5080        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
5081        default: return super.getProperty(hash, name, checkValid);
5082        }
5083
5084      }
5085
5086      @Override
5087      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5088        switch (hash) {
5089        case 1099842588: // revenue
5090          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5091          return value;
5092        case 1957227299: // productOrService
5093          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5094          return value;
5095        case -717476168: // productOrServiceEnd
5096          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5097          return value;
5098        case -615513385: // modifier
5099          this.getModifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
5100          return value;
5101        case -1285004149: // quantity
5102          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
5103          return value;
5104        case -486196699: // unitPrice
5105          this.unitPrice = TypeConvertor.castToMoney(value); // Money
5106          return value;
5107        case -1282148017: // factor
5108          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
5109          return value;
5110        case 114603: // tax
5111          this.tax = TypeConvertor.castToMoney(value); // Money
5112          return value;
5113        case 108957: // net
5114          this.net = TypeConvertor.castToMoney(value); // Money
5115          return value;
5116        case -1110033957: // noteNumber
5117          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value)); // PositiveIntType
5118          return value;
5119        case 565719004: // decision
5120          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5121          return value;
5122        case -231349275: // adjudication
5123          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
5124          return value;
5125        default: return super.setProperty(hash, name, value);
5126        }
5127
5128      }
5129
5130      @Override
5131      public Base setProperty(String name, Base value) throws FHIRException {
5132        if (name.equals("revenue")) {
5133          this.revenue = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5134        } else if (name.equals("productOrService")) {
5135          this.productOrService = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5136        } else if (name.equals("productOrServiceEnd")) {
5137          this.productOrServiceEnd = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5138        } else if (name.equals("modifier")) {
5139          this.getModifier().add(TypeConvertor.castToCodeableConcept(value));
5140        } else if (name.equals("quantity")) {
5141          this.quantity = TypeConvertor.castToQuantity(value); // Quantity
5142        } else if (name.equals("unitPrice")) {
5143          this.unitPrice = TypeConvertor.castToMoney(value); // Money
5144        } else if (name.equals("factor")) {
5145          this.factor = TypeConvertor.castToDecimal(value); // DecimalType
5146        } else if (name.equals("tax")) {
5147          this.tax = TypeConvertor.castToMoney(value); // Money
5148        } else if (name.equals("net")) {
5149          this.net = TypeConvertor.castToMoney(value); // Money
5150        } else if (name.equals("noteNumber")) {
5151          this.getNoteNumber().add(TypeConvertor.castToPositiveInt(value));
5152        } else if (name.equals("decision")) {
5153          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5154        } else if (name.equals("adjudication")) {
5155          this.getAdjudication().add((AdjudicationComponent) value);
5156        } else
5157          return super.setProperty(name, value);
5158        return value;
5159      }
5160
5161      @Override
5162      public Base makeProperty(int hash, String name) throws FHIRException {
5163        switch (hash) {
5164        case 1099842588:  return getRevenue();
5165        case 1957227299:  return getProductOrService();
5166        case -717476168:  return getProductOrServiceEnd();
5167        case -615513385:  return addModifier(); 
5168        case -1285004149:  return getQuantity();
5169        case -486196699:  return getUnitPrice();
5170        case -1282148017:  return getFactorElement();
5171        case 114603:  return getTax();
5172        case 108957:  return getNet();
5173        case -1110033957:  return addNoteNumberElement();
5174        case 565719004:  return getDecision();
5175        case -231349275:  return addAdjudication(); 
5176        default: return super.makeProperty(hash, name);
5177        }
5178
5179      }
5180
5181      @Override
5182      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5183        switch (hash) {
5184        case 1099842588: /*revenue*/ return new String[] {"CodeableConcept"};
5185        case 1957227299: /*productOrService*/ return new String[] {"CodeableConcept"};
5186        case -717476168: /*productOrServiceEnd*/ return new String[] {"CodeableConcept"};
5187        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
5188        case -1285004149: /*quantity*/ return new String[] {"Quantity"};
5189        case -486196699: /*unitPrice*/ return new String[] {"Money"};
5190        case -1282148017: /*factor*/ return new String[] {"decimal"};
5191        case 114603: /*tax*/ return new String[] {"Money"};
5192        case 108957: /*net*/ return new String[] {"Money"};
5193        case -1110033957: /*noteNumber*/ return new String[] {"positiveInt"};
5194        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
5195        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
5196        default: return super.getTypesForProperty(hash, name);
5197        }
5198
5199      }
5200
5201      @Override
5202      public Base addChild(String name) throws FHIRException {
5203        if (name.equals("revenue")) {
5204          this.revenue = new CodeableConcept();
5205          return this.revenue;
5206        }
5207        else if (name.equals("productOrService")) {
5208          this.productOrService = new CodeableConcept();
5209          return this.productOrService;
5210        }
5211        else if (name.equals("productOrServiceEnd")) {
5212          this.productOrServiceEnd = new CodeableConcept();
5213          return this.productOrServiceEnd;
5214        }
5215        else if (name.equals("modifier")) {
5216          return addModifier();
5217        }
5218        else if (name.equals("quantity")) {
5219          this.quantity = new Quantity();
5220          return this.quantity;
5221        }
5222        else if (name.equals("unitPrice")) {
5223          this.unitPrice = new Money();
5224          return this.unitPrice;
5225        }
5226        else if (name.equals("factor")) {
5227          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.detail.subDetail.factor");
5228        }
5229        else if (name.equals("tax")) {
5230          this.tax = new Money();
5231          return this.tax;
5232        }
5233        else if (name.equals("net")) {
5234          this.net = new Money();
5235          return this.net;
5236        }
5237        else if (name.equals("noteNumber")) {
5238          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.addItem.detail.subDetail.noteNumber");
5239        }
5240        else if (name.equals("decision")) {
5241          this.decision = new CodeableConcept();
5242          return this.decision;
5243        }
5244        else if (name.equals("adjudication")) {
5245          return addAdjudication();
5246        }
5247        else
5248          return super.addChild(name);
5249      }
5250
5251      public AddedItemSubDetailComponent copy() {
5252        AddedItemSubDetailComponent dst = new AddedItemSubDetailComponent();
5253        copyValues(dst);
5254        return dst;
5255      }
5256
5257      public void copyValues(AddedItemSubDetailComponent dst) {
5258        super.copyValues(dst);
5259        dst.revenue = revenue == null ? null : revenue.copy();
5260        dst.productOrService = productOrService == null ? null : productOrService.copy();
5261        dst.productOrServiceEnd = productOrServiceEnd == null ? null : productOrServiceEnd.copy();
5262        if (modifier != null) {
5263          dst.modifier = new ArrayList<CodeableConcept>();
5264          for (CodeableConcept i : modifier)
5265            dst.modifier.add(i.copy());
5266        };
5267        dst.quantity = quantity == null ? null : quantity.copy();
5268        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
5269        dst.factor = factor == null ? null : factor.copy();
5270        dst.tax = tax == null ? null : tax.copy();
5271        dst.net = net == null ? null : net.copy();
5272        if (noteNumber != null) {
5273          dst.noteNumber = new ArrayList<PositiveIntType>();
5274          for (PositiveIntType i : noteNumber)
5275            dst.noteNumber.add(i.copy());
5276        };
5277        dst.decision = decision == null ? null : decision.copy();
5278        if (adjudication != null) {
5279          dst.adjudication = new ArrayList<AdjudicationComponent>();
5280          for (AdjudicationComponent i : adjudication)
5281            dst.adjudication.add(i.copy());
5282        };
5283      }
5284
5285      @Override
5286      public boolean equalsDeep(Base other_) {
5287        if (!super.equalsDeep(other_))
5288          return false;
5289        if (!(other_ instanceof AddedItemSubDetailComponent))
5290          return false;
5291        AddedItemSubDetailComponent o = (AddedItemSubDetailComponent) other_;
5292        return compareDeep(revenue, o.revenue, true) && compareDeep(productOrService, o.productOrService, true)
5293           && compareDeep(productOrServiceEnd, o.productOrServiceEnd, true) && compareDeep(modifier, o.modifier, true)
5294           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
5295           && compareDeep(tax, o.tax, true) && compareDeep(net, o.net, true) && compareDeep(noteNumber, o.noteNumber, true)
5296           && compareDeep(decision, o.decision, true) && compareDeep(adjudication, o.adjudication, true);
5297      }
5298
5299      @Override
5300      public boolean equalsShallow(Base other_) {
5301        if (!super.equalsShallow(other_))
5302          return false;
5303        if (!(other_ instanceof AddedItemSubDetailComponent))
5304          return false;
5305        AddedItemSubDetailComponent o = (AddedItemSubDetailComponent) other_;
5306        return compareValues(factor, o.factor, true) && compareValues(noteNumber, o.noteNumber, true);
5307      }
5308
5309      public boolean isEmpty() {
5310        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(revenue, productOrService
5311          , productOrServiceEnd, modifier, quantity, unitPrice, factor, tax, net, noteNumber
5312          , decision, adjudication);
5313      }
5314
5315  public String fhirType() {
5316    return "ClaimResponse.addItem.detail.subDetail";
5317
5318  }
5319
5320  }
5321
5322    @Block()
5323    public static class TotalComponent extends BackboneElement implements IBaseBackboneElement {
5324        /**
5325         * A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.
5326         */
5327        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
5328        @Description(shortDefinition="Type of adjudication information", formalDefinition="A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item." )
5329        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication")
5330        protected CodeableConcept category;
5331
5332        /**
5333         * Monetary total amount associated with the category.
5334         */
5335        @Child(name = "amount", type = {Money.class}, order=2, min=1, max=1, modifier=false, summary=true)
5336        @Description(shortDefinition="Financial total for the category", formalDefinition="Monetary total amount associated with the category." )
5337        protected Money amount;
5338
5339        private static final long serialVersionUID = 2012310309L;
5340
5341    /**
5342     * Constructor
5343     */
5344      public TotalComponent() {
5345        super();
5346      }
5347
5348    /**
5349     * Constructor
5350     */
5351      public TotalComponent(CodeableConcept category, Money amount) {
5352        super();
5353        this.setCategory(category);
5354        this.setAmount(amount);
5355      }
5356
5357        /**
5358         * @return {@link #category} (A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.)
5359         */
5360        public CodeableConcept getCategory() { 
5361          if (this.category == null)
5362            if (Configuration.errorOnAutoCreate())
5363              throw new Error("Attempt to auto-create TotalComponent.category");
5364            else if (Configuration.doAutoCreate())
5365              this.category = new CodeableConcept(); // cc
5366          return this.category;
5367        }
5368
5369        public boolean hasCategory() { 
5370          return this.category != null && !this.category.isEmpty();
5371        }
5372
5373        /**
5374         * @param value {@link #category} (A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.)
5375         */
5376        public TotalComponent setCategory(CodeableConcept value) { 
5377          this.category = value;
5378          return this;
5379        }
5380
5381        /**
5382         * @return {@link #amount} (Monetary total amount associated with the category.)
5383         */
5384        public Money getAmount() { 
5385          if (this.amount == null)
5386            if (Configuration.errorOnAutoCreate())
5387              throw new Error("Attempt to auto-create TotalComponent.amount");
5388            else if (Configuration.doAutoCreate())
5389              this.amount = new Money(); // cc
5390          return this.amount;
5391        }
5392
5393        public boolean hasAmount() { 
5394          return this.amount != null && !this.amount.isEmpty();
5395        }
5396
5397        /**
5398         * @param value {@link #amount} (Monetary total amount associated with the category.)
5399         */
5400        public TotalComponent setAmount(Money value) { 
5401          this.amount = value;
5402          return this;
5403        }
5404
5405        protected void listChildren(List<Property> children) {
5406          super.listChildren(children);
5407          children.add(new Property("category", "CodeableConcept", "A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.", 0, 1, category));
5408          children.add(new Property("amount", "Money", "Monetary total amount associated with the category.", 0, 1, amount));
5409        }
5410
5411        @Override
5412        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5413          switch (_hash) {
5414          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.", 0, 1, category);
5415          case -1413853096: /*amount*/  return new Property("amount", "Money", "Monetary total amount associated with the category.", 0, 1, amount);
5416          default: return super.getNamedProperty(_hash, _name, _checkValid);
5417          }
5418
5419        }
5420
5421      @Override
5422      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5423        switch (hash) {
5424        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
5425        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
5426        default: return super.getProperty(hash, name, checkValid);
5427        }
5428
5429      }
5430
5431      @Override
5432      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5433        switch (hash) {
5434        case 50511102: // category
5435          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5436          return value;
5437        case -1413853096: // amount
5438          this.amount = TypeConvertor.castToMoney(value); // Money
5439          return value;
5440        default: return super.setProperty(hash, name, value);
5441        }
5442
5443      }
5444
5445      @Override
5446      public Base setProperty(String name, Base value) throws FHIRException {
5447        if (name.equals("category")) {
5448          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5449        } else if (name.equals("amount")) {
5450          this.amount = TypeConvertor.castToMoney(value); // Money
5451        } else
5452          return super.setProperty(name, value);
5453        return value;
5454      }
5455
5456      @Override
5457      public Base makeProperty(int hash, String name) throws FHIRException {
5458        switch (hash) {
5459        case 50511102:  return getCategory();
5460        case -1413853096:  return getAmount();
5461        default: return super.makeProperty(hash, name);
5462        }
5463
5464      }
5465
5466      @Override
5467      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5468        switch (hash) {
5469        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
5470        case -1413853096: /*amount*/ return new String[] {"Money"};
5471        default: return super.getTypesForProperty(hash, name);
5472        }
5473
5474      }
5475
5476      @Override
5477      public Base addChild(String name) throws FHIRException {
5478        if (name.equals("category")) {
5479          this.category = new CodeableConcept();
5480          return this.category;
5481        }
5482        else if (name.equals("amount")) {
5483          this.amount = new Money();
5484          return this.amount;
5485        }
5486        else
5487          return super.addChild(name);
5488      }
5489
5490      public TotalComponent copy() {
5491        TotalComponent dst = new TotalComponent();
5492        copyValues(dst);
5493        return dst;
5494      }
5495
5496      public void copyValues(TotalComponent dst) {
5497        super.copyValues(dst);
5498        dst.category = category == null ? null : category.copy();
5499        dst.amount = amount == null ? null : amount.copy();
5500      }
5501
5502      @Override
5503      public boolean equalsDeep(Base other_) {
5504        if (!super.equalsDeep(other_))
5505          return false;
5506        if (!(other_ instanceof TotalComponent))
5507          return false;
5508        TotalComponent o = (TotalComponent) other_;
5509        return compareDeep(category, o.category, true) && compareDeep(amount, o.amount, true);
5510      }
5511
5512      @Override
5513      public boolean equalsShallow(Base other_) {
5514        if (!super.equalsShallow(other_))
5515          return false;
5516        if (!(other_ instanceof TotalComponent))
5517          return false;
5518        TotalComponent o = (TotalComponent) other_;
5519        return true;
5520      }
5521
5522      public boolean isEmpty() {
5523        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, amount);
5524      }
5525
5526  public String fhirType() {
5527    return "ClaimResponse.total";
5528
5529  }
5530
5531  }
5532
5533    @Block()
5534    public static class PaymentComponent extends BackboneElement implements IBaseBackboneElement {
5535        /**
5536         * Whether this represents partial or complete payment of the benefits payable.
5537         */
5538        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
5539        @Description(shortDefinition="Partial or complete payment", formalDefinition="Whether this represents partial or complete payment of the benefits payable." )
5540        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-paymenttype")
5541        protected CodeableConcept type;
5542
5543        /**
5544         * Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.
5545         */
5546        @Child(name = "adjustment", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=false)
5547        @Description(shortDefinition="Payment adjustment for non-claim issues", formalDefinition="Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication." )
5548        protected Money adjustment;
5549
5550        /**
5551         * Reason for the payment adjustment.
5552         */
5553        @Child(name = "adjustmentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
5554        @Description(shortDefinition="Explanation for the adjustment", formalDefinition="Reason for the payment adjustment." )
5555        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payment-adjustment-reason")
5556        protected CodeableConcept adjustmentReason;
5557
5558        /**
5559         * Estimated date the payment will be issued or the actual issue date of payment.
5560         */
5561        @Child(name = "date", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5562        @Description(shortDefinition="Expected date of payment", formalDefinition="Estimated date the payment will be issued or the actual issue date of payment." )
5563        protected DateType date;
5564
5565        /**
5566         * Benefits payable less any payment adjustment.
5567         */
5568        @Child(name = "amount", type = {Money.class}, order=5, min=1, max=1, modifier=false, summary=false)
5569        @Description(shortDefinition="Payable amount after adjustment", formalDefinition="Benefits payable less any payment adjustment." )
5570        protected Money amount;
5571
5572        /**
5573         * Issuer's unique identifier for the payment instrument.
5574         */
5575        @Child(name = "identifier", type = {Identifier.class}, order=6, min=0, max=1, modifier=false, summary=false)
5576        @Description(shortDefinition="Business identifier for the payment", formalDefinition="Issuer's unique identifier for the payment instrument." )
5577        protected Identifier identifier;
5578
5579        private static final long serialVersionUID = 1539906026L;
5580
5581    /**
5582     * Constructor
5583     */
5584      public PaymentComponent() {
5585        super();
5586      }
5587
5588    /**
5589     * Constructor
5590     */
5591      public PaymentComponent(CodeableConcept type, Money amount) {
5592        super();
5593        this.setType(type);
5594        this.setAmount(amount);
5595      }
5596
5597        /**
5598         * @return {@link #type} (Whether this represents partial or complete payment of the benefits payable.)
5599         */
5600        public CodeableConcept getType() { 
5601          if (this.type == null)
5602            if (Configuration.errorOnAutoCreate())
5603              throw new Error("Attempt to auto-create PaymentComponent.type");
5604            else if (Configuration.doAutoCreate())
5605              this.type = new CodeableConcept(); // cc
5606          return this.type;
5607        }
5608
5609        public boolean hasType() { 
5610          return this.type != null && !this.type.isEmpty();
5611        }
5612
5613        /**
5614         * @param value {@link #type} (Whether this represents partial or complete payment of the benefits payable.)
5615         */
5616        public PaymentComponent setType(CodeableConcept value) { 
5617          this.type = value;
5618          return this;
5619        }
5620
5621        /**
5622         * @return {@link #adjustment} (Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.)
5623         */
5624        public Money getAdjustment() { 
5625          if (this.adjustment == null)
5626            if (Configuration.errorOnAutoCreate())
5627              throw new Error("Attempt to auto-create PaymentComponent.adjustment");
5628            else if (Configuration.doAutoCreate())
5629              this.adjustment = new Money(); // cc
5630          return this.adjustment;
5631        }
5632
5633        public boolean hasAdjustment() { 
5634          return this.adjustment != null && !this.adjustment.isEmpty();
5635        }
5636
5637        /**
5638         * @param value {@link #adjustment} (Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.)
5639         */
5640        public PaymentComponent setAdjustment(Money value) { 
5641          this.adjustment = value;
5642          return this;
5643        }
5644
5645        /**
5646         * @return {@link #adjustmentReason} (Reason for the payment adjustment.)
5647         */
5648        public CodeableConcept getAdjustmentReason() { 
5649          if (this.adjustmentReason == null)
5650            if (Configuration.errorOnAutoCreate())
5651              throw new Error("Attempt to auto-create PaymentComponent.adjustmentReason");
5652            else if (Configuration.doAutoCreate())
5653              this.adjustmentReason = new CodeableConcept(); // cc
5654          return this.adjustmentReason;
5655        }
5656
5657        public boolean hasAdjustmentReason() { 
5658          return this.adjustmentReason != null && !this.adjustmentReason.isEmpty();
5659        }
5660
5661        /**
5662         * @param value {@link #adjustmentReason} (Reason for the payment adjustment.)
5663         */
5664        public PaymentComponent setAdjustmentReason(CodeableConcept value) { 
5665          this.adjustmentReason = value;
5666          return this;
5667        }
5668
5669        /**
5670         * @return {@link #date} (Estimated date the payment will be issued or the actual issue date of payment.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5671         */
5672        public DateType getDateElement() { 
5673          if (this.date == null)
5674            if (Configuration.errorOnAutoCreate())
5675              throw new Error("Attempt to auto-create PaymentComponent.date");
5676            else if (Configuration.doAutoCreate())
5677              this.date = new DateType(); // bb
5678          return this.date;
5679        }
5680
5681        public boolean hasDateElement() { 
5682          return this.date != null && !this.date.isEmpty();
5683        }
5684
5685        public boolean hasDate() { 
5686          return this.date != null && !this.date.isEmpty();
5687        }
5688
5689        /**
5690         * @param value {@link #date} (Estimated date the payment will be issued or the actual issue date of payment.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
5691         */
5692        public PaymentComponent setDateElement(DateType value) { 
5693          this.date = value;
5694          return this;
5695        }
5696
5697        /**
5698         * @return Estimated date the payment will be issued or the actual issue date of payment.
5699         */
5700        public Date getDate() { 
5701          return this.date == null ? null : this.date.getValue();
5702        }
5703
5704        /**
5705         * @param value Estimated date the payment will be issued or the actual issue date of payment.
5706         */
5707        public PaymentComponent setDate(Date value) { 
5708          if (value == null)
5709            this.date = null;
5710          else {
5711            if (this.date == null)
5712              this.date = new DateType();
5713            this.date.setValue(value);
5714          }
5715          return this;
5716        }
5717
5718        /**
5719         * @return {@link #amount} (Benefits payable less any payment adjustment.)
5720         */
5721        public Money getAmount() { 
5722          if (this.amount == null)
5723            if (Configuration.errorOnAutoCreate())
5724              throw new Error("Attempt to auto-create PaymentComponent.amount");
5725            else if (Configuration.doAutoCreate())
5726              this.amount = new Money(); // cc
5727          return this.amount;
5728        }
5729
5730        public boolean hasAmount() { 
5731          return this.amount != null && !this.amount.isEmpty();
5732        }
5733
5734        /**
5735         * @param value {@link #amount} (Benefits payable less any payment adjustment.)
5736         */
5737        public PaymentComponent setAmount(Money value) { 
5738          this.amount = value;
5739          return this;
5740        }
5741
5742        /**
5743         * @return {@link #identifier} (Issuer's unique identifier for the payment instrument.)
5744         */
5745        public Identifier getIdentifier() { 
5746          if (this.identifier == null)
5747            if (Configuration.errorOnAutoCreate())
5748              throw new Error("Attempt to auto-create PaymentComponent.identifier");
5749            else if (Configuration.doAutoCreate())
5750              this.identifier = new Identifier(); // cc
5751          return this.identifier;
5752        }
5753
5754        public boolean hasIdentifier() { 
5755          return this.identifier != null && !this.identifier.isEmpty();
5756        }
5757
5758        /**
5759         * @param value {@link #identifier} (Issuer's unique identifier for the payment instrument.)
5760         */
5761        public PaymentComponent setIdentifier(Identifier value) { 
5762          this.identifier = value;
5763          return this;
5764        }
5765
5766        protected void listChildren(List<Property> children) {
5767          super.listChildren(children);
5768          children.add(new Property("type", "CodeableConcept", "Whether this represents partial or complete payment of the benefits payable.", 0, 1, type));
5769          children.add(new Property("adjustment", "Money", "Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.", 0, 1, adjustment));
5770          children.add(new Property("adjustmentReason", "CodeableConcept", "Reason for the payment adjustment.", 0, 1, adjustmentReason));
5771          children.add(new Property("date", "date", "Estimated date the payment will be issued or the actual issue date of payment.", 0, 1, date));
5772          children.add(new Property("amount", "Money", "Benefits payable less any payment adjustment.", 0, 1, amount));
5773          children.add(new Property("identifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, identifier));
5774        }
5775
5776        @Override
5777        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5778          switch (_hash) {
5779          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Whether this represents partial or complete payment of the benefits payable.", 0, 1, type);
5780          case 1977085293: /*adjustment*/  return new Property("adjustment", "Money", "Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.", 0, 1, adjustment);
5781          case -1255938543: /*adjustmentReason*/  return new Property("adjustmentReason", "CodeableConcept", "Reason for the payment adjustment.", 0, 1, adjustmentReason);
5782          case 3076014: /*date*/  return new Property("date", "date", "Estimated date the payment will be issued or the actual issue date of payment.", 0, 1, date);
5783          case -1413853096: /*amount*/  return new Property("amount", "Money", "Benefits payable less any payment adjustment.", 0, 1, amount);
5784          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Issuer's unique identifier for the payment instrument.", 0, 1, identifier);
5785          default: return super.getNamedProperty(_hash, _name, _checkValid);
5786          }
5787
5788        }
5789
5790      @Override
5791      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5792        switch (hash) {
5793        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
5794        case 1977085293: /*adjustment*/ return this.adjustment == null ? new Base[0] : new Base[] {this.adjustment}; // Money
5795        case -1255938543: /*adjustmentReason*/ return this.adjustmentReason == null ? new Base[0] : new Base[] {this.adjustmentReason}; // CodeableConcept
5796        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType
5797        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
5798        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
5799        default: return super.getProperty(hash, name, checkValid);
5800        }
5801
5802      }
5803
5804      @Override
5805      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5806        switch (hash) {
5807        case 3575610: // type
5808          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5809          return value;
5810        case 1977085293: // adjustment
5811          this.adjustment = TypeConvertor.castToMoney(value); // Money
5812          return value;
5813        case -1255938543: // adjustmentReason
5814          this.adjustmentReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5815          return value;
5816        case 3076014: // date
5817          this.date = TypeConvertor.castToDate(value); // DateType
5818          return value;
5819        case -1413853096: // amount
5820          this.amount = TypeConvertor.castToMoney(value); // Money
5821          return value;
5822        case -1618432855: // identifier
5823          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
5824          return value;
5825        default: return super.setProperty(hash, name, value);
5826        }
5827
5828      }
5829
5830      @Override
5831      public Base setProperty(String name, Base value) throws FHIRException {
5832        if (name.equals("type")) {
5833          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5834        } else if (name.equals("adjustment")) {
5835          this.adjustment = TypeConvertor.castToMoney(value); // Money
5836        } else if (name.equals("adjustmentReason")) {
5837          this.adjustmentReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
5838        } else if (name.equals("date")) {
5839          this.date = TypeConvertor.castToDate(value); // DateType
5840        } else if (name.equals("amount")) {
5841          this.amount = TypeConvertor.castToMoney(value); // Money
5842        } else if (name.equals("identifier")) {
5843          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
5844        } else
5845          return super.setProperty(name, value);
5846        return value;
5847      }
5848
5849      @Override
5850      public Base makeProperty(int hash, String name) throws FHIRException {
5851        switch (hash) {
5852        case 3575610:  return getType();
5853        case 1977085293:  return getAdjustment();
5854        case -1255938543:  return getAdjustmentReason();
5855        case 3076014:  return getDateElement();
5856        case -1413853096:  return getAmount();
5857        case -1618432855:  return getIdentifier();
5858        default: return super.makeProperty(hash, name);
5859        }
5860
5861      }
5862
5863      @Override
5864      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5865        switch (hash) {
5866        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
5867        case 1977085293: /*adjustment*/ return new String[] {"Money"};
5868        case -1255938543: /*adjustmentReason*/ return new String[] {"CodeableConcept"};
5869        case 3076014: /*date*/ return new String[] {"date"};
5870        case -1413853096: /*amount*/ return new String[] {"Money"};
5871        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
5872        default: return super.getTypesForProperty(hash, name);
5873        }
5874
5875      }
5876
5877      @Override
5878      public Base addChild(String name) throws FHIRException {
5879        if (name.equals("type")) {
5880          this.type = new CodeableConcept();
5881          return this.type;
5882        }
5883        else if (name.equals("adjustment")) {
5884          this.adjustment = new Money();
5885          return this.adjustment;
5886        }
5887        else if (name.equals("adjustmentReason")) {
5888          this.adjustmentReason = new CodeableConcept();
5889          return this.adjustmentReason;
5890        }
5891        else if (name.equals("date")) {
5892          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.payment.date");
5893        }
5894        else if (name.equals("amount")) {
5895          this.amount = new Money();
5896          return this.amount;
5897        }
5898        else if (name.equals("identifier")) {
5899          this.identifier = new Identifier();
5900          return this.identifier;
5901        }
5902        else
5903          return super.addChild(name);
5904      }
5905
5906      public PaymentComponent copy() {
5907        PaymentComponent dst = new PaymentComponent();
5908        copyValues(dst);
5909        return dst;
5910      }
5911
5912      public void copyValues(PaymentComponent dst) {
5913        super.copyValues(dst);
5914        dst.type = type == null ? null : type.copy();
5915        dst.adjustment = adjustment == null ? null : adjustment.copy();
5916        dst.adjustmentReason = adjustmentReason == null ? null : adjustmentReason.copy();
5917        dst.date = date == null ? null : date.copy();
5918        dst.amount = amount == null ? null : amount.copy();
5919        dst.identifier = identifier == null ? null : identifier.copy();
5920      }
5921
5922      @Override
5923      public boolean equalsDeep(Base other_) {
5924        if (!super.equalsDeep(other_))
5925          return false;
5926        if (!(other_ instanceof PaymentComponent))
5927          return false;
5928        PaymentComponent o = (PaymentComponent) other_;
5929        return compareDeep(type, o.type, true) && compareDeep(adjustment, o.adjustment, true) && compareDeep(adjustmentReason, o.adjustmentReason, true)
5930           && compareDeep(date, o.date, true) && compareDeep(amount, o.amount, true) && compareDeep(identifier, o.identifier, true)
5931          ;
5932      }
5933
5934      @Override
5935      public boolean equalsShallow(Base other_) {
5936        if (!super.equalsShallow(other_))
5937          return false;
5938        if (!(other_ instanceof PaymentComponent))
5939          return false;
5940        PaymentComponent o = (PaymentComponent) other_;
5941        return compareValues(date, o.date, true);
5942      }
5943
5944      public boolean isEmpty() {
5945        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, adjustment, adjustmentReason
5946          , date, amount, identifier);
5947      }
5948
5949  public String fhirType() {
5950    return "ClaimResponse.payment";
5951
5952  }
5953
5954  }
5955
5956    @Block()
5957    public static class NoteComponent extends BackboneElement implements IBaseBackboneElement {
5958        /**
5959         * A number to uniquely identify a note entry.
5960         */
5961        @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
5962        @Description(shortDefinition="Note instance identifier", formalDefinition="A number to uniquely identify a note entry." )
5963        protected PositiveIntType number;
5964
5965        /**
5966         * The business purpose of the note text.
5967         */
5968        @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5969        @Description(shortDefinition="display | print | printoper", formalDefinition="The business purpose of the note text." )
5970        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type")
5971        protected Enumeration<NoteType> type;
5972
5973        /**
5974         * The explanation or description associated with the processing.
5975         */
5976        @Child(name = "text", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false)
5977        @Description(shortDefinition="Note explanatory text", formalDefinition="The explanation or description associated with the processing." )
5978        protected StringType text;
5979
5980        /**
5981         * A code to define the language used in the text of the note.
5982         */
5983        @Child(name = "language", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
5984        @Description(shortDefinition="Language of the text", formalDefinition="A code to define the language used in the text of the note." )
5985        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
5986        protected CodeableConcept language;
5987
5988        private static final long serialVersionUID = -385184277L;
5989
5990    /**
5991     * Constructor
5992     */
5993      public NoteComponent() {
5994        super();
5995      }
5996
5997    /**
5998     * Constructor
5999     */
6000      public NoteComponent(String text) {
6001        super();
6002        this.setText(text);
6003      }
6004
6005        /**
6006         * @return {@link #number} (A number to uniquely identify a note entry.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
6007         */
6008        public PositiveIntType getNumberElement() { 
6009          if (this.number == null)
6010            if (Configuration.errorOnAutoCreate())
6011              throw new Error("Attempt to auto-create NoteComponent.number");
6012            else if (Configuration.doAutoCreate())
6013              this.number = new PositiveIntType(); // bb
6014          return this.number;
6015        }
6016
6017        public boolean hasNumberElement() { 
6018          return this.number != null && !this.number.isEmpty();
6019        }
6020
6021        public boolean hasNumber() { 
6022          return this.number != null && !this.number.isEmpty();
6023        }
6024
6025        /**
6026         * @param value {@link #number} (A number to uniquely identify a note entry.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
6027         */
6028        public NoteComponent setNumberElement(PositiveIntType value) { 
6029          this.number = value;
6030          return this;
6031        }
6032
6033        /**
6034         * @return A number to uniquely identify a note entry.
6035         */
6036        public int getNumber() { 
6037          return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
6038        }
6039
6040        /**
6041         * @param value A number to uniquely identify a note entry.
6042         */
6043        public NoteComponent setNumber(int value) { 
6044            if (this.number == null)
6045              this.number = new PositiveIntType();
6046            this.number.setValue(value);
6047          return this;
6048        }
6049
6050        /**
6051         * @return {@link #type} (The business purpose of the note text.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
6052         */
6053        public Enumeration<NoteType> getTypeElement() { 
6054          if (this.type == null)
6055            if (Configuration.errorOnAutoCreate())
6056              throw new Error("Attempt to auto-create NoteComponent.type");
6057            else if (Configuration.doAutoCreate())
6058              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory()); // bb
6059          return this.type;
6060        }
6061
6062        public boolean hasTypeElement() { 
6063          return this.type != null && !this.type.isEmpty();
6064        }
6065
6066        public boolean hasType() { 
6067          return this.type != null && !this.type.isEmpty();
6068        }
6069
6070        /**
6071         * @param value {@link #type} (The business purpose of the note text.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
6072         */
6073        public NoteComponent setTypeElement(Enumeration<NoteType> value) { 
6074          this.type = value;
6075          return this;
6076        }
6077
6078        /**
6079         * @return The business purpose of the note text.
6080         */
6081        public NoteType getType() { 
6082          return this.type == null ? null : this.type.getValue();
6083        }
6084
6085        /**
6086         * @param value The business purpose of the note text.
6087         */
6088        public NoteComponent setType(NoteType value) { 
6089          if (value == null)
6090            this.type = null;
6091          else {
6092            if (this.type == null)
6093              this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory());
6094            this.type.setValue(value);
6095          }
6096          return this;
6097        }
6098
6099        /**
6100         * @return {@link #text} (The explanation or description associated with the processing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
6101         */
6102        public StringType getTextElement() { 
6103          if (this.text == null)
6104            if (Configuration.errorOnAutoCreate())
6105              throw new Error("Attempt to auto-create NoteComponent.text");
6106            else if (Configuration.doAutoCreate())
6107              this.text = new StringType(); // bb
6108          return this.text;
6109        }
6110
6111        public boolean hasTextElement() { 
6112          return this.text != null && !this.text.isEmpty();
6113        }
6114
6115        public boolean hasText() { 
6116          return this.text != null && !this.text.isEmpty();
6117        }
6118
6119        /**
6120         * @param value {@link #text} (The explanation or description associated with the processing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
6121         */
6122        public NoteComponent setTextElement(StringType value) { 
6123          this.text = value;
6124          return this;
6125        }
6126
6127        /**
6128         * @return The explanation or description associated with the processing.
6129         */
6130        public String getText() { 
6131          return this.text == null ? null : this.text.getValue();
6132        }
6133
6134        /**
6135         * @param value The explanation or description associated with the processing.
6136         */
6137        public NoteComponent setText(String value) { 
6138            if (this.text == null)
6139              this.text = new StringType();
6140            this.text.setValue(value);
6141          return this;
6142        }
6143
6144        /**
6145         * @return {@link #language} (A code to define the language used in the text of the note.)
6146         */
6147        public CodeableConcept getLanguage() { 
6148          if (this.language == null)
6149            if (Configuration.errorOnAutoCreate())
6150              throw new Error("Attempt to auto-create NoteComponent.language");
6151            else if (Configuration.doAutoCreate())
6152              this.language = new CodeableConcept(); // cc
6153          return this.language;
6154        }
6155
6156        public boolean hasLanguage() { 
6157          return this.language != null && !this.language.isEmpty();
6158        }
6159
6160        /**
6161         * @param value {@link #language} (A code to define the language used in the text of the note.)
6162         */
6163        public NoteComponent setLanguage(CodeableConcept value) { 
6164          this.language = value;
6165          return this;
6166        }
6167
6168        protected void listChildren(List<Property> children) {
6169          super.listChildren(children);
6170          children.add(new Property("number", "positiveInt", "A number to uniquely identify a note entry.", 0, 1, number));
6171          children.add(new Property("type", "code", "The business purpose of the note text.", 0, 1, type));
6172          children.add(new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text));
6173          children.add(new Property("language", "CodeableConcept", "A code to define the language used in the text of the note.", 0, 1, language));
6174        }
6175
6176        @Override
6177        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6178          switch (_hash) {
6179          case -1034364087: /*number*/  return new Property("number", "positiveInt", "A number to uniquely identify a note entry.", 0, 1, number);
6180          case 3575610: /*type*/  return new Property("type", "code", "The business purpose of the note text.", 0, 1, type);
6181          case 3556653: /*text*/  return new Property("text", "string", "The explanation or description associated with the processing.", 0, 1, text);
6182          case -1613589672: /*language*/  return new Property("language", "CodeableConcept", "A code to define the language used in the text of the note.", 0, 1, language);
6183          default: return super.getNamedProperty(_hash, _name, _checkValid);
6184          }
6185
6186        }
6187
6188      @Override
6189      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6190        switch (hash) {
6191        case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType
6192        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<NoteType>
6193        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
6194        case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
6195        default: return super.getProperty(hash, name, checkValid);
6196        }
6197
6198      }
6199
6200      @Override
6201      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6202        switch (hash) {
6203        case -1034364087: // number
6204          this.number = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6205          return value;
6206        case 3575610: // type
6207          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
6208          this.type = (Enumeration) value; // Enumeration<NoteType>
6209          return value;
6210        case 3556653: // text
6211          this.text = TypeConvertor.castToString(value); // StringType
6212          return value;
6213        case -1613589672: // language
6214          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6215          return value;
6216        default: return super.setProperty(hash, name, value);
6217        }
6218
6219      }
6220
6221      @Override
6222      public Base setProperty(String name, Base value) throws FHIRException {
6223        if (name.equals("number")) {
6224          this.number = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6225        } else if (name.equals("type")) {
6226          value = new NoteTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
6227          this.type = (Enumeration) value; // Enumeration<NoteType>
6228        } else if (name.equals("text")) {
6229          this.text = TypeConvertor.castToString(value); // StringType
6230        } else if (name.equals("language")) {
6231          this.language = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6232        } else
6233          return super.setProperty(name, value);
6234        return value;
6235      }
6236
6237      @Override
6238      public Base makeProperty(int hash, String name) throws FHIRException {
6239        switch (hash) {
6240        case -1034364087:  return getNumberElement();
6241        case 3575610:  return getTypeElement();
6242        case 3556653:  return getTextElement();
6243        case -1613589672:  return getLanguage();
6244        default: return super.makeProperty(hash, name);
6245        }
6246
6247      }
6248
6249      @Override
6250      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6251        switch (hash) {
6252        case -1034364087: /*number*/ return new String[] {"positiveInt"};
6253        case 3575610: /*type*/ return new String[] {"code"};
6254        case 3556653: /*text*/ return new String[] {"string"};
6255        case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
6256        default: return super.getTypesForProperty(hash, name);
6257        }
6258
6259      }
6260
6261      @Override
6262      public Base addChild(String name) throws FHIRException {
6263        if (name.equals("number")) {
6264          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.processNote.number");
6265        }
6266        else if (name.equals("type")) {
6267          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.processNote.type");
6268        }
6269        else if (name.equals("text")) {
6270          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.processNote.text");
6271        }
6272        else if (name.equals("language")) {
6273          this.language = new CodeableConcept();
6274          return this.language;
6275        }
6276        else
6277          return super.addChild(name);
6278      }
6279
6280      public NoteComponent copy() {
6281        NoteComponent dst = new NoteComponent();
6282        copyValues(dst);
6283        return dst;
6284      }
6285
6286      public void copyValues(NoteComponent dst) {
6287        super.copyValues(dst);
6288        dst.number = number == null ? null : number.copy();
6289        dst.type = type == null ? null : type.copy();
6290        dst.text = text == null ? null : text.copy();
6291        dst.language = language == null ? null : language.copy();
6292      }
6293
6294      @Override
6295      public boolean equalsDeep(Base other_) {
6296        if (!super.equalsDeep(other_))
6297          return false;
6298        if (!(other_ instanceof NoteComponent))
6299          return false;
6300        NoteComponent o = (NoteComponent) other_;
6301        return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true)
6302           && compareDeep(language, o.language, true);
6303      }
6304
6305      @Override
6306      public boolean equalsShallow(Base other_) {
6307        if (!super.equalsShallow(other_))
6308          return false;
6309        if (!(other_ instanceof NoteComponent))
6310          return false;
6311        NoteComponent o = (NoteComponent) other_;
6312        return compareValues(number, o.number, true) && compareValues(type, o.type, true) && compareValues(text, o.text, true)
6313          ;
6314      }
6315
6316      public boolean isEmpty() {
6317        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(number, type, text, language
6318          );
6319      }
6320
6321  public String fhirType() {
6322    return "ClaimResponse.processNote";
6323
6324  }
6325
6326  }
6327
6328    @Block()
6329    public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement {
6330        /**
6331         * A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.
6332         */
6333        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false)
6334        @Description(shortDefinition="Insurance instance identifier", formalDefinition="A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order." )
6335        protected PositiveIntType sequence;
6336
6337        /**
6338         * A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.
6339         */
6340        @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=false)
6341        @Description(shortDefinition="Coverage to be used for adjudication", formalDefinition="A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true." )
6342        protected BooleanType focal;
6343
6344        /**
6345         * Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.
6346         */
6347        @Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1, modifier=false, summary=false)
6348        @Description(shortDefinition="Insurance information", formalDefinition="Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system." )
6349        protected Reference coverage;
6350
6351        /**
6352         * A business agreement number established between the provider and the insurer for special business processing purposes.
6353         */
6354        @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6355        @Description(shortDefinition="Additional provider contract number", formalDefinition="A business agreement number established between the provider and the insurer for special business processing purposes." )
6356        protected StringType businessArrangement;
6357
6358        /**
6359         * The result of the adjudication of the line items for the Coverage specified in this insurance.
6360         */
6361        @Child(name = "claimResponse", type = {ClaimResponse.class}, order=5, min=0, max=1, modifier=false, summary=false)
6362        @Description(shortDefinition="Adjudication results", formalDefinition="The result of the adjudication of the line items for the Coverage specified in this insurance." )
6363        protected Reference claimResponse;
6364
6365        private static final long serialVersionUID = -218152446L;
6366
6367    /**
6368     * Constructor
6369     */
6370      public InsuranceComponent() {
6371        super();
6372      }
6373
6374    /**
6375     * Constructor
6376     */
6377      public InsuranceComponent(int sequence, boolean focal, Reference coverage) {
6378        super();
6379        this.setSequence(sequence);
6380        this.setFocal(focal);
6381        this.setCoverage(coverage);
6382      }
6383
6384        /**
6385         * @return {@link #sequence} (A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
6386         */
6387        public PositiveIntType getSequenceElement() { 
6388          if (this.sequence == null)
6389            if (Configuration.errorOnAutoCreate())
6390              throw new Error("Attempt to auto-create InsuranceComponent.sequence");
6391            else if (Configuration.doAutoCreate())
6392              this.sequence = new PositiveIntType(); // bb
6393          return this.sequence;
6394        }
6395
6396        public boolean hasSequenceElement() { 
6397          return this.sequence != null && !this.sequence.isEmpty();
6398        }
6399
6400        public boolean hasSequence() { 
6401          return this.sequence != null && !this.sequence.isEmpty();
6402        }
6403
6404        /**
6405         * @param value {@link #sequence} (A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
6406         */
6407        public InsuranceComponent setSequenceElement(PositiveIntType value) { 
6408          this.sequence = value;
6409          return this;
6410        }
6411
6412        /**
6413         * @return A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.
6414         */
6415        public int getSequence() { 
6416          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
6417        }
6418
6419        /**
6420         * @param value A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.
6421         */
6422        public InsuranceComponent setSequence(int value) { 
6423            if (this.sequence == null)
6424              this.sequence = new PositiveIntType();
6425            this.sequence.setValue(value);
6426          return this;
6427        }
6428
6429        /**
6430         * @return {@link #focal} (A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
6431         */
6432        public BooleanType getFocalElement() { 
6433          if (this.focal == null)
6434            if (Configuration.errorOnAutoCreate())
6435              throw new Error("Attempt to auto-create InsuranceComponent.focal");
6436            else if (Configuration.doAutoCreate())
6437              this.focal = new BooleanType(); // bb
6438          return this.focal;
6439        }
6440
6441        public boolean hasFocalElement() { 
6442          return this.focal != null && !this.focal.isEmpty();
6443        }
6444
6445        public boolean hasFocal() { 
6446          return this.focal != null && !this.focal.isEmpty();
6447        }
6448
6449        /**
6450         * @param value {@link #focal} (A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
6451         */
6452        public InsuranceComponent setFocalElement(BooleanType value) { 
6453          this.focal = value;
6454          return this;
6455        }
6456
6457        /**
6458         * @return A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.
6459         */
6460        public boolean getFocal() { 
6461          return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue();
6462        }
6463
6464        /**
6465         * @param value A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.
6466         */
6467        public InsuranceComponent setFocal(boolean value) { 
6468            if (this.focal == null)
6469              this.focal = new BooleanType();
6470            this.focal.setValue(value);
6471          return this;
6472        }
6473
6474        /**
6475         * @return {@link #coverage} (Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.)
6476         */
6477        public Reference getCoverage() { 
6478          if (this.coverage == null)
6479            if (Configuration.errorOnAutoCreate())
6480              throw new Error("Attempt to auto-create InsuranceComponent.coverage");
6481            else if (Configuration.doAutoCreate())
6482              this.coverage = new Reference(); // cc
6483          return this.coverage;
6484        }
6485
6486        public boolean hasCoverage() { 
6487          return this.coverage != null && !this.coverage.isEmpty();
6488        }
6489
6490        /**
6491         * @param value {@link #coverage} (Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.)
6492         */
6493        public InsuranceComponent setCoverage(Reference value) { 
6494          this.coverage = value;
6495          return this;
6496        }
6497
6498        /**
6499         * @return {@link #businessArrangement} (A business agreement number established between the provider and the insurer for special business processing purposes.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
6500         */
6501        public StringType getBusinessArrangementElement() { 
6502          if (this.businessArrangement == null)
6503            if (Configuration.errorOnAutoCreate())
6504              throw new Error("Attempt to auto-create InsuranceComponent.businessArrangement");
6505            else if (Configuration.doAutoCreate())
6506              this.businessArrangement = new StringType(); // bb
6507          return this.businessArrangement;
6508        }
6509
6510        public boolean hasBusinessArrangementElement() { 
6511          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
6512        }
6513
6514        public boolean hasBusinessArrangement() { 
6515          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
6516        }
6517
6518        /**
6519         * @param value {@link #businessArrangement} (A business agreement number established between the provider and the insurer for special business processing purposes.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
6520         */
6521        public InsuranceComponent setBusinessArrangementElement(StringType value) { 
6522          this.businessArrangement = value;
6523          return this;
6524        }
6525
6526        /**
6527         * @return A business agreement number established between the provider and the insurer for special business processing purposes.
6528         */
6529        public String getBusinessArrangement() { 
6530          return this.businessArrangement == null ? null : this.businessArrangement.getValue();
6531        }
6532
6533        /**
6534         * @param value A business agreement number established between the provider and the insurer for special business processing purposes.
6535         */
6536        public InsuranceComponent setBusinessArrangement(String value) { 
6537          if (Utilities.noString(value))
6538            this.businessArrangement = null;
6539          else {
6540            if (this.businessArrangement == null)
6541              this.businessArrangement = new StringType();
6542            this.businessArrangement.setValue(value);
6543          }
6544          return this;
6545        }
6546
6547        /**
6548         * @return {@link #claimResponse} (The result of the adjudication of the line items for the Coverage specified in this insurance.)
6549         */
6550        public Reference getClaimResponse() { 
6551          if (this.claimResponse == null)
6552            if (Configuration.errorOnAutoCreate())
6553              throw new Error("Attempt to auto-create InsuranceComponent.claimResponse");
6554            else if (Configuration.doAutoCreate())
6555              this.claimResponse = new Reference(); // cc
6556          return this.claimResponse;
6557        }
6558
6559        public boolean hasClaimResponse() { 
6560          return this.claimResponse != null && !this.claimResponse.isEmpty();
6561        }
6562
6563        /**
6564         * @param value {@link #claimResponse} (The result of the adjudication of the line items for the Coverage specified in this insurance.)
6565         */
6566        public InsuranceComponent setClaimResponse(Reference value) { 
6567          this.claimResponse = value;
6568          return this;
6569        }
6570
6571        protected void listChildren(List<Property> children) {
6572          super.listChildren(children);
6573          children.add(new Property("sequence", "positiveInt", "A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.", 0, 1, sequence));
6574          children.add(new Property("focal", "boolean", "A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.", 0, 1, focal));
6575          children.add(new Property("coverage", "Reference(Coverage)", "Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.", 0, 1, coverage));
6576          children.add(new Property("businessArrangement", "string", "A business agreement number established between the provider and the insurer for special business processing purposes.", 0, 1, businessArrangement));
6577          children.add(new Property("claimResponse", "Reference(ClaimResponse)", "The result of the adjudication of the line items for the Coverage specified in this insurance.", 0, 1, claimResponse));
6578        }
6579
6580        @Override
6581        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6582          switch (_hash) {
6583          case 1349547969: /*sequence*/  return new Property("sequence", "positiveInt", "A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.", 0, 1, sequence);
6584          case 97604197: /*focal*/  return new Property("focal", "boolean", "A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.", 0, 1, focal);
6585          case -351767064: /*coverage*/  return new Property("coverage", "Reference(Coverage)", "Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.", 0, 1, coverage);
6586          case 259920682: /*businessArrangement*/  return new Property("businessArrangement", "string", "A business agreement number established between the provider and the insurer for special business processing purposes.", 0, 1, businessArrangement);
6587          case 689513629: /*claimResponse*/  return new Property("claimResponse", "Reference(ClaimResponse)", "The result of the adjudication of the line items for the Coverage specified in this insurance.", 0, 1, claimResponse);
6588          default: return super.getNamedProperty(_hash, _name, _checkValid);
6589          }
6590
6591        }
6592
6593      @Override
6594      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6595        switch (hash) {
6596        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
6597        case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType
6598        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
6599        case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
6600        case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference
6601        default: return super.getProperty(hash, name, checkValid);
6602        }
6603
6604      }
6605
6606      @Override
6607      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6608        switch (hash) {
6609        case 1349547969: // sequence
6610          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6611          return value;
6612        case 97604197: // focal
6613          this.focal = TypeConvertor.castToBoolean(value); // BooleanType
6614          return value;
6615        case -351767064: // coverage
6616          this.coverage = TypeConvertor.castToReference(value); // Reference
6617          return value;
6618        case 259920682: // businessArrangement
6619          this.businessArrangement = TypeConvertor.castToString(value); // StringType
6620          return value;
6621        case 689513629: // claimResponse
6622          this.claimResponse = TypeConvertor.castToReference(value); // Reference
6623          return value;
6624        default: return super.setProperty(hash, name, value);
6625        }
6626
6627      }
6628
6629      @Override
6630      public Base setProperty(String name, Base value) throws FHIRException {
6631        if (name.equals("sequence")) {
6632          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6633        } else if (name.equals("focal")) {
6634          this.focal = TypeConvertor.castToBoolean(value); // BooleanType
6635        } else if (name.equals("coverage")) {
6636          this.coverage = TypeConvertor.castToReference(value); // Reference
6637        } else if (name.equals("businessArrangement")) {
6638          this.businessArrangement = TypeConvertor.castToString(value); // StringType
6639        } else if (name.equals("claimResponse")) {
6640          this.claimResponse = TypeConvertor.castToReference(value); // Reference
6641        } else
6642          return super.setProperty(name, value);
6643        return value;
6644      }
6645
6646      @Override
6647      public Base makeProperty(int hash, String name) throws FHIRException {
6648        switch (hash) {
6649        case 1349547969:  return getSequenceElement();
6650        case 97604197:  return getFocalElement();
6651        case -351767064:  return getCoverage();
6652        case 259920682:  return getBusinessArrangementElement();
6653        case 689513629:  return getClaimResponse();
6654        default: return super.makeProperty(hash, name);
6655        }
6656
6657      }
6658
6659      @Override
6660      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6661        switch (hash) {
6662        case 1349547969: /*sequence*/ return new String[] {"positiveInt"};
6663        case 97604197: /*focal*/ return new String[] {"boolean"};
6664        case -351767064: /*coverage*/ return new String[] {"Reference"};
6665        case 259920682: /*businessArrangement*/ return new String[] {"string"};
6666        case 689513629: /*claimResponse*/ return new String[] {"Reference"};
6667        default: return super.getTypesForProperty(hash, name);
6668        }
6669
6670      }
6671
6672      @Override
6673      public Base addChild(String name) throws FHIRException {
6674        if (name.equals("sequence")) {
6675          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.insurance.sequence");
6676        }
6677        else if (name.equals("focal")) {
6678          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.insurance.focal");
6679        }
6680        else if (name.equals("coverage")) {
6681          this.coverage = new Reference();
6682          return this.coverage;
6683        }
6684        else if (name.equals("businessArrangement")) {
6685          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.insurance.businessArrangement");
6686        }
6687        else if (name.equals("claimResponse")) {
6688          this.claimResponse = new Reference();
6689          return this.claimResponse;
6690        }
6691        else
6692          return super.addChild(name);
6693      }
6694
6695      public InsuranceComponent copy() {
6696        InsuranceComponent dst = new InsuranceComponent();
6697        copyValues(dst);
6698        return dst;
6699      }
6700
6701      public void copyValues(InsuranceComponent dst) {
6702        super.copyValues(dst);
6703        dst.sequence = sequence == null ? null : sequence.copy();
6704        dst.focal = focal == null ? null : focal.copy();
6705        dst.coverage = coverage == null ? null : coverage.copy();
6706        dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
6707        dst.claimResponse = claimResponse == null ? null : claimResponse.copy();
6708      }
6709
6710      @Override
6711      public boolean equalsDeep(Base other_) {
6712        if (!super.equalsDeep(other_))
6713          return false;
6714        if (!(other_ instanceof InsuranceComponent))
6715          return false;
6716        InsuranceComponent o = (InsuranceComponent) other_;
6717        return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true)
6718           && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(claimResponse, o.claimResponse, true)
6719          ;
6720      }
6721
6722      @Override
6723      public boolean equalsShallow(Base other_) {
6724        if (!super.equalsShallow(other_))
6725          return false;
6726        if (!(other_ instanceof InsuranceComponent))
6727          return false;
6728        InsuranceComponent o = (InsuranceComponent) other_;
6729        return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true)
6730          ;
6731      }
6732
6733      public boolean isEmpty() {
6734        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, focal, coverage
6735          , businessArrangement, claimResponse);
6736      }
6737
6738  public String fhirType() {
6739    return "ClaimResponse.insurance";
6740
6741  }
6742
6743  }
6744
6745    @Block()
6746    public static class ErrorComponent extends BackboneElement implements IBaseBackboneElement {
6747        /**
6748         * The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6749         */
6750        @Child(name = "itemSequence", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6751        @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure." )
6752        protected PositiveIntType itemSequence;
6753
6754        /**
6755         * The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6756         */
6757        @Child(name = "detailSequence", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6758        @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure." )
6759        protected PositiveIntType detailSequence;
6760
6761        /**
6762         * The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6763         */
6764        @Child(name = "subDetailSequence", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6765        @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure." )
6766        protected PositiveIntType subDetailSequence;
6767
6768        /**
6769         * An error code, from a specified code system, which details why the claim could not be adjudicated.
6770         */
6771        @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=false)
6772        @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code, from a specified code system, which details why the claim could not be adjudicated." )
6773        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error")
6774        protected CodeableConcept code;
6775
6776        private static final long serialVersionUID = 843818320L;
6777
6778    /**
6779     * Constructor
6780     */
6781      public ErrorComponent() {
6782        super();
6783      }
6784
6785    /**
6786     * Constructor
6787     */
6788      public ErrorComponent(CodeableConcept code) {
6789        super();
6790        this.setCode(code);
6791      }
6792
6793        /**
6794         * @return {@link #itemSequence} (The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getItemSequence" gives direct access to the value
6795         */
6796        public PositiveIntType getItemSequenceElement() { 
6797          if (this.itemSequence == null)
6798            if (Configuration.errorOnAutoCreate())
6799              throw new Error("Attempt to auto-create ErrorComponent.itemSequence");
6800            else if (Configuration.doAutoCreate())
6801              this.itemSequence = new PositiveIntType(); // bb
6802          return this.itemSequence;
6803        }
6804
6805        public boolean hasItemSequenceElement() { 
6806          return this.itemSequence != null && !this.itemSequence.isEmpty();
6807        }
6808
6809        public boolean hasItemSequence() { 
6810          return this.itemSequence != null && !this.itemSequence.isEmpty();
6811        }
6812
6813        /**
6814         * @param value {@link #itemSequence} (The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getItemSequence" gives direct access to the value
6815         */
6816        public ErrorComponent setItemSequenceElement(PositiveIntType value) { 
6817          this.itemSequence = value;
6818          return this;
6819        }
6820
6821        /**
6822         * @return The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6823         */
6824        public int getItemSequence() { 
6825          return this.itemSequence == null || this.itemSequence.isEmpty() ? 0 : this.itemSequence.getValue();
6826        }
6827
6828        /**
6829         * @param value The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6830         */
6831        public ErrorComponent setItemSequence(int value) { 
6832            if (this.itemSequence == null)
6833              this.itemSequence = new PositiveIntType();
6834            this.itemSequence.setValue(value);
6835          return this;
6836        }
6837
6838        /**
6839         * @return {@link #detailSequence} (The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getDetailSequence" gives direct access to the value
6840         */
6841        public PositiveIntType getDetailSequenceElement() { 
6842          if (this.detailSequence == null)
6843            if (Configuration.errorOnAutoCreate())
6844              throw new Error("Attempt to auto-create ErrorComponent.detailSequence");
6845            else if (Configuration.doAutoCreate())
6846              this.detailSequence = new PositiveIntType(); // bb
6847          return this.detailSequence;
6848        }
6849
6850        public boolean hasDetailSequenceElement() { 
6851          return this.detailSequence != null && !this.detailSequence.isEmpty();
6852        }
6853
6854        public boolean hasDetailSequence() { 
6855          return this.detailSequence != null && !this.detailSequence.isEmpty();
6856        }
6857
6858        /**
6859         * @param value {@link #detailSequence} (The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getDetailSequence" gives direct access to the value
6860         */
6861        public ErrorComponent setDetailSequenceElement(PositiveIntType value) { 
6862          this.detailSequence = value;
6863          return this;
6864        }
6865
6866        /**
6867         * @return The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6868         */
6869        public int getDetailSequence() { 
6870          return this.detailSequence == null || this.detailSequence.isEmpty() ? 0 : this.detailSequence.getValue();
6871        }
6872
6873        /**
6874         * @param value The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6875         */
6876        public ErrorComponent setDetailSequence(int value) { 
6877            if (this.detailSequence == null)
6878              this.detailSequence = new PositiveIntType();
6879            this.detailSequence.setValue(value);
6880          return this;
6881        }
6882
6883        /**
6884         * @return {@link #subDetailSequence} (The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getSubDetailSequence" gives direct access to the value
6885         */
6886        public PositiveIntType getSubDetailSequenceElement() { 
6887          if (this.subDetailSequence == null)
6888            if (Configuration.errorOnAutoCreate())
6889              throw new Error("Attempt to auto-create ErrorComponent.subDetailSequence");
6890            else if (Configuration.doAutoCreate())
6891              this.subDetailSequence = new PositiveIntType(); // bb
6892          return this.subDetailSequence;
6893        }
6894
6895        public boolean hasSubDetailSequenceElement() { 
6896          return this.subDetailSequence != null && !this.subDetailSequence.isEmpty();
6897        }
6898
6899        public boolean hasSubDetailSequence() { 
6900          return this.subDetailSequence != null && !this.subDetailSequence.isEmpty();
6901        }
6902
6903        /**
6904         * @param value {@link #subDetailSequence} (The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.). This is the underlying object with id, value and extensions. The accessor "getSubDetailSequence" gives direct access to the value
6905         */
6906        public ErrorComponent setSubDetailSequenceElement(PositiveIntType value) { 
6907          this.subDetailSequence = value;
6908          return this;
6909        }
6910
6911        /**
6912         * @return The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6913         */
6914        public int getSubDetailSequence() { 
6915          return this.subDetailSequence == null || this.subDetailSequence.isEmpty() ? 0 : this.subDetailSequence.getValue();
6916        }
6917
6918        /**
6919         * @param value The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.
6920         */
6921        public ErrorComponent setSubDetailSequence(int value) { 
6922            if (this.subDetailSequence == null)
6923              this.subDetailSequence = new PositiveIntType();
6924            this.subDetailSequence.setValue(value);
6925          return this;
6926        }
6927
6928        /**
6929         * @return {@link #code} (An error code, from a specified code system, which details why the claim could not be adjudicated.)
6930         */
6931        public CodeableConcept getCode() { 
6932          if (this.code == null)
6933            if (Configuration.errorOnAutoCreate())
6934              throw new Error("Attempt to auto-create ErrorComponent.code");
6935            else if (Configuration.doAutoCreate())
6936              this.code = new CodeableConcept(); // cc
6937          return this.code;
6938        }
6939
6940        public boolean hasCode() { 
6941          return this.code != null && !this.code.isEmpty();
6942        }
6943
6944        /**
6945         * @param value {@link #code} (An error code, from a specified code system, which details why the claim could not be adjudicated.)
6946         */
6947        public ErrorComponent setCode(CodeableConcept value) { 
6948          this.code = value;
6949          return this;
6950        }
6951
6952        protected void listChildren(List<Property> children) {
6953          super.listChildren(children);
6954          children.add(new Property("itemSequence", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, itemSequence));
6955          children.add(new Property("detailSequence", "positiveInt", "The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, detailSequence));
6956          children.add(new Property("subDetailSequence", "positiveInt", "The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, subDetailSequence));
6957          children.add(new Property("code", "CodeableConcept", "An error code, from a specified code system, which details why the claim could not be adjudicated.", 0, 1, code));
6958        }
6959
6960        @Override
6961        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6962          switch (_hash) {
6963          case 1977979892: /*itemSequence*/  return new Property("itemSequence", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, itemSequence);
6964          case 1321472818: /*detailSequence*/  return new Property("detailSequence", "positiveInt", "The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, detailSequence);
6965          case -855462510: /*subDetailSequence*/  return new Property("subDetailSequence", "positiveInt", "The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.", 0, 1, subDetailSequence);
6966          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "An error code, from a specified code system, which details why the claim could not be adjudicated.", 0, 1, code);
6967          default: return super.getNamedProperty(_hash, _name, _checkValid);
6968          }
6969
6970        }
6971
6972      @Override
6973      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6974        switch (hash) {
6975        case 1977979892: /*itemSequence*/ return this.itemSequence == null ? new Base[0] : new Base[] {this.itemSequence}; // PositiveIntType
6976        case 1321472818: /*detailSequence*/ return this.detailSequence == null ? new Base[0] : new Base[] {this.detailSequence}; // PositiveIntType
6977        case -855462510: /*subDetailSequence*/ return this.subDetailSequence == null ? new Base[0] : new Base[] {this.subDetailSequence}; // PositiveIntType
6978        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
6979        default: return super.getProperty(hash, name, checkValid);
6980        }
6981
6982      }
6983
6984      @Override
6985      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6986        switch (hash) {
6987        case 1977979892: // itemSequence
6988          this.itemSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6989          return value;
6990        case 1321472818: // detailSequence
6991          this.detailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6992          return value;
6993        case -855462510: // subDetailSequence
6994          this.subDetailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
6995          return value;
6996        case 3059181: // code
6997          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
6998          return value;
6999        default: return super.setProperty(hash, name, value);
7000        }
7001
7002      }
7003
7004      @Override
7005      public Base setProperty(String name, Base value) throws FHIRException {
7006        if (name.equals("itemSequence")) {
7007          this.itemSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
7008        } else if (name.equals("detailSequence")) {
7009          this.detailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
7010        } else if (name.equals("subDetailSequence")) {
7011          this.subDetailSequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
7012        } else if (name.equals("code")) {
7013          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
7014        } else
7015          return super.setProperty(name, value);
7016        return value;
7017      }
7018
7019      @Override
7020      public Base makeProperty(int hash, String name) throws FHIRException {
7021        switch (hash) {
7022        case 1977979892:  return getItemSequenceElement();
7023        case 1321472818:  return getDetailSequenceElement();
7024        case -855462510:  return getSubDetailSequenceElement();
7025        case 3059181:  return getCode();
7026        default: return super.makeProperty(hash, name);
7027        }
7028
7029      }
7030
7031      @Override
7032      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
7033        switch (hash) {
7034        case 1977979892: /*itemSequence*/ return new String[] {"positiveInt"};
7035        case 1321472818: /*detailSequence*/ return new String[] {"positiveInt"};
7036        case -855462510: /*subDetailSequence*/ return new String[] {"positiveInt"};
7037        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
7038        default: return super.getTypesForProperty(hash, name);
7039        }
7040
7041      }
7042
7043      @Override
7044      public Base addChild(String name) throws FHIRException {
7045        if (name.equals("itemSequence")) {
7046          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.error.itemSequence");
7047        }
7048        else if (name.equals("detailSequence")) {
7049          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.error.detailSequence");
7050        }
7051        else if (name.equals("subDetailSequence")) {
7052          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.error.subDetailSequence");
7053        }
7054        else if (name.equals("code")) {
7055          this.code = new CodeableConcept();
7056          return this.code;
7057        }
7058        else
7059          return super.addChild(name);
7060      }
7061
7062      public ErrorComponent copy() {
7063        ErrorComponent dst = new ErrorComponent();
7064        copyValues(dst);
7065        return dst;
7066      }
7067
7068      public void copyValues(ErrorComponent dst) {
7069        super.copyValues(dst);
7070        dst.itemSequence = itemSequence == null ? null : itemSequence.copy();
7071        dst.detailSequence = detailSequence == null ? null : detailSequence.copy();
7072        dst.subDetailSequence = subDetailSequence == null ? null : subDetailSequence.copy();
7073        dst.code = code == null ? null : code.copy();
7074      }
7075
7076      @Override
7077      public boolean equalsDeep(Base other_) {
7078        if (!super.equalsDeep(other_))
7079          return false;
7080        if (!(other_ instanceof ErrorComponent))
7081          return false;
7082        ErrorComponent o = (ErrorComponent) other_;
7083        return compareDeep(itemSequence, o.itemSequence, true) && compareDeep(detailSequence, o.detailSequence, true)
7084           && compareDeep(subDetailSequence, o.subDetailSequence, true) && compareDeep(code, o.code, true)
7085          ;
7086      }
7087
7088      @Override
7089      public boolean equalsShallow(Base other_) {
7090        if (!super.equalsShallow(other_))
7091          return false;
7092        if (!(other_ instanceof ErrorComponent))
7093          return false;
7094        ErrorComponent o = (ErrorComponent) other_;
7095        return compareValues(itemSequence, o.itemSequence, true) && compareValues(detailSequence, o.detailSequence, true)
7096           && compareValues(subDetailSequence, o.subDetailSequence, true);
7097      }
7098
7099      public boolean isEmpty() {
7100        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(itemSequence, detailSequence
7101          , subDetailSequence, code);
7102      }
7103
7104  public String fhirType() {
7105    return "ClaimResponse.error";
7106
7107  }
7108
7109  }
7110
7111    /**
7112     * A unique identifier assigned to this claim response.
7113     */
7114    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7115    @Description(shortDefinition="Business Identifier for a claim response", formalDefinition="A unique identifier assigned to this claim response." )
7116    protected List<Identifier> identifier;
7117
7118    /**
7119     * The status of the resource instance.
7120     */
7121    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
7122    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
7123    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
7124    protected Enumeration<FinancialResourceStatusCodes> status;
7125
7126    /**
7127     * A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.
7128     */
7129    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true)
7130    @Description(shortDefinition="More granular claim type", formalDefinition="A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service." )
7131    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-type")
7132    protected CodeableConcept type;
7133
7134    /**
7135     * A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.
7136     */
7137    @Child(name = "subType", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
7138    @Description(shortDefinition="More granular claim type", formalDefinition="A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service." )
7139    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-subtype")
7140    protected CodeableConcept subType;
7141
7142    /**
7143     * A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.
7144     */
7145    @Child(name = "use", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
7146    @Description(shortDefinition="claim | preauthorization | predetermination", formalDefinition="A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided." )
7147    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-use")
7148    protected Enumeration<Use> use;
7149
7150    /**
7151     * The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.
7152     */
7153    @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true)
7154    @Description(shortDefinition="The recipient of the products and services", formalDefinition="The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought." )
7155    protected Reference patient;
7156
7157    /**
7158     * The date this resource was created.
7159     */
7160    @Child(name = "created", type = {DateTimeType.class}, order=6, min=1, max=1, modifier=false, summary=true)
7161    @Description(shortDefinition="Response creation date", formalDefinition="The date this resource was created." )
7162    protected DateTimeType created;
7163
7164    /**
7165     * The party responsible for authorization, adjudication and reimbursement.
7166     */
7167    @Child(name = "insurer", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
7168    @Description(shortDefinition="Party responsible for reimbursement", formalDefinition="The party responsible for authorization, adjudication and reimbursement." )
7169    protected Reference insurer;
7170
7171    /**
7172     * The provider which is responsible for the claim, predetermination or preauthorization.
7173     */
7174    @Child(name = "requestor", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
7175    @Description(shortDefinition="Party responsible for the claim", formalDefinition="The provider which is responsible for the claim, predetermination or preauthorization." )
7176    protected Reference requestor;
7177
7178    /**
7179     * Original request resource reference.
7180     */
7181    @Child(name = "request", type = {Claim.class}, order=9, min=0, max=1, modifier=false, summary=true)
7182    @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource reference." )
7183    protected Reference request;
7184
7185    /**
7186     * The outcome of the claim, predetermination, or preauthorization processing.
7187     */
7188    @Child(name = "outcome", type = {CodeType.class}, order=10, min=1, max=1, modifier=false, summary=true)
7189    @Description(shortDefinition="queued | complete | error | partial", formalDefinition="The outcome of the claim, predetermination, or preauthorization processing." )
7190    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-outcome")
7191    protected Enumeration<ClaimProcessingCodes> outcome;
7192
7193    /**
7194     * The result of the claim, predetermination, or preauthorization adjudication.
7195     */
7196    @Child(name = "decision", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true)
7197    @Description(shortDefinition="Result of the adjudication", formalDefinition="The result of the claim, predetermination, or preauthorization adjudication." )
7198    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-decision")
7199    protected CodeableConcept decision;
7200
7201    /**
7202     * A human readable description of the status of the adjudication.
7203     */
7204    @Child(name = "disposition", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
7205    @Description(shortDefinition="Disposition Message", formalDefinition="A human readable description of the status of the adjudication." )
7206    protected StringType disposition;
7207
7208    /**
7209     * Reference from the Insurer which is used in later communications which refers to this adjudication.
7210     */
7211    @Child(name = "preAuthRef", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
7212    @Description(shortDefinition="Preauthorization reference", formalDefinition="Reference from the Insurer which is used in later communications which refers to this adjudication." )
7213    protected StringType preAuthRef;
7214
7215    /**
7216     * The time frame during which this authorization is effective.
7217     */
7218    @Child(name = "preAuthPeriod", type = {Period.class}, order=14, min=0, max=1, modifier=false, summary=false)
7219    @Description(shortDefinition="Preauthorization reference effective period", formalDefinition="The time frame during which this authorization is effective." )
7220    protected Period preAuthPeriod;
7221
7222    /**
7223     * Type of Party to be reimbursed: subscriber, provider, other.
7224     */
7225    @Child(name = "payeeType", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false)
7226    @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Type of Party to be reimbursed: subscriber, provider, other." )
7227    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/payeetype")
7228    protected CodeableConcept payeeType;
7229
7230    /**
7231     * The Encounters during which this Claim was created or to which the creation of this record is tightly associated.
7232     */
7233    @Child(name = "encounter", type = {Encounter.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7234    @Description(shortDefinition="Encounters related to this billed item", formalDefinition="The Encounters during which this Claim was created or to which the creation of this record is tightly associated." )
7235    protected List<Reference> encounter;
7236
7237    /**
7238     * A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.
7239     */
7240    @Child(name = "diagnosisRelatedGroup", type = {CodeableConcept.class}, order=17, min=0, max=1, modifier=false, summary=false)
7241    @Description(shortDefinition="Package billing code", formalDefinition="A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system." )
7242    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-diagnosisrelatedgroup")
7243    protected CodeableConcept diagnosisRelatedGroup;
7244
7245    /**
7246     * A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.
7247     */
7248    @Child(name = "item", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7249    @Description(shortDefinition="Adjudication for claim line items", formalDefinition="A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details." )
7250    protected List<ItemComponent> item;
7251
7252    /**
7253     * The first-tier service adjudications for payor added product or service lines.
7254     */
7255    @Child(name = "addItem", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7256    @Description(shortDefinition="Insurer added line items", formalDefinition="The first-tier service adjudications for payor added product or service lines." )
7257    protected List<AddedItemComponent> addItem;
7258
7259    /**
7260     * The adjudication results which are presented at the header level rather than at the line-item or add-item levels.
7261     */
7262    @Child(name = "adjudication", type = {AdjudicationComponent.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7263    @Description(shortDefinition="Header-level adjudication", formalDefinition="The adjudication results which are presented at the header level rather than at the line-item or add-item levels." )
7264    protected List<AdjudicationComponent> adjudication;
7265
7266    /**
7267     * Categorized monetary totals for the adjudication.
7268     */
7269    @Child(name = "total", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
7270    @Description(shortDefinition="Adjudication totals", formalDefinition="Categorized monetary totals for the adjudication." )
7271    protected List<TotalComponent> total;
7272
7273    /**
7274     * Payment details for the adjudication of the claim.
7275     */
7276    @Child(name = "payment", type = {}, order=22, min=0, max=1, modifier=false, summary=false)
7277    @Description(shortDefinition="Payment Details", formalDefinition="Payment details for the adjudication of the claim." )
7278    protected PaymentComponent payment;
7279
7280    /**
7281     * A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.
7282     */
7283    @Child(name = "fundsReserve", type = {CodeableConcept.class}, order=23, min=0, max=1, modifier=false, summary=false)
7284    @Description(shortDefinition="Funds reserved status", formalDefinition="A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom." )
7285    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fundsreserve")
7286    protected CodeableConcept fundsReserve;
7287
7288    /**
7289     * A code for the form to be used for printing the content.
7290     */
7291    @Child(name = "formCode", type = {CodeableConcept.class}, order=24, min=0, max=1, modifier=false, summary=false)
7292    @Description(shortDefinition="Printed form identifier", formalDefinition="A code for the form to be used for printing the content." )
7293    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms")
7294    protected CodeableConcept formCode;
7295
7296    /**
7297     * The actual form, by reference or inclusion, for printing the content or an EOB.
7298     */
7299    @Child(name = "form", type = {Attachment.class}, order=25, min=0, max=1, modifier=false, summary=false)
7300    @Description(shortDefinition="Printed reference or actual form", formalDefinition="The actual form, by reference or inclusion, for printing the content or an EOB." )
7301    protected Attachment form;
7302
7303    /**
7304     * A note that describes or explains adjudication results in a human readable form.
7305     */
7306    @Child(name = "processNote", type = {}, order=26, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7307    @Description(shortDefinition="Note concerning adjudication", formalDefinition="A note that describes or explains adjudication results in a human readable form." )
7308    protected List<NoteComponent> processNote;
7309
7310    /**
7311     * Request for additional supporting or authorizing information.
7312     */
7313    @Child(name = "communicationRequest", type = {CommunicationRequest.class}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7314    @Description(shortDefinition="Request for additional information", formalDefinition="Request for additional supporting or authorizing information." )
7315    protected List<Reference> communicationRequest;
7316
7317    /**
7318     * Financial instruments for reimbursement for the health care products and services specified on the claim.
7319     */
7320    @Child(name = "insurance", type = {}, order=28, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7321    @Description(shortDefinition="Patient insurance information", formalDefinition="Financial instruments for reimbursement for the health care products and services specified on the claim." )
7322    protected List<InsuranceComponent> insurance;
7323
7324    /**
7325     * Errors encountered during the processing of the adjudication.
7326     */
7327    @Child(name = "error", type = {}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
7328    @Description(shortDefinition="Processing errors", formalDefinition="Errors encountered during the processing of the adjudication." )
7329    protected List<ErrorComponent> error;
7330
7331    private static final long serialVersionUID = -1308435182L;
7332
7333  /**
7334   * Constructor
7335   */
7336    public ClaimResponse() {
7337      super();
7338    }
7339
7340  /**
7341   * Constructor
7342   */
7343    public ClaimResponse(FinancialResourceStatusCodes status, CodeableConcept type, Use use, Reference patient, Date created, ClaimProcessingCodes outcome) {
7344      super();
7345      this.setStatus(status);
7346      this.setType(type);
7347      this.setUse(use);
7348      this.setPatient(patient);
7349      this.setCreated(created);
7350      this.setOutcome(outcome);
7351    }
7352
7353    /**
7354     * @return {@link #identifier} (A unique identifier assigned to this claim response.)
7355     */
7356    public List<Identifier> getIdentifier() { 
7357      if (this.identifier == null)
7358        this.identifier = new ArrayList<Identifier>();
7359      return this.identifier;
7360    }
7361
7362    /**
7363     * @return Returns a reference to <code>this</code> for easy method chaining
7364     */
7365    public ClaimResponse setIdentifier(List<Identifier> theIdentifier) { 
7366      this.identifier = theIdentifier;
7367      return this;
7368    }
7369
7370    public boolean hasIdentifier() { 
7371      if (this.identifier == null)
7372        return false;
7373      for (Identifier item : this.identifier)
7374        if (!item.isEmpty())
7375          return true;
7376      return false;
7377    }
7378
7379    public Identifier addIdentifier() { //3
7380      Identifier t = new Identifier();
7381      if (this.identifier == null)
7382        this.identifier = new ArrayList<Identifier>();
7383      this.identifier.add(t);
7384      return t;
7385    }
7386
7387    public ClaimResponse addIdentifier(Identifier t) { //3
7388      if (t == null)
7389        return this;
7390      if (this.identifier == null)
7391        this.identifier = new ArrayList<Identifier>();
7392      this.identifier.add(t);
7393      return this;
7394    }
7395
7396    /**
7397     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
7398     */
7399    public Identifier getIdentifierFirstRep() { 
7400      if (getIdentifier().isEmpty()) {
7401        addIdentifier();
7402      }
7403      return getIdentifier().get(0);
7404    }
7405
7406    /**
7407     * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
7408     */
7409    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
7410      if (this.status == null)
7411        if (Configuration.errorOnAutoCreate())
7412          throw new Error("Attempt to auto-create ClaimResponse.status");
7413        else if (Configuration.doAutoCreate())
7414          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
7415      return this.status;
7416    }
7417
7418    public boolean hasStatusElement() { 
7419      return this.status != null && !this.status.isEmpty();
7420    }
7421
7422    public boolean hasStatus() { 
7423      return this.status != null && !this.status.isEmpty();
7424    }
7425
7426    /**
7427     * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
7428     */
7429    public ClaimResponse setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
7430      this.status = value;
7431      return this;
7432    }
7433
7434    /**
7435     * @return The status of the resource instance.
7436     */
7437    public FinancialResourceStatusCodes getStatus() { 
7438      return this.status == null ? null : this.status.getValue();
7439    }
7440
7441    /**
7442     * @param value The status of the resource instance.
7443     */
7444    public ClaimResponse setStatus(FinancialResourceStatusCodes value) { 
7445        if (this.status == null)
7446          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
7447        this.status.setValue(value);
7448      return this;
7449    }
7450
7451    /**
7452     * @return {@link #type} (A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.)
7453     */
7454    public CodeableConcept getType() { 
7455      if (this.type == null)
7456        if (Configuration.errorOnAutoCreate())
7457          throw new Error("Attempt to auto-create ClaimResponse.type");
7458        else if (Configuration.doAutoCreate())
7459          this.type = new CodeableConcept(); // cc
7460      return this.type;
7461    }
7462
7463    public boolean hasType() { 
7464      return this.type != null && !this.type.isEmpty();
7465    }
7466
7467    /**
7468     * @param value {@link #type} (A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.)
7469     */
7470    public ClaimResponse setType(CodeableConcept value) { 
7471      this.type = value;
7472      return this;
7473    }
7474
7475    /**
7476     * @return {@link #subType} (A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.)
7477     */
7478    public CodeableConcept getSubType() { 
7479      if (this.subType == null)
7480        if (Configuration.errorOnAutoCreate())
7481          throw new Error("Attempt to auto-create ClaimResponse.subType");
7482        else if (Configuration.doAutoCreate())
7483          this.subType = new CodeableConcept(); // cc
7484      return this.subType;
7485    }
7486
7487    public boolean hasSubType() { 
7488      return this.subType != null && !this.subType.isEmpty();
7489    }
7490
7491    /**
7492     * @param value {@link #subType} (A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.)
7493     */
7494    public ClaimResponse setSubType(CodeableConcept value) { 
7495      this.subType = value;
7496      return this;
7497    }
7498
7499    /**
7500     * @return {@link #use} (A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
7501     */
7502    public Enumeration<Use> getUseElement() { 
7503      if (this.use == null)
7504        if (Configuration.errorOnAutoCreate())
7505          throw new Error("Attempt to auto-create ClaimResponse.use");
7506        else if (Configuration.doAutoCreate())
7507          this.use = new Enumeration<Use>(new UseEnumFactory()); // bb
7508      return this.use;
7509    }
7510
7511    public boolean hasUseElement() { 
7512      return this.use != null && !this.use.isEmpty();
7513    }
7514
7515    public boolean hasUse() { 
7516      return this.use != null && !this.use.isEmpty();
7517    }
7518
7519    /**
7520     * @param value {@link #use} (A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
7521     */
7522    public ClaimResponse setUseElement(Enumeration<Use> value) { 
7523      this.use = value;
7524      return this;
7525    }
7526
7527    /**
7528     * @return A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.
7529     */
7530    public Use getUse() { 
7531      return this.use == null ? null : this.use.getValue();
7532    }
7533
7534    /**
7535     * @param value A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.
7536     */
7537    public ClaimResponse setUse(Use value) { 
7538        if (this.use == null)
7539          this.use = new Enumeration<Use>(new UseEnumFactory());
7540        this.use.setValue(value);
7541      return this;
7542    }
7543
7544    /**
7545     * @return {@link #patient} (The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.)
7546     */
7547    public Reference getPatient() { 
7548      if (this.patient == null)
7549        if (Configuration.errorOnAutoCreate())
7550          throw new Error("Attempt to auto-create ClaimResponse.patient");
7551        else if (Configuration.doAutoCreate())
7552          this.patient = new Reference(); // cc
7553      return this.patient;
7554    }
7555
7556    public boolean hasPatient() { 
7557      return this.patient != null && !this.patient.isEmpty();
7558    }
7559
7560    /**
7561     * @param value {@link #patient} (The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.)
7562     */
7563    public ClaimResponse setPatient(Reference value) { 
7564      this.patient = value;
7565      return this;
7566    }
7567
7568    /**
7569     * @return {@link #created} (The date this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
7570     */
7571    public DateTimeType getCreatedElement() { 
7572      if (this.created == null)
7573        if (Configuration.errorOnAutoCreate())
7574          throw new Error("Attempt to auto-create ClaimResponse.created");
7575        else if (Configuration.doAutoCreate())
7576          this.created = new DateTimeType(); // bb
7577      return this.created;
7578    }
7579
7580    public boolean hasCreatedElement() { 
7581      return this.created != null && !this.created.isEmpty();
7582    }
7583
7584    public boolean hasCreated() { 
7585      return this.created != null && !this.created.isEmpty();
7586    }
7587
7588    /**
7589     * @param value {@link #created} (The date this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
7590     */
7591    public ClaimResponse setCreatedElement(DateTimeType value) { 
7592      this.created = value;
7593      return this;
7594    }
7595
7596    /**
7597     * @return The date this resource was created.
7598     */
7599    public Date getCreated() { 
7600      return this.created == null ? null : this.created.getValue();
7601    }
7602
7603    /**
7604     * @param value The date this resource was created.
7605     */
7606    public ClaimResponse setCreated(Date value) { 
7607        if (this.created == null)
7608          this.created = new DateTimeType();
7609        this.created.setValue(value);
7610      return this;
7611    }
7612
7613    /**
7614     * @return {@link #insurer} (The party responsible for authorization, adjudication and reimbursement.)
7615     */
7616    public Reference getInsurer() { 
7617      if (this.insurer == null)
7618        if (Configuration.errorOnAutoCreate())
7619          throw new Error("Attempt to auto-create ClaimResponse.insurer");
7620        else if (Configuration.doAutoCreate())
7621          this.insurer = new Reference(); // cc
7622      return this.insurer;
7623    }
7624
7625    public boolean hasInsurer() { 
7626      return this.insurer != null && !this.insurer.isEmpty();
7627    }
7628
7629    /**
7630     * @param value {@link #insurer} (The party responsible for authorization, adjudication and reimbursement.)
7631     */
7632    public ClaimResponse setInsurer(Reference value) { 
7633      this.insurer = value;
7634      return this;
7635    }
7636
7637    /**
7638     * @return {@link #requestor} (The provider which is responsible for the claim, predetermination or preauthorization.)
7639     */
7640    public Reference getRequestor() { 
7641      if (this.requestor == null)
7642        if (Configuration.errorOnAutoCreate())
7643          throw new Error("Attempt to auto-create ClaimResponse.requestor");
7644        else if (Configuration.doAutoCreate())
7645          this.requestor = new Reference(); // cc
7646      return this.requestor;
7647    }
7648
7649    public boolean hasRequestor() { 
7650      return this.requestor != null && !this.requestor.isEmpty();
7651    }
7652
7653    /**
7654     * @param value {@link #requestor} (The provider which is responsible for the claim, predetermination or preauthorization.)
7655     */
7656    public ClaimResponse setRequestor(Reference value) { 
7657      this.requestor = value;
7658      return this;
7659    }
7660
7661    /**
7662     * @return {@link #request} (Original request resource reference.)
7663     */
7664    public Reference getRequest() { 
7665      if (this.request == null)
7666        if (Configuration.errorOnAutoCreate())
7667          throw new Error("Attempt to auto-create ClaimResponse.request");
7668        else if (Configuration.doAutoCreate())
7669          this.request = new Reference(); // cc
7670      return this.request;
7671    }
7672
7673    public boolean hasRequest() { 
7674      return this.request != null && !this.request.isEmpty();
7675    }
7676
7677    /**
7678     * @param value {@link #request} (Original request resource reference.)
7679     */
7680    public ClaimResponse setRequest(Reference value) { 
7681      this.request = value;
7682      return this;
7683    }
7684
7685    /**
7686     * @return {@link #outcome} (The outcome of the claim, predetermination, or preauthorization processing.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
7687     */
7688    public Enumeration<ClaimProcessingCodes> getOutcomeElement() { 
7689      if (this.outcome == null)
7690        if (Configuration.errorOnAutoCreate())
7691          throw new Error("Attempt to auto-create ClaimResponse.outcome");
7692        else if (Configuration.doAutoCreate())
7693          this.outcome = new Enumeration<ClaimProcessingCodes>(new ClaimProcessingCodesEnumFactory()); // bb
7694      return this.outcome;
7695    }
7696
7697    public boolean hasOutcomeElement() { 
7698      return this.outcome != null && !this.outcome.isEmpty();
7699    }
7700
7701    public boolean hasOutcome() { 
7702      return this.outcome != null && !this.outcome.isEmpty();
7703    }
7704
7705    /**
7706     * @param value {@link #outcome} (The outcome of the claim, predetermination, or preauthorization processing.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
7707     */
7708    public ClaimResponse setOutcomeElement(Enumeration<ClaimProcessingCodes> value) { 
7709      this.outcome = value;
7710      return this;
7711    }
7712
7713    /**
7714     * @return The outcome of the claim, predetermination, or preauthorization processing.
7715     */
7716    public ClaimProcessingCodes getOutcome() { 
7717      return this.outcome == null ? null : this.outcome.getValue();
7718    }
7719
7720    /**
7721     * @param value The outcome of the claim, predetermination, or preauthorization processing.
7722     */
7723    public ClaimResponse setOutcome(ClaimProcessingCodes value) { 
7724        if (this.outcome == null)
7725          this.outcome = new Enumeration<ClaimProcessingCodes>(new ClaimProcessingCodesEnumFactory());
7726        this.outcome.setValue(value);
7727      return this;
7728    }
7729
7730    /**
7731     * @return {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
7732     */
7733    public CodeableConcept getDecision() { 
7734      if (this.decision == null)
7735        if (Configuration.errorOnAutoCreate())
7736          throw new Error("Attempt to auto-create ClaimResponse.decision");
7737        else if (Configuration.doAutoCreate())
7738          this.decision = new CodeableConcept(); // cc
7739      return this.decision;
7740    }
7741
7742    public boolean hasDecision() { 
7743      return this.decision != null && !this.decision.isEmpty();
7744    }
7745
7746    /**
7747     * @param value {@link #decision} (The result of the claim, predetermination, or preauthorization adjudication.)
7748     */
7749    public ClaimResponse setDecision(CodeableConcept value) { 
7750      this.decision = value;
7751      return this;
7752    }
7753
7754    /**
7755     * @return {@link #disposition} (A human readable description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
7756     */
7757    public StringType getDispositionElement() { 
7758      if (this.disposition == null)
7759        if (Configuration.errorOnAutoCreate())
7760          throw new Error("Attempt to auto-create ClaimResponse.disposition");
7761        else if (Configuration.doAutoCreate())
7762          this.disposition = new StringType(); // bb
7763      return this.disposition;
7764    }
7765
7766    public boolean hasDispositionElement() { 
7767      return this.disposition != null && !this.disposition.isEmpty();
7768    }
7769
7770    public boolean hasDisposition() { 
7771      return this.disposition != null && !this.disposition.isEmpty();
7772    }
7773
7774    /**
7775     * @param value {@link #disposition} (A human readable description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
7776     */
7777    public ClaimResponse setDispositionElement(StringType value) { 
7778      this.disposition = value;
7779      return this;
7780    }
7781
7782    /**
7783     * @return A human readable description of the status of the adjudication.
7784     */
7785    public String getDisposition() { 
7786      return this.disposition == null ? null : this.disposition.getValue();
7787    }
7788
7789    /**
7790     * @param value A human readable description of the status of the adjudication.
7791     */
7792    public ClaimResponse setDisposition(String value) { 
7793      if (Utilities.noString(value))
7794        this.disposition = null;
7795      else {
7796        if (this.disposition == null)
7797          this.disposition = new StringType();
7798        this.disposition.setValue(value);
7799      }
7800      return this;
7801    }
7802
7803    /**
7804     * @return {@link #preAuthRef} (Reference from the Insurer which is used in later communications which refers to this adjudication.). This is the underlying object with id, value and extensions. The accessor "getPreAuthRef" gives direct access to the value
7805     */
7806    public StringType getPreAuthRefElement() { 
7807      if (this.preAuthRef == null)
7808        if (Configuration.errorOnAutoCreate())
7809          throw new Error("Attempt to auto-create ClaimResponse.preAuthRef");
7810        else if (Configuration.doAutoCreate())
7811          this.preAuthRef = new StringType(); // bb
7812      return this.preAuthRef;
7813    }
7814
7815    public boolean hasPreAuthRefElement() { 
7816      return this.preAuthRef != null && !this.preAuthRef.isEmpty();
7817    }
7818
7819    public boolean hasPreAuthRef() { 
7820      return this.preAuthRef != null && !this.preAuthRef.isEmpty();
7821    }
7822
7823    /**
7824     * @param value {@link #preAuthRef} (Reference from the Insurer which is used in later communications which refers to this adjudication.). This is the underlying object with id, value and extensions. The accessor "getPreAuthRef" gives direct access to the value
7825     */
7826    public ClaimResponse setPreAuthRefElement(StringType value) { 
7827      this.preAuthRef = value;
7828      return this;
7829    }
7830
7831    /**
7832     * @return Reference from the Insurer which is used in later communications which refers to this adjudication.
7833     */
7834    public String getPreAuthRef() { 
7835      return this.preAuthRef == null ? null : this.preAuthRef.getValue();
7836    }
7837
7838    /**
7839     * @param value Reference from the Insurer which is used in later communications which refers to this adjudication.
7840     */
7841    public ClaimResponse setPreAuthRef(String value) { 
7842      if (Utilities.noString(value))
7843        this.preAuthRef = null;
7844      else {
7845        if (this.preAuthRef == null)
7846          this.preAuthRef = new StringType();
7847        this.preAuthRef.setValue(value);
7848      }
7849      return this;
7850    }
7851
7852    /**
7853     * @return {@link #preAuthPeriod} (The time frame during which this authorization is effective.)
7854     */
7855    public Period getPreAuthPeriod() { 
7856      if (this.preAuthPeriod == null)
7857        if (Configuration.errorOnAutoCreate())
7858          throw new Error("Attempt to auto-create ClaimResponse.preAuthPeriod");
7859        else if (Configuration.doAutoCreate())
7860          this.preAuthPeriod = new Period(); // cc
7861      return this.preAuthPeriod;
7862    }
7863
7864    public boolean hasPreAuthPeriod() { 
7865      return this.preAuthPeriod != null && !this.preAuthPeriod.isEmpty();
7866    }
7867
7868    /**
7869     * @param value {@link #preAuthPeriod} (The time frame during which this authorization is effective.)
7870     */
7871    public ClaimResponse setPreAuthPeriod(Period value) { 
7872      this.preAuthPeriod = value;
7873      return this;
7874    }
7875
7876    /**
7877     * @return {@link #payeeType} (Type of Party to be reimbursed: subscriber, provider, other.)
7878     */
7879    public CodeableConcept getPayeeType() { 
7880      if (this.payeeType == null)
7881        if (Configuration.errorOnAutoCreate())
7882          throw new Error("Attempt to auto-create ClaimResponse.payeeType");
7883        else if (Configuration.doAutoCreate())
7884          this.payeeType = new CodeableConcept(); // cc
7885      return this.payeeType;
7886    }
7887
7888    public boolean hasPayeeType() { 
7889      return this.payeeType != null && !this.payeeType.isEmpty();
7890    }
7891
7892    /**
7893     * @param value {@link #payeeType} (Type of Party to be reimbursed: subscriber, provider, other.)
7894     */
7895    public ClaimResponse setPayeeType(CodeableConcept value) { 
7896      this.payeeType = value;
7897      return this;
7898    }
7899
7900    /**
7901     * @return {@link #encounter} (The Encounters during which this Claim was created or to which the creation of this record is tightly associated.)
7902     */
7903    public List<Reference> getEncounter() { 
7904      if (this.encounter == null)
7905        this.encounter = new ArrayList<Reference>();
7906      return this.encounter;
7907    }
7908
7909    /**
7910     * @return Returns a reference to <code>this</code> for easy method chaining
7911     */
7912    public ClaimResponse setEncounter(List<Reference> theEncounter) { 
7913      this.encounter = theEncounter;
7914      return this;
7915    }
7916
7917    public boolean hasEncounter() { 
7918      if (this.encounter == null)
7919        return false;
7920      for (Reference item : this.encounter)
7921        if (!item.isEmpty())
7922          return true;
7923      return false;
7924    }
7925
7926    public Reference addEncounter() { //3
7927      Reference t = new Reference();
7928      if (this.encounter == null)
7929        this.encounter = new ArrayList<Reference>();
7930      this.encounter.add(t);
7931      return t;
7932    }
7933
7934    public ClaimResponse addEncounter(Reference t) { //3
7935      if (t == null)
7936        return this;
7937      if (this.encounter == null)
7938        this.encounter = new ArrayList<Reference>();
7939      this.encounter.add(t);
7940      return this;
7941    }
7942
7943    /**
7944     * @return The first repetition of repeating field {@link #encounter}, creating it if it does not already exist {3}
7945     */
7946    public Reference getEncounterFirstRep() { 
7947      if (getEncounter().isEmpty()) {
7948        addEncounter();
7949      }
7950      return getEncounter().get(0);
7951    }
7952
7953    /**
7954     * @return {@link #diagnosisRelatedGroup} (A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.)
7955     */
7956    public CodeableConcept getDiagnosisRelatedGroup() { 
7957      if (this.diagnosisRelatedGroup == null)
7958        if (Configuration.errorOnAutoCreate())
7959          throw new Error("Attempt to auto-create ClaimResponse.diagnosisRelatedGroup");
7960        else if (Configuration.doAutoCreate())
7961          this.diagnosisRelatedGroup = new CodeableConcept(); // cc
7962      return this.diagnosisRelatedGroup;
7963    }
7964
7965    public boolean hasDiagnosisRelatedGroup() { 
7966      return this.diagnosisRelatedGroup != null && !this.diagnosisRelatedGroup.isEmpty();
7967    }
7968
7969    /**
7970     * @param value {@link #diagnosisRelatedGroup} (A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.)
7971     */
7972    public ClaimResponse setDiagnosisRelatedGroup(CodeableConcept value) { 
7973      this.diagnosisRelatedGroup = value;
7974      return this;
7975    }
7976
7977    /**
7978     * @return {@link #item} (A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.)
7979     */
7980    public List<ItemComponent> getItem() { 
7981      if (this.item == null)
7982        this.item = new ArrayList<ItemComponent>();
7983      return this.item;
7984    }
7985
7986    /**
7987     * @return Returns a reference to <code>this</code> for easy method chaining
7988     */
7989    public ClaimResponse setItem(List<ItemComponent> theItem) { 
7990      this.item = theItem;
7991      return this;
7992    }
7993
7994    public boolean hasItem() { 
7995      if (this.item == null)
7996        return false;
7997      for (ItemComponent item : this.item)
7998        if (!item.isEmpty())
7999          return true;
8000      return false;
8001    }
8002
8003    public ItemComponent addItem() { //3
8004      ItemComponent t = new ItemComponent();
8005      if (this.item == null)
8006        this.item = new ArrayList<ItemComponent>();
8007      this.item.add(t);
8008      return t;
8009    }
8010
8011    public ClaimResponse addItem(ItemComponent t) { //3
8012      if (t == null)
8013        return this;
8014      if (this.item == null)
8015        this.item = new ArrayList<ItemComponent>();
8016      this.item.add(t);
8017      return this;
8018    }
8019
8020    /**
8021     * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist {3}
8022     */
8023    public ItemComponent getItemFirstRep() { 
8024      if (getItem().isEmpty()) {
8025        addItem();
8026      }
8027      return getItem().get(0);
8028    }
8029
8030    /**
8031     * @return {@link #addItem} (The first-tier service adjudications for payor added product or service lines.)
8032     */
8033    public List<AddedItemComponent> getAddItem() { 
8034      if (this.addItem == null)
8035        this.addItem = new ArrayList<AddedItemComponent>();
8036      return this.addItem;
8037    }
8038
8039    /**
8040     * @return Returns a reference to <code>this</code> for easy method chaining
8041     */
8042    public ClaimResponse setAddItem(List<AddedItemComponent> theAddItem) { 
8043      this.addItem = theAddItem;
8044      return this;
8045    }
8046
8047    public boolean hasAddItem() { 
8048      if (this.addItem == null)
8049        return false;
8050      for (AddedItemComponent item : this.addItem)
8051        if (!item.isEmpty())
8052          return true;
8053      return false;
8054    }
8055
8056    public AddedItemComponent addAddItem() { //3
8057      AddedItemComponent t = new AddedItemComponent();
8058      if (this.addItem == null)
8059        this.addItem = new ArrayList<AddedItemComponent>();
8060      this.addItem.add(t);
8061      return t;
8062    }
8063
8064    public ClaimResponse addAddItem(AddedItemComponent t) { //3
8065      if (t == null)
8066        return this;
8067      if (this.addItem == null)
8068        this.addItem = new ArrayList<AddedItemComponent>();
8069      this.addItem.add(t);
8070      return this;
8071    }
8072
8073    /**
8074     * @return The first repetition of repeating field {@link #addItem}, creating it if it does not already exist {3}
8075     */
8076    public AddedItemComponent getAddItemFirstRep() { 
8077      if (getAddItem().isEmpty()) {
8078        addAddItem();
8079      }
8080      return getAddItem().get(0);
8081    }
8082
8083    /**
8084     * @return {@link #adjudication} (The adjudication results which are presented at the header level rather than at the line-item or add-item levels.)
8085     */
8086    public List<AdjudicationComponent> getAdjudication() { 
8087      if (this.adjudication == null)
8088        this.adjudication = new ArrayList<AdjudicationComponent>();
8089      return this.adjudication;
8090    }
8091
8092    /**
8093     * @return Returns a reference to <code>this</code> for easy method chaining
8094     */
8095    public ClaimResponse setAdjudication(List<AdjudicationComponent> theAdjudication) { 
8096      this.adjudication = theAdjudication;
8097      return this;
8098    }
8099
8100    public boolean hasAdjudication() { 
8101      if (this.adjudication == null)
8102        return false;
8103      for (AdjudicationComponent item : this.adjudication)
8104        if (!item.isEmpty())
8105          return true;
8106      return false;
8107    }
8108
8109    public AdjudicationComponent addAdjudication() { //3
8110      AdjudicationComponent t = new AdjudicationComponent();
8111      if (this.adjudication == null)
8112        this.adjudication = new ArrayList<AdjudicationComponent>();
8113      this.adjudication.add(t);
8114      return t;
8115    }
8116
8117    public ClaimResponse addAdjudication(AdjudicationComponent t) { //3
8118      if (t == null)
8119        return this;
8120      if (this.adjudication == null)
8121        this.adjudication = new ArrayList<AdjudicationComponent>();
8122      this.adjudication.add(t);
8123      return this;
8124    }
8125
8126    /**
8127     * @return The first repetition of repeating field {@link #adjudication}, creating it if it does not already exist {3}
8128     */
8129    public AdjudicationComponent getAdjudicationFirstRep() { 
8130      if (getAdjudication().isEmpty()) {
8131        addAdjudication();
8132      }
8133      return getAdjudication().get(0);
8134    }
8135
8136    /**
8137     * @return {@link #total} (Categorized monetary totals for the adjudication.)
8138     */
8139    public List<TotalComponent> getTotal() { 
8140      if (this.total == null)
8141        this.total = new ArrayList<TotalComponent>();
8142      return this.total;
8143    }
8144
8145    /**
8146     * @return Returns a reference to <code>this</code> for easy method chaining
8147     */
8148    public ClaimResponse setTotal(List<TotalComponent> theTotal) { 
8149      this.total = theTotal;
8150      return this;
8151    }
8152
8153    public boolean hasTotal() { 
8154      if (this.total == null)
8155        return false;
8156      for (TotalComponent item : this.total)
8157        if (!item.isEmpty())
8158          return true;
8159      return false;
8160    }
8161
8162    public TotalComponent addTotal() { //3
8163      TotalComponent t = new TotalComponent();
8164      if (this.total == null)
8165        this.total = new ArrayList<TotalComponent>();
8166      this.total.add(t);
8167      return t;
8168    }
8169
8170    public ClaimResponse addTotal(TotalComponent t) { //3
8171      if (t == null)
8172        return this;
8173      if (this.total == null)
8174        this.total = new ArrayList<TotalComponent>();
8175      this.total.add(t);
8176      return this;
8177    }
8178
8179    /**
8180     * @return The first repetition of repeating field {@link #total}, creating it if it does not already exist {3}
8181     */
8182    public TotalComponent getTotalFirstRep() { 
8183      if (getTotal().isEmpty()) {
8184        addTotal();
8185      }
8186      return getTotal().get(0);
8187    }
8188
8189    /**
8190     * @return {@link #payment} (Payment details for the adjudication of the claim.)
8191     */
8192    public PaymentComponent getPayment() { 
8193      if (this.payment == null)
8194        if (Configuration.errorOnAutoCreate())
8195          throw new Error("Attempt to auto-create ClaimResponse.payment");
8196        else if (Configuration.doAutoCreate())
8197          this.payment = new PaymentComponent(); // cc
8198      return this.payment;
8199    }
8200
8201    public boolean hasPayment() { 
8202      return this.payment != null && !this.payment.isEmpty();
8203    }
8204
8205    /**
8206     * @param value {@link #payment} (Payment details for the adjudication of the claim.)
8207     */
8208    public ClaimResponse setPayment(PaymentComponent value) { 
8209      this.payment = value;
8210      return this;
8211    }
8212
8213    /**
8214     * @return {@link #fundsReserve} (A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.)
8215     */
8216    public CodeableConcept getFundsReserve() { 
8217      if (this.fundsReserve == null)
8218        if (Configuration.errorOnAutoCreate())
8219          throw new Error("Attempt to auto-create ClaimResponse.fundsReserve");
8220        else if (Configuration.doAutoCreate())
8221          this.fundsReserve = new CodeableConcept(); // cc
8222      return this.fundsReserve;
8223    }
8224
8225    public boolean hasFundsReserve() { 
8226      return this.fundsReserve != null && !this.fundsReserve.isEmpty();
8227    }
8228
8229    /**
8230     * @param value {@link #fundsReserve} (A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.)
8231     */
8232    public ClaimResponse setFundsReserve(CodeableConcept value) { 
8233      this.fundsReserve = value;
8234      return this;
8235    }
8236
8237    /**
8238     * @return {@link #formCode} (A code for the form to be used for printing the content.)
8239     */
8240    public CodeableConcept getFormCode() { 
8241      if (this.formCode == null)
8242        if (Configuration.errorOnAutoCreate())
8243          throw new Error("Attempt to auto-create ClaimResponse.formCode");
8244        else if (Configuration.doAutoCreate())
8245          this.formCode = new CodeableConcept(); // cc
8246      return this.formCode;
8247    }
8248
8249    public boolean hasFormCode() { 
8250      return this.formCode != null && !this.formCode.isEmpty();
8251    }
8252
8253    /**
8254     * @param value {@link #formCode} (A code for the form to be used for printing the content.)
8255     */
8256    public ClaimResponse setFormCode(CodeableConcept value) { 
8257      this.formCode = value;
8258      return this;
8259    }
8260
8261    /**
8262     * @return {@link #form} (The actual form, by reference or inclusion, for printing the content or an EOB.)
8263     */
8264    public Attachment getForm() { 
8265      if (this.form == null)
8266        if (Configuration.errorOnAutoCreate())
8267          throw new Error("Attempt to auto-create ClaimResponse.form");
8268        else if (Configuration.doAutoCreate())
8269          this.form = new Attachment(); // cc
8270      return this.form;
8271    }
8272
8273    public boolean hasForm() { 
8274      return this.form != null && !this.form.isEmpty();
8275    }
8276
8277    /**
8278     * @param value {@link #form} (The actual form, by reference or inclusion, for printing the content or an EOB.)
8279     */
8280    public ClaimResponse setForm(Attachment value) { 
8281      this.form = value;
8282      return this;
8283    }
8284
8285    /**
8286     * @return {@link #processNote} (A note that describes or explains adjudication results in a human readable form.)
8287     */
8288    public List<NoteComponent> getProcessNote() { 
8289      if (this.processNote == null)
8290        this.processNote = new ArrayList<NoteComponent>();
8291      return this.processNote;
8292    }
8293
8294    /**
8295     * @return Returns a reference to <code>this</code> for easy method chaining
8296     */
8297    public ClaimResponse setProcessNote(List<NoteComponent> theProcessNote) { 
8298      this.processNote = theProcessNote;
8299      return this;
8300    }
8301
8302    public boolean hasProcessNote() { 
8303      if (this.processNote == null)
8304        return false;
8305      for (NoteComponent item : this.processNote)
8306        if (!item.isEmpty())
8307          return true;
8308      return false;
8309    }
8310
8311    public NoteComponent addProcessNote() { //3
8312      NoteComponent t = new NoteComponent();
8313      if (this.processNote == null)
8314        this.processNote = new ArrayList<NoteComponent>();
8315      this.processNote.add(t);
8316      return t;
8317    }
8318
8319    public ClaimResponse addProcessNote(NoteComponent t) { //3
8320      if (t == null)
8321        return this;
8322      if (this.processNote == null)
8323        this.processNote = new ArrayList<NoteComponent>();
8324      this.processNote.add(t);
8325      return this;
8326    }
8327
8328    /**
8329     * @return The first repetition of repeating field {@link #processNote}, creating it if it does not already exist {3}
8330     */
8331    public NoteComponent getProcessNoteFirstRep() { 
8332      if (getProcessNote().isEmpty()) {
8333        addProcessNote();
8334      }
8335      return getProcessNote().get(0);
8336    }
8337
8338    /**
8339     * @return {@link #communicationRequest} (Request for additional supporting or authorizing information.)
8340     */
8341    public List<Reference> getCommunicationRequest() { 
8342      if (this.communicationRequest == null)
8343        this.communicationRequest = new ArrayList<Reference>();
8344      return this.communicationRequest;
8345    }
8346
8347    /**
8348     * @return Returns a reference to <code>this</code> for easy method chaining
8349     */
8350    public ClaimResponse setCommunicationRequest(List<Reference> theCommunicationRequest) { 
8351      this.communicationRequest = theCommunicationRequest;
8352      return this;
8353    }
8354
8355    public boolean hasCommunicationRequest() { 
8356      if (this.communicationRequest == null)
8357        return false;
8358      for (Reference item : this.communicationRequest)
8359        if (!item.isEmpty())
8360          return true;
8361      return false;
8362    }
8363
8364    public Reference addCommunicationRequest() { //3
8365      Reference t = new Reference();
8366      if (this.communicationRequest == null)
8367        this.communicationRequest = new ArrayList<Reference>();
8368      this.communicationRequest.add(t);
8369      return t;
8370    }
8371
8372    public ClaimResponse addCommunicationRequest(Reference t) { //3
8373      if (t == null)
8374        return this;
8375      if (this.communicationRequest == null)
8376        this.communicationRequest = new ArrayList<Reference>();
8377      this.communicationRequest.add(t);
8378      return this;
8379    }
8380
8381    /**
8382     * @return The first repetition of repeating field {@link #communicationRequest}, creating it if it does not already exist {3}
8383     */
8384    public Reference getCommunicationRequestFirstRep() { 
8385      if (getCommunicationRequest().isEmpty()) {
8386        addCommunicationRequest();
8387      }
8388      return getCommunicationRequest().get(0);
8389    }
8390
8391    /**
8392     * @return {@link #insurance} (Financial instruments for reimbursement for the health care products and services specified on the claim.)
8393     */
8394    public List<InsuranceComponent> getInsurance() { 
8395      if (this.insurance == null)
8396        this.insurance = new ArrayList<InsuranceComponent>();
8397      return this.insurance;
8398    }
8399
8400    /**
8401     * @return Returns a reference to <code>this</code> for easy method chaining
8402     */
8403    public ClaimResponse setInsurance(List<InsuranceComponent> theInsurance) { 
8404      this.insurance = theInsurance;
8405      return this;
8406    }
8407
8408    public boolean hasInsurance() { 
8409      if (this.insurance == null)
8410        return false;
8411      for (InsuranceComponent item : this.insurance)
8412        if (!item.isEmpty())
8413          return true;
8414      return false;
8415    }
8416
8417    public InsuranceComponent addInsurance() { //3
8418      InsuranceComponent t = new InsuranceComponent();
8419      if (this.insurance == null)
8420        this.insurance = new ArrayList<InsuranceComponent>();
8421      this.insurance.add(t);
8422      return t;
8423    }
8424
8425    public ClaimResponse addInsurance(InsuranceComponent t) { //3
8426      if (t == null)
8427        return this;
8428      if (this.insurance == null)
8429        this.insurance = new ArrayList<InsuranceComponent>();
8430      this.insurance.add(t);
8431      return this;
8432    }
8433
8434    /**
8435     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist {3}
8436     */
8437    public InsuranceComponent getInsuranceFirstRep() { 
8438      if (getInsurance().isEmpty()) {
8439        addInsurance();
8440      }
8441      return getInsurance().get(0);
8442    }
8443
8444    /**
8445     * @return {@link #error} (Errors encountered during the processing of the adjudication.)
8446     */
8447    public List<ErrorComponent> getError() { 
8448      if (this.error == null)
8449        this.error = new ArrayList<ErrorComponent>();
8450      return this.error;
8451    }
8452
8453    /**
8454     * @return Returns a reference to <code>this</code> for easy method chaining
8455     */
8456    public ClaimResponse setError(List<ErrorComponent> theError) { 
8457      this.error = theError;
8458      return this;
8459    }
8460
8461    public boolean hasError() { 
8462      if (this.error == null)
8463        return false;
8464      for (ErrorComponent item : this.error)
8465        if (!item.isEmpty())
8466          return true;
8467      return false;
8468    }
8469
8470    public ErrorComponent addError() { //3
8471      ErrorComponent t = new ErrorComponent();
8472      if (this.error == null)
8473        this.error = new ArrayList<ErrorComponent>();
8474      this.error.add(t);
8475      return t;
8476    }
8477
8478    public ClaimResponse addError(ErrorComponent t) { //3
8479      if (t == null)
8480        return this;
8481      if (this.error == null)
8482        this.error = new ArrayList<ErrorComponent>();
8483      this.error.add(t);
8484      return this;
8485    }
8486
8487    /**
8488     * @return The first repetition of repeating field {@link #error}, creating it if it does not already exist {3}
8489     */
8490    public ErrorComponent getErrorFirstRep() { 
8491      if (getError().isEmpty()) {
8492        addError();
8493      }
8494      return getError().get(0);
8495    }
8496
8497      protected void listChildren(List<Property> children) {
8498        super.listChildren(children);
8499        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this claim response.", 0, java.lang.Integer.MAX_VALUE, identifier));
8500        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
8501        children.add(new Property("type", "CodeableConcept", "A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.", 0, 1, type));
8502        children.add(new Property("subType", "CodeableConcept", "A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.", 0, 1, subType));
8503        children.add(new Property("use", "code", "A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.", 0, 1, use));
8504        children.add(new Property("patient", "Reference(Patient)", "The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.", 0, 1, patient));
8505        children.add(new Property("created", "dateTime", "The date this resource was created.", 0, 1, created));
8506        children.add(new Property("insurer", "Reference(Organization)", "The party responsible for authorization, adjudication and reimbursement.", 0, 1, insurer));
8507        children.add(new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)", "The provider which is responsible for the claim, predetermination or preauthorization.", 0, 1, requestor));
8508        children.add(new Property("request", "Reference(Claim)", "Original request resource reference.", 0, 1, request));
8509        children.add(new Property("outcome", "code", "The outcome of the claim, predetermination, or preauthorization processing.", 0, 1, outcome));
8510        children.add(new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision));
8511        children.add(new Property("disposition", "string", "A human readable description of the status of the adjudication.", 0, 1, disposition));
8512        children.add(new Property("preAuthRef", "string", "Reference from the Insurer which is used in later communications which refers to this adjudication.", 0, 1, preAuthRef));
8513        children.add(new Property("preAuthPeriod", "Period", "The time frame during which this authorization is effective.", 0, 1, preAuthPeriod));
8514        children.add(new Property("payeeType", "CodeableConcept", "Type of Party to be reimbursed: subscriber, provider, other.", 0, 1, payeeType));
8515        children.add(new Property("encounter", "Reference(Encounter)", "The Encounters during which this Claim was created or to which the creation of this record is tightly associated.", 0, java.lang.Integer.MAX_VALUE, encounter));
8516        children.add(new Property("diagnosisRelatedGroup", "CodeableConcept", "A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.", 0, 1, diagnosisRelatedGroup));
8517        children.add(new Property("item", "", "A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.", 0, java.lang.Integer.MAX_VALUE, item));
8518        children.add(new Property("addItem", "", "The first-tier service adjudications for payor added product or service lines.", 0, java.lang.Integer.MAX_VALUE, addItem));
8519        children.add(new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results which are presented at the header level rather than at the line-item or add-item levels.", 0, java.lang.Integer.MAX_VALUE, adjudication));
8520        children.add(new Property("total", "", "Categorized monetary totals for the adjudication.", 0, java.lang.Integer.MAX_VALUE, total));
8521        children.add(new Property("payment", "", "Payment details for the adjudication of the claim.", 0, 1, payment));
8522        children.add(new Property("fundsReserve", "CodeableConcept", "A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.", 0, 1, fundsReserve));
8523        children.add(new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode));
8524        children.add(new Property("form", "Attachment", "The actual form, by reference or inclusion, for printing the content or an EOB.", 0, 1, form));
8525        children.add(new Property("processNote", "", "A note that describes or explains adjudication results in a human readable form.", 0, java.lang.Integer.MAX_VALUE, processNote));
8526        children.add(new Property("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information.", 0, java.lang.Integer.MAX_VALUE, communicationRequest));
8527        children.add(new Property("insurance", "", "Financial instruments for reimbursement for the health care products and services specified on the claim.", 0, java.lang.Integer.MAX_VALUE, insurance));
8528        children.add(new Property("error", "", "Errors encountered during the processing of the adjudication.", 0, java.lang.Integer.MAX_VALUE, error));
8529      }
8530
8531      @Override
8532      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8533        switch (_hash) {
8534        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this claim response.", 0, java.lang.Integer.MAX_VALUE, identifier);
8535        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
8536        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.", 0, 1, type);
8537        case -1868521062: /*subType*/  return new Property("subType", "CodeableConcept", "A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.", 0, 1, subType);
8538        case 116103: /*use*/  return new Property("use", "code", "A code to indicate whether the nature of the request is: Claim - A request to an Insurer to adjudicate the supplied charges for health care goods and services under the identified policy and to pay the determined Benefit amount, if any; Preauthorization - A request to an Insurer to adjudicate the supplied proposed future charges for health care goods and services under the identified policy and to approve the services and provide the expected benefit amounts and potentially to reserve funds to pay the benefits when Claims for the indicated services are later submitted; or, Pre-determination - A request to an Insurer to adjudicate the supplied 'what if' charges for health care goods and services under the identified policy and report back what the Benefit payable would be had the services actually been provided.", 0, 1, use);
8539        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.", 0, 1, patient);
8540        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date this resource was created.", 0, 1, created);
8541        case 1957615864: /*insurer*/  return new Property("insurer", "Reference(Organization)", "The party responsible for authorization, adjudication and reimbursement.", 0, 1, insurer);
8542        case 693934258: /*requestor*/  return new Property("requestor", "Reference(Practitioner|PractitionerRole|Organization)", "The provider which is responsible for the claim, predetermination or preauthorization.", 0, 1, requestor);
8543        case 1095692943: /*request*/  return new Property("request", "Reference(Claim)", "Original request resource reference.", 0, 1, request);
8544        case -1106507950: /*outcome*/  return new Property("outcome", "code", "The outcome of the claim, predetermination, or preauthorization processing.", 0, 1, outcome);
8545        case 565719004: /*decision*/  return new Property("decision", "CodeableConcept", "The result of the claim, predetermination, or preauthorization adjudication.", 0, 1, decision);
8546        case 583380919: /*disposition*/  return new Property("disposition", "string", "A human readable description of the status of the adjudication.", 0, 1, disposition);
8547        case 522246568: /*preAuthRef*/  return new Property("preAuthRef", "string", "Reference from the Insurer which is used in later communications which refers to this adjudication.", 0, 1, preAuthRef);
8548        case 1819164812: /*preAuthPeriod*/  return new Property("preAuthPeriod", "Period", "The time frame during which this authorization is effective.", 0, 1, preAuthPeriod);
8549        case -316321118: /*payeeType*/  return new Property("payeeType", "CodeableConcept", "Type of Party to be reimbursed: subscriber, provider, other.", 0, 1, payeeType);
8550        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounters during which this Claim was created or to which the creation of this record is tightly associated.", 0, java.lang.Integer.MAX_VALUE, encounter);
8551        case -1599182171: /*diagnosisRelatedGroup*/  return new Property("diagnosisRelatedGroup", "CodeableConcept", "A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.", 0, 1, diagnosisRelatedGroup);
8552        case 3242771: /*item*/  return new Property("item", "", "A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.", 0, java.lang.Integer.MAX_VALUE, item);
8553        case -1148899500: /*addItem*/  return new Property("addItem", "", "The first-tier service adjudications for payor added product or service lines.", 0, java.lang.Integer.MAX_VALUE, addItem);
8554        case -231349275: /*adjudication*/  return new Property("adjudication", "@ClaimResponse.item.adjudication", "The adjudication results which are presented at the header level rather than at the line-item or add-item levels.", 0, java.lang.Integer.MAX_VALUE, adjudication);
8555        case 110549828: /*total*/  return new Property("total", "", "Categorized monetary totals for the adjudication.", 0, java.lang.Integer.MAX_VALUE, total);
8556        case -786681338: /*payment*/  return new Property("payment", "", "Payment details for the adjudication of the claim.", 0, 1, payment);
8557        case 1314609806: /*fundsReserve*/  return new Property("fundsReserve", "CodeableConcept", "A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.", 0, 1, fundsReserve);
8558        case 473181393: /*formCode*/  return new Property("formCode", "CodeableConcept", "A code for the form to be used for printing the content.", 0, 1, formCode);
8559        case 3148996: /*form*/  return new Property("form", "Attachment", "The actual form, by reference or inclusion, for printing the content or an EOB.", 0, 1, form);
8560        case 202339073: /*processNote*/  return new Property("processNote", "", "A note that describes or explains adjudication results in a human readable form.", 0, java.lang.Integer.MAX_VALUE, processNote);
8561        case -2071896615: /*communicationRequest*/  return new Property("communicationRequest", "Reference(CommunicationRequest)", "Request for additional supporting or authorizing information.", 0, java.lang.Integer.MAX_VALUE, communicationRequest);
8562        case 73049818: /*insurance*/  return new Property("insurance", "", "Financial instruments for reimbursement for the health care products and services specified on the claim.", 0, java.lang.Integer.MAX_VALUE, insurance);
8563        case 96784904: /*error*/  return new Property("error", "", "Errors encountered during the processing of the adjudication.", 0, java.lang.Integer.MAX_VALUE, error);
8564        default: return super.getNamedProperty(_hash, _name, _checkValid);
8565        }
8566
8567      }
8568
8569      @Override
8570      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8571        switch (hash) {
8572        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
8573        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
8574        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
8575        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept
8576        case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration<Use>
8577        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
8578        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
8579        case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference
8580        case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // Reference
8581        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
8582        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<ClaimProcessingCodes>
8583        case 565719004: /*decision*/ return this.decision == null ? new Base[0] : new Base[] {this.decision}; // CodeableConcept
8584        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
8585        case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : new Base[] {this.preAuthRef}; // StringType
8586        case 1819164812: /*preAuthPeriod*/ return this.preAuthPeriod == null ? new Base[0] : new Base[] {this.preAuthPeriod}; // Period
8587        case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // CodeableConcept
8588        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : this.encounter.toArray(new Base[this.encounter.size()]); // Reference
8589        case -1599182171: /*diagnosisRelatedGroup*/ return this.diagnosisRelatedGroup == null ? new Base[0] : new Base[] {this.diagnosisRelatedGroup}; // CodeableConcept
8590        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemComponent
8591        case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent
8592        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AdjudicationComponent
8593        case 110549828: /*total*/ return this.total == null ? new Base[0] : this.total.toArray(new Base[this.total.size()]); // TotalComponent
8594        case -786681338: /*payment*/ return this.payment == null ? new Base[0] : new Base[] {this.payment}; // PaymentComponent
8595        case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // CodeableConcept
8596        case 473181393: /*formCode*/ return this.formCode == null ? new Base[0] : new Base[] {this.formCode}; // CodeableConcept
8597        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Attachment
8598        case 202339073: /*processNote*/ return this.processNote == null ? new Base[0] : this.processNote.toArray(new Base[this.processNote.size()]); // NoteComponent
8599        case -2071896615: /*communicationRequest*/ return this.communicationRequest == null ? new Base[0] : this.communicationRequest.toArray(new Base[this.communicationRequest.size()]); // Reference
8600        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent
8601        case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorComponent
8602        default: return super.getProperty(hash, name, checkValid);
8603        }
8604
8605      }
8606
8607      @Override
8608      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8609        switch (hash) {
8610        case -1618432855: // identifier
8611          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
8612          return value;
8613        case -892481550: // status
8614          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
8615          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
8616          return value;
8617        case 3575610: // type
8618          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8619          return value;
8620        case -1868521062: // subType
8621          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8622          return value;
8623        case 116103: // use
8624          value = new UseEnumFactory().fromType(TypeConvertor.castToCode(value));
8625          this.use = (Enumeration) value; // Enumeration<Use>
8626          return value;
8627        case -791418107: // patient
8628          this.patient = TypeConvertor.castToReference(value); // Reference
8629          return value;
8630        case 1028554472: // created
8631          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
8632          return value;
8633        case 1957615864: // insurer
8634          this.insurer = TypeConvertor.castToReference(value); // Reference
8635          return value;
8636        case 693934258: // requestor
8637          this.requestor = TypeConvertor.castToReference(value); // Reference
8638          return value;
8639        case 1095692943: // request
8640          this.request = TypeConvertor.castToReference(value); // Reference
8641          return value;
8642        case -1106507950: // outcome
8643          value = new ClaimProcessingCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
8644          this.outcome = (Enumeration) value; // Enumeration<ClaimProcessingCodes>
8645          return value;
8646        case 565719004: // decision
8647          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8648          return value;
8649        case 583380919: // disposition
8650          this.disposition = TypeConvertor.castToString(value); // StringType
8651          return value;
8652        case 522246568: // preAuthRef
8653          this.preAuthRef = TypeConvertor.castToString(value); // StringType
8654          return value;
8655        case 1819164812: // preAuthPeriod
8656          this.preAuthPeriod = TypeConvertor.castToPeriod(value); // Period
8657          return value;
8658        case -316321118: // payeeType
8659          this.payeeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8660          return value;
8661        case 1524132147: // encounter
8662          this.getEncounter().add(TypeConvertor.castToReference(value)); // Reference
8663          return value;
8664        case -1599182171: // diagnosisRelatedGroup
8665          this.diagnosisRelatedGroup = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8666          return value;
8667        case 3242771: // item
8668          this.getItem().add((ItemComponent) value); // ItemComponent
8669          return value;
8670        case -1148899500: // addItem
8671          this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent
8672          return value;
8673        case -231349275: // adjudication
8674          this.getAdjudication().add((AdjudicationComponent) value); // AdjudicationComponent
8675          return value;
8676        case 110549828: // total
8677          this.getTotal().add((TotalComponent) value); // TotalComponent
8678          return value;
8679        case -786681338: // payment
8680          this.payment = (PaymentComponent) value; // PaymentComponent
8681          return value;
8682        case 1314609806: // fundsReserve
8683          this.fundsReserve = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8684          return value;
8685        case 473181393: // formCode
8686          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8687          return value;
8688        case 3148996: // form
8689          this.form = TypeConvertor.castToAttachment(value); // Attachment
8690          return value;
8691        case 202339073: // processNote
8692          this.getProcessNote().add((NoteComponent) value); // NoteComponent
8693          return value;
8694        case -2071896615: // communicationRequest
8695          this.getCommunicationRequest().add(TypeConvertor.castToReference(value)); // Reference
8696          return value;
8697        case 73049818: // insurance
8698          this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent
8699          return value;
8700        case 96784904: // error
8701          this.getError().add((ErrorComponent) value); // ErrorComponent
8702          return value;
8703        default: return super.setProperty(hash, name, value);
8704        }
8705
8706      }
8707
8708      @Override
8709      public Base setProperty(String name, Base value) throws FHIRException {
8710        if (name.equals("identifier")) {
8711          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
8712        } else if (name.equals("status")) {
8713          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
8714          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
8715        } else if (name.equals("type")) {
8716          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8717        } else if (name.equals("subType")) {
8718          this.subType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8719        } else if (name.equals("use")) {
8720          value = new UseEnumFactory().fromType(TypeConvertor.castToCode(value));
8721          this.use = (Enumeration) value; // Enumeration<Use>
8722        } else if (name.equals("patient")) {
8723          this.patient = TypeConvertor.castToReference(value); // Reference
8724        } else if (name.equals("created")) {
8725          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
8726        } else if (name.equals("insurer")) {
8727          this.insurer = TypeConvertor.castToReference(value); // Reference
8728        } else if (name.equals("requestor")) {
8729          this.requestor = TypeConvertor.castToReference(value); // Reference
8730        } else if (name.equals("request")) {
8731          this.request = TypeConvertor.castToReference(value); // Reference
8732        } else if (name.equals("outcome")) {
8733          value = new ClaimProcessingCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
8734          this.outcome = (Enumeration) value; // Enumeration<ClaimProcessingCodes>
8735        } else if (name.equals("decision")) {
8736          this.decision = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8737        } else if (name.equals("disposition")) {
8738          this.disposition = TypeConvertor.castToString(value); // StringType
8739        } else if (name.equals("preAuthRef")) {
8740          this.preAuthRef = TypeConvertor.castToString(value); // StringType
8741        } else if (name.equals("preAuthPeriod")) {
8742          this.preAuthPeriod = TypeConvertor.castToPeriod(value); // Period
8743        } else if (name.equals("payeeType")) {
8744          this.payeeType = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8745        } else if (name.equals("encounter")) {
8746          this.getEncounter().add(TypeConvertor.castToReference(value));
8747        } else if (name.equals("diagnosisRelatedGroup")) {
8748          this.diagnosisRelatedGroup = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8749        } else if (name.equals("item")) {
8750          this.getItem().add((ItemComponent) value);
8751        } else if (name.equals("addItem")) {
8752          this.getAddItem().add((AddedItemComponent) value);
8753        } else if (name.equals("adjudication")) {
8754          this.getAdjudication().add((AdjudicationComponent) value);
8755        } else if (name.equals("total")) {
8756          this.getTotal().add((TotalComponent) value);
8757        } else if (name.equals("payment")) {
8758          this.payment = (PaymentComponent) value; // PaymentComponent
8759        } else if (name.equals("fundsReserve")) {
8760          this.fundsReserve = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8761        } else if (name.equals("formCode")) {
8762          this.formCode = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
8763        } else if (name.equals("form")) {
8764          this.form = TypeConvertor.castToAttachment(value); // Attachment
8765        } else if (name.equals("processNote")) {
8766          this.getProcessNote().add((NoteComponent) value);
8767        } else if (name.equals("communicationRequest")) {
8768          this.getCommunicationRequest().add(TypeConvertor.castToReference(value));
8769        } else if (name.equals("insurance")) {
8770          this.getInsurance().add((InsuranceComponent) value);
8771        } else if (name.equals("error")) {
8772          this.getError().add((ErrorComponent) value);
8773        } else
8774          return super.setProperty(name, value);
8775        return value;
8776      }
8777
8778      @Override
8779      public Base makeProperty(int hash, String name) throws FHIRException {
8780        switch (hash) {
8781        case -1618432855:  return addIdentifier(); 
8782        case -892481550:  return getStatusElement();
8783        case 3575610:  return getType();
8784        case -1868521062:  return getSubType();
8785        case 116103:  return getUseElement();
8786        case -791418107:  return getPatient();
8787        case 1028554472:  return getCreatedElement();
8788        case 1957615864:  return getInsurer();
8789        case 693934258:  return getRequestor();
8790        case 1095692943:  return getRequest();
8791        case -1106507950:  return getOutcomeElement();
8792        case 565719004:  return getDecision();
8793        case 583380919:  return getDispositionElement();
8794        case 522246568:  return getPreAuthRefElement();
8795        case 1819164812:  return getPreAuthPeriod();
8796        case -316321118:  return getPayeeType();
8797        case 1524132147:  return addEncounter(); 
8798        case -1599182171:  return getDiagnosisRelatedGroup();
8799        case 3242771:  return addItem(); 
8800        case -1148899500:  return addAddItem(); 
8801        case -231349275:  return addAdjudication(); 
8802        case 110549828:  return addTotal(); 
8803        case -786681338:  return getPayment();
8804        case 1314609806:  return getFundsReserve();
8805        case 473181393:  return getFormCode();
8806        case 3148996:  return getForm();
8807        case 202339073:  return addProcessNote(); 
8808        case -2071896615:  return addCommunicationRequest(); 
8809        case 73049818:  return addInsurance(); 
8810        case 96784904:  return addError(); 
8811        default: return super.makeProperty(hash, name);
8812        }
8813
8814      }
8815
8816      @Override
8817      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8818        switch (hash) {
8819        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
8820        case -892481550: /*status*/ return new String[] {"code"};
8821        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
8822        case -1868521062: /*subType*/ return new String[] {"CodeableConcept"};
8823        case 116103: /*use*/ return new String[] {"code"};
8824        case -791418107: /*patient*/ return new String[] {"Reference"};
8825        case 1028554472: /*created*/ return new String[] {"dateTime"};
8826        case 1957615864: /*insurer*/ return new String[] {"Reference"};
8827        case 693934258: /*requestor*/ return new String[] {"Reference"};
8828        case 1095692943: /*request*/ return new String[] {"Reference"};
8829        case -1106507950: /*outcome*/ return new String[] {"code"};
8830        case 565719004: /*decision*/ return new String[] {"CodeableConcept"};
8831        case 583380919: /*disposition*/ return new String[] {"string"};
8832        case 522246568: /*preAuthRef*/ return new String[] {"string"};
8833        case 1819164812: /*preAuthPeriod*/ return new String[] {"Period"};
8834        case -316321118: /*payeeType*/ return new String[] {"CodeableConcept"};
8835        case 1524132147: /*encounter*/ return new String[] {"Reference"};
8836        case -1599182171: /*diagnosisRelatedGroup*/ return new String[] {"CodeableConcept"};
8837        case 3242771: /*item*/ return new String[] {};
8838        case -1148899500: /*addItem*/ return new String[] {};
8839        case -231349275: /*adjudication*/ return new String[] {"@ClaimResponse.item.adjudication"};
8840        case 110549828: /*total*/ return new String[] {};
8841        case -786681338: /*payment*/ return new String[] {};
8842        case 1314609806: /*fundsReserve*/ return new String[] {"CodeableConcept"};
8843        case 473181393: /*formCode*/ return new String[] {"CodeableConcept"};
8844        case 3148996: /*form*/ return new String[] {"Attachment"};
8845        case 202339073: /*processNote*/ return new String[] {};
8846        case -2071896615: /*communicationRequest*/ return new String[] {"Reference"};
8847        case 73049818: /*insurance*/ return new String[] {};
8848        case 96784904: /*error*/ return new String[] {};
8849        default: return super.getTypesForProperty(hash, name);
8850        }
8851
8852      }
8853
8854      @Override
8855      public Base addChild(String name) throws FHIRException {
8856        if (name.equals("identifier")) {
8857          return addIdentifier();
8858        }
8859        else if (name.equals("status")) {
8860          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.status");
8861        }
8862        else if (name.equals("type")) {
8863          this.type = new CodeableConcept();
8864          return this.type;
8865        }
8866        else if (name.equals("subType")) {
8867          this.subType = new CodeableConcept();
8868          return this.subType;
8869        }
8870        else if (name.equals("use")) {
8871          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.use");
8872        }
8873        else if (name.equals("patient")) {
8874          this.patient = new Reference();
8875          return this.patient;
8876        }
8877        else if (name.equals("created")) {
8878          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.created");
8879        }
8880        else if (name.equals("insurer")) {
8881          this.insurer = new Reference();
8882          return this.insurer;
8883        }
8884        else if (name.equals("requestor")) {
8885          this.requestor = new Reference();
8886          return this.requestor;
8887        }
8888        else if (name.equals("request")) {
8889          this.request = new Reference();
8890          return this.request;
8891        }
8892        else if (name.equals("outcome")) {
8893          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.outcome");
8894        }
8895        else if (name.equals("decision")) {
8896          this.decision = new CodeableConcept();
8897          return this.decision;
8898        }
8899        else if (name.equals("disposition")) {
8900          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition");
8901        }
8902        else if (name.equals("preAuthRef")) {
8903          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.preAuthRef");
8904        }
8905        else if (name.equals("preAuthPeriod")) {
8906          this.preAuthPeriod = new Period();
8907          return this.preAuthPeriod;
8908        }
8909        else if (name.equals("payeeType")) {
8910          this.payeeType = new CodeableConcept();
8911          return this.payeeType;
8912        }
8913        else if (name.equals("encounter")) {
8914          return addEncounter();
8915        }
8916        else if (name.equals("diagnosisRelatedGroup")) {
8917          this.diagnosisRelatedGroup = new CodeableConcept();
8918          return this.diagnosisRelatedGroup;
8919        }
8920        else if (name.equals("item")) {
8921          return addItem();
8922        }
8923        else if (name.equals("addItem")) {
8924          return addAddItem();
8925        }
8926        else if (name.equals("adjudication")) {
8927          return addAdjudication();
8928        }
8929        else if (name.equals("total")) {
8930          return addTotal();
8931        }
8932        else if (name.equals("payment")) {
8933          this.payment = new PaymentComponent();
8934          return this.payment;
8935        }
8936        else if (name.equals("fundsReserve")) {
8937          this.fundsReserve = new CodeableConcept();
8938          return this.fundsReserve;
8939        }
8940        else if (name.equals("formCode")) {
8941          this.formCode = new CodeableConcept();
8942          return this.formCode;
8943        }
8944        else if (name.equals("form")) {
8945          this.form = new Attachment();
8946          return this.form;
8947        }
8948        else if (name.equals("processNote")) {
8949          return addProcessNote();
8950        }
8951        else if (name.equals("communicationRequest")) {
8952          return addCommunicationRequest();
8953        }
8954        else if (name.equals("insurance")) {
8955          return addInsurance();
8956        }
8957        else if (name.equals("error")) {
8958          return addError();
8959        }
8960        else
8961          return super.addChild(name);
8962      }
8963
8964  public String fhirType() {
8965    return "ClaimResponse";
8966
8967  }
8968
8969      public ClaimResponse copy() {
8970        ClaimResponse dst = new ClaimResponse();
8971        copyValues(dst);
8972        return dst;
8973      }
8974
8975      public void copyValues(ClaimResponse dst) {
8976        super.copyValues(dst);
8977        if (identifier != null) {
8978          dst.identifier = new ArrayList<Identifier>();
8979          for (Identifier i : identifier)
8980            dst.identifier.add(i.copy());
8981        };
8982        dst.status = status == null ? null : status.copy();
8983        dst.type = type == null ? null : type.copy();
8984        dst.subType = subType == null ? null : subType.copy();
8985        dst.use = use == null ? null : use.copy();
8986        dst.patient = patient == null ? null : patient.copy();
8987        dst.created = created == null ? null : created.copy();
8988        dst.insurer = insurer == null ? null : insurer.copy();
8989        dst.requestor = requestor == null ? null : requestor.copy();
8990        dst.request = request == null ? null : request.copy();
8991        dst.outcome = outcome == null ? null : outcome.copy();
8992        dst.decision = decision == null ? null : decision.copy();
8993        dst.disposition = disposition == null ? null : disposition.copy();
8994        dst.preAuthRef = preAuthRef == null ? null : preAuthRef.copy();
8995        dst.preAuthPeriod = preAuthPeriod == null ? null : preAuthPeriod.copy();
8996        dst.payeeType = payeeType == null ? null : payeeType.copy();
8997        if (encounter != null) {
8998          dst.encounter = new ArrayList<Reference>();
8999          for (Reference i : encounter)
9000            dst.encounter.add(i.copy());
9001        };
9002        dst.diagnosisRelatedGroup = diagnosisRelatedGroup == null ? null : diagnosisRelatedGroup.copy();
9003        if (item != null) {
9004          dst.item = new ArrayList<ItemComponent>();
9005          for (ItemComponent i : item)
9006            dst.item.add(i.copy());
9007        };
9008        if (addItem != null) {
9009          dst.addItem = new ArrayList<AddedItemComponent>();
9010          for (AddedItemComponent i : addItem)
9011            dst.addItem.add(i.copy());
9012        };
9013        if (adjudication != null) {
9014          dst.adjudication = new ArrayList<AdjudicationComponent>();
9015          for (AdjudicationComponent i : adjudication)
9016            dst.adjudication.add(i.copy());
9017        };
9018        if (total != null) {
9019          dst.total = new ArrayList<TotalComponent>();
9020          for (TotalComponent i : total)
9021            dst.total.add(i.copy());
9022        };
9023        dst.payment = payment == null ? null : payment.copy();
9024        dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy();
9025        dst.formCode = formCode == null ? null : formCode.copy();
9026        dst.form = form == null ? null : form.copy();
9027        if (processNote != null) {
9028          dst.processNote = new ArrayList<NoteComponent>();
9029          for (NoteComponent i : processNote)
9030            dst.processNote.add(i.copy());
9031        };
9032        if (communicationRequest != null) {
9033          dst.communicationRequest = new ArrayList<Reference>();
9034          for (Reference i : communicationRequest)
9035            dst.communicationRequest.add(i.copy());
9036        };
9037        if (insurance != null) {
9038          dst.insurance = new ArrayList<InsuranceComponent>();
9039          for (InsuranceComponent i : insurance)
9040            dst.insurance.add(i.copy());
9041        };
9042        if (error != null) {
9043          dst.error = new ArrayList<ErrorComponent>();
9044          for (ErrorComponent i : error)
9045            dst.error.add(i.copy());
9046        };
9047      }
9048
9049      protected ClaimResponse typedCopy() {
9050        return copy();
9051      }
9052
9053      @Override
9054      public boolean equalsDeep(Base other_) {
9055        if (!super.equalsDeep(other_))
9056          return false;
9057        if (!(other_ instanceof ClaimResponse))
9058          return false;
9059        ClaimResponse o = (ClaimResponse) other_;
9060        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
9061           && compareDeep(subType, o.subType, true) && compareDeep(use, o.use, true) && compareDeep(patient, o.patient, true)
9062           && compareDeep(created, o.created, true) && compareDeep(insurer, o.insurer, true) && compareDeep(requestor, o.requestor, true)
9063           && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) && compareDeep(decision, o.decision, true)
9064           && compareDeep(disposition, o.disposition, true) && compareDeep(preAuthRef, o.preAuthRef, true)
9065           && compareDeep(preAuthPeriod, o.preAuthPeriod, true) && compareDeep(payeeType, o.payeeType, true)
9066           && compareDeep(encounter, o.encounter, true) && compareDeep(diagnosisRelatedGroup, o.diagnosisRelatedGroup, true)
9067           && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) && compareDeep(adjudication, o.adjudication, true)
9068           && compareDeep(total, o.total, true) && compareDeep(payment, o.payment, true) && compareDeep(fundsReserve, o.fundsReserve, true)
9069           && compareDeep(formCode, o.formCode, true) && compareDeep(form, o.form, true) && compareDeep(processNote, o.processNote, true)
9070           && compareDeep(communicationRequest, o.communicationRequest, true) && compareDeep(insurance, o.insurance, true)
9071           && compareDeep(error, o.error, true);
9072      }
9073
9074      @Override
9075      public boolean equalsShallow(Base other_) {
9076        if (!super.equalsShallow(other_))
9077          return false;
9078        if (!(other_ instanceof ClaimResponse))
9079          return false;
9080        ClaimResponse o = (ClaimResponse) other_;
9081        return compareValues(status, o.status, true) && compareValues(use, o.use, true) && compareValues(created, o.created, true)
9082           && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(preAuthRef, o.preAuthRef, true)
9083          ;
9084      }
9085
9086      public boolean isEmpty() {
9087        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
9088          , subType, use, patient, created, insurer, requestor, request, outcome, decision
9089          , disposition, preAuthRef, preAuthPeriod, payeeType, encounter, diagnosisRelatedGroup
9090          , item, addItem, adjudication, total, payment, fundsReserve, formCode, form
9091          , processNote, communicationRequest, insurance, error);
9092      }
9093
9094  @Override
9095  public ResourceType getResourceType() {
9096    return ResourceType.ClaimResponse;
9097   }
9098
9099 /**
9100   * Search parameter: <b>created</b>
9101   * <p>
9102   * Description: <b>The creation date</b><br>
9103   * Type: <b>date</b><br>
9104   * Path: <b>ClaimResponse.created</b><br>
9105   * </p>
9106   */
9107  @SearchParamDefinition(name="created", path="ClaimResponse.created", description="The creation date", type="date" )
9108  public static final String SP_CREATED = "created";
9109 /**
9110   * <b>Fluent Client</b> search parameter constant for <b>created</b>
9111   * <p>
9112   * Description: <b>The creation date</b><br>
9113   * Type: <b>date</b><br>
9114   * Path: <b>ClaimResponse.created</b><br>
9115   * </p>
9116   */
9117  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
9118
9119 /**
9120   * Search parameter: <b>disposition</b>
9121   * <p>
9122   * Description: <b>The contents of the disposition message</b><br>
9123   * Type: <b>string</b><br>
9124   * Path: <b>ClaimResponse.disposition</b><br>
9125   * </p>
9126   */
9127  @SearchParamDefinition(name="disposition", path="ClaimResponse.disposition", description="The contents of the disposition message", type="string" )
9128  public static final String SP_DISPOSITION = "disposition";
9129 /**
9130   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
9131   * <p>
9132   * Description: <b>The contents of the disposition message</b><br>
9133   * Type: <b>string</b><br>
9134   * Path: <b>ClaimResponse.disposition</b><br>
9135   * </p>
9136   */
9137  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION);
9138
9139 /**
9140   * Search parameter: <b>identifier</b>
9141   * <p>
9142   * Description: <b>The identity of the ClaimResponse</b><br>
9143   * Type: <b>token</b><br>
9144   * Path: <b>ClaimResponse.identifier</b><br>
9145   * </p>
9146   */
9147  @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the ClaimResponse", type="token" )
9148  public static final String SP_IDENTIFIER = "identifier";
9149 /**
9150   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
9151   * <p>
9152   * Description: <b>The identity of the ClaimResponse</b><br>
9153   * Type: <b>token</b><br>
9154   * Path: <b>ClaimResponse.identifier</b><br>
9155   * </p>
9156   */
9157  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
9158
9159 /**
9160   * Search parameter: <b>insurer</b>
9161   * <p>
9162   * Description: <b>The organization which generated this resource</b><br>
9163   * Type: <b>reference</b><br>
9164   * Path: <b>ClaimResponse.insurer</b><br>
9165   * </p>
9166   */
9167  @SearchParamDefinition(name="insurer", path="ClaimResponse.insurer", description="The organization which generated this resource", type="reference", target={Organization.class } )
9168  public static final String SP_INSURER = "insurer";
9169 /**
9170   * <b>Fluent Client</b> search parameter constant for <b>insurer</b>
9171   * <p>
9172   * Description: <b>The organization which generated this resource</b><br>
9173   * Type: <b>reference</b><br>
9174   * Path: <b>ClaimResponse.insurer</b><br>
9175   * </p>
9176   */
9177  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURER);
9178
9179/**
9180   * Constant for fluent queries to be used to add include statements. Specifies
9181   * the path value of "<b>ClaimResponse:insurer</b>".
9182   */
9183  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURER = new ca.uhn.fhir.model.api.Include("ClaimResponse:insurer").toLocked();
9184
9185 /**
9186   * Search parameter: <b>outcome</b>
9187   * <p>
9188   * Description: <b>The processing outcome</b><br>
9189   * Type: <b>token</b><br>
9190   * Path: <b>ClaimResponse.outcome</b><br>
9191   * </p>
9192   */
9193  @SearchParamDefinition(name="outcome", path="ClaimResponse.outcome", description="The processing outcome", type="token" )
9194  public static final String SP_OUTCOME = "outcome";
9195 /**
9196   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
9197   * <p>
9198   * Description: <b>The processing outcome</b><br>
9199   * Type: <b>token</b><br>
9200   * Path: <b>ClaimResponse.outcome</b><br>
9201   * </p>
9202   */
9203  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME);
9204
9205 /**
9206   * Search parameter: <b>patient</b>
9207   * <p>
9208   * Description: <b>The subject of care</b><br>
9209   * Type: <b>reference</b><br>
9210   * Path: <b>ClaimResponse.patient</b><br>
9211   * </p>
9212   */
9213  @SearchParamDefinition(name="patient", path="ClaimResponse.patient", description="The subject of care", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class } )
9214  public static final String SP_PATIENT = "patient";
9215 /**
9216   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
9217   * <p>
9218   * Description: <b>The subject of care</b><br>
9219   * Type: <b>reference</b><br>
9220   * Path: <b>ClaimResponse.patient</b><br>
9221   * </p>
9222   */
9223  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
9224
9225/**
9226   * Constant for fluent queries to be used to add include statements. Specifies
9227   * the path value of "<b>ClaimResponse:patient</b>".
9228   */
9229  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ClaimResponse:patient").toLocked();
9230
9231 /**
9232   * Search parameter: <b>payment-date</b>
9233   * <p>
9234   * Description: <b>The expected payment date</b><br>
9235   * Type: <b>date</b><br>
9236   * Path: <b>ClaimResponse.payment.date</b><br>
9237   * </p>
9238   */
9239  @SearchParamDefinition(name="payment-date", path="ClaimResponse.payment.date", description="The expected payment date", type="date" )
9240  public static final String SP_PAYMENT_DATE = "payment-date";
9241 /**
9242   * <b>Fluent Client</b> search parameter constant for <b>payment-date</b>
9243   * <p>
9244   * Description: <b>The expected payment date</b><br>
9245   * Type: <b>date</b><br>
9246   * Path: <b>ClaimResponse.payment.date</b><br>
9247   * </p>
9248   */
9249  public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENT_DATE);
9250
9251 /**
9252   * Search parameter: <b>request</b>
9253   * <p>
9254   * Description: <b>The claim reference</b><br>
9255   * Type: <b>reference</b><br>
9256   * Path: <b>ClaimResponse.request</b><br>
9257   * </p>
9258   */
9259  @SearchParamDefinition(name="request", path="ClaimResponse.request", description="The claim reference", type="reference", target={Claim.class } )
9260  public static final String SP_REQUEST = "request";
9261 /**
9262   * <b>Fluent Client</b> search parameter constant for <b>request</b>
9263   * <p>
9264   * Description: <b>The claim reference</b><br>
9265   * Type: <b>reference</b><br>
9266   * Path: <b>ClaimResponse.request</b><br>
9267   * </p>
9268   */
9269  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
9270
9271/**
9272   * Constant for fluent queries to be used to add include statements. Specifies
9273   * the path value of "<b>ClaimResponse:request</b>".
9274   */
9275  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("ClaimResponse:request").toLocked();
9276
9277 /**
9278   * Search parameter: <b>requestor</b>
9279   * <p>
9280   * Description: <b>The Provider of the claim</b><br>
9281   * Type: <b>reference</b><br>
9282   * Path: <b>ClaimResponse.requestor</b><br>
9283   * </p>
9284   */
9285  @SearchParamDefinition(name="requestor", path="ClaimResponse.requestor", description="The Provider of the claim", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
9286  public static final String SP_REQUESTOR = "requestor";
9287 /**
9288   * <b>Fluent Client</b> search parameter constant for <b>requestor</b>
9289   * <p>
9290   * Description: <b>The Provider of the claim</b><br>
9291   * Type: <b>reference</b><br>
9292   * Path: <b>ClaimResponse.requestor</b><br>
9293   * </p>
9294   */
9295  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTOR);
9296
9297/**
9298   * Constant for fluent queries to be used to add include statements. Specifies
9299   * the path value of "<b>ClaimResponse:requestor</b>".
9300   */
9301  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTOR = new ca.uhn.fhir.model.api.Include("ClaimResponse:requestor").toLocked();
9302
9303 /**
9304   * Search parameter: <b>status</b>
9305   * <p>
9306   * Description: <b>The status of the ClaimResponse</b><br>
9307   * Type: <b>token</b><br>
9308   * Path: <b>ClaimResponse.status</b><br>
9309   * </p>
9310   */
9311  @SearchParamDefinition(name="status", path="ClaimResponse.status", description="The status of the ClaimResponse", type="token" )
9312  public static final String SP_STATUS = "status";
9313 /**
9314   * <b>Fluent Client</b> search parameter constant for <b>status</b>
9315   * <p>
9316   * Description: <b>The status of the ClaimResponse</b><br>
9317   * Type: <b>token</b><br>
9318   * Path: <b>ClaimResponse.status</b><br>
9319   * </p>
9320   */
9321  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
9322
9323 /**
9324   * Search parameter: <b>use</b>
9325   * <p>
9326   * Description: <b>The type of claim</b><br>
9327   * Type: <b>token</b><br>
9328   * Path: <b>ClaimResponse.use</b><br>
9329   * </p>
9330   */
9331  @SearchParamDefinition(name="use", path="ClaimResponse.use", description="The type of claim", type="token" )
9332  public static final String SP_USE = "use";
9333 /**
9334   * <b>Fluent Client</b> search parameter constant for <b>use</b>
9335   * <p>
9336   * Description: <b>The type of claim</b><br>
9337   * Type: <b>token</b><br>
9338   * Path: <b>ClaimResponse.use</b><br>
9339   * </p>
9340   */
9341  public static final ca.uhn.fhir.rest.gclient.TokenClientParam USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USE);
9342
9343
9344}
9345