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