001package org.hl7.fhir.dstu2016may.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome;
040import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.ResourceDef;
049import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
050/**
051 * This resource provides the adjudication details from the processing of a Claim resource.
052 */
053@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse")
054public class ClaimResponse extends DomainResource {
055
056    @Block()
057    public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * A service line number.
060         */
061        @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
062        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
063        protected PositiveIntType sequenceLinkId;
064
065        /**
066         * A list of note references to the notes provided below.
067         */
068        @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
069        @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." )
070        protected List<PositiveIntType> noteNumber;
071
072        /**
073         * The adjudications results.
074         */
075        @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
076        @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." )
077        protected List<ItemAdjudicationComponent> adjudication;
078
079        /**
080         * The second tier service adjudications for submitted services.
081         */
082        @Child(name = "detail", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
083        @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." )
084        protected List<ItemDetailComponent> detail;
085
086        private static final long serialVersionUID = -1917866697L;
087
088    /**
089     * Constructor
090     */
091      public ItemsComponent() {
092        super();
093      }
094
095    /**
096     * Constructor
097     */
098      public ItemsComponent(PositiveIntType sequenceLinkId) {
099        super();
100        this.sequenceLinkId = sequenceLinkId;
101      }
102
103        /**
104         * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
105         */
106        public PositiveIntType getSequenceLinkIdElement() { 
107          if (this.sequenceLinkId == null)
108            if (Configuration.errorOnAutoCreate())
109              throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId");
110            else if (Configuration.doAutoCreate())
111              this.sequenceLinkId = new PositiveIntType(); // bb
112          return this.sequenceLinkId;
113        }
114
115        public boolean hasSequenceLinkIdElement() { 
116          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
117        }
118
119        public boolean hasSequenceLinkId() { 
120          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
121        }
122
123        /**
124         * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
125         */
126        public ItemsComponent setSequenceLinkIdElement(PositiveIntType value) { 
127          this.sequenceLinkId = value;
128          return this;
129        }
130
131        /**
132         * @return A service line number.
133         */
134        public int getSequenceLinkId() { 
135          return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue();
136        }
137
138        /**
139         * @param value A service line number.
140         */
141        public ItemsComponent setSequenceLinkId(int value) { 
142            if (this.sequenceLinkId == null)
143              this.sequenceLinkId = new PositiveIntType();
144            this.sequenceLinkId.setValue(value);
145          return this;
146        }
147
148        /**
149         * @return {@link #noteNumber} (A list of note references to the notes provided below.)
150         */
151        public List<PositiveIntType> getNoteNumber() { 
152          if (this.noteNumber == null)
153            this.noteNumber = new ArrayList<PositiveIntType>();
154          return this.noteNumber;
155        }
156
157        public boolean hasNoteNumber() { 
158          if (this.noteNumber == null)
159            return false;
160          for (PositiveIntType item : this.noteNumber)
161            if (!item.isEmpty())
162              return true;
163          return false;
164        }
165
166        /**
167         * @return {@link #noteNumber} (A list of note references to the notes provided below.)
168         */
169    // syntactic sugar
170        public PositiveIntType addNoteNumberElement() {//2 
171          PositiveIntType t = new PositiveIntType();
172          if (this.noteNumber == null)
173            this.noteNumber = new ArrayList<PositiveIntType>();
174          this.noteNumber.add(t);
175          return t;
176        }
177
178        /**
179         * @param value {@link #noteNumber} (A list of note references to the notes provided below.)
180         */
181        public ItemsComponent addNoteNumber(int value) { //1
182          PositiveIntType t = new PositiveIntType();
183          t.setValue(value);
184          if (this.noteNumber == null)
185            this.noteNumber = new ArrayList<PositiveIntType>();
186          this.noteNumber.add(t);
187          return this;
188        }
189
190        /**
191         * @param value {@link #noteNumber} (A list of note references to the notes provided below.)
192         */
193        public boolean hasNoteNumber(int value) { 
194          if (this.noteNumber == null)
195            return false;
196          for (PositiveIntType v : this.noteNumber)
197            if (v.equals(value)) // positiveInt
198              return true;
199          return false;
200        }
201
202        /**
203         * @return {@link #adjudication} (The adjudications results.)
204         */
205        public List<ItemAdjudicationComponent> getAdjudication() { 
206          if (this.adjudication == null)
207            this.adjudication = new ArrayList<ItemAdjudicationComponent>();
208          return this.adjudication;
209        }
210
211        public boolean hasAdjudication() { 
212          if (this.adjudication == null)
213            return false;
214          for (ItemAdjudicationComponent item : this.adjudication)
215            if (!item.isEmpty())
216              return true;
217          return false;
218        }
219
220        /**
221         * @return {@link #adjudication} (The adjudications results.)
222         */
223    // syntactic sugar
224        public ItemAdjudicationComponent addAdjudication() { //3
225          ItemAdjudicationComponent t = new ItemAdjudicationComponent();
226          if (this.adjudication == null)
227            this.adjudication = new ArrayList<ItemAdjudicationComponent>();
228          this.adjudication.add(t);
229          return t;
230        }
231
232    // syntactic sugar
233        public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3
234          if (t == null)
235            return this;
236          if (this.adjudication == null)
237            this.adjudication = new ArrayList<ItemAdjudicationComponent>();
238          this.adjudication.add(t);
239          return this;
240        }
241
242        /**
243         * @return {@link #detail} (The second tier service adjudications for submitted services.)
244         */
245        public List<ItemDetailComponent> getDetail() { 
246          if (this.detail == null)
247            this.detail = new ArrayList<ItemDetailComponent>();
248          return this.detail;
249        }
250
251        public boolean hasDetail() { 
252          if (this.detail == null)
253            return false;
254          for (ItemDetailComponent item : this.detail)
255            if (!item.isEmpty())
256              return true;
257          return false;
258        }
259
260        /**
261         * @return {@link #detail} (The second tier service adjudications for submitted services.)
262         */
263    // syntactic sugar
264        public ItemDetailComponent addDetail() { //3
265          ItemDetailComponent t = new ItemDetailComponent();
266          if (this.detail == null)
267            this.detail = new ArrayList<ItemDetailComponent>();
268          this.detail.add(t);
269          return t;
270        }
271
272    // syntactic sugar
273        public ItemsComponent addDetail(ItemDetailComponent t) { //3
274          if (t == null)
275            return this;
276          if (this.detail == null)
277            this.detail = new ArrayList<ItemDetailComponent>();
278          this.detail.add(t);
279          return this;
280        }
281
282        protected void listChildren(List<Property> childrenList) {
283          super.listChildren(childrenList);
284          childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId));
285          childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber));
286          childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
287          childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail));
288        }
289
290      @Override
291      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
292        switch (hash) {
293        case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType
294        case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType
295        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // ItemAdjudicationComponent
296        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // ItemDetailComponent
297        default: return super.getProperty(hash, name, checkValid);
298        }
299
300      }
301
302      @Override
303      public void setProperty(int hash, String name, Base value) throws FHIRException {
304        switch (hash) {
305        case -1422298666: // sequenceLinkId
306          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
307          break;
308        case -1110033957: // noteNumber
309          this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType
310          break;
311        case -231349275: // adjudication
312          this.getAdjudication().add((ItemAdjudicationComponent) value); // ItemAdjudicationComponent
313          break;
314        case -1335224239: // detail
315          this.getDetail().add((ItemDetailComponent) value); // ItemDetailComponent
316          break;
317        default: super.setProperty(hash, name, value);
318        }
319
320      }
321
322      @Override
323      public void setProperty(String name, Base value) throws FHIRException {
324        if (name.equals("sequenceLinkId"))
325          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
326        else if (name.equals("noteNumber"))
327          this.getNoteNumber().add(castToPositiveInt(value));
328        else if (name.equals("adjudication"))
329          this.getAdjudication().add((ItemAdjudicationComponent) value);
330        else if (name.equals("detail"))
331          this.getDetail().add((ItemDetailComponent) value);
332        else
333          super.setProperty(name, value);
334      }
335
336      @Override
337      public Base makeProperty(int hash, String name) throws FHIRException {
338        switch (hash) {
339        case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType
340        case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType
341        case -231349275:  return addAdjudication(); // ItemAdjudicationComponent
342        case -1335224239:  return addDetail(); // ItemDetailComponent
343        default: return super.makeProperty(hash, name);
344        }
345
346      }
347
348      @Override
349      public Base addChild(String name) throws FHIRException {
350        if (name.equals("sequenceLinkId")) {
351          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId");
352        }
353        else if (name.equals("noteNumber")) {
354          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumber");
355        }
356        else if (name.equals("adjudication")) {
357          return addAdjudication();
358        }
359        else if (name.equals("detail")) {
360          return addDetail();
361        }
362        else
363          return super.addChild(name);
364      }
365
366      public ItemsComponent copy() {
367        ItemsComponent dst = new ItemsComponent();
368        copyValues(dst);
369        dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy();
370        if (noteNumber != null) {
371          dst.noteNumber = new ArrayList<PositiveIntType>();
372          for (PositiveIntType i : noteNumber)
373            dst.noteNumber.add(i.copy());
374        };
375        if (adjudication != null) {
376          dst.adjudication = new ArrayList<ItemAdjudicationComponent>();
377          for (ItemAdjudicationComponent i : adjudication)
378            dst.adjudication.add(i.copy());
379        };
380        if (detail != null) {
381          dst.detail = new ArrayList<ItemDetailComponent>();
382          for (ItemDetailComponent i : detail)
383            dst.detail.add(i.copy());
384        };
385        return dst;
386      }
387
388      @Override
389      public boolean equalsDeep(Base other) {
390        if (!super.equalsDeep(other))
391          return false;
392        if (!(other instanceof ItemsComponent))
393          return false;
394        ItemsComponent o = (ItemsComponent) other;
395        return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(noteNumber, o.noteNumber, true)
396           && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true);
397      }
398
399      @Override
400      public boolean equalsShallow(Base other) {
401        if (!super.equalsShallow(other))
402          return false;
403        if (!(other instanceof ItemsComponent))
404          return false;
405        ItemsComponent o = (ItemsComponent) other;
406        return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumber, o.noteNumber, true)
407          ;
408      }
409
410      public boolean isEmpty() {
411        return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty())
412           && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty())
413          ;
414      }
415
416  public String fhirType() {
417    return "ClaimResponse.item";
418
419  }
420
421  }
422
423    @Block()
424    public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
425        /**
426         * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.
427         */
428        @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
429        @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." )
430        protected Coding category;
431
432        /**
433         * Adjudication reason such as limit reached.
434         */
435        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
436        @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." )
437        protected Coding reason;
438
439        /**
440         * Monetary amount associated with the code.
441         */
442        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
443        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." )
444        protected Money amount;
445
446        /**
447         * A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
448         */
449        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
450        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." )
451        protected DecimalType value;
452
453        private static final long serialVersionUID = -1926987562L;
454
455    /**
456     * Constructor
457     */
458      public ItemAdjudicationComponent() {
459        super();
460      }
461
462    /**
463     * Constructor
464     */
465      public ItemAdjudicationComponent(Coding category) {
466        super();
467        this.category = category;
468      }
469
470        /**
471         * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
472         */
473        public Coding getCategory() { 
474          if (this.category == null)
475            if (Configuration.errorOnAutoCreate())
476              throw new Error("Attempt to auto-create ItemAdjudicationComponent.category");
477            else if (Configuration.doAutoCreate())
478              this.category = new Coding(); // cc
479          return this.category;
480        }
481
482        public boolean hasCategory() { 
483          return this.category != null && !this.category.isEmpty();
484        }
485
486        /**
487         * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
488         */
489        public ItemAdjudicationComponent setCategory(Coding value) { 
490          this.category = value;
491          return this;
492        }
493
494        /**
495         * @return {@link #reason} (Adjudication reason such as limit reached.)
496         */
497        public Coding getReason() { 
498          if (this.reason == null)
499            if (Configuration.errorOnAutoCreate())
500              throw new Error("Attempt to auto-create ItemAdjudicationComponent.reason");
501            else if (Configuration.doAutoCreate())
502              this.reason = new Coding(); // cc
503          return this.reason;
504        }
505
506        public boolean hasReason() { 
507          return this.reason != null && !this.reason.isEmpty();
508        }
509
510        /**
511         * @param value {@link #reason} (Adjudication reason such as limit reached.)
512         */
513        public ItemAdjudicationComponent setReason(Coding value) { 
514          this.reason = value;
515          return this;
516        }
517
518        /**
519         * @return {@link #amount} (Monetary amount associated with the code.)
520         */
521        public Money getAmount() { 
522          if (this.amount == null)
523            if (Configuration.errorOnAutoCreate())
524              throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount");
525            else if (Configuration.doAutoCreate())
526              this.amount = new Money(); // cc
527          return this.amount;
528        }
529
530        public boolean hasAmount() { 
531          return this.amount != null && !this.amount.isEmpty();
532        }
533
534        /**
535         * @param value {@link #amount} (Monetary amount associated with the code.)
536         */
537        public ItemAdjudicationComponent setAmount(Money value) { 
538          this.amount = value;
539          return this;
540        }
541
542        /**
543         * @return {@link #value} (A non-monetary value for example a percentage. 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
544         */
545        public DecimalType getValueElement() { 
546          if (this.value == null)
547            if (Configuration.errorOnAutoCreate())
548              throw new Error("Attempt to auto-create ItemAdjudicationComponent.value");
549            else if (Configuration.doAutoCreate())
550              this.value = new DecimalType(); // bb
551          return this.value;
552        }
553
554        public boolean hasValueElement() { 
555          return this.value != null && !this.value.isEmpty();
556        }
557
558        public boolean hasValue() { 
559          return this.value != null && !this.value.isEmpty();
560        }
561
562        /**
563         * @param value {@link #value} (A non-monetary value for example a percentage. 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
564         */
565        public ItemAdjudicationComponent setValueElement(DecimalType value) { 
566          this.value = value;
567          return this;
568        }
569
570        /**
571         * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
572         */
573        public BigDecimal getValue() { 
574          return this.value == null ? null : this.value.getValue();
575        }
576
577        /**
578         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
579         */
580        public ItemAdjudicationComponent setValue(BigDecimal value) { 
581          if (value == null)
582            this.value = null;
583          else {
584            if (this.value == null)
585              this.value = new DecimalType();
586            this.value.setValue(value);
587          }
588          return this;
589        }
590
591        /**
592         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
593         */
594        public ItemAdjudicationComponent setValue(long value) { 
595              this.value = new DecimalType();
596            this.value.setValue(value);
597          return this;
598        }
599
600        /**
601         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
602         */
603        public ItemAdjudicationComponent setValue(double value) { 
604              this.value = new DecimalType();
605            this.value.setValue(value);
606          return this;
607        }
608
609        protected void listChildren(List<Property> childrenList) {
610          super.listChildren(childrenList);
611          childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category));
612          childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason));
613          childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount));
614          childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value));
615        }
616
617      @Override
618      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
619        switch (hash) {
620        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding
621        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
622        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
623        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
624        default: return super.getProperty(hash, name, checkValid);
625        }
626
627      }
628
629      @Override
630      public void setProperty(int hash, String name, Base value) throws FHIRException {
631        switch (hash) {
632        case 50511102: // category
633          this.category = castToCoding(value); // Coding
634          break;
635        case -934964668: // reason
636          this.reason = castToCoding(value); // Coding
637          break;
638        case -1413853096: // amount
639          this.amount = castToMoney(value); // Money
640          break;
641        case 111972721: // value
642          this.value = castToDecimal(value); // DecimalType
643          break;
644        default: super.setProperty(hash, name, value);
645        }
646
647      }
648
649      @Override
650      public void setProperty(String name, Base value) throws FHIRException {
651        if (name.equals("category"))
652          this.category = castToCoding(value); // Coding
653        else if (name.equals("reason"))
654          this.reason = castToCoding(value); // Coding
655        else if (name.equals("amount"))
656          this.amount = castToMoney(value); // Money
657        else if (name.equals("value"))
658          this.value = castToDecimal(value); // DecimalType
659        else
660          super.setProperty(name, value);
661      }
662
663      @Override
664      public Base makeProperty(int hash, String name) throws FHIRException {
665        switch (hash) {
666        case 50511102:  return getCategory(); // Coding
667        case -934964668:  return getReason(); // Coding
668        case -1413853096:  return getAmount(); // Money
669        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType
670        default: return super.makeProperty(hash, name);
671        }
672
673      }
674
675      @Override
676      public Base addChild(String name) throws FHIRException {
677        if (name.equals("category")) {
678          this.category = new Coding();
679          return this.category;
680        }
681        else if (name.equals("reason")) {
682          this.reason = new Coding();
683          return this.reason;
684        }
685        else if (name.equals("amount")) {
686          this.amount = new Money();
687          return this.amount;
688        }
689        else if (name.equals("value")) {
690          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value");
691        }
692        else
693          return super.addChild(name);
694      }
695
696      public ItemAdjudicationComponent copy() {
697        ItemAdjudicationComponent dst = new ItemAdjudicationComponent();
698        copyValues(dst);
699        dst.category = category == null ? null : category.copy();
700        dst.reason = reason == null ? null : reason.copy();
701        dst.amount = amount == null ? null : amount.copy();
702        dst.value = value == null ? null : value.copy();
703        return dst;
704      }
705
706      @Override
707      public boolean equalsDeep(Base other) {
708        if (!super.equalsDeep(other))
709          return false;
710        if (!(other instanceof ItemAdjudicationComponent))
711          return false;
712        ItemAdjudicationComponent o = (ItemAdjudicationComponent) other;
713        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
714           && compareDeep(value, o.value, true);
715      }
716
717      @Override
718      public boolean equalsShallow(Base other) {
719        if (!super.equalsShallow(other))
720          return false;
721        if (!(other instanceof ItemAdjudicationComponent))
722          return false;
723        ItemAdjudicationComponent o = (ItemAdjudicationComponent) other;
724        return compareValues(value, o.value, true);
725      }
726
727      public boolean isEmpty() {
728        return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty())
729           && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty());
730      }
731
732  public String fhirType() {
733    return "ClaimResponse.item.adjudication";
734
735  }
736
737  }
738
739    @Block()
740    public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement {
741        /**
742         * A service line number.
743         */
744        @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
745        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
746        protected PositiveIntType sequenceLinkId;
747
748        /**
749         * The adjudications results.
750         */
751        @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
752        @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." )
753        protected List<DetailAdjudicationComponent> adjudication;
754
755        /**
756         * The third tier service adjudications for submitted services.
757         */
758        @Child(name = "subDetail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
759        @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." )
760        protected List<SubDetailComponent> subDetail;
761
762        private static final long serialVersionUID = -1751018357L;
763
764    /**
765     * Constructor
766     */
767      public ItemDetailComponent() {
768        super();
769      }
770
771    /**
772     * Constructor
773     */
774      public ItemDetailComponent(PositiveIntType sequenceLinkId) {
775        super();
776        this.sequenceLinkId = sequenceLinkId;
777      }
778
779        /**
780         * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
781         */
782        public PositiveIntType getSequenceLinkIdElement() { 
783          if (this.sequenceLinkId == null)
784            if (Configuration.errorOnAutoCreate())
785              throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId");
786            else if (Configuration.doAutoCreate())
787              this.sequenceLinkId = new PositiveIntType(); // bb
788          return this.sequenceLinkId;
789        }
790
791        public boolean hasSequenceLinkIdElement() { 
792          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
793        }
794
795        public boolean hasSequenceLinkId() { 
796          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
797        }
798
799        /**
800         * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
801         */
802        public ItemDetailComponent setSequenceLinkIdElement(PositiveIntType value) { 
803          this.sequenceLinkId = value;
804          return this;
805        }
806
807        /**
808         * @return A service line number.
809         */
810        public int getSequenceLinkId() { 
811          return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue();
812        }
813
814        /**
815         * @param value A service line number.
816         */
817        public ItemDetailComponent setSequenceLinkId(int value) { 
818            if (this.sequenceLinkId == null)
819              this.sequenceLinkId = new PositiveIntType();
820            this.sequenceLinkId.setValue(value);
821          return this;
822        }
823
824        /**
825         * @return {@link #adjudication} (The adjudications results.)
826         */
827        public List<DetailAdjudicationComponent> getAdjudication() { 
828          if (this.adjudication == null)
829            this.adjudication = new ArrayList<DetailAdjudicationComponent>();
830          return this.adjudication;
831        }
832
833        public boolean hasAdjudication() { 
834          if (this.adjudication == null)
835            return false;
836          for (DetailAdjudicationComponent item : this.adjudication)
837            if (!item.isEmpty())
838              return true;
839          return false;
840        }
841
842        /**
843         * @return {@link #adjudication} (The adjudications results.)
844         */
845    // syntactic sugar
846        public DetailAdjudicationComponent addAdjudication() { //3
847          DetailAdjudicationComponent t = new DetailAdjudicationComponent();
848          if (this.adjudication == null)
849            this.adjudication = new ArrayList<DetailAdjudicationComponent>();
850          this.adjudication.add(t);
851          return t;
852        }
853
854    // syntactic sugar
855        public ItemDetailComponent addAdjudication(DetailAdjudicationComponent t) { //3
856          if (t == null)
857            return this;
858          if (this.adjudication == null)
859            this.adjudication = new ArrayList<DetailAdjudicationComponent>();
860          this.adjudication.add(t);
861          return this;
862        }
863
864        /**
865         * @return {@link #subDetail} (The third tier service adjudications for submitted services.)
866         */
867        public List<SubDetailComponent> getSubDetail() { 
868          if (this.subDetail == null)
869            this.subDetail = new ArrayList<SubDetailComponent>();
870          return this.subDetail;
871        }
872
873        public boolean hasSubDetail() { 
874          if (this.subDetail == null)
875            return false;
876          for (SubDetailComponent item : this.subDetail)
877            if (!item.isEmpty())
878              return true;
879          return false;
880        }
881
882        /**
883         * @return {@link #subDetail} (The third tier service adjudications for submitted services.)
884         */
885    // syntactic sugar
886        public SubDetailComponent addSubDetail() { //3
887          SubDetailComponent t = new SubDetailComponent();
888          if (this.subDetail == null)
889            this.subDetail = new ArrayList<SubDetailComponent>();
890          this.subDetail.add(t);
891          return t;
892        }
893
894    // syntactic sugar
895        public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3
896          if (t == null)
897            return this;
898          if (this.subDetail == null)
899            this.subDetail = new ArrayList<SubDetailComponent>();
900          this.subDetail.add(t);
901          return this;
902        }
903
904        protected void listChildren(List<Property> childrenList) {
905          super.listChildren(childrenList);
906          childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId));
907          childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
908          childrenList.add(new Property("subDetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subDetail));
909        }
910
911      @Override
912      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
913        switch (hash) {
914        case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType
915        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // DetailAdjudicationComponent
916        case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent
917        default: return super.getProperty(hash, name, checkValid);
918        }
919
920      }
921
922      @Override
923      public void setProperty(int hash, String name, Base value) throws FHIRException {
924        switch (hash) {
925        case -1422298666: // sequenceLinkId
926          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
927          break;
928        case -231349275: // adjudication
929          this.getAdjudication().add((DetailAdjudicationComponent) value); // DetailAdjudicationComponent
930          break;
931        case -828829007: // subDetail
932          this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent
933          break;
934        default: super.setProperty(hash, name, value);
935        }
936
937      }
938
939      @Override
940      public void setProperty(String name, Base value) throws FHIRException {
941        if (name.equals("sequenceLinkId"))
942          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
943        else if (name.equals("adjudication"))
944          this.getAdjudication().add((DetailAdjudicationComponent) value);
945        else if (name.equals("subDetail"))
946          this.getSubDetail().add((SubDetailComponent) value);
947        else
948          super.setProperty(name, value);
949      }
950
951      @Override
952      public Base makeProperty(int hash, String name) throws FHIRException {
953        switch (hash) {
954        case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType
955        case -231349275:  return addAdjudication(); // DetailAdjudicationComponent
956        case -828829007:  return addSubDetail(); // SubDetailComponent
957        default: return super.makeProperty(hash, name);
958        }
959
960      }
961
962      @Override
963      public Base addChild(String name) throws FHIRException {
964        if (name.equals("sequenceLinkId")) {
965          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId");
966        }
967        else if (name.equals("adjudication")) {
968          return addAdjudication();
969        }
970        else if (name.equals("subDetail")) {
971          return addSubDetail();
972        }
973        else
974          return super.addChild(name);
975      }
976
977      public ItemDetailComponent copy() {
978        ItemDetailComponent dst = new ItemDetailComponent();
979        copyValues(dst);
980        dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy();
981        if (adjudication != null) {
982          dst.adjudication = new ArrayList<DetailAdjudicationComponent>();
983          for (DetailAdjudicationComponent i : adjudication)
984            dst.adjudication.add(i.copy());
985        };
986        if (subDetail != null) {
987          dst.subDetail = new ArrayList<SubDetailComponent>();
988          for (SubDetailComponent i : subDetail)
989            dst.subDetail.add(i.copy());
990        };
991        return dst;
992      }
993
994      @Override
995      public boolean equalsDeep(Base other) {
996        if (!super.equalsDeep(other))
997          return false;
998        if (!(other instanceof ItemDetailComponent))
999          return false;
1000        ItemDetailComponent o = (ItemDetailComponent) other;
1001        return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true)
1002           && compareDeep(subDetail, o.subDetail, true);
1003      }
1004
1005      @Override
1006      public boolean equalsShallow(Base other) {
1007        if (!super.equalsShallow(other))
1008          return false;
1009        if (!(other instanceof ItemDetailComponent))
1010          return false;
1011        ItemDetailComponent o = (ItemDetailComponent) other;
1012        return compareValues(sequenceLinkId, o.sequenceLinkId, true);
1013      }
1014
1015      public boolean isEmpty() {
1016        return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty())
1017           && (subDetail == null || subDetail.isEmpty());
1018      }
1019
1020  public String fhirType() {
1021    return "ClaimResponse.item.detail";
1022
1023  }
1024
1025  }
1026
1027    @Block()
1028    public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
1029        /**
1030         * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.
1031         */
1032        @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
1033        @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." )
1034        protected Coding category;
1035
1036        /**
1037         * Adjudication reason such as limit reached.
1038         */
1039        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
1040        @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." )
1041        protected Coding reason;
1042
1043        /**
1044         * Monetary amount associated with the code.
1045         */
1046        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
1047        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." )
1048        protected Money amount;
1049
1050        /**
1051         * A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1052         */
1053        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1054        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." )
1055        protected DecimalType value;
1056
1057        private static final long serialVersionUID = -1926987562L;
1058
1059    /**
1060     * Constructor
1061     */
1062      public DetailAdjudicationComponent() {
1063        super();
1064      }
1065
1066    /**
1067     * Constructor
1068     */
1069      public DetailAdjudicationComponent(Coding category) {
1070        super();
1071        this.category = category;
1072      }
1073
1074        /**
1075         * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
1076         */
1077        public Coding getCategory() { 
1078          if (this.category == null)
1079            if (Configuration.errorOnAutoCreate())
1080              throw new Error("Attempt to auto-create DetailAdjudicationComponent.category");
1081            else if (Configuration.doAutoCreate())
1082              this.category = new Coding(); // cc
1083          return this.category;
1084        }
1085
1086        public boolean hasCategory() { 
1087          return this.category != null && !this.category.isEmpty();
1088        }
1089
1090        /**
1091         * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
1092         */
1093        public DetailAdjudicationComponent setCategory(Coding value) { 
1094          this.category = value;
1095          return this;
1096        }
1097
1098        /**
1099         * @return {@link #reason} (Adjudication reason such as limit reached.)
1100         */
1101        public Coding getReason() { 
1102          if (this.reason == null)
1103            if (Configuration.errorOnAutoCreate())
1104              throw new Error("Attempt to auto-create DetailAdjudicationComponent.reason");
1105            else if (Configuration.doAutoCreate())
1106              this.reason = new Coding(); // cc
1107          return this.reason;
1108        }
1109
1110        public boolean hasReason() { 
1111          return this.reason != null && !this.reason.isEmpty();
1112        }
1113
1114        /**
1115         * @param value {@link #reason} (Adjudication reason such as limit reached.)
1116         */
1117        public DetailAdjudicationComponent setReason(Coding value) { 
1118          this.reason = value;
1119          return this;
1120        }
1121
1122        /**
1123         * @return {@link #amount} (Monetary amount associated with the code.)
1124         */
1125        public Money getAmount() { 
1126          if (this.amount == null)
1127            if (Configuration.errorOnAutoCreate())
1128              throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount");
1129            else if (Configuration.doAutoCreate())
1130              this.amount = new Money(); // cc
1131          return this.amount;
1132        }
1133
1134        public boolean hasAmount() { 
1135          return this.amount != null && !this.amount.isEmpty();
1136        }
1137
1138        /**
1139         * @param value {@link #amount} (Monetary amount associated with the code.)
1140         */
1141        public DetailAdjudicationComponent setAmount(Money value) { 
1142          this.amount = value;
1143          return this;
1144        }
1145
1146        /**
1147         * @return {@link #value} (A non-monetary value for example a percentage. 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
1148         */
1149        public DecimalType getValueElement() { 
1150          if (this.value == null)
1151            if (Configuration.errorOnAutoCreate())
1152              throw new Error("Attempt to auto-create DetailAdjudicationComponent.value");
1153            else if (Configuration.doAutoCreate())
1154              this.value = new DecimalType(); // bb
1155          return this.value;
1156        }
1157
1158        public boolean hasValueElement() { 
1159          return this.value != null && !this.value.isEmpty();
1160        }
1161
1162        public boolean hasValue() { 
1163          return this.value != null && !this.value.isEmpty();
1164        }
1165
1166        /**
1167         * @param value {@link #value} (A non-monetary value for example a percentage. 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
1168         */
1169        public DetailAdjudicationComponent setValueElement(DecimalType value) { 
1170          this.value = value;
1171          return this;
1172        }
1173
1174        /**
1175         * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1176         */
1177        public BigDecimal getValue() { 
1178          return this.value == null ? null : this.value.getValue();
1179        }
1180
1181        /**
1182         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1183         */
1184        public DetailAdjudicationComponent setValue(BigDecimal value) { 
1185          if (value == null)
1186            this.value = null;
1187          else {
1188            if (this.value == null)
1189              this.value = new DecimalType();
1190            this.value.setValue(value);
1191          }
1192          return this;
1193        }
1194
1195        /**
1196         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1197         */
1198        public DetailAdjudicationComponent setValue(long value) { 
1199              this.value = new DecimalType();
1200            this.value.setValue(value);
1201          return this;
1202        }
1203
1204        /**
1205         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1206         */
1207        public DetailAdjudicationComponent setValue(double value) { 
1208              this.value = new DecimalType();
1209            this.value.setValue(value);
1210          return this;
1211        }
1212
1213        protected void listChildren(List<Property> childrenList) {
1214          super.listChildren(childrenList);
1215          childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category));
1216          childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason));
1217          childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount));
1218          childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value));
1219        }
1220
1221      @Override
1222      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1223        switch (hash) {
1224        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding
1225        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
1226        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
1227        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
1228        default: return super.getProperty(hash, name, checkValid);
1229        }
1230
1231      }
1232
1233      @Override
1234      public void setProperty(int hash, String name, Base value) throws FHIRException {
1235        switch (hash) {
1236        case 50511102: // category
1237          this.category = castToCoding(value); // Coding
1238          break;
1239        case -934964668: // reason
1240          this.reason = castToCoding(value); // Coding
1241          break;
1242        case -1413853096: // amount
1243          this.amount = castToMoney(value); // Money
1244          break;
1245        case 111972721: // value
1246          this.value = castToDecimal(value); // DecimalType
1247          break;
1248        default: super.setProperty(hash, name, value);
1249        }
1250
1251      }
1252
1253      @Override
1254      public void setProperty(String name, Base value) throws FHIRException {
1255        if (name.equals("category"))
1256          this.category = castToCoding(value); // Coding
1257        else if (name.equals("reason"))
1258          this.reason = castToCoding(value); // Coding
1259        else if (name.equals("amount"))
1260          this.amount = castToMoney(value); // Money
1261        else if (name.equals("value"))
1262          this.value = castToDecimal(value); // DecimalType
1263        else
1264          super.setProperty(name, value);
1265      }
1266
1267      @Override
1268      public Base makeProperty(int hash, String name) throws FHIRException {
1269        switch (hash) {
1270        case 50511102:  return getCategory(); // Coding
1271        case -934964668:  return getReason(); // Coding
1272        case -1413853096:  return getAmount(); // Money
1273        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType
1274        default: return super.makeProperty(hash, name);
1275        }
1276
1277      }
1278
1279      @Override
1280      public Base addChild(String name) throws FHIRException {
1281        if (name.equals("category")) {
1282          this.category = new Coding();
1283          return this.category;
1284        }
1285        else if (name.equals("reason")) {
1286          this.reason = new Coding();
1287          return this.reason;
1288        }
1289        else if (name.equals("amount")) {
1290          this.amount = new Money();
1291          return this.amount;
1292        }
1293        else if (name.equals("value")) {
1294          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value");
1295        }
1296        else
1297          return super.addChild(name);
1298      }
1299
1300      public DetailAdjudicationComponent copy() {
1301        DetailAdjudicationComponent dst = new DetailAdjudicationComponent();
1302        copyValues(dst);
1303        dst.category = category == null ? null : category.copy();
1304        dst.reason = reason == null ? null : reason.copy();
1305        dst.amount = amount == null ? null : amount.copy();
1306        dst.value = value == null ? null : value.copy();
1307        return dst;
1308      }
1309
1310      @Override
1311      public boolean equalsDeep(Base other) {
1312        if (!super.equalsDeep(other))
1313          return false;
1314        if (!(other instanceof DetailAdjudicationComponent))
1315          return false;
1316        DetailAdjudicationComponent o = (DetailAdjudicationComponent) other;
1317        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
1318           && compareDeep(value, o.value, true);
1319      }
1320
1321      @Override
1322      public boolean equalsShallow(Base other) {
1323        if (!super.equalsShallow(other))
1324          return false;
1325        if (!(other instanceof DetailAdjudicationComponent))
1326          return false;
1327        DetailAdjudicationComponent o = (DetailAdjudicationComponent) other;
1328        return compareValues(value, o.value, true);
1329      }
1330
1331      public boolean isEmpty() {
1332        return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty())
1333           && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty());
1334      }
1335
1336  public String fhirType() {
1337    return "ClaimResponse.item.detail.adjudication";
1338
1339  }
1340
1341  }
1342
1343    @Block()
1344    public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement {
1345        /**
1346         * A service line number.
1347         */
1348        @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1349        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
1350        protected PositiveIntType sequenceLinkId;
1351
1352        /**
1353         * The adjudications results.
1354         */
1355        @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1356        @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." )
1357        protected List<SubdetailAdjudicationComponent> adjudication;
1358
1359        private static final long serialVersionUID = 1780202110L;
1360
1361    /**
1362     * Constructor
1363     */
1364      public SubDetailComponent() {
1365        super();
1366      }
1367
1368    /**
1369     * Constructor
1370     */
1371      public SubDetailComponent(PositiveIntType sequenceLinkId) {
1372        super();
1373        this.sequenceLinkId = sequenceLinkId;
1374      }
1375
1376        /**
1377         * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
1378         */
1379        public PositiveIntType getSequenceLinkIdElement() { 
1380          if (this.sequenceLinkId == null)
1381            if (Configuration.errorOnAutoCreate())
1382              throw new Error("Attempt to auto-create SubDetailComponent.sequenceLinkId");
1383            else if (Configuration.doAutoCreate())
1384              this.sequenceLinkId = new PositiveIntType(); // bb
1385          return this.sequenceLinkId;
1386        }
1387
1388        public boolean hasSequenceLinkIdElement() { 
1389          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
1390        }
1391
1392        public boolean hasSequenceLinkId() { 
1393          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
1394        }
1395
1396        /**
1397         * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
1398         */
1399        public SubDetailComponent setSequenceLinkIdElement(PositiveIntType value) { 
1400          this.sequenceLinkId = value;
1401          return this;
1402        }
1403
1404        /**
1405         * @return A service line number.
1406         */
1407        public int getSequenceLinkId() { 
1408          return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue();
1409        }
1410
1411        /**
1412         * @param value A service line number.
1413         */
1414        public SubDetailComponent setSequenceLinkId(int value) { 
1415            if (this.sequenceLinkId == null)
1416              this.sequenceLinkId = new PositiveIntType();
1417            this.sequenceLinkId.setValue(value);
1418          return this;
1419        }
1420
1421        /**
1422         * @return {@link #adjudication} (The adjudications results.)
1423         */
1424        public List<SubdetailAdjudicationComponent> getAdjudication() { 
1425          if (this.adjudication == null)
1426            this.adjudication = new ArrayList<SubdetailAdjudicationComponent>();
1427          return this.adjudication;
1428        }
1429
1430        public boolean hasAdjudication() { 
1431          if (this.adjudication == null)
1432            return false;
1433          for (SubdetailAdjudicationComponent item : this.adjudication)
1434            if (!item.isEmpty())
1435              return true;
1436          return false;
1437        }
1438
1439        /**
1440         * @return {@link #adjudication} (The adjudications results.)
1441         */
1442    // syntactic sugar
1443        public SubdetailAdjudicationComponent addAdjudication() { //3
1444          SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent();
1445          if (this.adjudication == null)
1446            this.adjudication = new ArrayList<SubdetailAdjudicationComponent>();
1447          this.adjudication.add(t);
1448          return t;
1449        }
1450
1451    // syntactic sugar
1452        public SubDetailComponent addAdjudication(SubdetailAdjudicationComponent t) { //3
1453          if (t == null)
1454            return this;
1455          if (this.adjudication == null)
1456            this.adjudication = new ArrayList<SubdetailAdjudicationComponent>();
1457          this.adjudication.add(t);
1458          return this;
1459        }
1460
1461        protected void listChildren(List<Property> childrenList) {
1462          super.listChildren(childrenList);
1463          childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId));
1464          childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
1465        }
1466
1467      @Override
1468      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1469        switch (hash) {
1470        case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType
1471        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // SubdetailAdjudicationComponent
1472        default: return super.getProperty(hash, name, checkValid);
1473        }
1474
1475      }
1476
1477      @Override
1478      public void setProperty(int hash, String name, Base value) throws FHIRException {
1479        switch (hash) {
1480        case -1422298666: // sequenceLinkId
1481          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
1482          break;
1483        case -231349275: // adjudication
1484          this.getAdjudication().add((SubdetailAdjudicationComponent) value); // SubdetailAdjudicationComponent
1485          break;
1486        default: super.setProperty(hash, name, value);
1487        }
1488
1489      }
1490
1491      @Override
1492      public void setProperty(String name, Base value) throws FHIRException {
1493        if (name.equals("sequenceLinkId"))
1494          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
1495        else if (name.equals("adjudication"))
1496          this.getAdjudication().add((SubdetailAdjudicationComponent) value);
1497        else
1498          super.setProperty(name, value);
1499      }
1500
1501      @Override
1502      public Base makeProperty(int hash, String name) throws FHIRException {
1503        switch (hash) {
1504        case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType
1505        case -231349275:  return addAdjudication(); // SubdetailAdjudicationComponent
1506        default: return super.makeProperty(hash, name);
1507        }
1508
1509      }
1510
1511      @Override
1512      public Base addChild(String name) throws FHIRException {
1513        if (name.equals("sequenceLinkId")) {
1514          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId");
1515        }
1516        else if (name.equals("adjudication")) {
1517          return addAdjudication();
1518        }
1519        else
1520          return super.addChild(name);
1521      }
1522
1523      public SubDetailComponent copy() {
1524        SubDetailComponent dst = new SubDetailComponent();
1525        copyValues(dst);
1526        dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy();
1527        if (adjudication != null) {
1528          dst.adjudication = new ArrayList<SubdetailAdjudicationComponent>();
1529          for (SubdetailAdjudicationComponent i : adjudication)
1530            dst.adjudication.add(i.copy());
1531        };
1532        return dst;
1533      }
1534
1535      @Override
1536      public boolean equalsDeep(Base other) {
1537        if (!super.equalsDeep(other))
1538          return false;
1539        if (!(other instanceof SubDetailComponent))
1540          return false;
1541        SubDetailComponent o = (SubDetailComponent) other;
1542        return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true)
1543          ;
1544      }
1545
1546      @Override
1547      public boolean equalsShallow(Base other) {
1548        if (!super.equalsShallow(other))
1549          return false;
1550        if (!(other instanceof SubDetailComponent))
1551          return false;
1552        SubDetailComponent o = (SubDetailComponent) other;
1553        return compareValues(sequenceLinkId, o.sequenceLinkId, true);
1554      }
1555
1556      public boolean isEmpty() {
1557        return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty())
1558          ;
1559      }
1560
1561  public String fhirType() {
1562    return "ClaimResponse.item.detail.subDetail";
1563
1564  }
1565
1566  }
1567
1568    @Block()
1569    public static class SubdetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
1570        /**
1571         * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.
1572         */
1573        @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
1574        @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." )
1575        protected Coding category;
1576
1577        /**
1578         * Adjudication reason such as limit reached.
1579         */
1580        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
1581        @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." )
1582        protected Coding reason;
1583
1584        /**
1585         * Monetary amount associated with the code.
1586         */
1587        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
1588        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." )
1589        protected Money amount;
1590
1591        /**
1592         * A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1593         */
1594        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1595        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." )
1596        protected DecimalType value;
1597
1598        private static final long serialVersionUID = -1926987562L;
1599
1600    /**
1601     * Constructor
1602     */
1603      public SubdetailAdjudicationComponent() {
1604        super();
1605      }
1606
1607    /**
1608     * Constructor
1609     */
1610      public SubdetailAdjudicationComponent(Coding category) {
1611        super();
1612        this.category = category;
1613      }
1614
1615        /**
1616         * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
1617         */
1618        public Coding getCategory() { 
1619          if (this.category == null)
1620            if (Configuration.errorOnAutoCreate())
1621              throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.category");
1622            else if (Configuration.doAutoCreate())
1623              this.category = new Coding(); // cc
1624          return this.category;
1625        }
1626
1627        public boolean hasCategory() { 
1628          return this.category != null && !this.category.isEmpty();
1629        }
1630
1631        /**
1632         * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
1633         */
1634        public SubdetailAdjudicationComponent setCategory(Coding value) { 
1635          this.category = value;
1636          return this;
1637        }
1638
1639        /**
1640         * @return {@link #reason} (Adjudication reason such as limit reached.)
1641         */
1642        public Coding getReason() { 
1643          if (this.reason == null)
1644            if (Configuration.errorOnAutoCreate())
1645              throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.reason");
1646            else if (Configuration.doAutoCreate())
1647              this.reason = new Coding(); // cc
1648          return this.reason;
1649        }
1650
1651        public boolean hasReason() { 
1652          return this.reason != null && !this.reason.isEmpty();
1653        }
1654
1655        /**
1656         * @param value {@link #reason} (Adjudication reason such as limit reached.)
1657         */
1658        public SubdetailAdjudicationComponent setReason(Coding value) { 
1659          this.reason = value;
1660          return this;
1661        }
1662
1663        /**
1664         * @return {@link #amount} (Monetary amount associated with the code.)
1665         */
1666        public Money getAmount() { 
1667          if (this.amount == null)
1668            if (Configuration.errorOnAutoCreate())
1669              throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount");
1670            else if (Configuration.doAutoCreate())
1671              this.amount = new Money(); // cc
1672          return this.amount;
1673        }
1674
1675        public boolean hasAmount() { 
1676          return this.amount != null && !this.amount.isEmpty();
1677        }
1678
1679        /**
1680         * @param value {@link #amount} (Monetary amount associated with the code.)
1681         */
1682        public SubdetailAdjudicationComponent setAmount(Money value) { 
1683          this.amount = value;
1684          return this;
1685        }
1686
1687        /**
1688         * @return {@link #value} (A non-monetary value for example a percentage. 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
1689         */
1690        public DecimalType getValueElement() { 
1691          if (this.value == null)
1692            if (Configuration.errorOnAutoCreate())
1693              throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value");
1694            else if (Configuration.doAutoCreate())
1695              this.value = new DecimalType(); // bb
1696          return this.value;
1697        }
1698
1699        public boolean hasValueElement() { 
1700          return this.value != null && !this.value.isEmpty();
1701        }
1702
1703        public boolean hasValue() { 
1704          return this.value != null && !this.value.isEmpty();
1705        }
1706
1707        /**
1708         * @param value {@link #value} (A non-monetary value for example a percentage. 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
1709         */
1710        public SubdetailAdjudicationComponent setValueElement(DecimalType value) { 
1711          this.value = value;
1712          return this;
1713        }
1714
1715        /**
1716         * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1717         */
1718        public BigDecimal getValue() { 
1719          return this.value == null ? null : this.value.getValue();
1720        }
1721
1722        /**
1723         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1724         */
1725        public SubdetailAdjudicationComponent setValue(BigDecimal value) { 
1726          if (value == null)
1727            this.value = null;
1728          else {
1729            if (this.value == null)
1730              this.value = new DecimalType();
1731            this.value.setValue(value);
1732          }
1733          return this;
1734        }
1735
1736        /**
1737         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1738         */
1739        public SubdetailAdjudicationComponent setValue(long value) { 
1740              this.value = new DecimalType();
1741            this.value.setValue(value);
1742          return this;
1743        }
1744
1745        /**
1746         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
1747         */
1748        public SubdetailAdjudicationComponent setValue(double value) { 
1749              this.value = new DecimalType();
1750            this.value.setValue(value);
1751          return this;
1752        }
1753
1754        protected void listChildren(List<Property> childrenList) {
1755          super.listChildren(childrenList);
1756          childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category));
1757          childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason));
1758          childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount));
1759          childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value));
1760        }
1761
1762      @Override
1763      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1764        switch (hash) {
1765        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding
1766        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
1767        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
1768        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
1769        default: return super.getProperty(hash, name, checkValid);
1770        }
1771
1772      }
1773
1774      @Override
1775      public void setProperty(int hash, String name, Base value) throws FHIRException {
1776        switch (hash) {
1777        case 50511102: // category
1778          this.category = castToCoding(value); // Coding
1779          break;
1780        case -934964668: // reason
1781          this.reason = castToCoding(value); // Coding
1782          break;
1783        case -1413853096: // amount
1784          this.amount = castToMoney(value); // Money
1785          break;
1786        case 111972721: // value
1787          this.value = castToDecimal(value); // DecimalType
1788          break;
1789        default: super.setProperty(hash, name, value);
1790        }
1791
1792      }
1793
1794      @Override
1795      public void setProperty(String name, Base value) throws FHIRException {
1796        if (name.equals("category"))
1797          this.category = castToCoding(value); // Coding
1798        else if (name.equals("reason"))
1799          this.reason = castToCoding(value); // Coding
1800        else if (name.equals("amount"))
1801          this.amount = castToMoney(value); // Money
1802        else if (name.equals("value"))
1803          this.value = castToDecimal(value); // DecimalType
1804        else
1805          super.setProperty(name, value);
1806      }
1807
1808      @Override
1809      public Base makeProperty(int hash, String name) throws FHIRException {
1810        switch (hash) {
1811        case 50511102:  return getCategory(); // Coding
1812        case -934964668:  return getReason(); // Coding
1813        case -1413853096:  return getAmount(); // Money
1814        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType
1815        default: return super.makeProperty(hash, name);
1816        }
1817
1818      }
1819
1820      @Override
1821      public Base addChild(String name) throws FHIRException {
1822        if (name.equals("category")) {
1823          this.category = new Coding();
1824          return this.category;
1825        }
1826        else if (name.equals("reason")) {
1827          this.reason = new Coding();
1828          return this.reason;
1829        }
1830        else if (name.equals("amount")) {
1831          this.amount = new Money();
1832          return this.amount;
1833        }
1834        else if (name.equals("value")) {
1835          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value");
1836        }
1837        else
1838          return super.addChild(name);
1839      }
1840
1841      public SubdetailAdjudicationComponent copy() {
1842        SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent();
1843        copyValues(dst);
1844        dst.category = category == null ? null : category.copy();
1845        dst.reason = reason == null ? null : reason.copy();
1846        dst.amount = amount == null ? null : amount.copy();
1847        dst.value = value == null ? null : value.copy();
1848        return dst;
1849      }
1850
1851      @Override
1852      public boolean equalsDeep(Base other) {
1853        if (!super.equalsDeep(other))
1854          return false;
1855        if (!(other instanceof SubdetailAdjudicationComponent))
1856          return false;
1857        SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other;
1858        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
1859           && compareDeep(value, o.value, true);
1860      }
1861
1862      @Override
1863      public boolean equalsShallow(Base other) {
1864        if (!super.equalsShallow(other))
1865          return false;
1866        if (!(other instanceof SubdetailAdjudicationComponent))
1867          return false;
1868        SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other;
1869        return compareValues(value, o.value, true);
1870      }
1871
1872      public boolean isEmpty() {
1873        return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty())
1874           && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty());
1875      }
1876
1877  public String fhirType() {
1878    return "ClaimResponse.item.detail.subDetail.adjudication";
1879
1880  }
1881
1882  }
1883
1884    @Block()
1885    public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement {
1886        /**
1887         * List of input service items which this service line is intended to replace.
1888         */
1889        @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1890        @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." )
1891        protected List<PositiveIntType> sequenceLinkId;
1892
1893        /**
1894         * A code to indicate the Professional Service or Product supplied.
1895         */
1896        @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
1897        @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." )
1898        protected Coding service;
1899
1900        /**
1901         * The fee charged for the professional service or product..
1902         */
1903        @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
1904        @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." )
1905        protected Money fee;
1906
1907        /**
1908         * A list of note references to the notes provided below.
1909         */
1910        @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1911        @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." )
1912        protected List<PositiveIntType> noteNumberLinkId;
1913
1914        /**
1915         * The adjudications results.
1916         */
1917        @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1918        @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." )
1919        protected List<AddedItemAdjudicationComponent> adjudication;
1920
1921        /**
1922         * The second tier service adjudications for payor added services.
1923         */
1924        @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1925        @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." )
1926        protected List<AddedItemsDetailComponent> detail;
1927
1928        private static final long serialVersionUID = -1675935854L;
1929
1930    /**
1931     * Constructor
1932     */
1933      public AddedItemComponent() {
1934        super();
1935      }
1936
1937    /**
1938     * Constructor
1939     */
1940      public AddedItemComponent(Coding service) {
1941        super();
1942        this.service = service;
1943      }
1944
1945        /**
1946         * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.)
1947         */
1948        public List<PositiveIntType> getSequenceLinkId() { 
1949          if (this.sequenceLinkId == null)
1950            this.sequenceLinkId = new ArrayList<PositiveIntType>();
1951          return this.sequenceLinkId;
1952        }
1953
1954        public boolean hasSequenceLinkId() { 
1955          if (this.sequenceLinkId == null)
1956            return false;
1957          for (PositiveIntType item : this.sequenceLinkId)
1958            if (!item.isEmpty())
1959              return true;
1960          return false;
1961        }
1962
1963        /**
1964         * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.)
1965         */
1966    // syntactic sugar
1967        public PositiveIntType addSequenceLinkIdElement() {//2 
1968          PositiveIntType t = new PositiveIntType();
1969          if (this.sequenceLinkId == null)
1970            this.sequenceLinkId = new ArrayList<PositiveIntType>();
1971          this.sequenceLinkId.add(t);
1972          return t;
1973        }
1974
1975        /**
1976         * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.)
1977         */
1978        public AddedItemComponent addSequenceLinkId(int value) { //1
1979          PositiveIntType t = new PositiveIntType();
1980          t.setValue(value);
1981          if (this.sequenceLinkId == null)
1982            this.sequenceLinkId = new ArrayList<PositiveIntType>();
1983          this.sequenceLinkId.add(t);
1984          return this;
1985        }
1986
1987        /**
1988         * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.)
1989         */
1990        public boolean hasSequenceLinkId(int value) { 
1991          if (this.sequenceLinkId == null)
1992            return false;
1993          for (PositiveIntType v : this.sequenceLinkId)
1994            if (v.equals(value)) // positiveInt
1995              return true;
1996          return false;
1997        }
1998
1999        /**
2000         * @return {@link #service} (A code to indicate the Professional Service or Product supplied.)
2001         */
2002        public Coding getService() { 
2003          if (this.service == null)
2004            if (Configuration.errorOnAutoCreate())
2005              throw new Error("Attempt to auto-create AddedItemComponent.service");
2006            else if (Configuration.doAutoCreate())
2007              this.service = new Coding(); // cc
2008          return this.service;
2009        }
2010
2011        public boolean hasService() { 
2012          return this.service != null && !this.service.isEmpty();
2013        }
2014
2015        /**
2016         * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.)
2017         */
2018        public AddedItemComponent setService(Coding value) { 
2019          this.service = value;
2020          return this;
2021        }
2022
2023        /**
2024         * @return {@link #fee} (The fee charged for the professional service or product..)
2025         */
2026        public Money getFee() { 
2027          if (this.fee == null)
2028            if (Configuration.errorOnAutoCreate())
2029              throw new Error("Attempt to auto-create AddedItemComponent.fee");
2030            else if (Configuration.doAutoCreate())
2031              this.fee = new Money(); // cc
2032          return this.fee;
2033        }
2034
2035        public boolean hasFee() { 
2036          return this.fee != null && !this.fee.isEmpty();
2037        }
2038
2039        /**
2040         * @param value {@link #fee} (The fee charged for the professional service or product..)
2041         */
2042        public AddedItemComponent setFee(Money value) { 
2043          this.fee = value;
2044          return this;
2045        }
2046
2047        /**
2048         * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.)
2049         */
2050        public List<PositiveIntType> getNoteNumberLinkId() { 
2051          if (this.noteNumberLinkId == null)
2052            this.noteNumberLinkId = new ArrayList<PositiveIntType>();
2053          return this.noteNumberLinkId;
2054        }
2055
2056        public boolean hasNoteNumberLinkId() { 
2057          if (this.noteNumberLinkId == null)
2058            return false;
2059          for (PositiveIntType item : this.noteNumberLinkId)
2060            if (!item.isEmpty())
2061              return true;
2062          return false;
2063        }
2064
2065        /**
2066         * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.)
2067         */
2068    // syntactic sugar
2069        public PositiveIntType addNoteNumberLinkIdElement() {//2 
2070          PositiveIntType t = new PositiveIntType();
2071          if (this.noteNumberLinkId == null)
2072            this.noteNumberLinkId = new ArrayList<PositiveIntType>();
2073          this.noteNumberLinkId.add(t);
2074          return t;
2075        }
2076
2077        /**
2078         * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.)
2079         */
2080        public AddedItemComponent addNoteNumberLinkId(int value) { //1
2081          PositiveIntType t = new PositiveIntType();
2082          t.setValue(value);
2083          if (this.noteNumberLinkId == null)
2084            this.noteNumberLinkId = new ArrayList<PositiveIntType>();
2085          this.noteNumberLinkId.add(t);
2086          return this;
2087        }
2088
2089        /**
2090         * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.)
2091         */
2092        public boolean hasNoteNumberLinkId(int value) { 
2093          if (this.noteNumberLinkId == null)
2094            return false;
2095          for (PositiveIntType v : this.noteNumberLinkId)
2096            if (v.equals(value)) // positiveInt
2097              return true;
2098          return false;
2099        }
2100
2101        /**
2102         * @return {@link #adjudication} (The adjudications results.)
2103         */
2104        public List<AddedItemAdjudicationComponent> getAdjudication() { 
2105          if (this.adjudication == null)
2106            this.adjudication = new ArrayList<AddedItemAdjudicationComponent>();
2107          return this.adjudication;
2108        }
2109
2110        public boolean hasAdjudication() { 
2111          if (this.adjudication == null)
2112            return false;
2113          for (AddedItemAdjudicationComponent item : this.adjudication)
2114            if (!item.isEmpty())
2115              return true;
2116          return false;
2117        }
2118
2119        /**
2120         * @return {@link #adjudication} (The adjudications results.)
2121         */
2122    // syntactic sugar
2123        public AddedItemAdjudicationComponent addAdjudication() { //3
2124          AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent();
2125          if (this.adjudication == null)
2126            this.adjudication = new ArrayList<AddedItemAdjudicationComponent>();
2127          this.adjudication.add(t);
2128          return t;
2129        }
2130
2131    // syntactic sugar
2132        public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3
2133          if (t == null)
2134            return this;
2135          if (this.adjudication == null)
2136            this.adjudication = new ArrayList<AddedItemAdjudicationComponent>();
2137          this.adjudication.add(t);
2138          return this;
2139        }
2140
2141        /**
2142         * @return {@link #detail} (The second tier service adjudications for payor added services.)
2143         */
2144        public List<AddedItemsDetailComponent> getDetail() { 
2145          if (this.detail == null)
2146            this.detail = new ArrayList<AddedItemsDetailComponent>();
2147          return this.detail;
2148        }
2149
2150        public boolean hasDetail() { 
2151          if (this.detail == null)
2152            return false;
2153          for (AddedItemsDetailComponent item : this.detail)
2154            if (!item.isEmpty())
2155              return true;
2156          return false;
2157        }
2158
2159        /**
2160         * @return {@link #detail} (The second tier service adjudications for payor added services.)
2161         */
2162    // syntactic sugar
2163        public AddedItemsDetailComponent addDetail() { //3
2164          AddedItemsDetailComponent t = new AddedItemsDetailComponent();
2165          if (this.detail == null)
2166            this.detail = new ArrayList<AddedItemsDetailComponent>();
2167          this.detail.add(t);
2168          return t;
2169        }
2170
2171    // syntactic sugar
2172        public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3
2173          if (t == null)
2174            return this;
2175          if (this.detail == null)
2176            this.detail = new ArrayList<AddedItemsDetailComponent>();
2177          this.detail.add(t);
2178          return this;
2179        }
2180
2181        protected void listChildren(List<Property> childrenList) {
2182          super.listChildren(childrenList);
2183          childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId));
2184          childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service));
2185          childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee));
2186          childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId));
2187          childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
2188          childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail));
2189        }
2190
2191      @Override
2192      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2193        switch (hash) {
2194        case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType
2195        case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding
2196        case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money
2197        case -1859667856: /*noteNumberLinkId*/ return this.noteNumberLinkId == null ? new Base[0] : this.noteNumberLinkId.toArray(new Base[this.noteNumberLinkId.size()]); // PositiveIntType
2198        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemAdjudicationComponent
2199        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemsDetailComponent
2200        default: return super.getProperty(hash, name, checkValid);
2201        }
2202
2203      }
2204
2205      @Override
2206      public void setProperty(int hash, String name, Base value) throws FHIRException {
2207        switch (hash) {
2208        case -1422298666: // sequenceLinkId
2209          this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType
2210          break;
2211        case 1984153269: // service
2212          this.service = castToCoding(value); // Coding
2213          break;
2214        case 101254: // fee
2215          this.fee = castToMoney(value); // Money
2216          break;
2217        case -1859667856: // noteNumberLinkId
2218          this.getNoteNumberLinkId().add(castToPositiveInt(value)); // PositiveIntType
2219          break;
2220        case -231349275: // adjudication
2221          this.getAdjudication().add((AddedItemAdjudicationComponent) value); // AddedItemAdjudicationComponent
2222          break;
2223        case -1335224239: // detail
2224          this.getDetail().add((AddedItemsDetailComponent) value); // AddedItemsDetailComponent
2225          break;
2226        default: super.setProperty(hash, name, value);
2227        }
2228
2229      }
2230
2231      @Override
2232      public void setProperty(String name, Base value) throws FHIRException {
2233        if (name.equals("sequenceLinkId"))
2234          this.getSequenceLinkId().add(castToPositiveInt(value));
2235        else if (name.equals("service"))
2236          this.service = castToCoding(value); // Coding
2237        else if (name.equals("fee"))
2238          this.fee = castToMoney(value); // Money
2239        else if (name.equals("noteNumberLinkId"))
2240          this.getNoteNumberLinkId().add(castToPositiveInt(value));
2241        else if (name.equals("adjudication"))
2242          this.getAdjudication().add((AddedItemAdjudicationComponent) value);
2243        else if (name.equals("detail"))
2244          this.getDetail().add((AddedItemsDetailComponent) value);
2245        else
2246          super.setProperty(name, value);
2247      }
2248
2249      @Override
2250      public Base makeProperty(int hash, String name) throws FHIRException {
2251        switch (hash) {
2252        case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType
2253        case 1984153269:  return getService(); // Coding
2254        case 101254:  return getFee(); // Money
2255        case -1859667856: throw new FHIRException("Cannot make property noteNumberLinkId as it is not a complex type"); // PositiveIntType
2256        case -231349275:  return addAdjudication(); // AddedItemAdjudicationComponent
2257        case -1335224239:  return addDetail(); // AddedItemsDetailComponent
2258        default: return super.makeProperty(hash, name);
2259        }
2260
2261      }
2262
2263      @Override
2264      public Base addChild(String name) throws FHIRException {
2265        if (name.equals("sequenceLinkId")) {
2266          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId");
2267        }
2268        else if (name.equals("service")) {
2269          this.service = new Coding();
2270          return this.service;
2271        }
2272        else if (name.equals("fee")) {
2273          this.fee = new Money();
2274          return this.fee;
2275        }
2276        else if (name.equals("noteNumberLinkId")) {
2277          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumberLinkId");
2278        }
2279        else if (name.equals("adjudication")) {
2280          return addAdjudication();
2281        }
2282        else if (name.equals("detail")) {
2283          return addDetail();
2284        }
2285        else
2286          return super.addChild(name);
2287      }
2288
2289      public AddedItemComponent copy() {
2290        AddedItemComponent dst = new AddedItemComponent();
2291        copyValues(dst);
2292        if (sequenceLinkId != null) {
2293          dst.sequenceLinkId = new ArrayList<PositiveIntType>();
2294          for (PositiveIntType i : sequenceLinkId)
2295            dst.sequenceLinkId.add(i.copy());
2296        };
2297        dst.service = service == null ? null : service.copy();
2298        dst.fee = fee == null ? null : fee.copy();
2299        if (noteNumberLinkId != null) {
2300          dst.noteNumberLinkId = new ArrayList<PositiveIntType>();
2301          for (PositiveIntType i : noteNumberLinkId)
2302            dst.noteNumberLinkId.add(i.copy());
2303        };
2304        if (adjudication != null) {
2305          dst.adjudication = new ArrayList<AddedItemAdjudicationComponent>();
2306          for (AddedItemAdjudicationComponent i : adjudication)
2307            dst.adjudication.add(i.copy());
2308        };
2309        if (detail != null) {
2310          dst.detail = new ArrayList<AddedItemsDetailComponent>();
2311          for (AddedItemsDetailComponent i : detail)
2312            dst.detail.add(i.copy());
2313        };
2314        return dst;
2315      }
2316
2317      @Override
2318      public boolean equalsDeep(Base other) {
2319        if (!super.equalsDeep(other))
2320          return false;
2321        if (!(other instanceof AddedItemComponent))
2322          return false;
2323        AddedItemComponent o = (AddedItemComponent) other;
2324        return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true)
2325           && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true)
2326           && compareDeep(detail, o.detail, true);
2327      }
2328
2329      @Override
2330      public boolean equalsShallow(Base other) {
2331        if (!super.equalsShallow(other))
2332          return false;
2333        if (!(other instanceof AddedItemComponent))
2334          return false;
2335        AddedItemComponent o = (AddedItemComponent) other;
2336        return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true)
2337          ;
2338      }
2339
2340      public boolean isEmpty() {
2341        return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty())
2342           && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty())
2343           && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty())
2344          ;
2345      }
2346
2347  public String fhirType() {
2348    return "ClaimResponse.addItem";
2349
2350  }
2351
2352  }
2353
2354    @Block()
2355    public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
2356        /**
2357         * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.
2358         */
2359        @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
2360        @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." )
2361        protected Coding category;
2362
2363        /**
2364         * Adjudication reason such as limit reached.
2365         */
2366        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
2367        @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." )
2368        protected Coding reason;
2369
2370        /**
2371         * Monetary amount associated with the code.
2372         */
2373        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
2374        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." )
2375        protected Money amount;
2376
2377        /**
2378         * A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2379         */
2380        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2381        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." )
2382        protected DecimalType value;
2383
2384        private static final long serialVersionUID = -1926987562L;
2385
2386    /**
2387     * Constructor
2388     */
2389      public AddedItemAdjudicationComponent() {
2390        super();
2391      }
2392
2393    /**
2394     * Constructor
2395     */
2396      public AddedItemAdjudicationComponent(Coding category) {
2397        super();
2398        this.category = category;
2399      }
2400
2401        /**
2402         * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
2403         */
2404        public Coding getCategory() { 
2405          if (this.category == null)
2406            if (Configuration.errorOnAutoCreate())
2407              throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.category");
2408            else if (Configuration.doAutoCreate())
2409              this.category = new Coding(); // cc
2410          return this.category;
2411        }
2412
2413        public boolean hasCategory() { 
2414          return this.category != null && !this.category.isEmpty();
2415        }
2416
2417        /**
2418         * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
2419         */
2420        public AddedItemAdjudicationComponent setCategory(Coding value) { 
2421          this.category = value;
2422          return this;
2423        }
2424
2425        /**
2426         * @return {@link #reason} (Adjudication reason such as limit reached.)
2427         */
2428        public Coding getReason() { 
2429          if (this.reason == null)
2430            if (Configuration.errorOnAutoCreate())
2431              throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.reason");
2432            else if (Configuration.doAutoCreate())
2433              this.reason = new Coding(); // cc
2434          return this.reason;
2435        }
2436
2437        public boolean hasReason() { 
2438          return this.reason != null && !this.reason.isEmpty();
2439        }
2440
2441        /**
2442         * @param value {@link #reason} (Adjudication reason such as limit reached.)
2443         */
2444        public AddedItemAdjudicationComponent setReason(Coding value) { 
2445          this.reason = value;
2446          return this;
2447        }
2448
2449        /**
2450         * @return {@link #amount} (Monetary amount associated with the code.)
2451         */
2452        public Money getAmount() { 
2453          if (this.amount == null)
2454            if (Configuration.errorOnAutoCreate())
2455              throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount");
2456            else if (Configuration.doAutoCreate())
2457              this.amount = new Money(); // cc
2458          return this.amount;
2459        }
2460
2461        public boolean hasAmount() { 
2462          return this.amount != null && !this.amount.isEmpty();
2463        }
2464
2465        /**
2466         * @param value {@link #amount} (Monetary amount associated with the code.)
2467         */
2468        public AddedItemAdjudicationComponent setAmount(Money value) { 
2469          this.amount = value;
2470          return this;
2471        }
2472
2473        /**
2474         * @return {@link #value} (A non-monetary value for example a percentage. 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
2475         */
2476        public DecimalType getValueElement() { 
2477          if (this.value == null)
2478            if (Configuration.errorOnAutoCreate())
2479              throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value");
2480            else if (Configuration.doAutoCreate())
2481              this.value = new DecimalType(); // bb
2482          return this.value;
2483        }
2484
2485        public boolean hasValueElement() { 
2486          return this.value != null && !this.value.isEmpty();
2487        }
2488
2489        public boolean hasValue() { 
2490          return this.value != null && !this.value.isEmpty();
2491        }
2492
2493        /**
2494         * @param value {@link #value} (A non-monetary value for example a percentage. 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
2495         */
2496        public AddedItemAdjudicationComponent setValueElement(DecimalType value) { 
2497          this.value = value;
2498          return this;
2499        }
2500
2501        /**
2502         * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2503         */
2504        public BigDecimal getValue() { 
2505          return this.value == null ? null : this.value.getValue();
2506        }
2507
2508        /**
2509         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2510         */
2511        public AddedItemAdjudicationComponent setValue(BigDecimal value) { 
2512          if (value == null)
2513            this.value = null;
2514          else {
2515            if (this.value == null)
2516              this.value = new DecimalType();
2517            this.value.setValue(value);
2518          }
2519          return this;
2520        }
2521
2522        /**
2523         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2524         */
2525        public AddedItemAdjudicationComponent setValue(long value) { 
2526              this.value = new DecimalType();
2527            this.value.setValue(value);
2528          return this;
2529        }
2530
2531        /**
2532         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2533         */
2534        public AddedItemAdjudicationComponent setValue(double value) { 
2535              this.value = new DecimalType();
2536            this.value.setValue(value);
2537          return this;
2538        }
2539
2540        protected void listChildren(List<Property> childrenList) {
2541          super.listChildren(childrenList);
2542          childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category));
2543          childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason));
2544          childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount));
2545          childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value));
2546        }
2547
2548      @Override
2549      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2550        switch (hash) {
2551        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding
2552        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
2553        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
2554        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
2555        default: return super.getProperty(hash, name, checkValid);
2556        }
2557
2558      }
2559
2560      @Override
2561      public void setProperty(int hash, String name, Base value) throws FHIRException {
2562        switch (hash) {
2563        case 50511102: // category
2564          this.category = castToCoding(value); // Coding
2565          break;
2566        case -934964668: // reason
2567          this.reason = castToCoding(value); // Coding
2568          break;
2569        case -1413853096: // amount
2570          this.amount = castToMoney(value); // Money
2571          break;
2572        case 111972721: // value
2573          this.value = castToDecimal(value); // DecimalType
2574          break;
2575        default: super.setProperty(hash, name, value);
2576        }
2577
2578      }
2579
2580      @Override
2581      public void setProperty(String name, Base value) throws FHIRException {
2582        if (name.equals("category"))
2583          this.category = castToCoding(value); // Coding
2584        else if (name.equals("reason"))
2585          this.reason = castToCoding(value); // Coding
2586        else if (name.equals("amount"))
2587          this.amount = castToMoney(value); // Money
2588        else if (name.equals("value"))
2589          this.value = castToDecimal(value); // DecimalType
2590        else
2591          super.setProperty(name, value);
2592      }
2593
2594      @Override
2595      public Base makeProperty(int hash, String name) throws FHIRException {
2596        switch (hash) {
2597        case 50511102:  return getCategory(); // Coding
2598        case -934964668:  return getReason(); // Coding
2599        case -1413853096:  return getAmount(); // Money
2600        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType
2601        default: return super.makeProperty(hash, name);
2602        }
2603
2604      }
2605
2606      @Override
2607      public Base addChild(String name) throws FHIRException {
2608        if (name.equals("category")) {
2609          this.category = new Coding();
2610          return this.category;
2611        }
2612        else if (name.equals("reason")) {
2613          this.reason = new Coding();
2614          return this.reason;
2615        }
2616        else if (name.equals("amount")) {
2617          this.amount = new Money();
2618          return this.amount;
2619        }
2620        else if (name.equals("value")) {
2621          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value");
2622        }
2623        else
2624          return super.addChild(name);
2625      }
2626
2627      public AddedItemAdjudicationComponent copy() {
2628        AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent();
2629        copyValues(dst);
2630        dst.category = category == null ? null : category.copy();
2631        dst.reason = reason == null ? null : reason.copy();
2632        dst.amount = amount == null ? null : amount.copy();
2633        dst.value = value == null ? null : value.copy();
2634        return dst;
2635      }
2636
2637      @Override
2638      public boolean equalsDeep(Base other) {
2639        if (!super.equalsDeep(other))
2640          return false;
2641        if (!(other instanceof AddedItemAdjudicationComponent))
2642          return false;
2643        AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other;
2644        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
2645           && compareDeep(value, o.value, true);
2646      }
2647
2648      @Override
2649      public boolean equalsShallow(Base other) {
2650        if (!super.equalsShallow(other))
2651          return false;
2652        if (!(other instanceof AddedItemAdjudicationComponent))
2653          return false;
2654        AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other;
2655        return compareValues(value, o.value, true);
2656      }
2657
2658      public boolean isEmpty() {
2659        return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty())
2660           && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty());
2661      }
2662
2663  public String fhirType() {
2664    return "ClaimResponse.addItem.adjudication";
2665
2666  }
2667
2668  }
2669
2670    @Block()
2671    public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement {
2672        /**
2673         * A code to indicate the Professional Service or Product supplied.
2674         */
2675        @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
2676        @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." )
2677        protected Coding service;
2678
2679        /**
2680         * The fee charged for the professional service or product..
2681         */
2682        @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=true)
2683        @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." )
2684        protected Money fee;
2685
2686        /**
2687         * The adjudications results.
2688         */
2689        @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2690        @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." )
2691        protected List<AddedItemDetailAdjudicationComponent> adjudication;
2692
2693        private static final long serialVersionUID = -2104242020L;
2694
2695    /**
2696     * Constructor
2697     */
2698      public AddedItemsDetailComponent() {
2699        super();
2700      }
2701
2702    /**
2703     * Constructor
2704     */
2705      public AddedItemsDetailComponent(Coding service) {
2706        super();
2707        this.service = service;
2708      }
2709
2710        /**
2711         * @return {@link #service} (A code to indicate the Professional Service or Product supplied.)
2712         */
2713        public Coding getService() { 
2714          if (this.service == null)
2715            if (Configuration.errorOnAutoCreate())
2716              throw new Error("Attempt to auto-create AddedItemsDetailComponent.service");
2717            else if (Configuration.doAutoCreate())
2718              this.service = new Coding(); // cc
2719          return this.service;
2720        }
2721
2722        public boolean hasService() { 
2723          return this.service != null && !this.service.isEmpty();
2724        }
2725
2726        /**
2727         * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.)
2728         */
2729        public AddedItemsDetailComponent setService(Coding value) { 
2730          this.service = value;
2731          return this;
2732        }
2733
2734        /**
2735         * @return {@link #fee} (The fee charged for the professional service or product..)
2736         */
2737        public Money getFee() { 
2738          if (this.fee == null)
2739            if (Configuration.errorOnAutoCreate())
2740              throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee");
2741            else if (Configuration.doAutoCreate())
2742              this.fee = new Money(); // cc
2743          return this.fee;
2744        }
2745
2746        public boolean hasFee() { 
2747          return this.fee != null && !this.fee.isEmpty();
2748        }
2749
2750        /**
2751         * @param value {@link #fee} (The fee charged for the professional service or product..)
2752         */
2753        public AddedItemsDetailComponent setFee(Money value) { 
2754          this.fee = value;
2755          return this;
2756        }
2757
2758        /**
2759         * @return {@link #adjudication} (The adjudications results.)
2760         */
2761        public List<AddedItemDetailAdjudicationComponent> getAdjudication() { 
2762          if (this.adjudication == null)
2763            this.adjudication = new ArrayList<AddedItemDetailAdjudicationComponent>();
2764          return this.adjudication;
2765        }
2766
2767        public boolean hasAdjudication() { 
2768          if (this.adjudication == null)
2769            return false;
2770          for (AddedItemDetailAdjudicationComponent item : this.adjudication)
2771            if (!item.isEmpty())
2772              return true;
2773          return false;
2774        }
2775
2776        /**
2777         * @return {@link #adjudication} (The adjudications results.)
2778         */
2779    // syntactic sugar
2780        public AddedItemDetailAdjudicationComponent addAdjudication() { //3
2781          AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent();
2782          if (this.adjudication == null)
2783            this.adjudication = new ArrayList<AddedItemDetailAdjudicationComponent>();
2784          this.adjudication.add(t);
2785          return t;
2786        }
2787
2788    // syntactic sugar
2789        public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3
2790          if (t == null)
2791            return this;
2792          if (this.adjudication == null)
2793            this.adjudication = new ArrayList<AddedItemDetailAdjudicationComponent>();
2794          this.adjudication.add(t);
2795          return this;
2796        }
2797
2798        protected void listChildren(List<Property> childrenList) {
2799          super.listChildren(childrenList);
2800          childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service));
2801          childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee));
2802          childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication));
2803        }
2804
2805      @Override
2806      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2807        switch (hash) {
2808        case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding
2809        case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money
2810        case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemDetailAdjudicationComponent
2811        default: return super.getProperty(hash, name, checkValid);
2812        }
2813
2814      }
2815
2816      @Override
2817      public void setProperty(int hash, String name, Base value) throws FHIRException {
2818        switch (hash) {
2819        case 1984153269: // service
2820          this.service = castToCoding(value); // Coding
2821          break;
2822        case 101254: // fee
2823          this.fee = castToMoney(value); // Money
2824          break;
2825        case -231349275: // adjudication
2826          this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); // AddedItemDetailAdjudicationComponent
2827          break;
2828        default: super.setProperty(hash, name, value);
2829        }
2830
2831      }
2832
2833      @Override
2834      public void setProperty(String name, Base value) throws FHIRException {
2835        if (name.equals("service"))
2836          this.service = castToCoding(value); // Coding
2837        else if (name.equals("fee"))
2838          this.fee = castToMoney(value); // Money
2839        else if (name.equals("adjudication"))
2840          this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value);
2841        else
2842          super.setProperty(name, value);
2843      }
2844
2845      @Override
2846      public Base makeProperty(int hash, String name) throws FHIRException {
2847        switch (hash) {
2848        case 1984153269:  return getService(); // Coding
2849        case 101254:  return getFee(); // Money
2850        case -231349275:  return addAdjudication(); // AddedItemDetailAdjudicationComponent
2851        default: return super.makeProperty(hash, name);
2852        }
2853
2854      }
2855
2856      @Override
2857      public Base addChild(String name) throws FHIRException {
2858        if (name.equals("service")) {
2859          this.service = new Coding();
2860          return this.service;
2861        }
2862        else if (name.equals("fee")) {
2863          this.fee = new Money();
2864          return this.fee;
2865        }
2866        else if (name.equals("adjudication")) {
2867          return addAdjudication();
2868        }
2869        else
2870          return super.addChild(name);
2871      }
2872
2873      public AddedItemsDetailComponent copy() {
2874        AddedItemsDetailComponent dst = new AddedItemsDetailComponent();
2875        copyValues(dst);
2876        dst.service = service == null ? null : service.copy();
2877        dst.fee = fee == null ? null : fee.copy();
2878        if (adjudication != null) {
2879          dst.adjudication = new ArrayList<AddedItemDetailAdjudicationComponent>();
2880          for (AddedItemDetailAdjudicationComponent i : adjudication)
2881            dst.adjudication.add(i.copy());
2882        };
2883        return dst;
2884      }
2885
2886      @Override
2887      public boolean equalsDeep(Base other) {
2888        if (!super.equalsDeep(other))
2889          return false;
2890        if (!(other instanceof AddedItemsDetailComponent))
2891          return false;
2892        AddedItemsDetailComponent o = (AddedItemsDetailComponent) other;
2893        return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true)
2894          ;
2895      }
2896
2897      @Override
2898      public boolean equalsShallow(Base other) {
2899        if (!super.equalsShallow(other))
2900          return false;
2901        if (!(other instanceof AddedItemsDetailComponent))
2902          return false;
2903        AddedItemsDetailComponent o = (AddedItemsDetailComponent) other;
2904        return true;
2905      }
2906
2907      public boolean isEmpty() {
2908        return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty())
2909           && (adjudication == null || adjudication.isEmpty());
2910      }
2911
2912  public String fhirType() {
2913    return "ClaimResponse.addItem.detail";
2914
2915  }
2916
2917  }
2918
2919    @Block()
2920    public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement {
2921        /**
2922         * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.
2923         */
2924        @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
2925        @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." )
2926        protected Coding category;
2927
2928        /**
2929         * Adjudication reason such as limit reached.
2930         */
2931        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
2932        @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." )
2933        protected Coding reason;
2934
2935        /**
2936         * Monetary amount associated with the code.
2937         */
2938        @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true)
2939        @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." )
2940        protected Money amount;
2941
2942        /**
2943         * A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
2944         */
2945        @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2946        @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." )
2947        protected DecimalType value;
2948
2949        private static final long serialVersionUID = -1926987562L;
2950
2951    /**
2952     * Constructor
2953     */
2954      public AddedItemDetailAdjudicationComponent() {
2955        super();
2956      }
2957
2958    /**
2959     * Constructor
2960     */
2961      public AddedItemDetailAdjudicationComponent(Coding category) {
2962        super();
2963        this.category = category;
2964      }
2965
2966        /**
2967         * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
2968         */
2969        public Coding getCategory() { 
2970          if (this.category == null)
2971            if (Configuration.errorOnAutoCreate())
2972              throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.category");
2973            else if (Configuration.doAutoCreate())
2974              this.category = new Coding(); // cc
2975          return this.category;
2976        }
2977
2978        public boolean hasCategory() { 
2979          return this.category != null && !this.category.isEmpty();
2980        }
2981
2982        /**
2983         * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.)
2984         */
2985        public AddedItemDetailAdjudicationComponent setCategory(Coding value) { 
2986          this.category = value;
2987          return this;
2988        }
2989
2990        /**
2991         * @return {@link #reason} (Adjudication reason such as limit reached.)
2992         */
2993        public Coding getReason() { 
2994          if (this.reason == null)
2995            if (Configuration.errorOnAutoCreate())
2996              throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.reason");
2997            else if (Configuration.doAutoCreate())
2998              this.reason = new Coding(); // cc
2999          return this.reason;
3000        }
3001
3002        public boolean hasReason() { 
3003          return this.reason != null && !this.reason.isEmpty();
3004        }
3005
3006        /**
3007         * @param value {@link #reason} (Adjudication reason such as limit reached.)
3008         */
3009        public AddedItemDetailAdjudicationComponent setReason(Coding value) { 
3010          this.reason = value;
3011          return this;
3012        }
3013
3014        /**
3015         * @return {@link #amount} (Monetary amount associated with the code.)
3016         */
3017        public Money getAmount() { 
3018          if (this.amount == null)
3019            if (Configuration.errorOnAutoCreate())
3020              throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount");
3021            else if (Configuration.doAutoCreate())
3022              this.amount = new Money(); // cc
3023          return this.amount;
3024        }
3025
3026        public boolean hasAmount() { 
3027          return this.amount != null && !this.amount.isEmpty();
3028        }
3029
3030        /**
3031         * @param value {@link #amount} (Monetary amount associated with the code.)
3032         */
3033        public AddedItemDetailAdjudicationComponent setAmount(Money value) { 
3034          this.amount = value;
3035          return this;
3036        }
3037
3038        /**
3039         * @return {@link #value} (A non-monetary value for example a percentage. 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
3040         */
3041        public DecimalType getValueElement() { 
3042          if (this.value == null)
3043            if (Configuration.errorOnAutoCreate())
3044              throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value");
3045            else if (Configuration.doAutoCreate())
3046              this.value = new DecimalType(); // bb
3047          return this.value;
3048        }
3049
3050        public boolean hasValueElement() { 
3051          return this.value != null && !this.value.isEmpty();
3052        }
3053
3054        public boolean hasValue() { 
3055          return this.value != null && !this.value.isEmpty();
3056        }
3057
3058        /**
3059         * @param value {@link #value} (A non-monetary value for example a percentage. 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
3060         */
3061        public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { 
3062          this.value = value;
3063          return this;
3064        }
3065
3066        /**
3067         * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
3068         */
3069        public BigDecimal getValue() { 
3070          return this.value == null ? null : this.value.getValue();
3071        }
3072
3073        /**
3074         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
3075         */
3076        public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { 
3077          if (value == null)
3078            this.value = null;
3079          else {
3080            if (this.value == null)
3081              this.value = new DecimalType();
3082            this.value.setValue(value);
3083          }
3084          return this;
3085        }
3086
3087        /**
3088         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
3089         */
3090        public AddedItemDetailAdjudicationComponent setValue(long value) { 
3091              this.value = new DecimalType();
3092            this.value.setValue(value);
3093          return this;
3094        }
3095
3096        /**
3097         * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above.
3098         */
3099        public AddedItemDetailAdjudicationComponent setValue(double value) { 
3100              this.value = new DecimalType();
3101            this.value.setValue(value);
3102          return this;
3103        }
3104
3105        protected void listChildren(List<Property> childrenList) {
3106          super.listChildren(childrenList);
3107          childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category));
3108          childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason));
3109          childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount));
3110          childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value));
3111        }
3112
3113      @Override
3114      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3115        switch (hash) {
3116        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding
3117        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
3118        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
3119        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType
3120        default: return super.getProperty(hash, name, checkValid);
3121        }
3122
3123      }
3124
3125      @Override
3126      public void setProperty(int hash, String name, Base value) throws FHIRException {
3127        switch (hash) {
3128        case 50511102: // category
3129          this.category = castToCoding(value); // Coding
3130          break;
3131        case -934964668: // reason
3132          this.reason = castToCoding(value); // Coding
3133          break;
3134        case -1413853096: // amount
3135          this.amount = castToMoney(value); // Money
3136          break;
3137        case 111972721: // value
3138          this.value = castToDecimal(value); // DecimalType
3139          break;
3140        default: super.setProperty(hash, name, value);
3141        }
3142
3143      }
3144
3145      @Override
3146      public void setProperty(String name, Base value) throws FHIRException {
3147        if (name.equals("category"))
3148          this.category = castToCoding(value); // Coding
3149        else if (name.equals("reason"))
3150          this.reason = castToCoding(value); // Coding
3151        else if (name.equals("amount"))
3152          this.amount = castToMoney(value); // Money
3153        else if (name.equals("value"))
3154          this.value = castToDecimal(value); // DecimalType
3155        else
3156          super.setProperty(name, value);
3157      }
3158
3159      @Override
3160      public Base makeProperty(int hash, String name) throws FHIRException {
3161        switch (hash) {
3162        case 50511102:  return getCategory(); // Coding
3163        case -934964668:  return getReason(); // Coding
3164        case -1413853096:  return getAmount(); // Money
3165        case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType
3166        default: return super.makeProperty(hash, name);
3167        }
3168
3169      }
3170
3171      @Override
3172      public Base addChild(String name) throws FHIRException {
3173        if (name.equals("category")) {
3174          this.category = new Coding();
3175          return this.category;
3176        }
3177        else if (name.equals("reason")) {
3178          this.reason = new Coding();
3179          return this.reason;
3180        }
3181        else if (name.equals("amount")) {
3182          this.amount = new Money();
3183          return this.amount;
3184        }
3185        else if (name.equals("value")) {
3186          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value");
3187        }
3188        else
3189          return super.addChild(name);
3190      }
3191
3192      public AddedItemDetailAdjudicationComponent copy() {
3193        AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent();
3194        copyValues(dst);
3195        dst.category = category == null ? null : category.copy();
3196        dst.reason = reason == null ? null : reason.copy();
3197        dst.amount = amount == null ? null : amount.copy();
3198        dst.value = value == null ? null : value.copy();
3199        return dst;
3200      }
3201
3202      @Override
3203      public boolean equalsDeep(Base other) {
3204        if (!super.equalsDeep(other))
3205          return false;
3206        if (!(other instanceof AddedItemDetailAdjudicationComponent))
3207          return false;
3208        AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other;
3209        return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true)
3210           && compareDeep(value, o.value, true);
3211      }
3212
3213      @Override
3214      public boolean equalsShallow(Base other) {
3215        if (!super.equalsShallow(other))
3216          return false;
3217        if (!(other instanceof AddedItemDetailAdjudicationComponent))
3218          return false;
3219        AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other;
3220        return compareValues(value, o.value, true);
3221      }
3222
3223      public boolean isEmpty() {
3224        return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty())
3225           && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty());
3226      }
3227
3228  public String fhirType() {
3229    return "ClaimResponse.addItem.detail.adjudication";
3230
3231  }
3232
3233  }
3234
3235    @Block()
3236    public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement {
3237        /**
3238         * The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.
3239         */
3240        @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3241        @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 is elsewhere." )
3242        protected PositiveIntType sequenceLinkId;
3243
3244        /**
3245         * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3246         */
3247        @Child(name = "detailSequenceLinkId", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=true)
3248        @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." )
3249        protected PositiveIntType detailSequenceLinkId;
3250
3251        /**
3252         * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3253         */
3254        @Child(name = "subdetailSequenceLinkId", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3255        @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." )
3256        protected PositiveIntType subdetailSequenceLinkId;
3257
3258        /**
3259         * An error code,from a specified code system, which details why the claim could not be adjudicated.
3260         */
3261        @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1, modifier=false, summary=true)
3262        @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." )
3263        protected Coding code;
3264
3265        private static final long serialVersionUID = -1893641175L;
3266
3267    /**
3268     * Constructor
3269     */
3270      public ErrorsComponent() {
3271        super();
3272      }
3273
3274    /**
3275     * Constructor
3276     */
3277      public ErrorsComponent(Coding code) {
3278        super();
3279        this.code = code;
3280      }
3281
3282        /**
3283         * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
3284         */
3285        public PositiveIntType getSequenceLinkIdElement() { 
3286          if (this.sequenceLinkId == null)
3287            if (Configuration.errorOnAutoCreate())
3288              throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId");
3289            else if (Configuration.doAutoCreate())
3290              this.sequenceLinkId = new PositiveIntType(); // bb
3291          return this.sequenceLinkId;
3292        }
3293
3294        public boolean hasSequenceLinkIdElement() { 
3295          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
3296        }
3297
3298        public boolean hasSequenceLinkId() { 
3299          return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty();
3300        }
3301
3302        /**
3303         * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value
3304         */
3305        public ErrorsComponent setSequenceLinkIdElement(PositiveIntType value) { 
3306          this.sequenceLinkId = value;
3307          return this;
3308        }
3309
3310        /**
3311         * @return The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.
3312         */
3313        public int getSequenceLinkId() { 
3314          return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue();
3315        }
3316
3317        /**
3318         * @param value The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.
3319         */
3320        public ErrorsComponent setSequenceLinkId(int value) { 
3321            if (this.sequenceLinkId == null)
3322              this.sequenceLinkId = new PositiveIntType();
3323            this.sequenceLinkId.setValue(value);
3324          return this;
3325        }
3326
3327        /**
3328         * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value
3329         */
3330        public PositiveIntType getDetailSequenceLinkIdElement() { 
3331          if (this.detailSequenceLinkId == null)
3332            if (Configuration.errorOnAutoCreate())
3333              throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId");
3334            else if (Configuration.doAutoCreate())
3335              this.detailSequenceLinkId = new PositiveIntType(); // bb
3336          return this.detailSequenceLinkId;
3337        }
3338
3339        public boolean hasDetailSequenceLinkIdElement() { 
3340          return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty();
3341        }
3342
3343        public boolean hasDetailSequenceLinkId() { 
3344          return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty();
3345        }
3346
3347        /**
3348         * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value
3349         */
3350        public ErrorsComponent setDetailSequenceLinkIdElement(PositiveIntType value) { 
3351          this.detailSequenceLinkId = value;
3352          return this;
3353        }
3354
3355        /**
3356         * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3357         */
3358        public int getDetailSequenceLinkId() { 
3359          return this.detailSequenceLinkId == null || this.detailSequenceLinkId.isEmpty() ? 0 : this.detailSequenceLinkId.getValue();
3360        }
3361
3362        /**
3363         * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3364         */
3365        public ErrorsComponent setDetailSequenceLinkId(int value) { 
3366            if (this.detailSequenceLinkId == null)
3367              this.detailSequenceLinkId = new PositiveIntType();
3368            this.detailSequenceLinkId.setValue(value);
3369          return this;
3370        }
3371
3372        /**
3373         * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value
3374         */
3375        public PositiveIntType getSubdetailSequenceLinkIdElement() { 
3376          if (this.subdetailSequenceLinkId == null)
3377            if (Configuration.errorOnAutoCreate())
3378              throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId");
3379            else if (Configuration.doAutoCreate())
3380              this.subdetailSequenceLinkId = new PositiveIntType(); // bb
3381          return this.subdetailSequenceLinkId;
3382        }
3383
3384        public boolean hasSubdetailSequenceLinkIdElement() { 
3385          return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty();
3386        }
3387
3388        public boolean hasSubdetailSequenceLinkId() { 
3389          return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty();
3390        }
3391
3392        /**
3393         * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value
3394         */
3395        public ErrorsComponent setSubdetailSequenceLinkIdElement(PositiveIntType value) { 
3396          this.subdetailSequenceLinkId = value;
3397          return this;
3398        }
3399
3400        /**
3401         * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3402         */
3403        public int getSubdetailSequenceLinkId() { 
3404          return this.subdetailSequenceLinkId == null || this.subdetailSequenceLinkId.isEmpty() ? 0 : this.subdetailSequenceLinkId.getValue();
3405        }
3406
3407        /**
3408         * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.
3409         */
3410        public ErrorsComponent setSubdetailSequenceLinkId(int value) { 
3411            if (this.subdetailSequenceLinkId == null)
3412              this.subdetailSequenceLinkId = new PositiveIntType();
3413            this.subdetailSequenceLinkId.setValue(value);
3414          return this;
3415        }
3416
3417        /**
3418         * @return {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.)
3419         */
3420        public Coding getCode() { 
3421          if (this.code == null)
3422            if (Configuration.errorOnAutoCreate())
3423              throw new Error("Attempt to auto-create ErrorsComponent.code");
3424            else if (Configuration.doAutoCreate())
3425              this.code = new Coding(); // cc
3426          return this.code;
3427        }
3428
3429        public boolean hasCode() { 
3430          return this.code != null && !this.code.isEmpty();
3431        }
3432
3433        /**
3434         * @param value {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.)
3435         */
3436        public ErrorsComponent setCode(Coding value) { 
3437          this.code = value;
3438          return this;
3439        }
3440
3441        protected void listChildren(List<Property> childrenList) {
3442          super.listChildren(childrenList);
3443          childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId));
3444          childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId));
3445          childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId));
3446          childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code));
3447        }
3448
3449      @Override
3450      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3451        switch (hash) {
3452        case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType
3453        case 516748423: /*detailSequenceLinkId*/ return this.detailSequenceLinkId == null ? new Base[0] : new Base[] {this.detailSequenceLinkId}; // PositiveIntType
3454        case -1061088569: /*subdetailSequenceLinkId*/ return this.subdetailSequenceLinkId == null ? new Base[0] : new Base[] {this.subdetailSequenceLinkId}; // PositiveIntType
3455        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding
3456        default: return super.getProperty(hash, name, checkValid);
3457        }
3458
3459      }
3460
3461      @Override
3462      public void setProperty(int hash, String name, Base value) throws FHIRException {
3463        switch (hash) {
3464        case -1422298666: // sequenceLinkId
3465          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
3466          break;
3467        case 516748423: // detailSequenceLinkId
3468          this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType
3469          break;
3470        case -1061088569: // subdetailSequenceLinkId
3471          this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType
3472          break;
3473        case 3059181: // code
3474          this.code = castToCoding(value); // Coding
3475          break;
3476        default: super.setProperty(hash, name, value);
3477        }
3478
3479      }
3480
3481      @Override
3482      public void setProperty(String name, Base value) throws FHIRException {
3483        if (name.equals("sequenceLinkId"))
3484          this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType
3485        else if (name.equals("detailSequenceLinkId"))
3486          this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType
3487        else if (name.equals("subdetailSequenceLinkId"))
3488          this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType
3489        else if (name.equals("code"))
3490          this.code = castToCoding(value); // Coding
3491        else
3492          super.setProperty(name, value);
3493      }
3494
3495      @Override
3496      public Base makeProperty(int hash, String name) throws FHIRException {
3497        switch (hash) {
3498        case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType
3499        case 516748423: throw new FHIRException("Cannot make property detailSequenceLinkId as it is not a complex type"); // PositiveIntType
3500        case -1061088569: throw new FHIRException("Cannot make property subdetailSequenceLinkId as it is not a complex type"); // PositiveIntType
3501        case 3059181:  return getCode(); // Coding
3502        default: return super.makeProperty(hash, name);
3503        }
3504
3505      }
3506
3507      @Override
3508      public Base addChild(String name) throws FHIRException {
3509        if (name.equals("sequenceLinkId")) {
3510          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId");
3511        }
3512        else if (name.equals("detailSequenceLinkId")) {
3513          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.detailSequenceLinkId");
3514        }
3515        else if (name.equals("subdetailSequenceLinkId")) {
3516          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.subdetailSequenceLinkId");
3517        }
3518        else if (name.equals("code")) {
3519          this.code = new Coding();
3520          return this.code;
3521        }
3522        else
3523          return super.addChild(name);
3524      }
3525
3526      public ErrorsComponent copy() {
3527        ErrorsComponent dst = new ErrorsComponent();
3528        copyValues(dst);
3529        dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy();
3530        dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy();
3531        dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy();
3532        dst.code = code == null ? null : code.copy();
3533        return dst;
3534      }
3535
3536      @Override
3537      public boolean equalsDeep(Base other) {
3538        if (!super.equalsDeep(other))
3539          return false;
3540        if (!(other instanceof ErrorsComponent))
3541          return false;
3542        ErrorsComponent o = (ErrorsComponent) other;
3543        return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(detailSequenceLinkId, o.detailSequenceLinkId, true)
3544           && compareDeep(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true) && compareDeep(code, o.code, true)
3545          ;
3546      }
3547
3548      @Override
3549      public boolean equalsShallow(Base other) {
3550        if (!super.equalsShallow(other))
3551          return false;
3552        if (!(other instanceof ErrorsComponent))
3553          return false;
3554        ErrorsComponent o = (ErrorsComponent) other;
3555        return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(detailSequenceLinkId, o.detailSequenceLinkId, true)
3556           && compareValues(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true);
3557      }
3558
3559      public boolean isEmpty() {
3560        return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty())
3561           && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty())
3562          ;
3563      }
3564
3565  public String fhirType() {
3566    return "ClaimResponse.error";
3567
3568  }
3569
3570  }
3571
3572    @Block()
3573    public static class NotesComponent extends BackboneElement implements IBaseBackboneElement {
3574        /**
3575         * An integer associated with each note which may be referred to from each service line item.
3576         */
3577        @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3578        @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." )
3579        protected PositiveIntType number;
3580
3581        /**
3582         * The note purpose: Print/Display.
3583         */
3584        @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
3585        @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." )
3586        protected Coding type;
3587
3588        /**
3589         * The note text.
3590         */
3591        @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3592        @Description(shortDefinition="Note explanatory text", formalDefinition="The note text." )
3593        protected StringType text;
3594
3595        private static final long serialVersionUID = 1768923951L;
3596
3597    /**
3598     * Constructor
3599     */
3600      public NotesComponent() {
3601        super();
3602      }
3603
3604        /**
3605         * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
3606         */
3607        public PositiveIntType getNumberElement() { 
3608          if (this.number == null)
3609            if (Configuration.errorOnAutoCreate())
3610              throw new Error("Attempt to auto-create NotesComponent.number");
3611            else if (Configuration.doAutoCreate())
3612              this.number = new PositiveIntType(); // bb
3613          return this.number;
3614        }
3615
3616        public boolean hasNumberElement() { 
3617          return this.number != null && !this.number.isEmpty();
3618        }
3619
3620        public boolean hasNumber() { 
3621          return this.number != null && !this.number.isEmpty();
3622        }
3623
3624        /**
3625         * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value
3626         */
3627        public NotesComponent setNumberElement(PositiveIntType value) { 
3628          this.number = value;
3629          return this;
3630        }
3631
3632        /**
3633         * @return An integer associated with each note which may be referred to from each service line item.
3634         */
3635        public int getNumber() { 
3636          return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue();
3637        }
3638
3639        /**
3640         * @param value An integer associated with each note which may be referred to from each service line item.
3641         */
3642        public NotesComponent setNumber(int value) { 
3643            if (this.number == null)
3644              this.number = new PositiveIntType();
3645            this.number.setValue(value);
3646          return this;
3647        }
3648
3649        /**
3650         * @return {@link #type} (The note purpose: Print/Display.)
3651         */
3652        public Coding getType() { 
3653          if (this.type == null)
3654            if (Configuration.errorOnAutoCreate())
3655              throw new Error("Attempt to auto-create NotesComponent.type");
3656            else if (Configuration.doAutoCreate())
3657              this.type = new Coding(); // cc
3658          return this.type;
3659        }
3660
3661        public boolean hasType() { 
3662          return this.type != null && !this.type.isEmpty();
3663        }
3664
3665        /**
3666         * @param value {@link #type} (The note purpose: Print/Display.)
3667         */
3668        public NotesComponent setType(Coding value) { 
3669          this.type = value;
3670          return this;
3671        }
3672
3673        /**
3674         * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3675         */
3676        public StringType getTextElement() { 
3677          if (this.text == null)
3678            if (Configuration.errorOnAutoCreate())
3679              throw new Error("Attempt to auto-create NotesComponent.text");
3680            else if (Configuration.doAutoCreate())
3681              this.text = new StringType(); // bb
3682          return this.text;
3683        }
3684
3685        public boolean hasTextElement() { 
3686          return this.text != null && !this.text.isEmpty();
3687        }
3688
3689        public boolean hasText() { 
3690          return this.text != null && !this.text.isEmpty();
3691        }
3692
3693        /**
3694         * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value
3695         */
3696        public NotesComponent setTextElement(StringType value) { 
3697          this.text = value;
3698          return this;
3699        }
3700
3701        /**
3702         * @return The note text.
3703         */
3704        public String getText() { 
3705          return this.text == null ? null : this.text.getValue();
3706        }
3707
3708        /**
3709         * @param value The note text.
3710         */
3711        public NotesComponent setText(String value) { 
3712          if (Utilities.noString(value))
3713            this.text = null;
3714          else {
3715            if (this.text == null)
3716              this.text = new StringType();
3717            this.text.setValue(value);
3718          }
3719          return this;
3720        }
3721
3722        protected void listChildren(List<Property> childrenList) {
3723          super.listChildren(childrenList);
3724          childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number));
3725          childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type));
3726          childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text));
3727        }
3728
3729      @Override
3730      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3731        switch (hash) {
3732        case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType
3733        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
3734        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
3735        default: return super.getProperty(hash, name, checkValid);
3736        }
3737
3738      }
3739
3740      @Override
3741      public void setProperty(int hash, String name, Base value) throws FHIRException {
3742        switch (hash) {
3743        case -1034364087: // number
3744          this.number = castToPositiveInt(value); // PositiveIntType
3745          break;
3746        case 3575610: // type
3747          this.type = castToCoding(value); // Coding
3748          break;
3749        case 3556653: // text
3750          this.text = castToString(value); // StringType
3751          break;
3752        default: super.setProperty(hash, name, value);
3753        }
3754
3755      }
3756
3757      @Override
3758      public void setProperty(String name, Base value) throws FHIRException {
3759        if (name.equals("number"))
3760          this.number = castToPositiveInt(value); // PositiveIntType
3761        else if (name.equals("type"))
3762          this.type = castToCoding(value); // Coding
3763        else if (name.equals("text"))
3764          this.text = castToString(value); // StringType
3765        else
3766          super.setProperty(name, value);
3767      }
3768
3769      @Override
3770      public Base makeProperty(int hash, String name) throws FHIRException {
3771        switch (hash) {
3772        case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType
3773        case 3575610:  return getType(); // Coding
3774        case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType
3775        default: return super.makeProperty(hash, name);
3776        }
3777
3778      }
3779
3780      @Override
3781      public Base addChild(String name) throws FHIRException {
3782        if (name.equals("number")) {
3783          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.number");
3784        }
3785        else if (name.equals("type")) {
3786          this.type = new Coding();
3787          return this.type;
3788        }
3789        else if (name.equals("text")) {
3790          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.text");
3791        }
3792        else
3793          return super.addChild(name);
3794      }
3795
3796      public NotesComponent copy() {
3797        NotesComponent dst = new NotesComponent();
3798        copyValues(dst);
3799        dst.number = number == null ? null : number.copy();
3800        dst.type = type == null ? null : type.copy();
3801        dst.text = text == null ? null : text.copy();
3802        return dst;
3803      }
3804
3805      @Override
3806      public boolean equalsDeep(Base other) {
3807        if (!super.equalsDeep(other))
3808          return false;
3809        if (!(other instanceof NotesComponent))
3810          return false;
3811        NotesComponent o = (NotesComponent) other;
3812        return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true)
3813          ;
3814      }
3815
3816      @Override
3817      public boolean equalsShallow(Base other) {
3818        if (!super.equalsShallow(other))
3819          return false;
3820        if (!(other instanceof NotesComponent))
3821          return false;
3822        NotesComponent o = (NotesComponent) other;
3823        return compareValues(number, o.number, true) && compareValues(text, o.text, true);
3824      }
3825
3826      public boolean isEmpty() {
3827        return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty())
3828           && (text == null || text.isEmpty());
3829      }
3830
3831  public String fhirType() {
3832    return "ClaimResponse.note";
3833
3834  }
3835
3836  }
3837
3838    @Block()
3839    public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement {
3840        /**
3841         * A service line item.
3842         */
3843        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3844        @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." )
3845        protected PositiveIntType sequence;
3846
3847        /**
3848         * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
3849         */
3850        @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true)
3851        @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." )
3852        protected BooleanType focal;
3853
3854        /**
3855         * Reference to the program or plan identification, underwriter or payor.
3856         */
3857        @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true)
3858        @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." )
3859        protected Type coverage;
3860
3861        /**
3862         * The contract number of a business agreement which describes the terms and conditions.
3863         */
3864        @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
3865        @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." )
3866        protected StringType businessArrangement;
3867
3868        /**
3869         * A list of references from the Insurer to which these services pertain.
3870         */
3871        @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3872        @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." )
3873        protected List<StringType> preAuthRef;
3874
3875        /**
3876         * The Coverages adjudication details.
3877         */
3878        @Child(name = "claimResponse", type = {ClaimResponse.class}, order=6, min=0, max=1, modifier=false, summary=true)
3879        @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." )
3880        protected Reference claimResponse;
3881
3882        /**
3883         * The actual object that is the target of the reference (The Coverages adjudication details.)
3884         */
3885        protected ClaimResponse claimResponseTarget;
3886
3887        private static final long serialVersionUID = -1151494539L;
3888
3889    /**
3890     * Constructor
3891     */
3892      public CoverageComponent() {
3893        super();
3894      }
3895
3896    /**
3897     * Constructor
3898     */
3899      public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) {
3900        super();
3901        this.sequence = sequence;
3902        this.focal = focal;
3903        this.coverage = coverage;
3904      }
3905
3906        /**
3907         * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
3908         */
3909        public PositiveIntType getSequenceElement() { 
3910          if (this.sequence == null)
3911            if (Configuration.errorOnAutoCreate())
3912              throw new Error("Attempt to auto-create CoverageComponent.sequence");
3913            else if (Configuration.doAutoCreate())
3914              this.sequence = new PositiveIntType(); // bb
3915          return this.sequence;
3916        }
3917
3918        public boolean hasSequenceElement() { 
3919          return this.sequence != null && !this.sequence.isEmpty();
3920        }
3921
3922        public boolean hasSequence() { 
3923          return this.sequence != null && !this.sequence.isEmpty();
3924        }
3925
3926        /**
3927         * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
3928         */
3929        public CoverageComponent setSequenceElement(PositiveIntType value) { 
3930          this.sequence = value;
3931          return this;
3932        }
3933
3934        /**
3935         * @return A service line item.
3936         */
3937        public int getSequence() { 
3938          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
3939        }
3940
3941        /**
3942         * @param value A service line item.
3943         */
3944        public CoverageComponent setSequence(int value) { 
3945            if (this.sequence == null)
3946              this.sequence = new PositiveIntType();
3947            this.sequence.setValue(value);
3948          return this;
3949        }
3950
3951        /**
3952         * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
3953         */
3954        public BooleanType getFocalElement() { 
3955          if (this.focal == null)
3956            if (Configuration.errorOnAutoCreate())
3957              throw new Error("Attempt to auto-create CoverageComponent.focal");
3958            else if (Configuration.doAutoCreate())
3959              this.focal = new BooleanType(); // bb
3960          return this.focal;
3961        }
3962
3963        public boolean hasFocalElement() { 
3964          return this.focal != null && !this.focal.isEmpty();
3965        }
3966
3967        public boolean hasFocal() { 
3968          return this.focal != null && !this.focal.isEmpty();
3969        }
3970
3971        /**
3972         * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
3973         */
3974        public CoverageComponent setFocalElement(BooleanType value) { 
3975          this.focal = value;
3976          return this;
3977        }
3978
3979        /**
3980         * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
3981         */
3982        public boolean getFocal() { 
3983          return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue();
3984        }
3985
3986        /**
3987         * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
3988         */
3989        public CoverageComponent setFocal(boolean value) { 
3990            if (this.focal == null)
3991              this.focal = new BooleanType();
3992            this.focal.setValue(value);
3993          return this;
3994        }
3995
3996        /**
3997         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
3998         */
3999        public Type getCoverage() { 
4000          return this.coverage;
4001        }
4002
4003        /**
4004         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
4005         */
4006        public Identifier getCoverageIdentifier() throws FHIRException { 
4007          if (!(this.coverage instanceof Identifier))
4008            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered");
4009          return (Identifier) this.coverage;
4010        }
4011
4012        public boolean hasCoverageIdentifier() { 
4013          return this.coverage instanceof Identifier;
4014        }
4015
4016        /**
4017         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
4018         */
4019        public Reference getCoverageReference() throws FHIRException { 
4020          if (!(this.coverage instanceof Reference))
4021            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered");
4022          return (Reference) this.coverage;
4023        }
4024
4025        public boolean hasCoverageReference() { 
4026          return this.coverage instanceof Reference;
4027        }
4028
4029        public boolean hasCoverage() { 
4030          return this.coverage != null && !this.coverage.isEmpty();
4031        }
4032
4033        /**
4034         * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
4035         */
4036        public CoverageComponent setCoverage(Type value) { 
4037          this.coverage = value;
4038          return this;
4039        }
4040
4041        /**
4042         * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
4043         */
4044        public StringType getBusinessArrangementElement() { 
4045          if (this.businessArrangement == null)
4046            if (Configuration.errorOnAutoCreate())
4047              throw new Error("Attempt to auto-create CoverageComponent.businessArrangement");
4048            else if (Configuration.doAutoCreate())
4049              this.businessArrangement = new StringType(); // bb
4050          return this.businessArrangement;
4051        }
4052
4053        public boolean hasBusinessArrangementElement() { 
4054          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
4055        }
4056
4057        public boolean hasBusinessArrangement() { 
4058          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
4059        }
4060
4061        /**
4062         * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
4063         */
4064        public CoverageComponent setBusinessArrangementElement(StringType value) { 
4065          this.businessArrangement = value;
4066          return this;
4067        }
4068
4069        /**
4070         * @return The contract number of a business agreement which describes the terms and conditions.
4071         */
4072        public String getBusinessArrangement() { 
4073          return this.businessArrangement == null ? null : this.businessArrangement.getValue();
4074        }
4075
4076        /**
4077         * @param value The contract number of a business agreement which describes the terms and conditions.
4078         */
4079        public CoverageComponent setBusinessArrangement(String value) { 
4080          if (Utilities.noString(value))
4081            this.businessArrangement = null;
4082          else {
4083            if (this.businessArrangement == null)
4084              this.businessArrangement = new StringType();
4085            this.businessArrangement.setValue(value);
4086          }
4087          return this;
4088        }
4089
4090        /**
4091         * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
4092         */
4093        public List<StringType> getPreAuthRef() { 
4094          if (this.preAuthRef == null)
4095            this.preAuthRef = new ArrayList<StringType>();
4096          return this.preAuthRef;
4097        }
4098
4099        public boolean hasPreAuthRef() { 
4100          if (this.preAuthRef == null)
4101            return false;
4102          for (StringType item : this.preAuthRef)
4103            if (!item.isEmpty())
4104              return true;
4105          return false;
4106        }
4107
4108        /**
4109         * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
4110         */
4111    // syntactic sugar
4112        public StringType addPreAuthRefElement() {//2 
4113          StringType t = new StringType();
4114          if (this.preAuthRef == null)
4115            this.preAuthRef = new ArrayList<StringType>();
4116          this.preAuthRef.add(t);
4117          return t;
4118        }
4119
4120        /**
4121         * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
4122         */
4123        public CoverageComponent addPreAuthRef(String value) { //1
4124          StringType t = new StringType();
4125          t.setValue(value);
4126          if (this.preAuthRef == null)
4127            this.preAuthRef = new ArrayList<StringType>();
4128          this.preAuthRef.add(t);
4129          return this;
4130        }
4131
4132        /**
4133         * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
4134         */
4135        public boolean hasPreAuthRef(String value) { 
4136          if (this.preAuthRef == null)
4137            return false;
4138          for (StringType v : this.preAuthRef)
4139            if (v.equals(value)) // string
4140              return true;
4141          return false;
4142        }
4143
4144        /**
4145         * @return {@link #claimResponse} (The Coverages adjudication details.)
4146         */
4147        public Reference getClaimResponse() { 
4148          if (this.claimResponse == null)
4149            if (Configuration.errorOnAutoCreate())
4150              throw new Error("Attempt to auto-create CoverageComponent.claimResponse");
4151            else if (Configuration.doAutoCreate())
4152              this.claimResponse = new Reference(); // cc
4153          return this.claimResponse;
4154        }
4155
4156        public boolean hasClaimResponse() { 
4157          return this.claimResponse != null && !this.claimResponse.isEmpty();
4158        }
4159
4160        /**
4161         * @param value {@link #claimResponse} (The Coverages adjudication details.)
4162         */
4163        public CoverageComponent setClaimResponse(Reference value) { 
4164          this.claimResponse = value;
4165          return this;
4166        }
4167
4168        /**
4169         * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.)
4170         */
4171        public ClaimResponse getClaimResponseTarget() { 
4172          if (this.claimResponseTarget == null)
4173            if (Configuration.errorOnAutoCreate())
4174              throw new Error("Attempt to auto-create CoverageComponent.claimResponse");
4175            else if (Configuration.doAutoCreate())
4176              this.claimResponseTarget = new ClaimResponse(); // aa
4177          return this.claimResponseTarget;
4178        }
4179
4180        /**
4181         * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.)
4182         */
4183        public CoverageComponent setClaimResponseTarget(ClaimResponse value) { 
4184          this.claimResponseTarget = value;
4185          return this;
4186        }
4187
4188        protected void listChildren(List<Property> childrenList) {
4189          super.listChildren(childrenList);
4190          childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence));
4191          childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal));
4192          childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage));
4193          childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement));
4194          childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef));
4195          childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse));
4196        }
4197
4198      @Override
4199      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4200        switch (hash) {
4201        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
4202        case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType
4203        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type
4204        case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
4205        case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType
4206        case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference
4207        default: return super.getProperty(hash, name, checkValid);
4208        }
4209
4210      }
4211
4212      @Override
4213      public void setProperty(int hash, String name, Base value) throws FHIRException {
4214        switch (hash) {
4215        case 1349547969: // sequence
4216          this.sequence = castToPositiveInt(value); // PositiveIntType
4217          break;
4218        case 97604197: // focal
4219          this.focal = castToBoolean(value); // BooleanType
4220          break;
4221        case -351767064: // coverage
4222          this.coverage = (Type) value; // Type
4223          break;
4224        case 259920682: // businessArrangement
4225          this.businessArrangement = castToString(value); // StringType
4226          break;
4227        case 522246568: // preAuthRef
4228          this.getPreAuthRef().add(castToString(value)); // StringType
4229          break;
4230        case 689513629: // claimResponse
4231          this.claimResponse = castToReference(value); // Reference
4232          break;
4233        default: super.setProperty(hash, name, value);
4234        }
4235
4236      }
4237
4238      @Override
4239      public void setProperty(String name, Base value) throws FHIRException {
4240        if (name.equals("sequence"))
4241          this.sequence = castToPositiveInt(value); // PositiveIntType
4242        else if (name.equals("focal"))
4243          this.focal = castToBoolean(value); // BooleanType
4244        else if (name.equals("coverage[x]"))
4245          this.coverage = (Type) value; // Type
4246        else if (name.equals("businessArrangement"))
4247          this.businessArrangement = castToString(value); // StringType
4248        else if (name.equals("preAuthRef"))
4249          this.getPreAuthRef().add(castToString(value));
4250        else if (name.equals("claimResponse"))
4251          this.claimResponse = castToReference(value); // Reference
4252        else
4253          super.setProperty(name, value);
4254      }
4255
4256      @Override
4257      public Base makeProperty(int hash, String name) throws FHIRException {
4258        switch (hash) {
4259        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
4260        case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType
4261        case 227689880:  return getCoverage(); // Type
4262        case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType
4263        case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType
4264        case 689513629:  return getClaimResponse(); // Reference
4265        default: return super.makeProperty(hash, name);
4266        }
4267
4268      }
4269
4270      @Override
4271      public Base addChild(String name) throws FHIRException {
4272        if (name.equals("sequence")) {
4273          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequence");
4274        }
4275        else if (name.equals("focal")) {
4276          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.focal");
4277        }
4278        else if (name.equals("coverageIdentifier")) {
4279          this.coverage = new Identifier();
4280          return this.coverage;
4281        }
4282        else if (name.equals("coverageReference")) {
4283          this.coverage = new Reference();
4284          return this.coverage;
4285        }
4286        else if (name.equals("businessArrangement")) {
4287          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.businessArrangement");
4288        }
4289        else if (name.equals("preAuthRef")) {
4290          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.preAuthRef");
4291        }
4292        else if (name.equals("claimResponse")) {
4293          this.claimResponse = new Reference();
4294          return this.claimResponse;
4295        }
4296        else
4297          return super.addChild(name);
4298      }
4299
4300      public CoverageComponent copy() {
4301        CoverageComponent dst = new CoverageComponent();
4302        copyValues(dst);
4303        dst.sequence = sequence == null ? null : sequence.copy();
4304        dst.focal = focal == null ? null : focal.copy();
4305        dst.coverage = coverage == null ? null : coverage.copy();
4306        dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
4307        if (preAuthRef != null) {
4308          dst.preAuthRef = new ArrayList<StringType>();
4309          for (StringType i : preAuthRef)
4310            dst.preAuthRef.add(i.copy());
4311        };
4312        dst.claimResponse = claimResponse == null ? null : claimResponse.copy();
4313        return dst;
4314      }
4315
4316      @Override
4317      public boolean equalsDeep(Base other) {
4318        if (!super.equalsDeep(other))
4319          return false;
4320        if (!(other instanceof CoverageComponent))
4321          return false;
4322        CoverageComponent o = (CoverageComponent) other;
4323        return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true)
4324           && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true)
4325           && compareDeep(claimResponse, o.claimResponse, true);
4326      }
4327
4328      @Override
4329      public boolean equalsShallow(Base other) {
4330        if (!super.equalsShallow(other))
4331          return false;
4332        if (!(other instanceof CoverageComponent))
4333          return false;
4334        CoverageComponent o = (CoverageComponent) other;
4335        return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true)
4336           && compareValues(preAuthRef, o.preAuthRef, true);
4337      }
4338
4339      public boolean isEmpty() {
4340        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty())
4341           && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty())
4342           && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty())
4343          ;
4344      }
4345
4346  public String fhirType() {
4347    return "ClaimResponse.coverage";
4348
4349  }
4350
4351  }
4352
4353    /**
4354     * The Response business identifier.
4355     */
4356    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4357    @Description(shortDefinition="Response  number", formalDefinition="The Response business identifier." )
4358    protected List<Identifier> identifier;
4359
4360    /**
4361     * Original request resource referrence.
4362     */
4363    @Child(name = "request", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true)
4364    @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." )
4365    protected Type request;
4366
4367    /**
4368     * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.
4369     */
4370    @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
4371    @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." )
4372    protected Coding ruleset;
4373
4374    /**
4375     * The style (standard) and version of the original material which was converted into this resource.
4376     */
4377    @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true)
4378    @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
4379    protected Coding originalRuleset;
4380
4381    /**
4382     * The date when the enclosed suite of services were performed or completed.
4383     */
4384    @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
4385    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
4386    protected DateTimeType created;
4387
4388    /**
4389     * The Insurer who produced this adjudicated response.
4390     */
4391    @Child(name = "organization", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true)
4392    @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." )
4393    protected Type organization;
4394
4395    /**
4396     * The practitioner who is responsible for the services rendered to the patient.
4397     */
4398    @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true)
4399    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
4400    protected Type requestProvider;
4401
4402    /**
4403     * The organization which is responsible for the services rendered to the patient.
4404     */
4405    @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
4406    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
4407    protected Type requestOrganization;
4408
4409    /**
4410     * Transaction status: error, complete.
4411     */
4412    @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4413    @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." )
4414    protected Enumeration<RemittanceOutcome> outcome;
4415
4416    /**
4417     * A description of the status of the adjudication.
4418     */
4419    @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
4420    @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." )
4421    protected StringType disposition;
4422
4423    /**
4424     * Party to be reimbursed: Subscriber, provider, other.
4425     */
4426    @Child(name = "payeeType", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=true)
4427    @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." )
4428    protected Coding payeeType;
4429
4430    /**
4431     * The first tier service adjudications for submitted services.
4432     */
4433    @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4434    @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." )
4435    protected List<ItemsComponent> item;
4436
4437    /**
4438     * The first tier service adjudications for payor added services.
4439     */
4440    @Child(name = "addItem", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4441    @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." )
4442    protected List<AddedItemComponent> addItem;
4443
4444    /**
4445     * Mutually exclusive with Services Provided (Item).
4446     */
4447    @Child(name = "error", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4448    @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." )
4449    protected List<ErrorsComponent> error;
4450
4451    /**
4452     * The total cost of the services reported.
4453     */
4454    @Child(name = "totalCost", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true)
4455    @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." )
4456    protected Money totalCost;
4457
4458    /**
4459     * The amount of deductible applied which was not allocated to any particular service line.
4460     */
4461    @Child(name = "unallocDeductable", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=true)
4462    @Description(shortDefinition="Unallocated deductible", formalDefinition="The amount of deductible applied which was not allocated to any particular service line." )
4463    protected Money unallocDeductable;
4464
4465    /**
4466     * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).
4467     */
4468    @Child(name = "totalBenefit", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=true)
4469    @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible)." )
4470    protected Money totalBenefit;
4471
4472    /**
4473     * Adjustment to the payment of this transaction which is not related to adjudication of this transaction.
4474     */
4475    @Child(name = "paymentAdjustment", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true)
4476    @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." )
4477    protected Money paymentAdjustment;
4478
4479    /**
4480     * Reason for the payment adjustment.
4481     */
4482    @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=18, min=0, max=1, modifier=false, summary=true)
4483    @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." )
4484    protected Coding paymentAdjustmentReason;
4485
4486    /**
4487     * Estimated payment data.
4488     */
4489    @Child(name = "paymentDate", type = {DateType.class}, order=19, min=0, max=1, modifier=false, summary=true)
4490    @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." )
4491    protected DateType paymentDate;
4492
4493    /**
4494     * Payable less any payment adjustment.
4495     */
4496    @Child(name = "paymentAmount", type = {Money.class}, order=20, min=0, max=1, modifier=false, summary=true)
4497    @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." )
4498    protected Money paymentAmount;
4499
4500    /**
4501     * Payment identifier.
4502     */
4503    @Child(name = "paymentRef", type = {Identifier.class}, order=21, min=0, max=1, modifier=false, summary=true)
4504    @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifier." )
4505    protected Identifier paymentRef;
4506
4507    /**
4508     * Status of funds reservation (For provider, for Patient, None).
4509     */
4510    @Child(name = "reserved", type = {Coding.class}, order=22, min=0, max=1, modifier=false, summary=true)
4511    @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." )
4512    protected Coding reserved;
4513
4514    /**
4515     * The form to be used for printing the content.
4516     */
4517    @Child(name = "form", type = {Coding.class}, order=23, min=0, max=1, modifier=false, summary=true)
4518    @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." )
4519    protected Coding form;
4520
4521    /**
4522     * Note text.
4523     */
4524    @Child(name = "note", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4525    @Description(shortDefinition="Processing notes", formalDefinition="Note text." )
4526    protected List<NotesComponent> note;
4527
4528    /**
4529     * Financial instrument by which payment information for health care.
4530     */
4531    @Child(name = "coverage", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4532    @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." )
4533    protected List<CoverageComponent> coverage;
4534
4535    private static final long serialVersionUID = 1381594471L;
4536
4537  /**
4538   * Constructor
4539   */
4540    public ClaimResponse() {
4541      super();
4542    }
4543
4544    /**
4545     * @return {@link #identifier} (The Response business identifier.)
4546     */
4547    public List<Identifier> getIdentifier() { 
4548      if (this.identifier == null)
4549        this.identifier = new ArrayList<Identifier>();
4550      return this.identifier;
4551    }
4552
4553    public boolean hasIdentifier() { 
4554      if (this.identifier == null)
4555        return false;
4556      for (Identifier item : this.identifier)
4557        if (!item.isEmpty())
4558          return true;
4559      return false;
4560    }
4561
4562    /**
4563     * @return {@link #identifier} (The Response business identifier.)
4564     */
4565    // syntactic sugar
4566    public Identifier addIdentifier() { //3
4567      Identifier t = new Identifier();
4568      if (this.identifier == null)
4569        this.identifier = new ArrayList<Identifier>();
4570      this.identifier.add(t);
4571      return t;
4572    }
4573
4574    // syntactic sugar
4575    public ClaimResponse addIdentifier(Identifier t) { //3
4576      if (t == null)
4577        return this;
4578      if (this.identifier == null)
4579        this.identifier = new ArrayList<Identifier>();
4580      this.identifier.add(t);
4581      return this;
4582    }
4583
4584    /**
4585     * @return {@link #request} (Original request resource referrence.)
4586     */
4587    public Type getRequest() { 
4588      return this.request;
4589    }
4590
4591    /**
4592     * @return {@link #request} (Original request resource referrence.)
4593     */
4594    public Identifier getRequestIdentifier() throws FHIRException { 
4595      if (!(this.request instanceof Identifier))
4596        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered");
4597      return (Identifier) this.request;
4598    }
4599
4600    public boolean hasRequestIdentifier() { 
4601      return this.request instanceof Identifier;
4602    }
4603
4604    /**
4605     * @return {@link #request} (Original request resource referrence.)
4606     */
4607    public Reference getRequestReference() throws FHIRException { 
4608      if (!(this.request instanceof Reference))
4609        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered");
4610      return (Reference) this.request;
4611    }
4612
4613    public boolean hasRequestReference() { 
4614      return this.request instanceof Reference;
4615    }
4616
4617    public boolean hasRequest() { 
4618      return this.request != null && !this.request.isEmpty();
4619    }
4620
4621    /**
4622     * @param value {@link #request} (Original request resource referrence.)
4623     */
4624    public ClaimResponse setRequest(Type value) { 
4625      this.request = value;
4626      return this;
4627    }
4628
4629    /**
4630     * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
4631     */
4632    public Coding getRuleset() { 
4633      if (this.ruleset == null)
4634        if (Configuration.errorOnAutoCreate())
4635          throw new Error("Attempt to auto-create ClaimResponse.ruleset");
4636        else if (Configuration.doAutoCreate())
4637          this.ruleset = new Coding(); // cc
4638      return this.ruleset;
4639    }
4640
4641    public boolean hasRuleset() { 
4642      return this.ruleset != null && !this.ruleset.isEmpty();
4643    }
4644
4645    /**
4646     * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
4647     */
4648    public ClaimResponse setRuleset(Coding value) { 
4649      this.ruleset = value;
4650      return this;
4651    }
4652
4653    /**
4654     * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
4655     */
4656    public Coding getOriginalRuleset() { 
4657      if (this.originalRuleset == null)
4658        if (Configuration.errorOnAutoCreate())
4659          throw new Error("Attempt to auto-create ClaimResponse.originalRuleset");
4660        else if (Configuration.doAutoCreate())
4661          this.originalRuleset = new Coding(); // cc
4662      return this.originalRuleset;
4663    }
4664
4665    public boolean hasOriginalRuleset() { 
4666      return this.originalRuleset != null && !this.originalRuleset.isEmpty();
4667    }
4668
4669    /**
4670     * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
4671     */
4672    public ClaimResponse setOriginalRuleset(Coding value) { 
4673      this.originalRuleset = value;
4674      return this;
4675    }
4676
4677    /**
4678     * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
4679     */
4680    public DateTimeType getCreatedElement() { 
4681      if (this.created == null)
4682        if (Configuration.errorOnAutoCreate())
4683          throw new Error("Attempt to auto-create ClaimResponse.created");
4684        else if (Configuration.doAutoCreate())
4685          this.created = new DateTimeType(); // bb
4686      return this.created;
4687    }
4688
4689    public boolean hasCreatedElement() { 
4690      return this.created != null && !this.created.isEmpty();
4691    }
4692
4693    public boolean hasCreated() { 
4694      return this.created != null && !this.created.isEmpty();
4695    }
4696
4697    /**
4698     * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
4699     */
4700    public ClaimResponse setCreatedElement(DateTimeType value) { 
4701      this.created = value;
4702      return this;
4703    }
4704
4705    /**
4706     * @return The date when the enclosed suite of services were performed or completed.
4707     */
4708    public Date getCreated() { 
4709      return this.created == null ? null : this.created.getValue();
4710    }
4711
4712    /**
4713     * @param value The date when the enclosed suite of services were performed or completed.
4714     */
4715    public ClaimResponse setCreated(Date value) { 
4716      if (value == null)
4717        this.created = null;
4718      else {
4719        if (this.created == null)
4720          this.created = new DateTimeType();
4721        this.created.setValue(value);
4722      }
4723      return this;
4724    }
4725
4726    /**
4727     * @return {@link #organization} (The Insurer who produced this adjudicated response.)
4728     */
4729    public Type getOrganization() { 
4730      return this.organization;
4731    }
4732
4733    /**
4734     * @return {@link #organization} (The Insurer who produced this adjudicated response.)
4735     */
4736    public Identifier getOrganizationIdentifier() throws FHIRException { 
4737      if (!(this.organization instanceof Identifier))
4738        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered");
4739      return (Identifier) this.organization;
4740    }
4741
4742    public boolean hasOrganizationIdentifier() { 
4743      return this.organization instanceof Identifier;
4744    }
4745
4746    /**
4747     * @return {@link #organization} (The Insurer who produced this adjudicated response.)
4748     */
4749    public Reference getOrganizationReference() throws FHIRException { 
4750      if (!(this.organization instanceof Reference))
4751        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered");
4752      return (Reference) this.organization;
4753    }
4754
4755    public boolean hasOrganizationReference() { 
4756      return this.organization instanceof Reference;
4757    }
4758
4759    public boolean hasOrganization() { 
4760      return this.organization != null && !this.organization.isEmpty();
4761    }
4762
4763    /**
4764     * @param value {@link #organization} (The Insurer who produced this adjudicated response.)
4765     */
4766    public ClaimResponse setOrganization(Type value) { 
4767      this.organization = value;
4768      return this;
4769    }
4770
4771    /**
4772     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
4773     */
4774    public Type getRequestProvider() { 
4775      return this.requestProvider;
4776    }
4777
4778    /**
4779     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
4780     */
4781    public Identifier getRequestProviderIdentifier() throws FHIRException { 
4782      if (!(this.requestProvider instanceof Identifier))
4783        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered");
4784      return (Identifier) this.requestProvider;
4785    }
4786
4787    public boolean hasRequestProviderIdentifier() { 
4788      return this.requestProvider instanceof Identifier;
4789    }
4790
4791    /**
4792     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
4793     */
4794    public Reference getRequestProviderReference() throws FHIRException { 
4795      if (!(this.requestProvider instanceof Reference))
4796        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered");
4797      return (Reference) this.requestProvider;
4798    }
4799
4800    public boolean hasRequestProviderReference() { 
4801      return this.requestProvider instanceof Reference;
4802    }
4803
4804    public boolean hasRequestProvider() { 
4805      return this.requestProvider != null && !this.requestProvider.isEmpty();
4806    }
4807
4808    /**
4809     * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
4810     */
4811    public ClaimResponse setRequestProvider(Type value) { 
4812      this.requestProvider = value;
4813      return this;
4814    }
4815
4816    /**
4817     * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
4818     */
4819    public Type getRequestOrganization() { 
4820      return this.requestOrganization;
4821    }
4822
4823    /**
4824     * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
4825     */
4826    public Identifier getRequestOrganizationIdentifier() throws FHIRException { 
4827      if (!(this.requestOrganization instanceof Identifier))
4828        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered");
4829      return (Identifier) this.requestOrganization;
4830    }
4831
4832    public boolean hasRequestOrganizationIdentifier() { 
4833      return this.requestOrganization instanceof Identifier;
4834    }
4835
4836    /**
4837     * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
4838     */
4839    public Reference getRequestOrganizationReference() throws FHIRException { 
4840      if (!(this.requestOrganization instanceof Reference))
4841        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered");
4842      return (Reference) this.requestOrganization;
4843    }
4844
4845    public boolean hasRequestOrganizationReference() { 
4846      return this.requestOrganization instanceof Reference;
4847    }
4848
4849    public boolean hasRequestOrganization() { 
4850      return this.requestOrganization != null && !this.requestOrganization.isEmpty();
4851    }
4852
4853    /**
4854     * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
4855     */
4856    public ClaimResponse setRequestOrganization(Type value) { 
4857      this.requestOrganization = value;
4858      return this;
4859    }
4860
4861    /**
4862     * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
4863     */
4864    public Enumeration<RemittanceOutcome> getOutcomeElement() { 
4865      if (this.outcome == null)
4866        if (Configuration.errorOnAutoCreate())
4867          throw new Error("Attempt to auto-create ClaimResponse.outcome");
4868        else if (Configuration.doAutoCreate())
4869          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
4870      return this.outcome;
4871    }
4872
4873    public boolean hasOutcomeElement() { 
4874      return this.outcome != null && !this.outcome.isEmpty();
4875    }
4876
4877    public boolean hasOutcome() { 
4878      return this.outcome != null && !this.outcome.isEmpty();
4879    }
4880
4881    /**
4882     * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
4883     */
4884    public ClaimResponse setOutcomeElement(Enumeration<RemittanceOutcome> value) { 
4885      this.outcome = value;
4886      return this;
4887    }
4888
4889    /**
4890     * @return Transaction status: error, complete.
4891     */
4892    public RemittanceOutcome getOutcome() { 
4893      return this.outcome == null ? null : this.outcome.getValue();
4894    }
4895
4896    /**
4897     * @param value Transaction status: error, complete.
4898     */
4899    public ClaimResponse setOutcome(RemittanceOutcome value) { 
4900      if (value == null)
4901        this.outcome = null;
4902      else {
4903        if (this.outcome == null)
4904          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
4905        this.outcome.setValue(value);
4906      }
4907      return this;
4908    }
4909
4910    /**
4911     * @return {@link #disposition} (A 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
4912     */
4913    public StringType getDispositionElement() { 
4914      if (this.disposition == null)
4915        if (Configuration.errorOnAutoCreate())
4916          throw new Error("Attempt to auto-create ClaimResponse.disposition");
4917        else if (Configuration.doAutoCreate())
4918          this.disposition = new StringType(); // bb
4919      return this.disposition;
4920    }
4921
4922    public boolean hasDispositionElement() { 
4923      return this.disposition != null && !this.disposition.isEmpty();
4924    }
4925
4926    public boolean hasDisposition() { 
4927      return this.disposition != null && !this.disposition.isEmpty();
4928    }
4929
4930    /**
4931     * @param value {@link #disposition} (A 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
4932     */
4933    public ClaimResponse setDispositionElement(StringType value) { 
4934      this.disposition = value;
4935      return this;
4936    }
4937
4938    /**
4939     * @return A description of the status of the adjudication.
4940     */
4941    public String getDisposition() { 
4942      return this.disposition == null ? null : this.disposition.getValue();
4943    }
4944
4945    /**
4946     * @param value A description of the status of the adjudication.
4947     */
4948    public ClaimResponse setDisposition(String value) { 
4949      if (Utilities.noString(value))
4950        this.disposition = null;
4951      else {
4952        if (this.disposition == null)
4953          this.disposition = new StringType();
4954        this.disposition.setValue(value);
4955      }
4956      return this;
4957    }
4958
4959    /**
4960     * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.)
4961     */
4962    public Coding getPayeeType() { 
4963      if (this.payeeType == null)
4964        if (Configuration.errorOnAutoCreate())
4965          throw new Error("Attempt to auto-create ClaimResponse.payeeType");
4966        else if (Configuration.doAutoCreate())
4967          this.payeeType = new Coding(); // cc
4968      return this.payeeType;
4969    }
4970
4971    public boolean hasPayeeType() { 
4972      return this.payeeType != null && !this.payeeType.isEmpty();
4973    }
4974
4975    /**
4976     * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.)
4977     */
4978    public ClaimResponse setPayeeType(Coding value) { 
4979      this.payeeType = value;
4980      return this;
4981    }
4982
4983    /**
4984     * @return {@link #item} (The first tier service adjudications for submitted services.)
4985     */
4986    public List<ItemsComponent> getItem() { 
4987      if (this.item == null)
4988        this.item = new ArrayList<ItemsComponent>();
4989      return this.item;
4990    }
4991
4992    public boolean hasItem() { 
4993      if (this.item == null)
4994        return false;
4995      for (ItemsComponent item : this.item)
4996        if (!item.isEmpty())
4997          return true;
4998      return false;
4999    }
5000
5001    /**
5002     * @return {@link #item} (The first tier service adjudications for submitted services.)
5003     */
5004    // syntactic sugar
5005    public ItemsComponent addItem() { //3
5006      ItemsComponent t = new ItemsComponent();
5007      if (this.item == null)
5008        this.item = new ArrayList<ItemsComponent>();
5009      this.item.add(t);
5010      return t;
5011    }
5012
5013    // syntactic sugar
5014    public ClaimResponse addItem(ItemsComponent t) { //3
5015      if (t == null)
5016        return this;
5017      if (this.item == null)
5018        this.item = new ArrayList<ItemsComponent>();
5019      this.item.add(t);
5020      return this;
5021    }
5022
5023    /**
5024     * @return {@link #addItem} (The first tier service adjudications for payor added services.)
5025     */
5026    public List<AddedItemComponent> getAddItem() { 
5027      if (this.addItem == null)
5028        this.addItem = new ArrayList<AddedItemComponent>();
5029      return this.addItem;
5030    }
5031
5032    public boolean hasAddItem() { 
5033      if (this.addItem == null)
5034        return false;
5035      for (AddedItemComponent item : this.addItem)
5036        if (!item.isEmpty())
5037          return true;
5038      return false;
5039    }
5040
5041    /**
5042     * @return {@link #addItem} (The first tier service adjudications for payor added services.)
5043     */
5044    // syntactic sugar
5045    public AddedItemComponent addAddItem() { //3
5046      AddedItemComponent t = new AddedItemComponent();
5047      if (this.addItem == null)
5048        this.addItem = new ArrayList<AddedItemComponent>();
5049      this.addItem.add(t);
5050      return t;
5051    }
5052
5053    // syntactic sugar
5054    public ClaimResponse addAddItem(AddedItemComponent t) { //3
5055      if (t == null)
5056        return this;
5057      if (this.addItem == null)
5058        this.addItem = new ArrayList<AddedItemComponent>();
5059      this.addItem.add(t);
5060      return this;
5061    }
5062
5063    /**
5064     * @return {@link #error} (Mutually exclusive with Services Provided (Item).)
5065     */
5066    public List<ErrorsComponent> getError() { 
5067      if (this.error == null)
5068        this.error = new ArrayList<ErrorsComponent>();
5069      return this.error;
5070    }
5071
5072    public boolean hasError() { 
5073      if (this.error == null)
5074        return false;
5075      for (ErrorsComponent item : this.error)
5076        if (!item.isEmpty())
5077          return true;
5078      return false;
5079    }
5080
5081    /**
5082     * @return {@link #error} (Mutually exclusive with Services Provided (Item).)
5083     */
5084    // syntactic sugar
5085    public ErrorsComponent addError() { //3
5086      ErrorsComponent t = new ErrorsComponent();
5087      if (this.error == null)
5088        this.error = new ArrayList<ErrorsComponent>();
5089      this.error.add(t);
5090      return t;
5091    }
5092
5093    // syntactic sugar
5094    public ClaimResponse addError(ErrorsComponent t) { //3
5095      if (t == null)
5096        return this;
5097      if (this.error == null)
5098        this.error = new ArrayList<ErrorsComponent>();
5099      this.error.add(t);
5100      return this;
5101    }
5102
5103    /**
5104     * @return {@link #totalCost} (The total cost of the services reported.)
5105     */
5106    public Money getTotalCost() { 
5107      if (this.totalCost == null)
5108        if (Configuration.errorOnAutoCreate())
5109          throw new Error("Attempt to auto-create ClaimResponse.totalCost");
5110        else if (Configuration.doAutoCreate())
5111          this.totalCost = new Money(); // cc
5112      return this.totalCost;
5113    }
5114
5115    public boolean hasTotalCost() { 
5116      return this.totalCost != null && !this.totalCost.isEmpty();
5117    }
5118
5119    /**
5120     * @param value {@link #totalCost} (The total cost of the services reported.)
5121     */
5122    public ClaimResponse setTotalCost(Money value) { 
5123      this.totalCost = value;
5124      return this;
5125    }
5126
5127    /**
5128     * @return {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.)
5129     */
5130    public Money getUnallocDeductable() { 
5131      if (this.unallocDeductable == null)
5132        if (Configuration.errorOnAutoCreate())
5133          throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable");
5134        else if (Configuration.doAutoCreate())
5135          this.unallocDeductable = new Money(); // cc
5136      return this.unallocDeductable;
5137    }
5138
5139    public boolean hasUnallocDeductable() { 
5140      return this.unallocDeductable != null && !this.unallocDeductable.isEmpty();
5141    }
5142
5143    /**
5144     * @param value {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.)
5145     */
5146    public ClaimResponse setUnallocDeductable(Money value) { 
5147      this.unallocDeductable = value;
5148      return this;
5149    }
5150
5151    /**
5152     * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).)
5153     */
5154    public Money getTotalBenefit() { 
5155      if (this.totalBenefit == null)
5156        if (Configuration.errorOnAutoCreate())
5157          throw new Error("Attempt to auto-create ClaimResponse.totalBenefit");
5158        else if (Configuration.doAutoCreate())
5159          this.totalBenefit = new Money(); // cc
5160      return this.totalBenefit;
5161    }
5162
5163    public boolean hasTotalBenefit() { 
5164      return this.totalBenefit != null && !this.totalBenefit.isEmpty();
5165    }
5166
5167    /**
5168     * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).)
5169     */
5170    public ClaimResponse setTotalBenefit(Money value) { 
5171      this.totalBenefit = value;
5172      return this;
5173    }
5174
5175    /**
5176     * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.)
5177     */
5178    public Money getPaymentAdjustment() { 
5179      if (this.paymentAdjustment == null)
5180        if (Configuration.errorOnAutoCreate())
5181          throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment");
5182        else if (Configuration.doAutoCreate())
5183          this.paymentAdjustment = new Money(); // cc
5184      return this.paymentAdjustment;
5185    }
5186
5187    public boolean hasPaymentAdjustment() { 
5188      return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty();
5189    }
5190
5191    /**
5192     * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.)
5193     */
5194    public ClaimResponse setPaymentAdjustment(Money value) { 
5195      this.paymentAdjustment = value;
5196      return this;
5197    }
5198
5199    /**
5200     * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.)
5201     */
5202    public Coding getPaymentAdjustmentReason() { 
5203      if (this.paymentAdjustmentReason == null)
5204        if (Configuration.errorOnAutoCreate())
5205          throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason");
5206        else if (Configuration.doAutoCreate())
5207          this.paymentAdjustmentReason = new Coding(); // cc
5208      return this.paymentAdjustmentReason;
5209    }
5210
5211    public boolean hasPaymentAdjustmentReason() { 
5212      return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty();
5213    }
5214
5215    /**
5216     * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.)
5217     */
5218    public ClaimResponse setPaymentAdjustmentReason(Coding value) { 
5219      this.paymentAdjustmentReason = value;
5220      return this;
5221    }
5222
5223    /**
5224     * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
5225     */
5226    public DateType getPaymentDateElement() { 
5227      if (this.paymentDate == null)
5228        if (Configuration.errorOnAutoCreate())
5229          throw new Error("Attempt to auto-create ClaimResponse.paymentDate");
5230        else if (Configuration.doAutoCreate())
5231          this.paymentDate = new DateType(); // bb
5232      return this.paymentDate;
5233    }
5234
5235    public boolean hasPaymentDateElement() { 
5236      return this.paymentDate != null && !this.paymentDate.isEmpty();
5237    }
5238
5239    public boolean hasPaymentDate() { 
5240      return this.paymentDate != null && !this.paymentDate.isEmpty();
5241    }
5242
5243    /**
5244     * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value
5245     */
5246    public ClaimResponse setPaymentDateElement(DateType value) { 
5247      this.paymentDate = value;
5248      return this;
5249    }
5250
5251    /**
5252     * @return Estimated payment data.
5253     */
5254    public Date getPaymentDate() { 
5255      return this.paymentDate == null ? null : this.paymentDate.getValue();
5256    }
5257
5258    /**
5259     * @param value Estimated payment data.
5260     */
5261    public ClaimResponse setPaymentDate(Date value) { 
5262      if (value == null)
5263        this.paymentDate = null;
5264      else {
5265        if (this.paymentDate == null)
5266          this.paymentDate = new DateType();
5267        this.paymentDate.setValue(value);
5268      }
5269      return this;
5270    }
5271
5272    /**
5273     * @return {@link #paymentAmount} (Payable less any payment adjustment.)
5274     */
5275    public Money getPaymentAmount() { 
5276      if (this.paymentAmount == null)
5277        if (Configuration.errorOnAutoCreate())
5278          throw new Error("Attempt to auto-create ClaimResponse.paymentAmount");
5279        else if (Configuration.doAutoCreate())
5280          this.paymentAmount = new Money(); // cc
5281      return this.paymentAmount;
5282    }
5283
5284    public boolean hasPaymentAmount() { 
5285      return this.paymentAmount != null && !this.paymentAmount.isEmpty();
5286    }
5287
5288    /**
5289     * @param value {@link #paymentAmount} (Payable less any payment adjustment.)
5290     */
5291    public ClaimResponse setPaymentAmount(Money value) { 
5292      this.paymentAmount = value;
5293      return this;
5294    }
5295
5296    /**
5297     * @return {@link #paymentRef} (Payment identifier.)
5298     */
5299    public Identifier getPaymentRef() { 
5300      if (this.paymentRef == null)
5301        if (Configuration.errorOnAutoCreate())
5302          throw new Error("Attempt to auto-create ClaimResponse.paymentRef");
5303        else if (Configuration.doAutoCreate())
5304          this.paymentRef = new Identifier(); // cc
5305      return this.paymentRef;
5306    }
5307
5308    public boolean hasPaymentRef() { 
5309      return this.paymentRef != null && !this.paymentRef.isEmpty();
5310    }
5311
5312    /**
5313     * @param value {@link #paymentRef} (Payment identifier.)
5314     */
5315    public ClaimResponse setPaymentRef(Identifier value) { 
5316      this.paymentRef = value;
5317      return this;
5318    }
5319
5320    /**
5321     * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).)
5322     */
5323    public Coding getReserved() { 
5324      if (this.reserved == null)
5325        if (Configuration.errorOnAutoCreate())
5326          throw new Error("Attempt to auto-create ClaimResponse.reserved");
5327        else if (Configuration.doAutoCreate())
5328          this.reserved = new Coding(); // cc
5329      return this.reserved;
5330    }
5331
5332    public boolean hasReserved() { 
5333      return this.reserved != null && !this.reserved.isEmpty();
5334    }
5335
5336    /**
5337     * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).)
5338     */
5339    public ClaimResponse setReserved(Coding value) { 
5340      this.reserved = value;
5341      return this;
5342    }
5343
5344    /**
5345     * @return {@link #form} (The form to be used for printing the content.)
5346     */
5347    public Coding getForm() { 
5348      if (this.form == null)
5349        if (Configuration.errorOnAutoCreate())
5350          throw new Error("Attempt to auto-create ClaimResponse.form");
5351        else if (Configuration.doAutoCreate())
5352          this.form = new Coding(); // cc
5353      return this.form;
5354    }
5355
5356    public boolean hasForm() { 
5357      return this.form != null && !this.form.isEmpty();
5358    }
5359
5360    /**
5361     * @param value {@link #form} (The form to be used for printing the content.)
5362     */
5363    public ClaimResponse setForm(Coding value) { 
5364      this.form = value;
5365      return this;
5366    }
5367
5368    /**
5369     * @return {@link #note} (Note text.)
5370     */
5371    public List<NotesComponent> getNote() { 
5372      if (this.note == null)
5373        this.note = new ArrayList<NotesComponent>();
5374      return this.note;
5375    }
5376
5377    public boolean hasNote() { 
5378      if (this.note == null)
5379        return false;
5380      for (NotesComponent item : this.note)
5381        if (!item.isEmpty())
5382          return true;
5383      return false;
5384    }
5385
5386    /**
5387     * @return {@link #note} (Note text.)
5388     */
5389    // syntactic sugar
5390    public NotesComponent addNote() { //3
5391      NotesComponent t = new NotesComponent();
5392      if (this.note == null)
5393        this.note = new ArrayList<NotesComponent>();
5394      this.note.add(t);
5395      return t;
5396    }
5397
5398    // syntactic sugar
5399    public ClaimResponse addNote(NotesComponent t) { //3
5400      if (t == null)
5401        return this;
5402      if (this.note == null)
5403        this.note = new ArrayList<NotesComponent>();
5404      this.note.add(t);
5405      return this;
5406    }
5407
5408    /**
5409     * @return {@link #coverage} (Financial instrument by which payment information for health care.)
5410     */
5411    public List<CoverageComponent> getCoverage() { 
5412      if (this.coverage == null)
5413        this.coverage = new ArrayList<CoverageComponent>();
5414      return this.coverage;
5415    }
5416
5417    public boolean hasCoverage() { 
5418      if (this.coverage == null)
5419        return false;
5420      for (CoverageComponent item : this.coverage)
5421        if (!item.isEmpty())
5422          return true;
5423      return false;
5424    }
5425
5426    /**
5427     * @return {@link #coverage} (Financial instrument by which payment information for health care.)
5428     */
5429    // syntactic sugar
5430    public CoverageComponent addCoverage() { //3
5431      CoverageComponent t = new CoverageComponent();
5432      if (this.coverage == null)
5433        this.coverage = new ArrayList<CoverageComponent>();
5434      this.coverage.add(t);
5435      return t;
5436    }
5437
5438    // syntactic sugar
5439    public ClaimResponse addCoverage(CoverageComponent t) { //3
5440      if (t == null)
5441        return this;
5442      if (this.coverage == null)
5443        this.coverage = new ArrayList<CoverageComponent>();
5444      this.coverage.add(t);
5445      return this;
5446    }
5447
5448      protected void listChildren(List<Property> childrenList) {
5449        super.listChildren(childrenList);
5450        childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
5451        childrenList.add(new Property("request[x]", "Identifier|Reference(Claim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request));
5452        childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
5453        childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
5454        childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
5455        childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
5456        childrenList.add(new Property("requestProvider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
5457        childrenList.add(new Property("requestOrganization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
5458        childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome));
5459        childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition));
5460        childrenList.add(new Property("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType));
5461        childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item));
5462        childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem));
5463        childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error));
5464        childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost));
5465        childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductible applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable));
5466        childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).", 0, java.lang.Integer.MAX_VALUE, totalBenefit));
5467        childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment));
5468        childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason));
5469        childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate));
5470        childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount));
5471        childrenList.add(new Property("paymentRef", "Identifier", "Payment identifier.", 0, java.lang.Integer.MAX_VALUE, paymentRef));
5472        childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved));
5473        childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form));
5474        childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note));
5475        childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage));
5476      }
5477
5478      @Override
5479      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5480        switch (hash) {
5481        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
5482        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type
5483        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding
5484        case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding
5485        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
5486        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type
5487        case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type
5488        case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type
5489        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<RemittanceOutcome>
5490        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
5491        case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // Coding
5492        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent
5493        case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent
5494        case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent
5495        case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money
5496        case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money
5497        case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money
5498        case 856402963: /*paymentAdjustment*/ return this.paymentAdjustment == null ? new Base[0] : new Base[] {this.paymentAdjustment}; // Money
5499        case -1386508233: /*paymentAdjustmentReason*/ return this.paymentAdjustmentReason == null ? new Base[0] : new Base[] {this.paymentAdjustmentReason}; // Coding
5500        case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType
5501        case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money
5502        case 1612875949: /*paymentRef*/ return this.paymentRef == null ? new Base[0] : new Base[] {this.paymentRef}; // Identifier
5503        case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding
5504        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding
5505        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent
5506        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent
5507        default: return super.getProperty(hash, name, checkValid);
5508        }
5509
5510      }
5511
5512      @Override
5513      public void setProperty(int hash, String name, Base value) throws FHIRException {
5514        switch (hash) {
5515        case -1618432855: // identifier
5516          this.getIdentifier().add(castToIdentifier(value)); // Identifier
5517          break;
5518        case 1095692943: // request
5519          this.request = (Type) value; // Type
5520          break;
5521        case 1548678118: // ruleset
5522          this.ruleset = castToCoding(value); // Coding
5523          break;
5524        case 1089373397: // originalRuleset
5525          this.originalRuleset = castToCoding(value); // Coding
5526          break;
5527        case 1028554472: // created
5528          this.created = castToDateTime(value); // DateTimeType
5529          break;
5530        case 1178922291: // organization
5531          this.organization = (Type) value; // Type
5532          break;
5533        case 1601527200: // requestProvider
5534          this.requestProvider = (Type) value; // Type
5535          break;
5536        case 599053666: // requestOrganization
5537          this.requestOrganization = (Type) value; // Type
5538          break;
5539        case -1106507950: // outcome
5540          this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration<RemittanceOutcome>
5541          break;
5542        case 583380919: // disposition
5543          this.disposition = castToString(value); // StringType
5544          break;
5545        case -316321118: // payeeType
5546          this.payeeType = castToCoding(value); // Coding
5547          break;
5548        case 3242771: // item
5549          this.getItem().add((ItemsComponent) value); // ItemsComponent
5550          break;
5551        case -1148899500: // addItem
5552          this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent
5553          break;
5554        case 96784904: // error
5555          this.getError().add((ErrorsComponent) value); // ErrorsComponent
5556          break;
5557        case -577782479: // totalCost
5558          this.totalCost = castToMoney(value); // Money
5559          break;
5560        case 2096309753: // unallocDeductable
5561          this.unallocDeductable = castToMoney(value); // Money
5562          break;
5563        case 332332211: // totalBenefit
5564          this.totalBenefit = castToMoney(value); // Money
5565          break;
5566        case 856402963: // paymentAdjustment
5567          this.paymentAdjustment = castToMoney(value); // Money
5568          break;
5569        case -1386508233: // paymentAdjustmentReason
5570          this.paymentAdjustmentReason = castToCoding(value); // Coding
5571          break;
5572        case -1540873516: // paymentDate
5573          this.paymentDate = castToDate(value); // DateType
5574          break;
5575        case 909332990: // paymentAmount
5576          this.paymentAmount = castToMoney(value); // Money
5577          break;
5578        case 1612875949: // paymentRef
5579          this.paymentRef = castToIdentifier(value); // Identifier
5580          break;
5581        case -350385368: // reserved
5582          this.reserved = castToCoding(value); // Coding
5583          break;
5584        case 3148996: // form
5585          this.form = castToCoding(value); // Coding
5586          break;
5587        case 3387378: // note
5588          this.getNote().add((NotesComponent) value); // NotesComponent
5589          break;
5590        case -351767064: // coverage
5591          this.getCoverage().add((CoverageComponent) value); // CoverageComponent
5592          break;
5593        default: super.setProperty(hash, name, value);
5594        }
5595
5596      }
5597
5598      @Override
5599      public void setProperty(String name, Base value) throws FHIRException {
5600        if (name.equals("identifier"))
5601          this.getIdentifier().add(castToIdentifier(value));
5602        else if (name.equals("request[x]"))
5603          this.request = (Type) value; // Type
5604        else if (name.equals("ruleset"))
5605          this.ruleset = castToCoding(value); // Coding
5606        else if (name.equals("originalRuleset"))
5607          this.originalRuleset = castToCoding(value); // Coding
5608        else if (name.equals("created"))
5609          this.created = castToDateTime(value); // DateTimeType
5610        else if (name.equals("organization[x]"))
5611          this.organization = (Type) value; // Type
5612        else if (name.equals("requestProvider[x]"))
5613          this.requestProvider = (Type) value; // Type
5614        else if (name.equals("requestOrganization[x]"))
5615          this.requestOrganization = (Type) value; // Type
5616        else if (name.equals("outcome"))
5617          this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration<RemittanceOutcome>
5618        else if (name.equals("disposition"))
5619          this.disposition = castToString(value); // StringType
5620        else if (name.equals("payeeType"))
5621          this.payeeType = castToCoding(value); // Coding
5622        else if (name.equals("item"))
5623          this.getItem().add((ItemsComponent) value);
5624        else if (name.equals("addItem"))
5625          this.getAddItem().add((AddedItemComponent) value);
5626        else if (name.equals("error"))
5627          this.getError().add((ErrorsComponent) value);
5628        else if (name.equals("totalCost"))
5629          this.totalCost = castToMoney(value); // Money
5630        else if (name.equals("unallocDeductable"))
5631          this.unallocDeductable = castToMoney(value); // Money
5632        else if (name.equals("totalBenefit"))
5633          this.totalBenefit = castToMoney(value); // Money
5634        else if (name.equals("paymentAdjustment"))
5635          this.paymentAdjustment = castToMoney(value); // Money
5636        else if (name.equals("paymentAdjustmentReason"))
5637          this.paymentAdjustmentReason = castToCoding(value); // Coding
5638        else if (name.equals("paymentDate"))
5639          this.paymentDate = castToDate(value); // DateType
5640        else if (name.equals("paymentAmount"))
5641          this.paymentAmount = castToMoney(value); // Money
5642        else if (name.equals("paymentRef"))
5643          this.paymentRef = castToIdentifier(value); // Identifier
5644        else if (name.equals("reserved"))
5645          this.reserved = castToCoding(value); // Coding
5646        else if (name.equals("form"))
5647          this.form = castToCoding(value); // Coding
5648        else if (name.equals("note"))
5649          this.getNote().add((NotesComponent) value);
5650        else if (name.equals("coverage"))
5651          this.getCoverage().add((CoverageComponent) value);
5652        else
5653          super.setProperty(name, value);
5654      }
5655
5656      @Override
5657      public Base makeProperty(int hash, String name) throws FHIRException {
5658        switch (hash) {
5659        case -1618432855:  return addIdentifier(); // Identifier
5660        case 37106577:  return getRequest(); // Type
5661        case 1548678118:  return getRuleset(); // Coding
5662        case 1089373397:  return getOriginalRuleset(); // Coding
5663        case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType
5664        case 1326483053:  return getOrganization(); // Type
5665        case -1694784800:  return getRequestProvider(); // Type
5666        case 818740190:  return getRequestOrganization(); // Type
5667        case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration<RemittanceOutcome>
5668        case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType
5669        case -316321118:  return getPayeeType(); // Coding
5670        case 3242771:  return addItem(); // ItemsComponent
5671        case -1148899500:  return addAddItem(); // AddedItemComponent
5672        case 96784904:  return addError(); // ErrorsComponent
5673        case -577782479:  return getTotalCost(); // Money
5674        case 2096309753:  return getUnallocDeductable(); // Money
5675        case 332332211:  return getTotalBenefit(); // Money
5676        case 856402963:  return getPaymentAdjustment(); // Money
5677        case -1386508233:  return getPaymentAdjustmentReason(); // Coding
5678        case -1540873516: throw new FHIRException("Cannot make property paymentDate as it is not a complex type"); // DateType
5679        case 909332990:  return getPaymentAmount(); // Money
5680        case 1612875949:  return getPaymentRef(); // Identifier
5681        case -350385368:  return getReserved(); // Coding
5682        case 3148996:  return getForm(); // Coding
5683        case 3387378:  return addNote(); // NotesComponent
5684        case -351767064:  return addCoverage(); // CoverageComponent
5685        default: return super.makeProperty(hash, name);
5686        }
5687
5688      }
5689
5690      @Override
5691      public Base addChild(String name) throws FHIRException {
5692        if (name.equals("identifier")) {
5693          return addIdentifier();
5694        }
5695        else if (name.equals("requestIdentifier")) {
5696          this.request = new Identifier();
5697          return this.request;
5698        }
5699        else if (name.equals("requestReference")) {
5700          this.request = new Reference();
5701          return this.request;
5702        }
5703        else if (name.equals("ruleset")) {
5704          this.ruleset = new Coding();
5705          return this.ruleset;
5706        }
5707        else if (name.equals("originalRuleset")) {
5708          this.originalRuleset = new Coding();
5709          return this.originalRuleset;
5710        }
5711        else if (name.equals("created")) {
5712          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.created");
5713        }
5714        else if (name.equals("organizationIdentifier")) {
5715          this.organization = new Identifier();
5716          return this.organization;
5717        }
5718        else if (name.equals("organizationReference")) {
5719          this.organization = new Reference();
5720          return this.organization;
5721        }
5722        else if (name.equals("requestProviderIdentifier")) {
5723          this.requestProvider = new Identifier();
5724          return this.requestProvider;
5725        }
5726        else if (name.equals("requestProviderReference")) {
5727          this.requestProvider = new Reference();
5728          return this.requestProvider;
5729        }
5730        else if (name.equals("requestOrganizationIdentifier")) {
5731          this.requestOrganization = new Identifier();
5732          return this.requestOrganization;
5733        }
5734        else if (name.equals("requestOrganizationReference")) {
5735          this.requestOrganization = new Reference();
5736          return this.requestOrganization;
5737        }
5738        else if (name.equals("outcome")) {
5739          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.outcome");
5740        }
5741        else if (name.equals("disposition")) {
5742          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition");
5743        }
5744        else if (name.equals("payeeType")) {
5745          this.payeeType = new Coding();
5746          return this.payeeType;
5747        }
5748        else if (name.equals("item")) {
5749          return addItem();
5750        }
5751        else if (name.equals("addItem")) {
5752          return addAddItem();
5753        }
5754        else if (name.equals("error")) {
5755          return addError();
5756        }
5757        else if (name.equals("totalCost")) {
5758          this.totalCost = new Money();
5759          return this.totalCost;
5760        }
5761        else if (name.equals("unallocDeductable")) {
5762          this.unallocDeductable = new Money();
5763          return this.unallocDeductable;
5764        }
5765        else if (name.equals("totalBenefit")) {
5766          this.totalBenefit = new Money();
5767          return this.totalBenefit;
5768        }
5769        else if (name.equals("paymentAdjustment")) {
5770          this.paymentAdjustment = new Money();
5771          return this.paymentAdjustment;
5772        }
5773        else if (name.equals("paymentAdjustmentReason")) {
5774          this.paymentAdjustmentReason = new Coding();
5775          return this.paymentAdjustmentReason;
5776        }
5777        else if (name.equals("paymentDate")) {
5778          throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.paymentDate");
5779        }
5780        else if (name.equals("paymentAmount")) {
5781          this.paymentAmount = new Money();
5782          return this.paymentAmount;
5783        }
5784        else if (name.equals("paymentRef")) {
5785          this.paymentRef = new Identifier();
5786          return this.paymentRef;
5787        }
5788        else if (name.equals("reserved")) {
5789          this.reserved = new Coding();
5790          return this.reserved;
5791        }
5792        else if (name.equals("form")) {
5793          this.form = new Coding();
5794          return this.form;
5795        }
5796        else if (name.equals("note")) {
5797          return addNote();
5798        }
5799        else if (name.equals("coverage")) {
5800          return addCoverage();
5801        }
5802        else
5803          return super.addChild(name);
5804      }
5805
5806  public String fhirType() {
5807    return "ClaimResponse";
5808
5809  }
5810
5811      public ClaimResponse copy() {
5812        ClaimResponse dst = new ClaimResponse();
5813        copyValues(dst);
5814        if (identifier != null) {
5815          dst.identifier = new ArrayList<Identifier>();
5816          for (Identifier i : identifier)
5817            dst.identifier.add(i.copy());
5818        };
5819        dst.request = request == null ? null : request.copy();
5820        dst.ruleset = ruleset == null ? null : ruleset.copy();
5821        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
5822        dst.created = created == null ? null : created.copy();
5823        dst.organization = organization == null ? null : organization.copy();
5824        dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
5825        dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
5826        dst.outcome = outcome == null ? null : outcome.copy();
5827        dst.disposition = disposition == null ? null : disposition.copy();
5828        dst.payeeType = payeeType == null ? null : payeeType.copy();
5829        if (item != null) {
5830          dst.item = new ArrayList<ItemsComponent>();
5831          for (ItemsComponent i : item)
5832            dst.item.add(i.copy());
5833        };
5834        if (addItem != null) {
5835          dst.addItem = new ArrayList<AddedItemComponent>();
5836          for (AddedItemComponent i : addItem)
5837            dst.addItem.add(i.copy());
5838        };
5839        if (error != null) {
5840          dst.error = new ArrayList<ErrorsComponent>();
5841          for (ErrorsComponent i : error)
5842            dst.error.add(i.copy());
5843        };
5844        dst.totalCost = totalCost == null ? null : totalCost.copy();
5845        dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy();
5846        dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy();
5847        dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy();
5848        dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy();
5849        dst.paymentDate = paymentDate == null ? null : paymentDate.copy();
5850        dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy();
5851        dst.paymentRef = paymentRef == null ? null : paymentRef.copy();
5852        dst.reserved = reserved == null ? null : reserved.copy();
5853        dst.form = form == null ? null : form.copy();
5854        if (note != null) {
5855          dst.note = new ArrayList<NotesComponent>();
5856          for (NotesComponent i : note)
5857            dst.note.add(i.copy());
5858        };
5859        if (coverage != null) {
5860          dst.coverage = new ArrayList<CoverageComponent>();
5861          for (CoverageComponent i : coverage)
5862            dst.coverage.add(i.copy());
5863        };
5864        return dst;
5865      }
5866
5867      protected ClaimResponse typedCopy() {
5868        return copy();
5869      }
5870
5871      @Override
5872      public boolean equalsDeep(Base other) {
5873        if (!super.equalsDeep(other))
5874          return false;
5875        if (!(other instanceof ClaimResponse))
5876          return false;
5877        ClaimResponse o = (ClaimResponse) other;
5878        return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(ruleset, o.ruleset, true)
5879           && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true)
5880           && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true)
5881           && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true)
5882           && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true)
5883           && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true)
5884           && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true)
5885           && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true)
5886           && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true)
5887           && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true)
5888           && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true);
5889      }
5890
5891      @Override
5892      public boolean equalsShallow(Base other) {
5893        if (!super.equalsShallow(other))
5894          return false;
5895        if (!(other instanceof ClaimResponse))
5896          return false;
5897        ClaimResponse o = (ClaimResponse) other;
5898        return compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true)
5899           && compareValues(paymentDate, o.paymentDate, true);
5900      }
5901
5902      public boolean isEmpty() {
5903        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
5904           && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
5905           && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
5906           && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
5907           && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
5908           && (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (addItem == null || addItem.isEmpty())
5909           && (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty())
5910           && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty())
5911           && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty())
5912           && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty())
5913           && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty())
5914           && (coverage == null || coverage.isEmpty());
5915      }
5916
5917  @Override
5918  public ResourceType getResourceType() {
5919    return ResourceType.ClaimResponse;
5920   }
5921
5922 /**
5923   * Search parameter: <b>created</b>
5924   * <p>
5925   * Description: <b>The creation date</b><br>
5926   * Type: <b>date</b><br>
5927   * Path: <b>ClaimResponse.created</b><br>
5928   * </p>
5929   */
5930  @SearchParamDefinition(name="created", path="ClaimResponse.created", description="The creation date", type="date" )
5931  public static final String SP_CREATED = "created";
5932 /**
5933   * <b>Fluent Client</b> search parameter constant for <b>created</b>
5934   * <p>
5935   * Description: <b>The creation date</b><br>
5936   * Type: <b>date</b><br>
5937   * Path: <b>ClaimResponse.created</b><br>
5938   * </p>
5939   */
5940  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
5941
5942 /**
5943   * Search parameter: <b>requestidentifier</b>
5944   * <p>
5945   * Description: <b>The claim reference</b><br>
5946   * Type: <b>token</b><br>
5947   * Path: <b>ClaimResponse.requestIdentifier</b><br>
5948   * </p>
5949   */
5950  @SearchParamDefinition(name="requestidentifier", path="ClaimResponse.request.as(Identifier)", description="The claim reference", type="token" )
5951  public static final String SP_REQUESTIDENTIFIER = "requestidentifier";
5952 /**
5953   * <b>Fluent Client</b> search parameter constant for <b>requestidentifier</b>
5954   * <p>
5955   * Description: <b>The claim reference</b><br>
5956   * Type: <b>token</b><br>
5957   * Path: <b>ClaimResponse.requestIdentifier</b><br>
5958   * </p>
5959   */
5960  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER);
5961
5962 /**
5963   * Search parameter: <b>requestreference</b>
5964   * <p>
5965   * Description: <b>The claim reference</b><br>
5966   * Type: <b>reference</b><br>
5967   * Path: <b>ClaimResponse.requestReference</b><br>
5968   * </p>
5969   */
5970  @SearchParamDefinition(name="requestreference", path="ClaimResponse.request.as(Reference)", description="The claim reference", type="reference" )
5971  public static final String SP_REQUESTREFERENCE = "requestreference";
5972 /**
5973   * <b>Fluent Client</b> search parameter constant for <b>requestreference</b>
5974   * <p>
5975   * Description: <b>The claim reference</b><br>
5976   * Type: <b>reference</b><br>
5977   * Path: <b>ClaimResponse.requestReference</b><br>
5978   * </p>
5979   */
5980  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE);
5981
5982/**
5983   * Constant for fluent queries to be used to add include statements. Specifies
5984   * the path value of "<b>ClaimResponse:requestreference</b>".
5985   */
5986  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:requestreference").toLocked();
5987
5988 /**
5989   * Search parameter: <b>paymentdate</b>
5990   * <p>
5991   * Description: <b>The expected paymentDate</b><br>
5992   * Type: <b>date</b><br>
5993   * Path: <b>ClaimResponse.paymentDate</b><br>
5994   * </p>
5995   */
5996  @SearchParamDefinition(name="paymentdate", path="ClaimResponse.paymentDate", description="The expected paymentDate", type="date" )
5997  public static final String SP_PAYMENTDATE = "paymentdate";
5998 /**
5999   * <b>Fluent Client</b> search parameter constant for <b>paymentdate</b>
6000   * <p>
6001   * Description: <b>The expected paymentDate</b><br>
6002   * Type: <b>date</b><br>
6003   * Path: <b>ClaimResponse.paymentDate</b><br>
6004   * </p>
6005   */
6006  public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENTDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENTDATE);
6007
6008 /**
6009   * Search parameter: <b>organizationidentifier</b>
6010   * <p>
6011   * Description: <b>The organization who generated this resource</b><br>
6012   * Type: <b>token</b><br>
6013   * Path: <b>ClaimResponse.organizationIdentifier</b><br>
6014   * </p>
6015   */
6016  @SearchParamDefinition(name="organizationidentifier", path="ClaimResponse.organization.as(Identifier)", description="The organization who generated this resource", type="token" )
6017  public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier";
6018 /**
6019   * <b>Fluent Client</b> search parameter constant for <b>organizationidentifier</b>
6020   * <p>
6021   * Description: <b>The organization who generated this resource</b><br>
6022   * Type: <b>token</b><br>
6023   * Path: <b>ClaimResponse.organizationIdentifier</b><br>
6024   * </p>
6025   */
6026  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER);
6027
6028 /**
6029   * Search parameter: <b>organizationreference</b>
6030   * <p>
6031   * Description: <b>The organization who generated this resource</b><br>
6032   * Type: <b>reference</b><br>
6033   * Path: <b>ClaimResponse.organizationReference</b><br>
6034   * </p>
6035   */
6036  @SearchParamDefinition(name="organizationreference", path="ClaimResponse.organization.as(Reference)", description="The organization who generated this resource", type="reference" )
6037  public static final String SP_ORGANIZATIONREFERENCE = "organizationreference";
6038 /**
6039   * <b>Fluent Client</b> search parameter constant for <b>organizationreference</b>
6040   * <p>
6041   * Description: <b>The organization who generated this resource</b><br>
6042   * Type: <b>reference</b><br>
6043   * Path: <b>ClaimResponse.organizationReference</b><br>
6044   * </p>
6045   */
6046  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE);
6047
6048/**
6049   * Constant for fluent queries to be used to add include statements. Specifies
6050   * the path value of "<b>ClaimResponse:organizationreference</b>".
6051   */
6052  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:organizationreference").toLocked();
6053
6054 /**
6055   * Search parameter: <b>outcome</b>
6056   * <p>
6057   * Description: <b>The processing outcome</b><br>
6058   * Type: <b>token</b><br>
6059   * Path: <b>ClaimResponse.outcome</b><br>
6060   * </p>
6061   */
6062  @SearchParamDefinition(name="outcome", path="ClaimResponse.outcome", description="The processing outcome", type="token" )
6063  public static final String SP_OUTCOME = "outcome";
6064 /**
6065   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
6066   * <p>
6067   * Description: <b>The processing outcome</b><br>
6068   * Type: <b>token</b><br>
6069   * Path: <b>ClaimResponse.outcome</b><br>
6070   * </p>
6071   */
6072  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME);
6073
6074 /**
6075   * Search parameter: <b>identifier</b>
6076   * <p>
6077   * Description: <b>The identity of the insurer</b><br>
6078   * Type: <b>token</b><br>
6079   * Path: <b>ClaimResponse.identifier</b><br>
6080   * </p>
6081   */
6082  @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" )
6083  public static final String SP_IDENTIFIER = "identifier";
6084 /**
6085   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
6086   * <p>
6087   * Description: <b>The identity of the insurer</b><br>
6088   * Type: <b>token</b><br>
6089   * Path: <b>ClaimResponse.identifier</b><br>
6090   * </p>
6091   */
6092  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
6093
6094 /**
6095   * Search parameter: <b>disposition</b>
6096   * <p>
6097   * Description: <b>The contents of the disposition message</b><br>
6098   * Type: <b>string</b><br>
6099   * Path: <b>ClaimResponse.disposition</b><br>
6100   * </p>
6101   */
6102  @SearchParamDefinition(name="disposition", path="ClaimResponse.disposition", description="The contents of the disposition message", type="string" )
6103  public static final String SP_DISPOSITION = "disposition";
6104 /**
6105   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
6106   * <p>
6107   * Description: <b>The contents of the disposition message</b><br>
6108   * Type: <b>string</b><br>
6109   * Path: <b>ClaimResponse.disposition</b><br>
6110   * </p>
6111   */
6112  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION);
6113
6114
6115}
6116