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