001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.
048 */
049@ResourceDef(name="CoverageEligibilityResponse", profile="http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse")
050public class CoverageEligibilityResponse extends DomainResource {
051
052    public enum EligibilityResponseStatus {
053        /**
054         * The instance is currently in-force.
055         */
056        ACTIVE, 
057        /**
058         * The instance is withdrawn, rescinded or reversed.
059         */
060        CANCELLED, 
061        /**
062         * A new instance the contents of which is not complete.
063         */
064        DRAFT, 
065        /**
066         * The instance was entered in error.
067         */
068        ENTEREDINERROR, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static EligibilityResponseStatus fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("active".equals(codeString))
077          return ACTIVE;
078        if ("cancelled".equals(codeString))
079          return CANCELLED;
080        if ("draft".equals(codeString))
081          return DRAFT;
082        if ("entered-in-error".equals(codeString))
083          return ENTEREDINERROR;
084        if (Configuration.isAcceptInvalidEnums())
085          return null;
086        else
087          throw new FHIRException("Unknown EligibilityResponseStatus code '"+codeString+"'");
088        }
089        public String toCode() {
090          switch (this) {
091            case ACTIVE: return "active";
092            case CANCELLED: return "cancelled";
093            case DRAFT: return "draft";
094            case ENTEREDINERROR: return "entered-in-error";
095            default: return "?";
096          }
097        }
098        public String getSystem() {
099          switch (this) {
100            case ACTIVE: return "http://hl7.org/fhir/fm-status";
101            case CANCELLED: return "http://hl7.org/fhir/fm-status";
102            case DRAFT: return "http://hl7.org/fhir/fm-status";
103            case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status";
104            default: return "?";
105          }
106        }
107        public String getDefinition() {
108          switch (this) {
109            case ACTIVE: return "The instance is currently in-force.";
110            case CANCELLED: return "The instance is withdrawn, rescinded or reversed.";
111            case DRAFT: return "A new instance the contents of which is not complete.";
112            case ENTEREDINERROR: return "The instance was entered in error.";
113            default: return "?";
114          }
115        }
116        public String getDisplay() {
117          switch (this) {
118            case ACTIVE: return "Active";
119            case CANCELLED: return "Cancelled";
120            case DRAFT: return "Draft";
121            case ENTEREDINERROR: return "Entered in Error";
122            default: return "?";
123          }
124        }
125    }
126
127  public static class EligibilityResponseStatusEnumFactory implements EnumFactory<EligibilityResponseStatus> {
128    public EligibilityResponseStatus fromCode(String codeString) throws IllegalArgumentException {
129      if (codeString == null || "".equals(codeString))
130            if (codeString == null || "".equals(codeString))
131                return null;
132        if ("active".equals(codeString))
133          return EligibilityResponseStatus.ACTIVE;
134        if ("cancelled".equals(codeString))
135          return EligibilityResponseStatus.CANCELLED;
136        if ("draft".equals(codeString))
137          return EligibilityResponseStatus.DRAFT;
138        if ("entered-in-error".equals(codeString))
139          return EligibilityResponseStatus.ENTEREDINERROR;
140        throw new IllegalArgumentException("Unknown EligibilityResponseStatus code '"+codeString+"'");
141        }
142        public Enumeration<EligibilityResponseStatus> fromType(Base code) throws FHIRException {
143          if (code == null)
144            return null;
145          if (code.isEmpty())
146            return new Enumeration<EligibilityResponseStatus>(this);
147          String codeString = ((PrimitiveType) code).asStringValue();
148          if (codeString == null || "".equals(codeString))
149            return null;
150        if ("active".equals(codeString))
151          return new Enumeration<EligibilityResponseStatus>(this, EligibilityResponseStatus.ACTIVE);
152        if ("cancelled".equals(codeString))
153          return new Enumeration<EligibilityResponseStatus>(this, EligibilityResponseStatus.CANCELLED);
154        if ("draft".equals(codeString))
155          return new Enumeration<EligibilityResponseStatus>(this, EligibilityResponseStatus.DRAFT);
156        if ("entered-in-error".equals(codeString))
157          return new Enumeration<EligibilityResponseStatus>(this, EligibilityResponseStatus.ENTEREDINERROR);
158        throw new FHIRException("Unknown EligibilityResponseStatus code '"+codeString+"'");
159        }
160    public String toCode(EligibilityResponseStatus code) {
161      if (code == EligibilityResponseStatus.ACTIVE)
162        return "active";
163      if (code == EligibilityResponseStatus.CANCELLED)
164        return "cancelled";
165      if (code == EligibilityResponseStatus.DRAFT)
166        return "draft";
167      if (code == EligibilityResponseStatus.ENTEREDINERROR)
168        return "entered-in-error";
169      return "?";
170      }
171    public String toSystem(EligibilityResponseStatus code) {
172      return code.getSystem();
173      }
174    }
175
176    public enum EligibilityResponsePurpose {
177        /**
178         * The prior authorization requirements for the listed, or discovered if specified, converages for the categories of service and/or specifed biling codes are requested.
179         */
180        AUTHREQUIREMENTS, 
181        /**
182         * The plan benefits and optionally benefits consumed  for the listed, or discovered if specified, converages are requested.
183         */
184        BENEFITS, 
185        /**
186         * The insurer is requested to report on any coverages which they are aware of in addition to any specifed.
187         */
188        DISCOVERY, 
189        /**
190         * A check that the specified coverages are in-force is requested.
191         */
192        VALIDATION, 
193        /**
194         * added to help the parsers with the generic types
195         */
196        NULL;
197        public static EligibilityResponsePurpose fromCode(String codeString) throws FHIRException {
198            if (codeString == null || "".equals(codeString))
199                return null;
200        if ("auth-requirements".equals(codeString))
201          return AUTHREQUIREMENTS;
202        if ("benefits".equals(codeString))
203          return BENEFITS;
204        if ("discovery".equals(codeString))
205          return DISCOVERY;
206        if ("validation".equals(codeString))
207          return VALIDATION;
208        if (Configuration.isAcceptInvalidEnums())
209          return null;
210        else
211          throw new FHIRException("Unknown EligibilityResponsePurpose code '"+codeString+"'");
212        }
213        public String toCode() {
214          switch (this) {
215            case AUTHREQUIREMENTS: return "auth-requirements";
216            case BENEFITS: return "benefits";
217            case DISCOVERY: return "discovery";
218            case VALIDATION: return "validation";
219            default: return "?";
220          }
221        }
222        public String getSystem() {
223          switch (this) {
224            case AUTHREQUIREMENTS: return "http://hl7.org/fhir/eligibilityresponse-purpose";
225            case BENEFITS: return "http://hl7.org/fhir/eligibilityresponse-purpose";
226            case DISCOVERY: return "http://hl7.org/fhir/eligibilityresponse-purpose";
227            case VALIDATION: return "http://hl7.org/fhir/eligibilityresponse-purpose";
228            default: return "?";
229          }
230        }
231        public String getDefinition() {
232          switch (this) {
233            case AUTHREQUIREMENTS: return "The prior authorization requirements for the listed, or discovered if specified, converages for the categories of service and/or specifed biling codes are requested.";
234            case BENEFITS: return "The plan benefits and optionally benefits consumed  for the listed, or discovered if specified, converages are requested.";
235            case DISCOVERY: return "The insurer is requested to report on any coverages which they are aware of in addition to any specifed.";
236            case VALIDATION: return "A check that the specified coverages are in-force is requested.";
237            default: return "?";
238          }
239        }
240        public String getDisplay() {
241          switch (this) {
242            case AUTHREQUIREMENTS: return "Coverage auth-requirements";
243            case BENEFITS: return "Coverage benefits";
244            case DISCOVERY: return "Coverage Discovery";
245            case VALIDATION: return "Coverage Validation";
246            default: return "?";
247          }
248        }
249    }
250
251  public static class EligibilityResponsePurposeEnumFactory implements EnumFactory<EligibilityResponsePurpose> {
252    public EligibilityResponsePurpose fromCode(String codeString) throws IllegalArgumentException {
253      if (codeString == null || "".equals(codeString))
254            if (codeString == null || "".equals(codeString))
255                return null;
256        if ("auth-requirements".equals(codeString))
257          return EligibilityResponsePurpose.AUTHREQUIREMENTS;
258        if ("benefits".equals(codeString))
259          return EligibilityResponsePurpose.BENEFITS;
260        if ("discovery".equals(codeString))
261          return EligibilityResponsePurpose.DISCOVERY;
262        if ("validation".equals(codeString))
263          return EligibilityResponsePurpose.VALIDATION;
264        throw new IllegalArgumentException("Unknown EligibilityResponsePurpose code '"+codeString+"'");
265        }
266        public Enumeration<EligibilityResponsePurpose> fromType(Base code) throws FHIRException {
267          if (code == null)
268            return null;
269          if (code.isEmpty())
270            return new Enumeration<EligibilityResponsePurpose>(this);
271          String codeString = ((PrimitiveType) code).asStringValue();
272          if (codeString == null || "".equals(codeString))
273            return null;
274        if ("auth-requirements".equals(codeString))
275          return new Enumeration<EligibilityResponsePurpose>(this, EligibilityResponsePurpose.AUTHREQUIREMENTS);
276        if ("benefits".equals(codeString))
277          return new Enumeration<EligibilityResponsePurpose>(this, EligibilityResponsePurpose.BENEFITS);
278        if ("discovery".equals(codeString))
279          return new Enumeration<EligibilityResponsePurpose>(this, EligibilityResponsePurpose.DISCOVERY);
280        if ("validation".equals(codeString))
281          return new Enumeration<EligibilityResponsePurpose>(this, EligibilityResponsePurpose.VALIDATION);
282        throw new FHIRException("Unknown EligibilityResponsePurpose code '"+codeString+"'");
283        }
284    public String toCode(EligibilityResponsePurpose code) {
285      if (code == EligibilityResponsePurpose.AUTHREQUIREMENTS)
286        return "auth-requirements";
287      if (code == EligibilityResponsePurpose.BENEFITS)
288        return "benefits";
289      if (code == EligibilityResponsePurpose.DISCOVERY)
290        return "discovery";
291      if (code == EligibilityResponsePurpose.VALIDATION)
292        return "validation";
293      return "?";
294      }
295    public String toSystem(EligibilityResponsePurpose code) {
296      return code.getSystem();
297      }
298    }
299
300    @Block()
301    public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement {
302        /**
303         * A suite of updated or additional Coverages from the Insurer.
304         */
305        @Child(name = "coverage", type = {Coverage.class}, order=1, min=0, max=1, modifier=false, summary=false)
306        @Description(shortDefinition="Updated Coverage details", formalDefinition="A suite of updated or additional Coverages from the Insurer." )
307        protected Reference coverage;
308
309        /**
310         * The actual object that is the target of the reference (A suite of updated or additional Coverages from the Insurer.)
311         */
312        protected Coverage coverageTarget;
313
314        /**
315         * The contract resource which may provide more detailed information.
316         */
317        @Child(name = "contract", type = {Contract.class}, order=2, min=0, max=1, modifier=false, summary=false)
318        @Description(shortDefinition="Contract details", formalDefinition="The contract resource which may provide more detailed information." )
319        protected Reference contract;
320
321        /**
322         * The actual object that is the target of the reference (The contract resource which may provide more detailed information.)
323         */
324        protected Contract contractTarget;
325
326        /**
327         * Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.
328         */
329        @Child(name = "inforce", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
330        @Description(shortDefinition="Coverage inforce indicator", formalDefinition="Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates." )
331        protected BooleanType inforce;
332
333        /**
334         * Benefits and optionally current balances by Category or Service.
335         */
336        @Child(name = "item", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
337        @Description(shortDefinition="Benefits and Authorization requirements by Category or Service", formalDefinition="Benefits and optionally current balances by Category or Service." )
338        protected List<ItemsComponent> item;
339
340        private static final long serialVersionUID = -633294702L;
341
342    /**
343     * Constructor
344     */
345      public InsuranceComponent() {
346        super();
347      }
348
349        /**
350         * @return {@link #coverage} (A suite of updated or additional Coverages from the Insurer.)
351         */
352        public Reference getCoverage() { 
353          if (this.coverage == null)
354            if (Configuration.errorOnAutoCreate())
355              throw new Error("Attempt to auto-create InsuranceComponent.coverage");
356            else if (Configuration.doAutoCreate())
357              this.coverage = new Reference(); // cc
358          return this.coverage;
359        }
360
361        public boolean hasCoverage() { 
362          return this.coverage != null && !this.coverage.isEmpty();
363        }
364
365        /**
366         * @param value {@link #coverage} (A suite of updated or additional Coverages from the Insurer.)
367         */
368        public InsuranceComponent setCoverage(Reference value) { 
369          this.coverage = value;
370          return this;
371        }
372
373        /**
374         * @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. (A suite of updated or additional Coverages from the Insurer.)
375         */
376        public Coverage getCoverageTarget() { 
377          if (this.coverageTarget == null)
378            if (Configuration.errorOnAutoCreate())
379              throw new Error("Attempt to auto-create InsuranceComponent.coverage");
380            else if (Configuration.doAutoCreate())
381              this.coverageTarget = new Coverage(); // aa
382          return this.coverageTarget;
383        }
384
385        /**
386         * @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. (A suite of updated or additional Coverages from the Insurer.)
387         */
388        public InsuranceComponent setCoverageTarget(Coverage value) { 
389          this.coverageTarget = value;
390          return this;
391        }
392
393        /**
394         * @return {@link #contract} (The contract resource which may provide more detailed information.)
395         */
396        public Reference getContract() { 
397          if (this.contract == null)
398            if (Configuration.errorOnAutoCreate())
399              throw new Error("Attempt to auto-create InsuranceComponent.contract");
400            else if (Configuration.doAutoCreate())
401              this.contract = new Reference(); // cc
402          return this.contract;
403        }
404
405        public boolean hasContract() { 
406          return this.contract != null && !this.contract.isEmpty();
407        }
408
409        /**
410         * @param value {@link #contract} (The contract resource which may provide more detailed information.)
411         */
412        public InsuranceComponent setContract(Reference value) { 
413          this.contract = value;
414          return this;
415        }
416
417        /**
418         * @return {@link #contract} 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 contract resource which may provide more detailed information.)
419         */
420        public Contract getContractTarget() { 
421          if (this.contractTarget == null)
422            if (Configuration.errorOnAutoCreate())
423              throw new Error("Attempt to auto-create InsuranceComponent.contract");
424            else if (Configuration.doAutoCreate())
425              this.contractTarget = new Contract(); // aa
426          return this.contractTarget;
427        }
428
429        /**
430         * @param value {@link #contract} 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 contract resource which may provide more detailed information.)
431         */
432        public InsuranceComponent setContractTarget(Contract value) { 
433          this.contractTarget = value;
434          return this;
435        }
436
437        /**
438         * @return {@link #inforce} (Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value
439         */
440        public BooleanType getInforceElement() { 
441          if (this.inforce == null)
442            if (Configuration.errorOnAutoCreate())
443              throw new Error("Attempt to auto-create InsuranceComponent.inforce");
444            else if (Configuration.doAutoCreate())
445              this.inforce = new BooleanType(); // bb
446          return this.inforce;
447        }
448
449        public boolean hasInforceElement() { 
450          return this.inforce != null && !this.inforce.isEmpty();
451        }
452
453        public boolean hasInforce() { 
454          return this.inforce != null && !this.inforce.isEmpty();
455        }
456
457        /**
458         * @param value {@link #inforce} (Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value
459         */
460        public InsuranceComponent setInforceElement(BooleanType value) { 
461          this.inforce = value;
462          return this;
463        }
464
465        /**
466         * @return Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.
467         */
468        public boolean getInforce() { 
469          return this.inforce == null || this.inforce.isEmpty() ? false : this.inforce.getValue();
470        }
471
472        /**
473         * @param value Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.
474         */
475        public InsuranceComponent setInforce(boolean value) { 
476            if (this.inforce == null)
477              this.inforce = new BooleanType();
478            this.inforce.setValue(value);
479          return this;
480        }
481
482        /**
483         * @return {@link #item} (Benefits and optionally current balances by Category or Service.)
484         */
485        public List<ItemsComponent> getItem() { 
486          if (this.item == null)
487            this.item = new ArrayList<ItemsComponent>();
488          return this.item;
489        }
490
491        /**
492         * @return Returns a reference to <code>this</code> for easy method chaining
493         */
494        public InsuranceComponent setItem(List<ItemsComponent> theItem) { 
495          this.item = theItem;
496          return this;
497        }
498
499        public boolean hasItem() { 
500          if (this.item == null)
501            return false;
502          for (ItemsComponent item : this.item)
503            if (!item.isEmpty())
504              return true;
505          return false;
506        }
507
508        public ItemsComponent addItem() { //3
509          ItemsComponent t = new ItemsComponent();
510          if (this.item == null)
511            this.item = new ArrayList<ItemsComponent>();
512          this.item.add(t);
513          return t;
514        }
515
516        public InsuranceComponent addItem(ItemsComponent t) { //3
517          if (t == null)
518            return this;
519          if (this.item == null)
520            this.item = new ArrayList<ItemsComponent>();
521          this.item.add(t);
522          return this;
523        }
524
525        /**
526         * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
527         */
528        public ItemsComponent getItemFirstRep() { 
529          if (getItem().isEmpty()) {
530            addItem();
531          }
532          return getItem().get(0);
533        }
534
535        protected void listChildren(List<Property> children) {
536          super.listChildren(children);
537          children.add(new Property("coverage", "Reference(Coverage)", "A suite of updated or additional Coverages from the Insurer.", 0, 1, coverage));
538          children.add(new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, 1, contract));
539          children.add(new Property("inforce", "boolean", "Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.", 0, 1, inforce));
540          children.add(new Property("item", "", "Benefits and optionally current balances by Category or Service.", 0, java.lang.Integer.MAX_VALUE, item));
541        }
542
543        @Override
544        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
545          switch (_hash) {
546          case -351767064: /*coverage*/  return new Property("coverage", "Reference(Coverage)", "A suite of updated or additional Coverages from the Insurer.", 0, 1, coverage);
547          case -566947566: /*contract*/  return new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, 1, contract);
548          case 1945431270: /*inforce*/  return new Property("inforce", "boolean", "Flag indicating if the coverage provided is inforce currently  if no service date(s) specified or for the whole duration of the service dates.", 0, 1, inforce);
549          case 3242771: /*item*/  return new Property("item", "", "Benefits and optionally current balances by Category or Service.", 0, java.lang.Integer.MAX_VALUE, item);
550          default: return super.getNamedProperty(_hash, _name, _checkValid);
551          }
552
553        }
554
555      @Override
556      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
557        switch (hash) {
558        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
559        case -566947566: /*contract*/ return this.contract == null ? new Base[0] : new Base[] {this.contract}; // Reference
560        case 1945431270: /*inforce*/ return this.inforce == null ? new Base[0] : new Base[] {this.inforce}; // BooleanType
561        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent
562        default: return super.getProperty(hash, name, checkValid);
563        }
564
565      }
566
567      @Override
568      public Base setProperty(int hash, String name, Base value) throws FHIRException {
569        switch (hash) {
570        case -351767064: // coverage
571          this.coverage = castToReference(value); // Reference
572          return value;
573        case -566947566: // contract
574          this.contract = castToReference(value); // Reference
575          return value;
576        case 1945431270: // inforce
577          this.inforce = castToBoolean(value); // BooleanType
578          return value;
579        case 3242771: // item
580          this.getItem().add((ItemsComponent) value); // ItemsComponent
581          return value;
582        default: return super.setProperty(hash, name, value);
583        }
584
585      }
586
587      @Override
588      public Base setProperty(String name, Base value) throws FHIRException {
589        if (name.equals("coverage")) {
590          this.coverage = castToReference(value); // Reference
591        } else if (name.equals("contract")) {
592          this.contract = castToReference(value); // Reference
593        } else if (name.equals("inforce")) {
594          this.inforce = castToBoolean(value); // BooleanType
595        } else if (name.equals("item")) {
596          this.getItem().add((ItemsComponent) value);
597        } else
598          return super.setProperty(name, value);
599        return value;
600      }
601
602      @Override
603      public Base makeProperty(int hash, String name) throws FHIRException {
604        switch (hash) {
605        case -351767064:  return getCoverage(); 
606        case -566947566:  return getContract(); 
607        case 1945431270:  return getInforceElement();
608        case 3242771:  return addItem(); 
609        default: return super.makeProperty(hash, name);
610        }
611
612      }
613
614      @Override
615      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
616        switch (hash) {
617        case -351767064: /*coverage*/ return new String[] {"Reference"};
618        case -566947566: /*contract*/ return new String[] {"Reference"};
619        case 1945431270: /*inforce*/ return new String[] {"boolean"};
620        case 3242771: /*item*/ return new String[] {};
621        default: return super.getTypesForProperty(hash, name);
622        }
623
624      }
625
626      @Override
627      public Base addChild(String name) throws FHIRException {
628        if (name.equals("coverage")) {
629          this.coverage = new Reference();
630          return this.coverage;
631        }
632        else if (name.equals("contract")) {
633          this.contract = new Reference();
634          return this.contract;
635        }
636        else if (name.equals("inforce")) {
637          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.inforce");
638        }
639        else if (name.equals("item")) {
640          return addItem();
641        }
642        else
643          return super.addChild(name);
644      }
645
646      public InsuranceComponent copy() {
647        InsuranceComponent dst = new InsuranceComponent();
648        copyValues(dst);
649        dst.coverage = coverage == null ? null : coverage.copy();
650        dst.contract = contract == null ? null : contract.copy();
651        dst.inforce = inforce == null ? null : inforce.copy();
652        if (item != null) {
653          dst.item = new ArrayList<ItemsComponent>();
654          for (ItemsComponent i : item)
655            dst.item.add(i.copy());
656        };
657        return dst;
658      }
659
660      @Override
661      public boolean equalsDeep(Base other_) {
662        if (!super.equalsDeep(other_))
663          return false;
664        if (!(other_ instanceof InsuranceComponent))
665          return false;
666        InsuranceComponent o = (InsuranceComponent) other_;
667        return compareDeep(coverage, o.coverage, true) && compareDeep(contract, o.contract, true) && compareDeep(inforce, o.inforce, true)
668           && compareDeep(item, o.item, true);
669      }
670
671      @Override
672      public boolean equalsShallow(Base other_) {
673        if (!super.equalsShallow(other_))
674          return false;
675        if (!(other_ instanceof InsuranceComponent))
676          return false;
677        InsuranceComponent o = (InsuranceComponent) other_;
678        return compareValues(inforce, o.inforce, true);
679      }
680
681      public boolean isEmpty() {
682        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coverage, contract, inforce
683          , item);
684      }
685
686  public String fhirType() {
687    return "CoverageEligibilityResponse.insurance";
688
689  }
690
691  }
692
693    @Block()
694    public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement {
695        /**
696         * High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.
697         */
698        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
699        @Description(shortDefinition="Type of service", formalDefinition="High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." )
700        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-benefitcategory")
701        protected CodeableConcept category;
702
703        /**
704         * A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).
705         */
706        @Child(name = "billcode", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
707        @Description(shortDefinition="Billing Code", formalDefinition="A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI)." )
708        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
709        protected CodeableConcept billcode;
710
711        /**
712         * 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.
713         */
714        @Child(name = "modifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
715        @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." )
716        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers")
717        protected List<CodeableConcept> modifier;
718
719        /**
720         * The practitioner who is responsible for the services rendered to the patient.
721         */
722        @Child(name = "provider", type = {Practitioner.class, PractitionerRole.class}, order=4, min=0, max=1, modifier=false, summary=false)
723        @Description(shortDefinition="Performing practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
724        protected Reference provider;
725
726        /**
727         * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
728         */
729        protected Resource providerTarget;
730
731        /**
732         * True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.
733         */
734        @Child(name = "excluded", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false)
735        @Description(shortDefinition="Excluded from the plan", formalDefinition="True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage." )
736        protected BooleanType excluded;
737
738        /**
739         * A short name or tag for the benefit, for example MED01, or DENT2.
740         */
741        @Child(name = "name", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
742        @Description(shortDefinition="Short name for the benefit", formalDefinition="A short name or tag for the benefit, for example MED01, or DENT2." )
743        protected StringType name;
744
745        /**
746         * A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.
747         */
748        @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
749        @Description(shortDefinition="Description of the benefit or services covered", formalDefinition="A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'." )
750        protected StringType description;
751
752        /**
753         * Network designation.
754         */
755        @Child(name = "network", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false)
756        @Description(shortDefinition="In or out of network", formalDefinition="Network designation." )
757        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-network")
758        protected CodeableConcept network;
759
760        /**
761         * Unit designation: individual or family.
762         */
763        @Child(name = "unit", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false)
764        @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." )
765        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-unit")
766        protected CodeableConcept unit;
767
768        /**
769         * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.
770         */
771        @Child(name = "term", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false)
772        @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'." )
773        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-term")
774        protected CodeableConcept term;
775
776        /**
777         * Benefits used to date.
778         */
779        @Child(name = "benefit", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
780        @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits used to date." )
781        protected List<BenefitComponent> benefit;
782
783        /**
784         * A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.
785         */
786        @Child(name = "authorizationRequired", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=false)
787        @Description(shortDefinition="Authorization required flag", formalDefinition="A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery." )
788        protected BooleanType authorizationRequired;
789
790        /**
791         * Codes or comments regarding information or actions assciated with the pre-authorization.
792         */
793        @Child(name = "authorizationSupporting", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
794        @Description(shortDefinition="Codes or text of materials to be submitted", formalDefinition="Codes or comments regarding information or actions assciated with the pre-authorization." )
795        protected List<CodeableConcept> authorizationSupporting;
796
797        /**
798         * A descriptive document location.
799         */
800        @Child(name = "authorizationUrl", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=false)
801        @Description(shortDefinition="Pre-authorization requirements", formalDefinition="A descriptive document location." )
802        protected UriType authorizationUrl;
803
804        private static final long serialVersionUID = -950511602L;
805
806    /**
807     * Constructor
808     */
809      public ItemsComponent() {
810        super();
811      }
812
813        /**
814         * @return {@link #category} (High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.)
815         */
816        public CodeableConcept getCategory() { 
817          if (this.category == null)
818            if (Configuration.errorOnAutoCreate())
819              throw new Error("Attempt to auto-create ItemsComponent.category");
820            else if (Configuration.doAutoCreate())
821              this.category = new CodeableConcept(); // cc
822          return this.category;
823        }
824
825        public boolean hasCategory() { 
826          return this.category != null && !this.category.isEmpty();
827        }
828
829        /**
830         * @param value {@link #category} (High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.)
831         */
832        public ItemsComponent setCategory(CodeableConcept value) { 
833          this.category = value;
834          return this;
835        }
836
837        /**
838         * @return {@link #billcode} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).)
839         */
840        public CodeableConcept getBillcode() { 
841          if (this.billcode == null)
842            if (Configuration.errorOnAutoCreate())
843              throw new Error("Attempt to auto-create ItemsComponent.billcode");
844            else if (Configuration.doAutoCreate())
845              this.billcode = new CodeableConcept(); // cc
846          return this.billcode;
847        }
848
849        public boolean hasBillcode() { 
850          return this.billcode != null && !this.billcode.isEmpty();
851        }
852
853        /**
854         * @param value {@link #billcode} (A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).)
855         */
856        public ItemsComponent setBillcode(CodeableConcept value) { 
857          this.billcode = value;
858          return this;
859        }
860
861        /**
862         * @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.)
863         */
864        public List<CodeableConcept> getModifier() { 
865          if (this.modifier == null)
866            this.modifier = new ArrayList<CodeableConcept>();
867          return this.modifier;
868        }
869
870        /**
871         * @return Returns a reference to <code>this</code> for easy method chaining
872         */
873        public ItemsComponent setModifier(List<CodeableConcept> theModifier) { 
874          this.modifier = theModifier;
875          return this;
876        }
877
878        public boolean hasModifier() { 
879          if (this.modifier == null)
880            return false;
881          for (CodeableConcept item : this.modifier)
882            if (!item.isEmpty())
883              return true;
884          return false;
885        }
886
887        public CodeableConcept addModifier() { //3
888          CodeableConcept t = new CodeableConcept();
889          if (this.modifier == null)
890            this.modifier = new ArrayList<CodeableConcept>();
891          this.modifier.add(t);
892          return t;
893        }
894
895        public ItemsComponent addModifier(CodeableConcept t) { //3
896          if (t == null)
897            return this;
898          if (this.modifier == null)
899            this.modifier = new ArrayList<CodeableConcept>();
900          this.modifier.add(t);
901          return this;
902        }
903
904        /**
905         * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist
906         */
907        public CodeableConcept getModifierFirstRep() { 
908          if (getModifier().isEmpty()) {
909            addModifier();
910          }
911          return getModifier().get(0);
912        }
913
914        /**
915         * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
916         */
917        public Reference getProvider() { 
918          if (this.provider == null)
919            if (Configuration.errorOnAutoCreate())
920              throw new Error("Attempt to auto-create ItemsComponent.provider");
921            else if (Configuration.doAutoCreate())
922              this.provider = new Reference(); // cc
923          return this.provider;
924        }
925
926        public boolean hasProvider() { 
927          return this.provider != null && !this.provider.isEmpty();
928        }
929
930        /**
931         * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
932         */
933        public ItemsComponent setProvider(Reference value) { 
934          this.provider = value;
935          return this;
936        }
937
938        /**
939         * @return {@link #provider} 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.)
940         */
941        public Resource getProviderTarget() { 
942          return this.providerTarget;
943        }
944
945        /**
946         * @param value {@link #provider} 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.)
947         */
948        public ItemsComponent setProviderTarget(Resource value) { 
949          this.providerTarget = value;
950          return this;
951        }
952
953        /**
954         * @return {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value
955         */
956        public BooleanType getExcludedElement() { 
957          if (this.excluded == null)
958            if (Configuration.errorOnAutoCreate())
959              throw new Error("Attempt to auto-create ItemsComponent.excluded");
960            else if (Configuration.doAutoCreate())
961              this.excluded = new BooleanType(); // bb
962          return this.excluded;
963        }
964
965        public boolean hasExcludedElement() { 
966          return this.excluded != null && !this.excluded.isEmpty();
967        }
968
969        public boolean hasExcluded() { 
970          return this.excluded != null && !this.excluded.isEmpty();
971        }
972
973        /**
974         * @param value {@link #excluded} (True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.). This is the underlying object with id, value and extensions. The accessor "getExcluded" gives direct access to the value
975         */
976        public ItemsComponent setExcludedElement(BooleanType value) { 
977          this.excluded = value;
978          return this;
979        }
980
981        /**
982         * @return True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.
983         */
984        public boolean getExcluded() { 
985          return this.excluded == null || this.excluded.isEmpty() ? false : this.excluded.getValue();
986        }
987
988        /**
989         * @param value True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.
990         */
991        public ItemsComponent setExcluded(boolean value) { 
992            if (this.excluded == null)
993              this.excluded = new BooleanType();
994            this.excluded.setValue(value);
995          return this;
996        }
997
998        /**
999         * @return {@link #name} (A short name or tag for the benefit, for example MED01, or DENT2.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1000         */
1001        public StringType getNameElement() { 
1002          if (this.name == null)
1003            if (Configuration.errorOnAutoCreate())
1004              throw new Error("Attempt to auto-create ItemsComponent.name");
1005            else if (Configuration.doAutoCreate())
1006              this.name = new StringType(); // bb
1007          return this.name;
1008        }
1009
1010        public boolean hasNameElement() { 
1011          return this.name != null && !this.name.isEmpty();
1012        }
1013
1014        public boolean hasName() { 
1015          return this.name != null && !this.name.isEmpty();
1016        }
1017
1018        /**
1019         * @param value {@link #name} (A short name or tag for the benefit, for example MED01, or DENT2.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1020         */
1021        public ItemsComponent setNameElement(StringType value) { 
1022          this.name = value;
1023          return this;
1024        }
1025
1026        /**
1027         * @return A short name or tag for the benefit, for example MED01, or DENT2.
1028         */
1029        public String getName() { 
1030          return this.name == null ? null : this.name.getValue();
1031        }
1032
1033        /**
1034         * @param value A short name or tag for the benefit, for example MED01, or DENT2.
1035         */
1036        public ItemsComponent setName(String value) { 
1037          if (Utilities.noString(value))
1038            this.name = null;
1039          else {
1040            if (this.name == null)
1041              this.name = new StringType();
1042            this.name.setValue(value);
1043          }
1044          return this;
1045        }
1046
1047        /**
1048         * @return {@link #description} (A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1049         */
1050        public StringType getDescriptionElement() { 
1051          if (this.description == null)
1052            if (Configuration.errorOnAutoCreate())
1053              throw new Error("Attempt to auto-create ItemsComponent.description");
1054            else if (Configuration.doAutoCreate())
1055              this.description = new StringType(); // bb
1056          return this.description;
1057        }
1058
1059        public boolean hasDescriptionElement() { 
1060          return this.description != null && !this.description.isEmpty();
1061        }
1062
1063        public boolean hasDescription() { 
1064          return this.description != null && !this.description.isEmpty();
1065        }
1066
1067        /**
1068         * @param value {@link #description} (A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1069         */
1070        public ItemsComponent setDescriptionElement(StringType value) { 
1071          this.description = value;
1072          return this;
1073        }
1074
1075        /**
1076         * @return A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.
1077         */
1078        public String getDescription() { 
1079          return this.description == null ? null : this.description.getValue();
1080        }
1081
1082        /**
1083         * @param value A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.
1084         */
1085        public ItemsComponent setDescription(String value) { 
1086          if (Utilities.noString(value))
1087            this.description = null;
1088          else {
1089            if (this.description == null)
1090              this.description = new StringType();
1091            this.description.setValue(value);
1092          }
1093          return this;
1094        }
1095
1096        /**
1097         * @return {@link #network} (Network designation.)
1098         */
1099        public CodeableConcept getNetwork() { 
1100          if (this.network == null)
1101            if (Configuration.errorOnAutoCreate())
1102              throw new Error("Attempt to auto-create ItemsComponent.network");
1103            else if (Configuration.doAutoCreate())
1104              this.network = new CodeableConcept(); // cc
1105          return this.network;
1106        }
1107
1108        public boolean hasNetwork() { 
1109          return this.network != null && !this.network.isEmpty();
1110        }
1111
1112        /**
1113         * @param value {@link #network} (Network designation.)
1114         */
1115        public ItemsComponent setNetwork(CodeableConcept value) { 
1116          this.network = value;
1117          return this;
1118        }
1119
1120        /**
1121         * @return {@link #unit} (Unit designation: individual or family.)
1122         */
1123        public CodeableConcept getUnit() { 
1124          if (this.unit == null)
1125            if (Configuration.errorOnAutoCreate())
1126              throw new Error("Attempt to auto-create ItemsComponent.unit");
1127            else if (Configuration.doAutoCreate())
1128              this.unit = new CodeableConcept(); // cc
1129          return this.unit;
1130        }
1131
1132        public boolean hasUnit() { 
1133          return this.unit != null && !this.unit.isEmpty();
1134        }
1135
1136        /**
1137         * @param value {@link #unit} (Unit designation: individual or family.)
1138         */
1139        public ItemsComponent setUnit(CodeableConcept value) { 
1140          this.unit = value;
1141          return this;
1142        }
1143
1144        /**
1145         * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.)
1146         */
1147        public CodeableConcept getTerm() { 
1148          if (this.term == null)
1149            if (Configuration.errorOnAutoCreate())
1150              throw new Error("Attempt to auto-create ItemsComponent.term");
1151            else if (Configuration.doAutoCreate())
1152              this.term = new CodeableConcept(); // cc
1153          return this.term;
1154        }
1155
1156        public boolean hasTerm() { 
1157          return this.term != null && !this.term.isEmpty();
1158        }
1159
1160        /**
1161         * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.)
1162         */
1163        public ItemsComponent setTerm(CodeableConcept value) { 
1164          this.term = value;
1165          return this;
1166        }
1167
1168        /**
1169         * @return {@link #benefit} (Benefits used to date.)
1170         */
1171        public List<BenefitComponent> getBenefit() { 
1172          if (this.benefit == null)
1173            this.benefit = new ArrayList<BenefitComponent>();
1174          return this.benefit;
1175        }
1176
1177        /**
1178         * @return Returns a reference to <code>this</code> for easy method chaining
1179         */
1180        public ItemsComponent setBenefit(List<BenefitComponent> theBenefit) { 
1181          this.benefit = theBenefit;
1182          return this;
1183        }
1184
1185        public boolean hasBenefit() { 
1186          if (this.benefit == null)
1187            return false;
1188          for (BenefitComponent item : this.benefit)
1189            if (!item.isEmpty())
1190              return true;
1191          return false;
1192        }
1193
1194        public BenefitComponent addBenefit() { //3
1195          BenefitComponent t = new BenefitComponent();
1196          if (this.benefit == null)
1197            this.benefit = new ArrayList<BenefitComponent>();
1198          this.benefit.add(t);
1199          return t;
1200        }
1201
1202        public ItemsComponent addBenefit(BenefitComponent t) { //3
1203          if (t == null)
1204            return this;
1205          if (this.benefit == null)
1206            this.benefit = new ArrayList<BenefitComponent>();
1207          this.benefit.add(t);
1208          return this;
1209        }
1210
1211        /**
1212         * @return The first repetition of repeating field {@link #benefit}, creating it if it does not already exist
1213         */
1214        public BenefitComponent getBenefitFirstRep() { 
1215          if (getBenefit().isEmpty()) {
1216            addBenefit();
1217          }
1218          return getBenefit().get(0);
1219        }
1220
1221        /**
1222         * @return {@link #authorizationRequired} (A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.). This is the underlying object with id, value and extensions. The accessor "getAuthorizationRequired" gives direct access to the value
1223         */
1224        public BooleanType getAuthorizationRequiredElement() { 
1225          if (this.authorizationRequired == null)
1226            if (Configuration.errorOnAutoCreate())
1227              throw new Error("Attempt to auto-create ItemsComponent.authorizationRequired");
1228            else if (Configuration.doAutoCreate())
1229              this.authorizationRequired = new BooleanType(); // bb
1230          return this.authorizationRequired;
1231        }
1232
1233        public boolean hasAuthorizationRequiredElement() { 
1234          return this.authorizationRequired != null && !this.authorizationRequired.isEmpty();
1235        }
1236
1237        public boolean hasAuthorizationRequired() { 
1238          return this.authorizationRequired != null && !this.authorizationRequired.isEmpty();
1239        }
1240
1241        /**
1242         * @param value {@link #authorizationRequired} (A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.). This is the underlying object with id, value and extensions. The accessor "getAuthorizationRequired" gives direct access to the value
1243         */
1244        public ItemsComponent setAuthorizationRequiredElement(BooleanType value) { 
1245          this.authorizationRequired = value;
1246          return this;
1247        }
1248
1249        /**
1250         * @return A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.
1251         */
1252        public boolean getAuthorizationRequired() { 
1253          return this.authorizationRequired == null || this.authorizationRequired.isEmpty() ? false : this.authorizationRequired.getValue();
1254        }
1255
1256        /**
1257         * @param value A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.
1258         */
1259        public ItemsComponent setAuthorizationRequired(boolean value) { 
1260            if (this.authorizationRequired == null)
1261              this.authorizationRequired = new BooleanType();
1262            this.authorizationRequired.setValue(value);
1263          return this;
1264        }
1265
1266        /**
1267         * @return {@link #authorizationSupporting} (Codes or comments regarding information or actions assciated with the pre-authorization.)
1268         */
1269        public List<CodeableConcept> getAuthorizationSupporting() { 
1270          if (this.authorizationSupporting == null)
1271            this.authorizationSupporting = new ArrayList<CodeableConcept>();
1272          return this.authorizationSupporting;
1273        }
1274
1275        /**
1276         * @return Returns a reference to <code>this</code> for easy method chaining
1277         */
1278        public ItemsComponent setAuthorizationSupporting(List<CodeableConcept> theAuthorizationSupporting) { 
1279          this.authorizationSupporting = theAuthorizationSupporting;
1280          return this;
1281        }
1282
1283        public boolean hasAuthorizationSupporting() { 
1284          if (this.authorizationSupporting == null)
1285            return false;
1286          for (CodeableConcept item : this.authorizationSupporting)
1287            if (!item.isEmpty())
1288              return true;
1289          return false;
1290        }
1291
1292        public CodeableConcept addAuthorizationSupporting() { //3
1293          CodeableConcept t = new CodeableConcept();
1294          if (this.authorizationSupporting == null)
1295            this.authorizationSupporting = new ArrayList<CodeableConcept>();
1296          this.authorizationSupporting.add(t);
1297          return t;
1298        }
1299
1300        public ItemsComponent addAuthorizationSupporting(CodeableConcept t) { //3
1301          if (t == null)
1302            return this;
1303          if (this.authorizationSupporting == null)
1304            this.authorizationSupporting = new ArrayList<CodeableConcept>();
1305          this.authorizationSupporting.add(t);
1306          return this;
1307        }
1308
1309        /**
1310         * @return The first repetition of repeating field {@link #authorizationSupporting}, creating it if it does not already exist
1311         */
1312        public CodeableConcept getAuthorizationSupportingFirstRep() { 
1313          if (getAuthorizationSupporting().isEmpty()) {
1314            addAuthorizationSupporting();
1315          }
1316          return getAuthorizationSupporting().get(0);
1317        }
1318
1319        /**
1320         * @return {@link #authorizationUrl} (A descriptive document location.). This is the underlying object with id, value and extensions. The accessor "getAuthorizationUrl" gives direct access to the value
1321         */
1322        public UriType getAuthorizationUrlElement() { 
1323          if (this.authorizationUrl == null)
1324            if (Configuration.errorOnAutoCreate())
1325              throw new Error("Attempt to auto-create ItemsComponent.authorizationUrl");
1326            else if (Configuration.doAutoCreate())
1327              this.authorizationUrl = new UriType(); // bb
1328          return this.authorizationUrl;
1329        }
1330
1331        public boolean hasAuthorizationUrlElement() { 
1332          return this.authorizationUrl != null && !this.authorizationUrl.isEmpty();
1333        }
1334
1335        public boolean hasAuthorizationUrl() { 
1336          return this.authorizationUrl != null && !this.authorizationUrl.isEmpty();
1337        }
1338
1339        /**
1340         * @param value {@link #authorizationUrl} (A descriptive document location.). This is the underlying object with id, value and extensions. The accessor "getAuthorizationUrl" gives direct access to the value
1341         */
1342        public ItemsComponent setAuthorizationUrlElement(UriType value) { 
1343          this.authorizationUrl = value;
1344          return this;
1345        }
1346
1347        /**
1348         * @return A descriptive document location.
1349         */
1350        public String getAuthorizationUrl() { 
1351          return this.authorizationUrl == null ? null : this.authorizationUrl.getValue();
1352        }
1353
1354        /**
1355         * @param value A descriptive document location.
1356         */
1357        public ItemsComponent setAuthorizationUrl(String value) { 
1358          if (Utilities.noString(value))
1359            this.authorizationUrl = null;
1360          else {
1361            if (this.authorizationUrl == null)
1362              this.authorizationUrl = new UriType();
1363            this.authorizationUrl.setValue(value);
1364          }
1365          return this;
1366        }
1367
1368        protected void listChildren(List<Property> children) {
1369          super.listChildren(children);
1370          children.add(new Property("category", "CodeableConcept", "High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, 1, category));
1371          children.add(new Property("billcode", "CodeableConcept", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, 1, billcode));
1372          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));
1373          children.add(new Property("provider", "Reference(Practitioner|PractitionerRole)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider));
1374          children.add(new Property("excluded", "boolean", "True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.", 0, 1, excluded));
1375          children.add(new Property("name", "string", "A short name or tag for the benefit, for example MED01, or DENT2.", 0, 1, name));
1376          children.add(new Property("description", "string", "A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.", 0, 1, description));
1377          children.add(new Property("network", "CodeableConcept", "Network designation.", 0, 1, network));
1378          children.add(new Property("unit", "CodeableConcept", "Unit designation: individual or family.", 0, 1, unit));
1379          children.add(new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.", 0, 1, term));
1380          children.add(new Property("benefit", "", "Benefits used to date.", 0, java.lang.Integer.MAX_VALUE, benefit));
1381          children.add(new Property("authorizationRequired", "boolean", "A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.", 0, 1, authorizationRequired));
1382          children.add(new Property("authorizationSupporting", "CodeableConcept", "Codes or comments regarding information or actions assciated with the pre-authorization.", 0, java.lang.Integer.MAX_VALUE, authorizationSupporting));
1383          children.add(new Property("authorizationUrl", "uri", "A descriptive document location.", 0, 1, authorizationUrl));
1384        }
1385
1386        @Override
1387        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1388          switch (_hash) {
1389          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "High-level Dental, Vision, Medical, Pharmacy, Rehab etc. and detailed types of services: Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, 1, category);
1390          case 890074740: /*billcode*/  return new Property("billcode", "CodeableConcept", "A code to indicate the Professional Service or Product supplied (eg. CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).", 0, 1, billcode);
1391          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);
1392          case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner|PractitionerRole)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider);
1393          case 1994055114: /*excluded*/  return new Property("excluded", "boolean", "True if the indicated class of service is excluded from the plan, missing or False indicated the service is included in the coverage.", 0, 1, excluded);
1394          case 3373707: /*name*/  return new Property("name", "string", "A short name or tag for the benefit, for example MED01, or DENT2.", 0, 1, name);
1395          case -1724546052: /*description*/  return new Property("description", "string", "A richer description of the benefit, for example 'DENT2 covers 100% of basic, 50% of major but excludes Ortho, Implants and Cosmetic services'.", 0, 1, description);
1396          case 1843485230: /*network*/  return new Property("network", "CodeableConcept", "Network designation.", 0, 1, network);
1397          case 3594628: /*unit*/  return new Property("unit", "CodeableConcept", "Unit designation: individual or family.", 0, 1, unit);
1398          case 3556460: /*term*/  return new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.", 0, 1, term);
1399          case -222710633: /*benefit*/  return new Property("benefit", "", "Benefits used to date.", 0, java.lang.Integer.MAX_VALUE, benefit);
1400          case 374204216: /*authorizationRequired*/  return new Property("authorizationRequired", "boolean", "A boolean flag indicating whether a prior authorization or pre-authorization is required prior to actual service delivery.", 0, 1, authorizationRequired);
1401          case -1931146484: /*authorizationSupporting*/  return new Property("authorizationSupporting", "CodeableConcept", "Codes or comments regarding information or actions assciated with the pre-authorization.", 0, java.lang.Integer.MAX_VALUE, authorizationSupporting);
1402          case 1409445430: /*authorizationUrl*/  return new Property("authorizationUrl", "uri", "A descriptive document location.", 0, 1, authorizationUrl);
1403          default: return super.getNamedProperty(_hash, _name, _checkValid);
1404          }
1405
1406        }
1407
1408      @Override
1409      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1410        switch (hash) {
1411        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1412        case 890074740: /*billcode*/ return this.billcode == null ? new Base[0] : new Base[] {this.billcode}; // CodeableConcept
1413        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept
1414        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference
1415        case 1994055114: /*excluded*/ return this.excluded == null ? new Base[0] : new Base[] {this.excluded}; // BooleanType
1416        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1417        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1418        case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // CodeableConcept
1419        case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept
1420        case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept
1421        case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : this.benefit.toArray(new Base[this.benefit.size()]); // BenefitComponent
1422        case 374204216: /*authorizationRequired*/ return this.authorizationRequired == null ? new Base[0] : new Base[] {this.authorizationRequired}; // BooleanType
1423        case -1931146484: /*authorizationSupporting*/ return this.authorizationSupporting == null ? new Base[0] : this.authorizationSupporting.toArray(new Base[this.authorizationSupporting.size()]); // CodeableConcept
1424        case 1409445430: /*authorizationUrl*/ return this.authorizationUrl == null ? new Base[0] : new Base[] {this.authorizationUrl}; // UriType
1425        default: return super.getProperty(hash, name, checkValid);
1426        }
1427
1428      }
1429
1430      @Override
1431      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1432        switch (hash) {
1433        case 50511102: // category
1434          this.category = castToCodeableConcept(value); // CodeableConcept
1435          return value;
1436        case 890074740: // billcode
1437          this.billcode = castToCodeableConcept(value); // CodeableConcept
1438          return value;
1439        case -615513385: // modifier
1440          this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept
1441          return value;
1442        case -987494927: // provider
1443          this.provider = castToReference(value); // Reference
1444          return value;
1445        case 1994055114: // excluded
1446          this.excluded = castToBoolean(value); // BooleanType
1447          return value;
1448        case 3373707: // name
1449          this.name = castToString(value); // StringType
1450          return value;
1451        case -1724546052: // description
1452          this.description = castToString(value); // StringType
1453          return value;
1454        case 1843485230: // network
1455          this.network = castToCodeableConcept(value); // CodeableConcept
1456          return value;
1457        case 3594628: // unit
1458          this.unit = castToCodeableConcept(value); // CodeableConcept
1459          return value;
1460        case 3556460: // term
1461          this.term = castToCodeableConcept(value); // CodeableConcept
1462          return value;
1463        case -222710633: // benefit
1464          this.getBenefit().add((BenefitComponent) value); // BenefitComponent
1465          return value;
1466        case 374204216: // authorizationRequired
1467          this.authorizationRequired = castToBoolean(value); // BooleanType
1468          return value;
1469        case -1931146484: // authorizationSupporting
1470          this.getAuthorizationSupporting().add(castToCodeableConcept(value)); // CodeableConcept
1471          return value;
1472        case 1409445430: // authorizationUrl
1473          this.authorizationUrl = castToUri(value); // UriType
1474          return value;
1475        default: return super.setProperty(hash, name, value);
1476        }
1477
1478      }
1479
1480      @Override
1481      public Base setProperty(String name, Base value) throws FHIRException {
1482        if (name.equals("category")) {
1483          this.category = castToCodeableConcept(value); // CodeableConcept
1484        } else if (name.equals("billcode")) {
1485          this.billcode = castToCodeableConcept(value); // CodeableConcept
1486        } else if (name.equals("modifier")) {
1487          this.getModifier().add(castToCodeableConcept(value));
1488        } else if (name.equals("provider")) {
1489          this.provider = castToReference(value); // Reference
1490        } else if (name.equals("excluded")) {
1491          this.excluded = castToBoolean(value); // BooleanType
1492        } else if (name.equals("name")) {
1493          this.name = castToString(value); // StringType
1494        } else if (name.equals("description")) {
1495          this.description = castToString(value); // StringType
1496        } else if (name.equals("network")) {
1497          this.network = castToCodeableConcept(value); // CodeableConcept
1498        } else if (name.equals("unit")) {
1499          this.unit = castToCodeableConcept(value); // CodeableConcept
1500        } else if (name.equals("term")) {
1501          this.term = castToCodeableConcept(value); // CodeableConcept
1502        } else if (name.equals("benefit")) {
1503          this.getBenefit().add((BenefitComponent) value);
1504        } else if (name.equals("authorizationRequired")) {
1505          this.authorizationRequired = castToBoolean(value); // BooleanType
1506        } else if (name.equals("authorizationSupporting")) {
1507          this.getAuthorizationSupporting().add(castToCodeableConcept(value));
1508        } else if (name.equals("authorizationUrl")) {
1509          this.authorizationUrl = castToUri(value); // UriType
1510        } else
1511          return super.setProperty(name, value);
1512        return value;
1513      }
1514
1515      @Override
1516      public Base makeProperty(int hash, String name) throws FHIRException {
1517        switch (hash) {
1518        case 50511102:  return getCategory(); 
1519        case 890074740:  return getBillcode(); 
1520        case -615513385:  return addModifier(); 
1521        case -987494927:  return getProvider(); 
1522        case 1994055114:  return getExcludedElement();
1523        case 3373707:  return getNameElement();
1524        case -1724546052:  return getDescriptionElement();
1525        case 1843485230:  return getNetwork(); 
1526        case 3594628:  return getUnit(); 
1527        case 3556460:  return getTerm(); 
1528        case -222710633:  return addBenefit(); 
1529        case 374204216:  return getAuthorizationRequiredElement();
1530        case -1931146484:  return addAuthorizationSupporting(); 
1531        case 1409445430:  return getAuthorizationUrlElement();
1532        default: return super.makeProperty(hash, name);
1533        }
1534
1535      }
1536
1537      @Override
1538      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1539        switch (hash) {
1540        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1541        case 890074740: /*billcode*/ return new String[] {"CodeableConcept"};
1542        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
1543        case -987494927: /*provider*/ return new String[] {"Reference"};
1544        case 1994055114: /*excluded*/ return new String[] {"boolean"};
1545        case 3373707: /*name*/ return new String[] {"string"};
1546        case -1724546052: /*description*/ return new String[] {"string"};
1547        case 1843485230: /*network*/ return new String[] {"CodeableConcept"};
1548        case 3594628: /*unit*/ return new String[] {"CodeableConcept"};
1549        case 3556460: /*term*/ return new String[] {"CodeableConcept"};
1550        case -222710633: /*benefit*/ return new String[] {};
1551        case 374204216: /*authorizationRequired*/ return new String[] {"boolean"};
1552        case -1931146484: /*authorizationSupporting*/ return new String[] {"CodeableConcept"};
1553        case 1409445430: /*authorizationUrl*/ return new String[] {"uri"};
1554        default: return super.getTypesForProperty(hash, name);
1555        }
1556
1557      }
1558
1559      @Override
1560      public Base addChild(String name) throws FHIRException {
1561        if (name.equals("category")) {
1562          this.category = new CodeableConcept();
1563          return this.category;
1564        }
1565        else if (name.equals("billcode")) {
1566          this.billcode = new CodeableConcept();
1567          return this.billcode;
1568        }
1569        else if (name.equals("modifier")) {
1570          return addModifier();
1571        }
1572        else if (name.equals("provider")) {
1573          this.provider = new Reference();
1574          return this.provider;
1575        }
1576        else if (name.equals("excluded")) {
1577          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.excluded");
1578        }
1579        else if (name.equals("name")) {
1580          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.name");
1581        }
1582        else if (name.equals("description")) {
1583          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.description");
1584        }
1585        else if (name.equals("network")) {
1586          this.network = new CodeableConcept();
1587          return this.network;
1588        }
1589        else if (name.equals("unit")) {
1590          this.unit = new CodeableConcept();
1591          return this.unit;
1592        }
1593        else if (name.equals("term")) {
1594          this.term = new CodeableConcept();
1595          return this.term;
1596        }
1597        else if (name.equals("benefit")) {
1598          return addBenefit();
1599        }
1600        else if (name.equals("authorizationRequired")) {
1601          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.authorizationRequired");
1602        }
1603        else if (name.equals("authorizationSupporting")) {
1604          return addAuthorizationSupporting();
1605        }
1606        else if (name.equals("authorizationUrl")) {
1607          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.authorizationUrl");
1608        }
1609        else
1610          return super.addChild(name);
1611      }
1612
1613      public ItemsComponent copy() {
1614        ItemsComponent dst = new ItemsComponent();
1615        copyValues(dst);
1616        dst.category = category == null ? null : category.copy();
1617        dst.billcode = billcode == null ? null : billcode.copy();
1618        if (modifier != null) {
1619          dst.modifier = new ArrayList<CodeableConcept>();
1620          for (CodeableConcept i : modifier)
1621            dst.modifier.add(i.copy());
1622        };
1623        dst.provider = provider == null ? null : provider.copy();
1624        dst.excluded = excluded == null ? null : excluded.copy();
1625        dst.name = name == null ? null : name.copy();
1626        dst.description = description == null ? null : description.copy();
1627        dst.network = network == null ? null : network.copy();
1628        dst.unit = unit == null ? null : unit.copy();
1629        dst.term = term == null ? null : term.copy();
1630        if (benefit != null) {
1631          dst.benefit = new ArrayList<BenefitComponent>();
1632          for (BenefitComponent i : benefit)
1633            dst.benefit.add(i.copy());
1634        };
1635        dst.authorizationRequired = authorizationRequired == null ? null : authorizationRequired.copy();
1636        if (authorizationSupporting != null) {
1637          dst.authorizationSupporting = new ArrayList<CodeableConcept>();
1638          for (CodeableConcept i : authorizationSupporting)
1639            dst.authorizationSupporting.add(i.copy());
1640        };
1641        dst.authorizationUrl = authorizationUrl == null ? null : authorizationUrl.copy();
1642        return dst;
1643      }
1644
1645      @Override
1646      public boolean equalsDeep(Base other_) {
1647        if (!super.equalsDeep(other_))
1648          return false;
1649        if (!(other_ instanceof ItemsComponent))
1650          return false;
1651        ItemsComponent o = (ItemsComponent) other_;
1652        return compareDeep(category, o.category, true) && compareDeep(billcode, o.billcode, true) && compareDeep(modifier, o.modifier, true)
1653           && compareDeep(provider, o.provider, true) && compareDeep(excluded, o.excluded, true) && compareDeep(name, o.name, true)
1654           && compareDeep(description, o.description, true) && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true)
1655           && compareDeep(term, o.term, true) && compareDeep(benefit, o.benefit, true) && compareDeep(authorizationRequired, o.authorizationRequired, true)
1656           && compareDeep(authorizationSupporting, o.authorizationSupporting, true) && compareDeep(authorizationUrl, o.authorizationUrl, true)
1657          ;
1658      }
1659
1660      @Override
1661      public boolean equalsShallow(Base other_) {
1662        if (!super.equalsShallow(other_))
1663          return false;
1664        if (!(other_ instanceof ItemsComponent))
1665          return false;
1666        ItemsComponent o = (ItemsComponent) other_;
1667        return compareValues(excluded, o.excluded, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true)
1668           && compareValues(authorizationRequired, o.authorizationRequired, true) && compareValues(authorizationUrl, o.authorizationUrl, true)
1669          ;
1670      }
1671
1672      public boolean isEmpty() {
1673        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, billcode, modifier
1674          , provider, excluded, name, description, network, unit, term, benefit, authorizationRequired
1675          , authorizationSupporting, authorizationUrl);
1676      }
1677
1678  public String fhirType() {
1679    return "CoverageEligibilityResponse.insurance.item";
1680
1681  }
1682
1683  }
1684
1685    @Block()
1686    public static class BenefitComponent extends BackboneElement implements IBaseBackboneElement {
1687        /**
1688         * Deductible, visits, benefit amount.
1689         */
1690        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
1691        @Description(shortDefinition="Deductible, visits, benefit amount", formalDefinition="Deductible, visits, benefit amount." )
1692        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-type")
1693        protected CodeableConcept type;
1694
1695        /**
1696         * Benefits allowed.
1697         */
1698        @Child(name = "allowed", type = {UnsignedIntType.class, StringType.class, Money.class}, order=2, min=0, max=1, modifier=false, summary=false)
1699        @Description(shortDefinition="Benefits allowed", formalDefinition="Benefits allowed." )
1700        protected Type allowed;
1701
1702        /**
1703         * Benefits used.
1704         */
1705        @Child(name = "used", type = {UnsignedIntType.class, Money.class}, order=3, min=0, max=1, modifier=false, summary=false)
1706        @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." )
1707        protected Type used;
1708
1709        private static final long serialVersionUID = -1506285314L;
1710
1711    /**
1712     * Constructor
1713     */
1714      public BenefitComponent() {
1715        super();
1716      }
1717
1718    /**
1719     * Constructor
1720     */
1721      public BenefitComponent(CodeableConcept type) {
1722        super();
1723        this.type = type;
1724      }
1725
1726        /**
1727         * @return {@link #type} (Deductible, visits, benefit amount.)
1728         */
1729        public CodeableConcept getType() { 
1730          if (this.type == null)
1731            if (Configuration.errorOnAutoCreate())
1732              throw new Error("Attempt to auto-create BenefitComponent.type");
1733            else if (Configuration.doAutoCreate())
1734              this.type = new CodeableConcept(); // cc
1735          return this.type;
1736        }
1737
1738        public boolean hasType() { 
1739          return this.type != null && !this.type.isEmpty();
1740        }
1741
1742        /**
1743         * @param value {@link #type} (Deductible, visits, benefit amount.)
1744         */
1745        public BenefitComponent setType(CodeableConcept value) { 
1746          this.type = value;
1747          return this;
1748        }
1749
1750        /**
1751         * @return {@link #allowed} (Benefits allowed.)
1752         */
1753        public Type getAllowed() { 
1754          return this.allowed;
1755        }
1756
1757        /**
1758         * @return {@link #allowed} (Benefits allowed.)
1759         */
1760        public UnsignedIntType getAllowedUnsignedIntType() throws FHIRException { 
1761          if (this.allowed == null)
1762            return null;
1763          if (!(this.allowed instanceof UnsignedIntType))
1764            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.allowed.getClass().getName()+" was encountered");
1765          return (UnsignedIntType) this.allowed;
1766        }
1767
1768        public boolean hasAllowedUnsignedIntType() { 
1769          return this != null && this.allowed instanceof UnsignedIntType;
1770        }
1771
1772        /**
1773         * @return {@link #allowed} (Benefits allowed.)
1774         */
1775        public StringType getAllowedStringType() throws FHIRException { 
1776          if (this.allowed == null)
1777            return null;
1778          if (!(this.allowed instanceof StringType))
1779            throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.allowed.getClass().getName()+" was encountered");
1780          return (StringType) this.allowed;
1781        }
1782
1783        public boolean hasAllowedStringType() { 
1784          return this != null && this.allowed instanceof StringType;
1785        }
1786
1787        /**
1788         * @return {@link #allowed} (Benefits allowed.)
1789         */
1790        public Money getAllowedMoney() throws FHIRException { 
1791          if (this.allowed == null)
1792            return null;
1793          if (!(this.allowed instanceof Money))
1794            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.allowed.getClass().getName()+" was encountered");
1795          return (Money) this.allowed;
1796        }
1797
1798        public boolean hasAllowedMoney() { 
1799          return this != null && this.allowed instanceof Money;
1800        }
1801
1802        public boolean hasAllowed() { 
1803          return this.allowed != null && !this.allowed.isEmpty();
1804        }
1805
1806        /**
1807         * @param value {@link #allowed} (Benefits allowed.)
1808         */
1809        public BenefitComponent setAllowed(Type value) { 
1810          if (value != null && !(value instanceof UnsignedIntType || value instanceof StringType || value instanceof Money))
1811            throw new Error("Not the right type for CoverageEligibilityResponse.insurance.item.benefit.allowed[x]: "+value.fhirType());
1812          this.allowed = value;
1813          return this;
1814        }
1815
1816        /**
1817         * @return {@link #used} (Benefits used.)
1818         */
1819        public Type getUsed() { 
1820          return this.used;
1821        }
1822
1823        /**
1824         * @return {@link #used} (Benefits used.)
1825         */
1826        public UnsignedIntType getUsedUnsignedIntType() throws FHIRException { 
1827          if (this.used == null)
1828            return null;
1829          if (!(this.used instanceof UnsignedIntType))
1830            throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.used.getClass().getName()+" was encountered");
1831          return (UnsignedIntType) this.used;
1832        }
1833
1834        public boolean hasUsedUnsignedIntType() { 
1835          return this != null && this.used instanceof UnsignedIntType;
1836        }
1837
1838        /**
1839         * @return {@link #used} (Benefits used.)
1840         */
1841        public Money getUsedMoney() throws FHIRException { 
1842          if (this.used == null)
1843            return null;
1844          if (!(this.used instanceof Money))
1845            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.used.getClass().getName()+" was encountered");
1846          return (Money) this.used;
1847        }
1848
1849        public boolean hasUsedMoney() { 
1850          return this != null && this.used instanceof Money;
1851        }
1852
1853        public boolean hasUsed() { 
1854          return this.used != null && !this.used.isEmpty();
1855        }
1856
1857        /**
1858         * @param value {@link #used} (Benefits used.)
1859         */
1860        public BenefitComponent setUsed(Type value) { 
1861          if (value != null && !(value instanceof UnsignedIntType || value instanceof Money))
1862            throw new Error("Not the right type for CoverageEligibilityResponse.insurance.item.benefit.used[x]: "+value.fhirType());
1863          this.used = value;
1864          return this;
1865        }
1866
1867        protected void listChildren(List<Property> children) {
1868          super.listChildren(children);
1869          children.add(new Property("type", "CodeableConcept", "Deductible, visits, benefit amount.", 0, 1, type));
1870          children.add(new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed));
1871          children.add(new Property("used[x]", "unsignedInt|Money", "Benefits used.", 0, 1, used));
1872        }
1873
1874        @Override
1875        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1876          switch (_hash) {
1877          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Deductible, visits, benefit amount.", 0, 1, type);
1878          case -1336663592: /*allowed[x]*/  return new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed);
1879          case -911343192: /*allowed*/  return new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed);
1880          case 1668802034: /*allowedUnsignedInt*/  return new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed);
1881          case -2135265319: /*allowedString*/  return new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed);
1882          case -351668232: /*allowedMoney*/  return new Property("allowed[x]", "unsignedInt|string|Money", "Benefits allowed.", 0, 1, allowed);
1883          case -147553373: /*used[x]*/  return new Property("used[x]", "unsignedInt|Money", "Benefits used.", 0, 1, used);
1884          case 3599293: /*used*/  return new Property("used[x]", "unsignedInt|Money", "Benefits used.", 0, 1, used);
1885          case 1252740285: /*usedUnsignedInt*/  return new Property("used[x]", "unsignedInt|Money", "Benefits used.", 0, 1, used);
1886          case -78048509: /*usedMoney*/  return new Property("used[x]", "unsignedInt|Money", "Benefits used.", 0, 1, used);
1887          default: return super.getNamedProperty(_hash, _name, _checkValid);
1888          }
1889
1890        }
1891
1892      @Override
1893      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1894        switch (hash) {
1895        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1896        case -911343192: /*allowed*/ return this.allowed == null ? new Base[0] : new Base[] {this.allowed}; // Type
1897        case 3599293: /*used*/ return this.used == null ? new Base[0] : new Base[] {this.used}; // Type
1898        default: return super.getProperty(hash, name, checkValid);
1899        }
1900
1901      }
1902
1903      @Override
1904      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1905        switch (hash) {
1906        case 3575610: // type
1907          this.type = castToCodeableConcept(value); // CodeableConcept
1908          return value;
1909        case -911343192: // allowed
1910          this.allowed = castToType(value); // Type
1911          return value;
1912        case 3599293: // used
1913          this.used = castToType(value); // Type
1914          return value;
1915        default: return super.setProperty(hash, name, value);
1916        }
1917
1918      }
1919
1920      @Override
1921      public Base setProperty(String name, Base value) throws FHIRException {
1922        if (name.equals("type")) {
1923          this.type = castToCodeableConcept(value); // CodeableConcept
1924        } else if (name.equals("allowed[x]")) {
1925          this.allowed = castToType(value); // Type
1926        } else if (name.equals("used[x]")) {
1927          this.used = castToType(value); // Type
1928        } else
1929          return super.setProperty(name, value);
1930        return value;
1931      }
1932
1933      @Override
1934      public Base makeProperty(int hash, String name) throws FHIRException {
1935        switch (hash) {
1936        case 3575610:  return getType(); 
1937        case -1336663592:  return getAllowed(); 
1938        case -911343192:  return getAllowed(); 
1939        case -147553373:  return getUsed(); 
1940        case 3599293:  return getUsed(); 
1941        default: return super.makeProperty(hash, name);
1942        }
1943
1944      }
1945
1946      @Override
1947      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1948        switch (hash) {
1949        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1950        case -911343192: /*allowed*/ return new String[] {"unsignedInt", "string", "Money"};
1951        case 3599293: /*used*/ return new String[] {"unsignedInt", "Money"};
1952        default: return super.getTypesForProperty(hash, name);
1953        }
1954
1955      }
1956
1957      @Override
1958      public Base addChild(String name) throws FHIRException {
1959        if (name.equals("type")) {
1960          this.type = new CodeableConcept();
1961          return this.type;
1962        }
1963        else if (name.equals("allowedUnsignedInt")) {
1964          this.allowed = new UnsignedIntType();
1965          return this.allowed;
1966        }
1967        else if (name.equals("allowedString")) {
1968          this.allowed = new StringType();
1969          return this.allowed;
1970        }
1971        else if (name.equals("allowedMoney")) {
1972          this.allowed = new Money();
1973          return this.allowed;
1974        }
1975        else if (name.equals("usedUnsignedInt")) {
1976          this.used = new UnsignedIntType();
1977          return this.used;
1978        }
1979        else if (name.equals("usedMoney")) {
1980          this.used = new Money();
1981          return this.used;
1982        }
1983        else
1984          return super.addChild(name);
1985      }
1986
1987      public BenefitComponent copy() {
1988        BenefitComponent dst = new BenefitComponent();
1989        copyValues(dst);
1990        dst.type = type == null ? null : type.copy();
1991        dst.allowed = allowed == null ? null : allowed.copy();
1992        dst.used = used == null ? null : used.copy();
1993        return dst;
1994      }
1995
1996      @Override
1997      public boolean equalsDeep(Base other_) {
1998        if (!super.equalsDeep(other_))
1999          return false;
2000        if (!(other_ instanceof BenefitComponent))
2001          return false;
2002        BenefitComponent o = (BenefitComponent) other_;
2003        return compareDeep(type, o.type, true) && compareDeep(allowed, o.allowed, true) && compareDeep(used, o.used, true)
2004          ;
2005      }
2006
2007      @Override
2008      public boolean equalsShallow(Base other_) {
2009        if (!super.equalsShallow(other_))
2010          return false;
2011        if (!(other_ instanceof BenefitComponent))
2012          return false;
2013        BenefitComponent o = (BenefitComponent) other_;
2014        return true;
2015      }
2016
2017      public boolean isEmpty() {
2018        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, allowed, used);
2019      }
2020
2021  public String fhirType() {
2022    return "CoverageEligibilityResponse.insurance.item.benefit";
2023
2024  }
2025
2026  }
2027
2028    @Block()
2029    public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement {
2030        /**
2031         * An error code,from a specified code system, which details why the eligibility check could not be performed.
2032         */
2033        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2034        @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the eligibility check could not be performed." )
2035        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adjudication-error")
2036        protected CodeableConcept code;
2037
2038        private static final long serialVersionUID = -1048343046L;
2039
2040    /**
2041     * Constructor
2042     */
2043      public ErrorsComponent() {
2044        super();
2045      }
2046
2047    /**
2048     * Constructor
2049     */
2050      public ErrorsComponent(CodeableConcept code) {
2051        super();
2052        this.code = code;
2053      }
2054
2055        /**
2056         * @return {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.)
2057         */
2058        public CodeableConcept getCode() { 
2059          if (this.code == null)
2060            if (Configuration.errorOnAutoCreate())
2061              throw new Error("Attempt to auto-create ErrorsComponent.code");
2062            else if (Configuration.doAutoCreate())
2063              this.code = new CodeableConcept(); // cc
2064          return this.code;
2065        }
2066
2067        public boolean hasCode() { 
2068          return this.code != null && !this.code.isEmpty();
2069        }
2070
2071        /**
2072         * @param value {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.)
2073         */
2074        public ErrorsComponent setCode(CodeableConcept value) { 
2075          this.code = value;
2076          return this;
2077        }
2078
2079        protected void listChildren(List<Property> children) {
2080          super.listChildren(children);
2081          children.add(new Property("code", "CodeableConcept", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, 1, code));
2082        }
2083
2084        @Override
2085        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2086          switch (_hash) {
2087          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, 1, code);
2088          default: return super.getNamedProperty(_hash, _name, _checkValid);
2089          }
2090
2091        }
2092
2093      @Override
2094      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2095        switch (hash) {
2096        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2097        default: return super.getProperty(hash, name, checkValid);
2098        }
2099
2100      }
2101
2102      @Override
2103      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2104        switch (hash) {
2105        case 3059181: // code
2106          this.code = castToCodeableConcept(value); // CodeableConcept
2107          return value;
2108        default: return super.setProperty(hash, name, value);
2109        }
2110
2111      }
2112
2113      @Override
2114      public Base setProperty(String name, Base value) throws FHIRException {
2115        if (name.equals("code")) {
2116          this.code = castToCodeableConcept(value); // CodeableConcept
2117        } else
2118          return super.setProperty(name, value);
2119        return value;
2120      }
2121
2122      @Override
2123      public Base makeProperty(int hash, String name) throws FHIRException {
2124        switch (hash) {
2125        case 3059181:  return getCode(); 
2126        default: return super.makeProperty(hash, name);
2127        }
2128
2129      }
2130
2131      @Override
2132      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2133        switch (hash) {
2134        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2135        default: return super.getTypesForProperty(hash, name);
2136        }
2137
2138      }
2139
2140      @Override
2141      public Base addChild(String name) throws FHIRException {
2142        if (name.equals("code")) {
2143          this.code = new CodeableConcept();
2144          return this.code;
2145        }
2146        else
2147          return super.addChild(name);
2148      }
2149
2150      public ErrorsComponent copy() {
2151        ErrorsComponent dst = new ErrorsComponent();
2152        copyValues(dst);
2153        dst.code = code == null ? null : code.copy();
2154        return dst;
2155      }
2156
2157      @Override
2158      public boolean equalsDeep(Base other_) {
2159        if (!super.equalsDeep(other_))
2160          return false;
2161        if (!(other_ instanceof ErrorsComponent))
2162          return false;
2163        ErrorsComponent o = (ErrorsComponent) other_;
2164        return compareDeep(code, o.code, true);
2165      }
2166
2167      @Override
2168      public boolean equalsShallow(Base other_) {
2169        if (!super.equalsShallow(other_))
2170          return false;
2171        if (!(other_ instanceof ErrorsComponent))
2172          return false;
2173        ErrorsComponent o = (ErrorsComponent) other_;
2174        return true;
2175      }
2176
2177      public boolean isEmpty() {
2178        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code);
2179      }
2180
2181  public String fhirType() {
2182    return "CoverageEligibilityResponse.error";
2183
2184  }
2185
2186  }
2187
2188    /**
2189     * The Response business identifier.
2190     */
2191    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2192    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
2193    protected List<Identifier> identifier;
2194
2195    /**
2196     * The status of the resource instance.
2197     */
2198    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
2199    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
2200    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
2201    protected Enumeration<EligibilityResponseStatus> status;
2202
2203    /**
2204     * Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.
2205     */
2206    @Child(name = "purpose", type = {CodeType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2207    @Description(shortDefinition="auth-requirements | benefits | discovery | validation", formalDefinition="Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified." )
2208    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/eligibilityresponse-purpose")
2209    protected List<Enumeration<EligibilityResponsePurpose>> purpose;
2210
2211    /**
2212     * Patient Resource.
2213     */
2214    @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=false)
2215    @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." )
2216    protected Reference patient;
2217
2218    /**
2219     * The actual object that is the target of the reference (Patient Resource.)
2220     */
2221    protected Patient patientTarget;
2222
2223    /**
2224     * The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.
2225     */
2226    @Child(name = "serviced", type = {DateType.class, Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
2227    @Description(shortDefinition="Estimated date or dates for inquiry", formalDefinition="The date or dates when the enclosed suite of services are proposed and for which coverage details are requested." )
2228    protected Type serviced;
2229
2230    /**
2231     * The date when the enclosed suite of services were performed or completed.
2232     */
2233    @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2234    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
2235    protected DateTimeType created;
2236
2237    /**
2238     * The provider who is responsible for the services rendered to the patient.
2239     */
2240    @Child(name = "requestProvider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=false)
2241    @Description(shortDefinition="Responsible provider", formalDefinition="The provider who is responsible for the services rendered to the patient." )
2242    protected Reference requestProvider;
2243
2244    /**
2245     * The actual object that is the target of the reference (The provider who is responsible for the services rendered to the patient.)
2246     */
2247    protected Resource requestProviderTarget;
2248
2249    /**
2250     * Original request resource reference.
2251     */
2252    @Child(name = "request", type = {CoverageEligibilityRequest.class}, order=7, min=0, max=1, modifier=false, summary=false)
2253    @Description(shortDefinition="Eligibility reference", formalDefinition="Original request resource reference." )
2254    protected Reference request;
2255
2256    /**
2257     * The actual object that is the target of the reference (Original request resource reference.)
2258     */
2259    protected CoverageEligibilityRequest requestTarget;
2260
2261    /**
2262     * Transaction status: error, complete.
2263     */
2264    @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2265    @Description(shortDefinition="queued | complete | error | partial", formalDefinition="Transaction status: error, complete." )
2266    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome")
2267    protected Enumeration<RemittanceOutcome> outcome;
2268
2269    /**
2270     * A description of the status of the adjudication.
2271     */
2272    @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2273    @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." )
2274    protected StringType disposition;
2275
2276    /**
2277     * The Insurer who produced this adjudicated response.
2278     */
2279    @Child(name = "insurer", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false)
2280    @Description(shortDefinition="Insurer issuing the coverage", formalDefinition="The Insurer who produced this adjudicated response." )
2281    protected Reference insurer;
2282
2283    /**
2284     * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.)
2285     */
2286    protected Organization insurerTarget;
2287
2288    /**
2289     * The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.
2290     */
2291    @Child(name = "insurance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2292    @Description(shortDefinition="Details by insurance coverage", formalDefinition="The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer." )
2293    protected List<InsuranceComponent> insurance;
2294
2295    /**
2296     * A reference from the Insurer to which these services pertain.
2297     */
2298    @Child(name = "preAuthRef", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
2299    @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A reference from the Insurer to which these services pertain." )
2300    protected StringType preAuthRef;
2301
2302    /**
2303     * The form to be used for printing the content.
2304     */
2305    @Child(name = "form", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
2306    @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." )
2307    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/forms")
2308    protected CodeableConcept form;
2309
2310    /**
2311     * Mutually exclusive with Services Provided (Item).
2312     */
2313    @Child(name = "error", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2314    @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." )
2315    protected List<ErrorsComponent> error;
2316
2317    private static final long serialVersionUID = -2068729296L;
2318
2319  /**
2320   * Constructor
2321   */
2322    public CoverageEligibilityResponse() {
2323      super();
2324    }
2325
2326    /**
2327     * @return {@link #identifier} (The Response business identifier.)
2328     */
2329    public List<Identifier> getIdentifier() { 
2330      if (this.identifier == null)
2331        this.identifier = new ArrayList<Identifier>();
2332      return this.identifier;
2333    }
2334
2335    /**
2336     * @return Returns a reference to <code>this</code> for easy method chaining
2337     */
2338    public CoverageEligibilityResponse setIdentifier(List<Identifier> theIdentifier) { 
2339      this.identifier = theIdentifier;
2340      return this;
2341    }
2342
2343    public boolean hasIdentifier() { 
2344      if (this.identifier == null)
2345        return false;
2346      for (Identifier item : this.identifier)
2347        if (!item.isEmpty())
2348          return true;
2349      return false;
2350    }
2351
2352    public Identifier addIdentifier() { //3
2353      Identifier t = new Identifier();
2354      if (this.identifier == null)
2355        this.identifier = new ArrayList<Identifier>();
2356      this.identifier.add(t);
2357      return t;
2358    }
2359
2360    public CoverageEligibilityResponse addIdentifier(Identifier t) { //3
2361      if (t == null)
2362        return this;
2363      if (this.identifier == null)
2364        this.identifier = new ArrayList<Identifier>();
2365      this.identifier.add(t);
2366      return this;
2367    }
2368
2369    /**
2370     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
2371     */
2372    public Identifier getIdentifierFirstRep() { 
2373      if (getIdentifier().isEmpty()) {
2374        addIdentifier();
2375      }
2376      return getIdentifier().get(0);
2377    }
2378
2379    /**
2380     * @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
2381     */
2382    public Enumeration<EligibilityResponseStatus> getStatusElement() { 
2383      if (this.status == null)
2384        if (Configuration.errorOnAutoCreate())
2385          throw new Error("Attempt to auto-create CoverageEligibilityResponse.status");
2386        else if (Configuration.doAutoCreate())
2387          this.status = new Enumeration<EligibilityResponseStatus>(new EligibilityResponseStatusEnumFactory()); // bb
2388      return this.status;
2389    }
2390
2391    public boolean hasStatusElement() { 
2392      return this.status != null && !this.status.isEmpty();
2393    }
2394
2395    public boolean hasStatus() { 
2396      return this.status != null && !this.status.isEmpty();
2397    }
2398
2399    /**
2400     * @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
2401     */
2402    public CoverageEligibilityResponse setStatusElement(Enumeration<EligibilityResponseStatus> value) { 
2403      this.status = value;
2404      return this;
2405    }
2406
2407    /**
2408     * @return The status of the resource instance.
2409     */
2410    public EligibilityResponseStatus getStatus() { 
2411      return this.status == null ? null : this.status.getValue();
2412    }
2413
2414    /**
2415     * @param value The status of the resource instance.
2416     */
2417    public CoverageEligibilityResponse setStatus(EligibilityResponseStatus value) { 
2418      if (value == null)
2419        this.status = null;
2420      else {
2421        if (this.status == null)
2422          this.status = new Enumeration<EligibilityResponseStatus>(new EligibilityResponseStatusEnumFactory());
2423        this.status.setValue(value);
2424      }
2425      return this;
2426    }
2427
2428    /**
2429     * @return {@link #purpose} (Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2430     */
2431    public List<Enumeration<EligibilityResponsePurpose>> getPurpose() { 
2432      if (this.purpose == null)
2433        this.purpose = new ArrayList<Enumeration<EligibilityResponsePurpose>>();
2434      return this.purpose;
2435    }
2436
2437    /**
2438     * @return Returns a reference to <code>this</code> for easy method chaining
2439     */
2440    public CoverageEligibilityResponse setPurpose(List<Enumeration<EligibilityResponsePurpose>> thePurpose) { 
2441      this.purpose = thePurpose;
2442      return this;
2443    }
2444
2445    public boolean hasPurpose() { 
2446      if (this.purpose == null)
2447        return false;
2448      for (Enumeration<EligibilityResponsePurpose> item : this.purpose)
2449        if (!item.isEmpty())
2450          return true;
2451      return false;
2452    }
2453
2454    /**
2455     * @return {@link #purpose} (Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2456     */
2457    public Enumeration<EligibilityResponsePurpose> addPurposeElement() {//2 
2458      Enumeration<EligibilityResponsePurpose> t = new Enumeration<EligibilityResponsePurpose>(new EligibilityResponsePurposeEnumFactory());
2459      if (this.purpose == null)
2460        this.purpose = new ArrayList<Enumeration<EligibilityResponsePurpose>>();
2461      this.purpose.add(t);
2462      return t;
2463    }
2464
2465    /**
2466     * @param value {@link #purpose} (Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2467     */
2468    public CoverageEligibilityResponse addPurpose(EligibilityResponsePurpose value) { //1
2469      Enumeration<EligibilityResponsePurpose> t = new Enumeration<EligibilityResponsePurpose>(new EligibilityResponsePurposeEnumFactory());
2470      t.setValue(value);
2471      if (this.purpose == null)
2472        this.purpose = new ArrayList<Enumeration<EligibilityResponsePurpose>>();
2473      this.purpose.add(t);
2474      return this;
2475    }
2476
2477    /**
2478     * @param value {@link #purpose} (Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2479     */
2480    public boolean hasPurpose(EligibilityResponsePurpose value) { 
2481      if (this.purpose == null)
2482        return false;
2483      for (Enumeration<EligibilityResponsePurpose> v : this.purpose)
2484        if (v.getValue().equals(value)) // code
2485          return true;
2486      return false;
2487    }
2488
2489    /**
2490     * @return {@link #patient} (Patient Resource.)
2491     */
2492    public Reference getPatient() { 
2493      if (this.patient == null)
2494        if (Configuration.errorOnAutoCreate())
2495          throw new Error("Attempt to auto-create CoverageEligibilityResponse.patient");
2496        else if (Configuration.doAutoCreate())
2497          this.patient = new Reference(); // cc
2498      return this.patient;
2499    }
2500
2501    public boolean hasPatient() { 
2502      return this.patient != null && !this.patient.isEmpty();
2503    }
2504
2505    /**
2506     * @param value {@link #patient} (Patient Resource.)
2507     */
2508    public CoverageEligibilityResponse setPatient(Reference value) { 
2509      this.patient = value;
2510      return this;
2511    }
2512
2513    /**
2514     * @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.)
2515     */
2516    public Patient getPatientTarget() { 
2517      if (this.patientTarget == null)
2518        if (Configuration.errorOnAutoCreate())
2519          throw new Error("Attempt to auto-create CoverageEligibilityResponse.patient");
2520        else if (Configuration.doAutoCreate())
2521          this.patientTarget = new Patient(); // aa
2522      return this.patientTarget;
2523    }
2524
2525    /**
2526     * @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.)
2527     */
2528    public CoverageEligibilityResponse setPatientTarget(Patient value) { 
2529      this.patientTarget = value;
2530      return this;
2531    }
2532
2533    /**
2534     * @return {@link #serviced} (The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.)
2535     */
2536    public Type getServiced() { 
2537      return this.serviced;
2538    }
2539
2540    /**
2541     * @return {@link #serviced} (The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.)
2542     */
2543    public DateType getServicedDateType() throws FHIRException { 
2544      if (this.serviced == null)
2545        return null;
2546      if (!(this.serviced instanceof DateType))
2547        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered");
2548      return (DateType) this.serviced;
2549    }
2550
2551    public boolean hasServicedDateType() { 
2552      return this != null && this.serviced instanceof DateType;
2553    }
2554
2555    /**
2556     * @return {@link #serviced} (The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.)
2557     */
2558    public Period getServicedPeriod() throws FHIRException { 
2559      if (this.serviced == null)
2560        return null;
2561      if (!(this.serviced instanceof Period))
2562        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered");
2563      return (Period) this.serviced;
2564    }
2565
2566    public boolean hasServicedPeriod() { 
2567      return this != null && this.serviced instanceof Period;
2568    }
2569
2570    public boolean hasServiced() { 
2571      return this.serviced != null && !this.serviced.isEmpty();
2572    }
2573
2574    /**
2575     * @param value {@link #serviced} (The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.)
2576     */
2577    public CoverageEligibilityResponse setServiced(Type value) { 
2578      if (value != null && !(value instanceof DateType || value instanceof Period))
2579        throw new Error("Not the right type for CoverageEligibilityResponse.serviced[x]: "+value.fhirType());
2580      this.serviced = value;
2581      return this;
2582    }
2583
2584    /**
2585     * @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
2586     */
2587    public DateTimeType getCreatedElement() { 
2588      if (this.created == null)
2589        if (Configuration.errorOnAutoCreate())
2590          throw new Error("Attempt to auto-create CoverageEligibilityResponse.created");
2591        else if (Configuration.doAutoCreate())
2592          this.created = new DateTimeType(); // bb
2593      return this.created;
2594    }
2595
2596    public boolean hasCreatedElement() { 
2597      return this.created != null && !this.created.isEmpty();
2598    }
2599
2600    public boolean hasCreated() { 
2601      return this.created != null && !this.created.isEmpty();
2602    }
2603
2604    /**
2605     * @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
2606     */
2607    public CoverageEligibilityResponse setCreatedElement(DateTimeType value) { 
2608      this.created = value;
2609      return this;
2610    }
2611
2612    /**
2613     * @return The date when the enclosed suite of services were performed or completed.
2614     */
2615    public Date getCreated() { 
2616      return this.created == null ? null : this.created.getValue();
2617    }
2618
2619    /**
2620     * @param value The date when the enclosed suite of services were performed or completed.
2621     */
2622    public CoverageEligibilityResponse setCreated(Date value) { 
2623      if (value == null)
2624        this.created = null;
2625      else {
2626        if (this.created == null)
2627          this.created = new DateTimeType();
2628        this.created.setValue(value);
2629      }
2630      return this;
2631    }
2632
2633    /**
2634     * @return {@link #requestProvider} (The provider who is responsible for the services rendered to the patient.)
2635     */
2636    public Reference getRequestProvider() { 
2637      if (this.requestProvider == null)
2638        if (Configuration.errorOnAutoCreate())
2639          throw new Error("Attempt to auto-create CoverageEligibilityResponse.requestProvider");
2640        else if (Configuration.doAutoCreate())
2641          this.requestProvider = new Reference(); // cc
2642      return this.requestProvider;
2643    }
2644
2645    public boolean hasRequestProvider() { 
2646      return this.requestProvider != null && !this.requestProvider.isEmpty();
2647    }
2648
2649    /**
2650     * @param value {@link #requestProvider} (The provider who is responsible for the services rendered to the patient.)
2651     */
2652    public CoverageEligibilityResponse setRequestProvider(Reference value) { 
2653      this.requestProvider = value;
2654      return this;
2655    }
2656
2657    /**
2658     * @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 provider who is responsible for the services rendered to the patient.)
2659     */
2660    public Resource getRequestProviderTarget() { 
2661      return this.requestProviderTarget;
2662    }
2663
2664    /**
2665     * @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 provider who is responsible for the services rendered to the patient.)
2666     */
2667    public CoverageEligibilityResponse setRequestProviderTarget(Resource value) { 
2668      this.requestProviderTarget = value;
2669      return this;
2670    }
2671
2672    /**
2673     * @return {@link #request} (Original request resource reference.)
2674     */
2675    public Reference getRequest() { 
2676      if (this.request == null)
2677        if (Configuration.errorOnAutoCreate())
2678          throw new Error("Attempt to auto-create CoverageEligibilityResponse.request");
2679        else if (Configuration.doAutoCreate())
2680          this.request = new Reference(); // cc
2681      return this.request;
2682    }
2683
2684    public boolean hasRequest() { 
2685      return this.request != null && !this.request.isEmpty();
2686    }
2687
2688    /**
2689     * @param value {@link #request} (Original request resource reference.)
2690     */
2691    public CoverageEligibilityResponse setRequest(Reference value) { 
2692      this.request = value;
2693      return this;
2694    }
2695
2696    /**
2697     * @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 reference.)
2698     */
2699    public CoverageEligibilityRequest getRequestTarget() { 
2700      if (this.requestTarget == null)
2701        if (Configuration.errorOnAutoCreate())
2702          throw new Error("Attempt to auto-create CoverageEligibilityResponse.request");
2703        else if (Configuration.doAutoCreate())
2704          this.requestTarget = new CoverageEligibilityRequest(); // aa
2705      return this.requestTarget;
2706    }
2707
2708    /**
2709     * @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 reference.)
2710     */
2711    public CoverageEligibilityResponse setRequestTarget(CoverageEligibilityRequest value) { 
2712      this.requestTarget = value;
2713      return this;
2714    }
2715
2716    /**
2717     * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
2718     */
2719    public Enumeration<RemittanceOutcome> getOutcomeElement() { 
2720      if (this.outcome == null)
2721        if (Configuration.errorOnAutoCreate())
2722          throw new Error("Attempt to auto-create CoverageEligibilityResponse.outcome");
2723        else if (Configuration.doAutoCreate())
2724          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
2725      return this.outcome;
2726    }
2727
2728    public boolean hasOutcomeElement() { 
2729      return this.outcome != null && !this.outcome.isEmpty();
2730    }
2731
2732    public boolean hasOutcome() { 
2733      return this.outcome != null && !this.outcome.isEmpty();
2734    }
2735
2736    /**
2737     * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
2738     */
2739    public CoverageEligibilityResponse setOutcomeElement(Enumeration<RemittanceOutcome> value) { 
2740      this.outcome = value;
2741      return this;
2742    }
2743
2744    /**
2745     * @return Transaction status: error, complete.
2746     */
2747    public RemittanceOutcome getOutcome() { 
2748      return this.outcome == null ? null : this.outcome.getValue();
2749    }
2750
2751    /**
2752     * @param value Transaction status: error, complete.
2753     */
2754    public CoverageEligibilityResponse setOutcome(RemittanceOutcome value) { 
2755      if (value == null)
2756        this.outcome = null;
2757      else {
2758        if (this.outcome == null)
2759          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
2760        this.outcome.setValue(value);
2761      }
2762      return this;
2763    }
2764
2765    /**
2766     * @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
2767     */
2768    public StringType getDispositionElement() { 
2769      if (this.disposition == null)
2770        if (Configuration.errorOnAutoCreate())
2771          throw new Error("Attempt to auto-create CoverageEligibilityResponse.disposition");
2772        else if (Configuration.doAutoCreate())
2773          this.disposition = new StringType(); // bb
2774      return this.disposition;
2775    }
2776
2777    public boolean hasDispositionElement() { 
2778      return this.disposition != null && !this.disposition.isEmpty();
2779    }
2780
2781    public boolean hasDisposition() { 
2782      return this.disposition != null && !this.disposition.isEmpty();
2783    }
2784
2785    /**
2786     * @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
2787     */
2788    public CoverageEligibilityResponse setDispositionElement(StringType value) { 
2789      this.disposition = value;
2790      return this;
2791    }
2792
2793    /**
2794     * @return A description of the status of the adjudication.
2795     */
2796    public String getDisposition() { 
2797      return this.disposition == null ? null : this.disposition.getValue();
2798    }
2799
2800    /**
2801     * @param value A description of the status of the adjudication.
2802     */
2803    public CoverageEligibilityResponse setDisposition(String value) { 
2804      if (Utilities.noString(value))
2805        this.disposition = null;
2806      else {
2807        if (this.disposition == null)
2808          this.disposition = new StringType();
2809        this.disposition.setValue(value);
2810      }
2811      return this;
2812    }
2813
2814    /**
2815     * @return {@link #insurer} (The Insurer who produced this adjudicated response.)
2816     */
2817    public Reference getInsurer() { 
2818      if (this.insurer == null)
2819        if (Configuration.errorOnAutoCreate())
2820          throw new Error("Attempt to auto-create CoverageEligibilityResponse.insurer");
2821        else if (Configuration.doAutoCreate())
2822          this.insurer = new Reference(); // cc
2823      return this.insurer;
2824    }
2825
2826    public boolean hasInsurer() { 
2827      return this.insurer != null && !this.insurer.isEmpty();
2828    }
2829
2830    /**
2831     * @param value {@link #insurer} (The Insurer who produced this adjudicated response.)
2832     */
2833    public CoverageEligibilityResponse setInsurer(Reference value) { 
2834      this.insurer = value;
2835      return this;
2836    }
2837
2838    /**
2839     * @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.)
2840     */
2841    public Organization getInsurerTarget() { 
2842      if (this.insurerTarget == null)
2843        if (Configuration.errorOnAutoCreate())
2844          throw new Error("Attempt to auto-create CoverageEligibilityResponse.insurer");
2845        else if (Configuration.doAutoCreate())
2846          this.insurerTarget = new Organization(); // aa
2847      return this.insurerTarget;
2848    }
2849
2850    /**
2851     * @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.)
2852     */
2853    public CoverageEligibilityResponse setInsurerTarget(Organization value) { 
2854      this.insurerTarget = value;
2855      return this;
2856    }
2857
2858    /**
2859     * @return {@link #insurance} (The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.)
2860     */
2861    public List<InsuranceComponent> getInsurance() { 
2862      if (this.insurance == null)
2863        this.insurance = new ArrayList<InsuranceComponent>();
2864      return this.insurance;
2865    }
2866
2867    /**
2868     * @return Returns a reference to <code>this</code> for easy method chaining
2869     */
2870    public CoverageEligibilityResponse setInsurance(List<InsuranceComponent> theInsurance) { 
2871      this.insurance = theInsurance;
2872      return this;
2873    }
2874
2875    public boolean hasInsurance() { 
2876      if (this.insurance == null)
2877        return false;
2878      for (InsuranceComponent item : this.insurance)
2879        if (!item.isEmpty())
2880          return true;
2881      return false;
2882    }
2883
2884    public InsuranceComponent addInsurance() { //3
2885      InsuranceComponent t = new InsuranceComponent();
2886      if (this.insurance == null)
2887        this.insurance = new ArrayList<InsuranceComponent>();
2888      this.insurance.add(t);
2889      return t;
2890    }
2891
2892    public CoverageEligibilityResponse addInsurance(InsuranceComponent t) { //3
2893      if (t == null)
2894        return this;
2895      if (this.insurance == null)
2896        this.insurance = new ArrayList<InsuranceComponent>();
2897      this.insurance.add(t);
2898      return this;
2899    }
2900
2901    /**
2902     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist
2903     */
2904    public InsuranceComponent getInsuranceFirstRep() { 
2905      if (getInsurance().isEmpty()) {
2906        addInsurance();
2907      }
2908      return getInsurance().get(0);
2909    }
2910
2911    /**
2912     * @return {@link #preAuthRef} (A reference from the Insurer to which these services pertain.). This is the underlying object with id, value and extensions. The accessor "getPreAuthRef" gives direct access to the value
2913     */
2914    public StringType getPreAuthRefElement() { 
2915      if (this.preAuthRef == null)
2916        if (Configuration.errorOnAutoCreate())
2917          throw new Error("Attempt to auto-create CoverageEligibilityResponse.preAuthRef");
2918        else if (Configuration.doAutoCreate())
2919          this.preAuthRef = new StringType(); // bb
2920      return this.preAuthRef;
2921    }
2922
2923    public boolean hasPreAuthRefElement() { 
2924      return this.preAuthRef != null && !this.preAuthRef.isEmpty();
2925    }
2926
2927    public boolean hasPreAuthRef() { 
2928      return this.preAuthRef != null && !this.preAuthRef.isEmpty();
2929    }
2930
2931    /**
2932     * @param value {@link #preAuthRef} (A reference from the Insurer to which these services pertain.). This is the underlying object with id, value and extensions. The accessor "getPreAuthRef" gives direct access to the value
2933     */
2934    public CoverageEligibilityResponse setPreAuthRefElement(StringType value) { 
2935      this.preAuthRef = value;
2936      return this;
2937    }
2938
2939    /**
2940     * @return A reference from the Insurer to which these services pertain.
2941     */
2942    public String getPreAuthRef() { 
2943      return this.preAuthRef == null ? null : this.preAuthRef.getValue();
2944    }
2945
2946    /**
2947     * @param value A reference from the Insurer to which these services pertain.
2948     */
2949    public CoverageEligibilityResponse setPreAuthRef(String value) { 
2950      if (Utilities.noString(value))
2951        this.preAuthRef = null;
2952      else {
2953        if (this.preAuthRef == null)
2954          this.preAuthRef = new StringType();
2955        this.preAuthRef.setValue(value);
2956      }
2957      return this;
2958    }
2959
2960    /**
2961     * @return {@link #form} (The form to be used for printing the content.)
2962     */
2963    public CodeableConcept getForm() { 
2964      if (this.form == null)
2965        if (Configuration.errorOnAutoCreate())
2966          throw new Error("Attempt to auto-create CoverageEligibilityResponse.form");
2967        else if (Configuration.doAutoCreate())
2968          this.form = new CodeableConcept(); // cc
2969      return this.form;
2970    }
2971
2972    public boolean hasForm() { 
2973      return this.form != null && !this.form.isEmpty();
2974    }
2975
2976    /**
2977     * @param value {@link #form} (The form to be used for printing the content.)
2978     */
2979    public CoverageEligibilityResponse setForm(CodeableConcept value) { 
2980      this.form = value;
2981      return this;
2982    }
2983
2984    /**
2985     * @return {@link #error} (Mutually exclusive with Services Provided (Item).)
2986     */
2987    public List<ErrorsComponent> getError() { 
2988      if (this.error == null)
2989        this.error = new ArrayList<ErrorsComponent>();
2990      return this.error;
2991    }
2992
2993    /**
2994     * @return Returns a reference to <code>this</code> for easy method chaining
2995     */
2996    public CoverageEligibilityResponse setError(List<ErrorsComponent> theError) { 
2997      this.error = theError;
2998      return this;
2999    }
3000
3001    public boolean hasError() { 
3002      if (this.error == null)
3003        return false;
3004      for (ErrorsComponent item : this.error)
3005        if (!item.isEmpty())
3006          return true;
3007      return false;
3008    }
3009
3010    public ErrorsComponent addError() { //3
3011      ErrorsComponent t = new ErrorsComponent();
3012      if (this.error == null)
3013        this.error = new ArrayList<ErrorsComponent>();
3014      this.error.add(t);
3015      return t;
3016    }
3017
3018    public CoverageEligibilityResponse addError(ErrorsComponent t) { //3
3019      if (t == null)
3020        return this;
3021      if (this.error == null)
3022        this.error = new ArrayList<ErrorsComponent>();
3023      this.error.add(t);
3024      return this;
3025    }
3026
3027    /**
3028     * @return The first repetition of repeating field {@link #error}, creating it if it does not already exist
3029     */
3030    public ErrorsComponent getErrorFirstRep() { 
3031      if (getError().isEmpty()) {
3032        addError();
3033      }
3034      return getError().get(0);
3035    }
3036
3037      protected void listChildren(List<Property> children) {
3038        super.listChildren(children);
3039        children.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
3040        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
3041        children.add(new Property("purpose", "code", "Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.", 0, java.lang.Integer.MAX_VALUE, purpose));
3042        children.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, 1, patient));
3043        children.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.", 0, 1, serviced));
3044        children.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created));
3045        children.add(new Property("requestProvider", "Reference(Practitioner|PractitionerRole|Organization)", "The provider who is responsible for the services rendered to the patient.", 0, 1, requestProvider));
3046        children.add(new Property("request", "Reference(CoverageEligibilityRequest)", "Original request resource reference.", 0, 1, request));
3047        children.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, 1, outcome));
3048        children.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition));
3049        children.add(new Property("insurer", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, insurer));
3050        children.add(new Property("insurance", "", "The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.", 0, java.lang.Integer.MAX_VALUE, insurance));
3051        children.add(new Property("preAuthRef", "string", "A reference from the Insurer to which these services pertain.", 0, 1, preAuthRef));
3052        children.add(new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, 1, form));
3053        children.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error));
3054      }
3055
3056      @Override
3057      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3058        switch (_hash) {
3059        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
3060        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
3061        case -220463842: /*purpose*/  return new Property("purpose", "code", "Specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for th patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.", 0, java.lang.Integer.MAX_VALUE, purpose);
3062        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "Patient Resource.", 0, 1, patient);
3063        case -1927922223: /*serviced[x]*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.", 0, 1, serviced);
3064        case 1379209295: /*serviced*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.", 0, 1, serviced);
3065        case 363246749: /*servicedDate*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.", 0, 1, serviced);
3066        case 1534966512: /*servicedPeriod*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services are proposed and for which coverage details are requested.", 0, 1, serviced);
3067        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created);
3068        case 1601527200: /*requestProvider*/  return new Property("requestProvider", "Reference(Practitioner|PractitionerRole|Organization)", "The provider who is responsible for the services rendered to the patient.", 0, 1, requestProvider);
3069        case 1095692943: /*request*/  return new Property("request", "Reference(CoverageEligibilityRequest)", "Original request resource reference.", 0, 1, request);
3070        case -1106507950: /*outcome*/  return new Property("outcome", "code", "Transaction status: error, complete.", 0, 1, outcome);
3071        case 583380919: /*disposition*/  return new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition);
3072        case 1957615864: /*insurer*/  return new Property("insurer", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, insurer);
3073        case 73049818: /*insurance*/  return new Property("insurance", "", "The insurer may provide both the details for the requested coverage as well as details for additional coverages known to the insurer.", 0, java.lang.Integer.MAX_VALUE, insurance);
3074        case 522246568: /*preAuthRef*/  return new Property("preAuthRef", "string", "A reference from the Insurer to which these services pertain.", 0, 1, preAuthRef);
3075        case 3148996: /*form*/  return new Property("form", "CodeableConcept", "The form to be used for printing the content.", 0, 1, form);
3076        case 96784904: /*error*/  return new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error);
3077        default: return super.getNamedProperty(_hash, _name, _checkValid);
3078        }
3079
3080      }
3081
3082      @Override
3083      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3084        switch (hash) {
3085        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3086        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EligibilityResponseStatus>
3087        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : this.purpose.toArray(new Base[this.purpose.size()]); // Enumeration<EligibilityResponsePurpose>
3088        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
3089        case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type
3090        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
3091        case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference
3092        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
3093        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<RemittanceOutcome>
3094        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
3095        case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference
3096        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent
3097        case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : new Base[] {this.preAuthRef}; // StringType
3098        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept
3099        case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent
3100        default: return super.getProperty(hash, name, checkValid);
3101        }
3102
3103      }
3104
3105      @Override
3106      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3107        switch (hash) {
3108        case -1618432855: // identifier
3109          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3110          return value;
3111        case -892481550: // status
3112          value = new EligibilityResponseStatusEnumFactory().fromType(castToCode(value));
3113          this.status = (Enumeration) value; // Enumeration<EligibilityResponseStatus>
3114          return value;
3115        case -220463842: // purpose
3116          value = new EligibilityResponsePurposeEnumFactory().fromType(castToCode(value));
3117          this.getPurpose().add((Enumeration) value); // Enumeration<EligibilityResponsePurpose>
3118          return value;
3119        case -791418107: // patient
3120          this.patient = castToReference(value); // Reference
3121          return value;
3122        case 1379209295: // serviced
3123          this.serviced = castToType(value); // Type
3124          return value;
3125        case 1028554472: // created
3126          this.created = castToDateTime(value); // DateTimeType
3127          return value;
3128        case 1601527200: // requestProvider
3129          this.requestProvider = castToReference(value); // Reference
3130          return value;
3131        case 1095692943: // request
3132          this.request = castToReference(value); // Reference
3133          return value;
3134        case -1106507950: // outcome
3135          value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
3136          this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
3137          return value;
3138        case 583380919: // disposition
3139          this.disposition = castToString(value); // StringType
3140          return value;
3141        case 1957615864: // insurer
3142          this.insurer = castToReference(value); // Reference
3143          return value;
3144        case 73049818: // insurance
3145          this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent
3146          return value;
3147        case 522246568: // preAuthRef
3148          this.preAuthRef = castToString(value); // StringType
3149          return value;
3150        case 3148996: // form
3151          this.form = castToCodeableConcept(value); // CodeableConcept
3152          return value;
3153        case 96784904: // error
3154          this.getError().add((ErrorsComponent) value); // ErrorsComponent
3155          return value;
3156        default: return super.setProperty(hash, name, value);
3157        }
3158
3159      }
3160
3161      @Override
3162      public Base setProperty(String name, Base value) throws FHIRException {
3163        if (name.equals("identifier")) {
3164          this.getIdentifier().add(castToIdentifier(value));
3165        } else if (name.equals("status")) {
3166          value = new EligibilityResponseStatusEnumFactory().fromType(castToCode(value));
3167          this.status = (Enumeration) value; // Enumeration<EligibilityResponseStatus>
3168        } else if (name.equals("purpose")) {
3169          value = new EligibilityResponsePurposeEnumFactory().fromType(castToCode(value));
3170          this.getPurpose().add((Enumeration) value);
3171        } else if (name.equals("patient")) {
3172          this.patient = castToReference(value); // Reference
3173        } else if (name.equals("serviced[x]")) {
3174          this.serviced = castToType(value); // Type
3175        } else if (name.equals("created")) {
3176          this.created = castToDateTime(value); // DateTimeType
3177        } else if (name.equals("requestProvider")) {
3178          this.requestProvider = castToReference(value); // Reference
3179        } else if (name.equals("request")) {
3180          this.request = castToReference(value); // Reference
3181        } else if (name.equals("outcome")) {
3182          value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
3183          this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
3184        } else if (name.equals("disposition")) {
3185          this.disposition = castToString(value); // StringType
3186        } else if (name.equals("insurer")) {
3187          this.insurer = castToReference(value); // Reference
3188        } else if (name.equals("insurance")) {
3189          this.getInsurance().add((InsuranceComponent) value);
3190        } else if (name.equals("preAuthRef")) {
3191          this.preAuthRef = castToString(value); // StringType
3192        } else if (name.equals("form")) {
3193          this.form = castToCodeableConcept(value); // CodeableConcept
3194        } else if (name.equals("error")) {
3195          this.getError().add((ErrorsComponent) value);
3196        } else
3197          return super.setProperty(name, value);
3198        return value;
3199      }
3200
3201      @Override
3202      public Base makeProperty(int hash, String name) throws FHIRException {
3203        switch (hash) {
3204        case -1618432855:  return addIdentifier(); 
3205        case -892481550:  return getStatusElement();
3206        case -220463842:  return addPurposeElement();
3207        case -791418107:  return getPatient(); 
3208        case -1927922223:  return getServiced(); 
3209        case 1379209295:  return getServiced(); 
3210        case 1028554472:  return getCreatedElement();
3211        case 1601527200:  return getRequestProvider(); 
3212        case 1095692943:  return getRequest(); 
3213        case -1106507950:  return getOutcomeElement();
3214        case 583380919:  return getDispositionElement();
3215        case 1957615864:  return getInsurer(); 
3216        case 73049818:  return addInsurance(); 
3217        case 522246568:  return getPreAuthRefElement();
3218        case 3148996:  return getForm(); 
3219        case 96784904:  return addError(); 
3220        default: return super.makeProperty(hash, name);
3221        }
3222
3223      }
3224
3225      @Override
3226      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3227        switch (hash) {
3228        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3229        case -892481550: /*status*/ return new String[] {"code"};
3230        case -220463842: /*purpose*/ return new String[] {"code"};
3231        case -791418107: /*patient*/ return new String[] {"Reference"};
3232        case 1379209295: /*serviced*/ return new String[] {"date", "Period"};
3233        case 1028554472: /*created*/ return new String[] {"dateTime"};
3234        case 1601527200: /*requestProvider*/ return new String[] {"Reference"};
3235        case 1095692943: /*request*/ return new String[] {"Reference"};
3236        case -1106507950: /*outcome*/ return new String[] {"code"};
3237        case 583380919: /*disposition*/ return new String[] {"string"};
3238        case 1957615864: /*insurer*/ return new String[] {"Reference"};
3239        case 73049818: /*insurance*/ return new String[] {};
3240        case 522246568: /*preAuthRef*/ return new String[] {"string"};
3241        case 3148996: /*form*/ return new String[] {"CodeableConcept"};
3242        case 96784904: /*error*/ return new String[] {};
3243        default: return super.getTypesForProperty(hash, name);
3244        }
3245
3246      }
3247
3248      @Override
3249      public Base addChild(String name) throws FHIRException {
3250        if (name.equals("identifier")) {
3251          return addIdentifier();
3252        }
3253        else if (name.equals("status")) {
3254          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.status");
3255        }
3256        else if (name.equals("purpose")) {
3257          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.purpose");
3258        }
3259        else if (name.equals("patient")) {
3260          this.patient = new Reference();
3261          return this.patient;
3262        }
3263        else if (name.equals("servicedDate")) {
3264          this.serviced = new DateType();
3265          return this.serviced;
3266        }
3267        else if (name.equals("servicedPeriod")) {
3268          this.serviced = new Period();
3269          return this.serviced;
3270        }
3271        else if (name.equals("created")) {
3272          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.created");
3273        }
3274        else if (name.equals("requestProvider")) {
3275          this.requestProvider = new Reference();
3276          return this.requestProvider;
3277        }
3278        else if (name.equals("request")) {
3279          this.request = new Reference();
3280          return this.request;
3281        }
3282        else if (name.equals("outcome")) {
3283          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.outcome");
3284        }
3285        else if (name.equals("disposition")) {
3286          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.disposition");
3287        }
3288        else if (name.equals("insurer")) {
3289          this.insurer = new Reference();
3290          return this.insurer;
3291        }
3292        else if (name.equals("insurance")) {
3293          return addInsurance();
3294        }
3295        else if (name.equals("preAuthRef")) {
3296          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityResponse.preAuthRef");
3297        }
3298        else if (name.equals("form")) {
3299          this.form = new CodeableConcept();
3300          return this.form;
3301        }
3302        else if (name.equals("error")) {
3303          return addError();
3304        }
3305        else
3306          return super.addChild(name);
3307      }
3308
3309  public String fhirType() {
3310    return "CoverageEligibilityResponse";
3311
3312  }
3313
3314      public CoverageEligibilityResponse copy() {
3315        CoverageEligibilityResponse dst = new CoverageEligibilityResponse();
3316        copyValues(dst);
3317        if (identifier != null) {
3318          dst.identifier = new ArrayList<Identifier>();
3319          for (Identifier i : identifier)
3320            dst.identifier.add(i.copy());
3321        };
3322        dst.status = status == null ? null : status.copy();
3323        if (purpose != null) {
3324          dst.purpose = new ArrayList<Enumeration<EligibilityResponsePurpose>>();
3325          for (Enumeration<EligibilityResponsePurpose> i : purpose)
3326            dst.purpose.add(i.copy());
3327        };
3328        dst.patient = patient == null ? null : patient.copy();
3329        dst.serviced = serviced == null ? null : serviced.copy();
3330        dst.created = created == null ? null : created.copy();
3331        dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
3332        dst.request = request == null ? null : request.copy();
3333        dst.outcome = outcome == null ? null : outcome.copy();
3334        dst.disposition = disposition == null ? null : disposition.copy();
3335        dst.insurer = insurer == null ? null : insurer.copy();
3336        if (insurance != null) {
3337          dst.insurance = new ArrayList<InsuranceComponent>();
3338          for (InsuranceComponent i : insurance)
3339            dst.insurance.add(i.copy());
3340        };
3341        dst.preAuthRef = preAuthRef == null ? null : preAuthRef.copy();
3342        dst.form = form == null ? null : form.copy();
3343        if (error != null) {
3344          dst.error = new ArrayList<ErrorsComponent>();
3345          for (ErrorsComponent i : error)
3346            dst.error.add(i.copy());
3347        };
3348        return dst;
3349      }
3350
3351      protected CoverageEligibilityResponse typedCopy() {
3352        return copy();
3353      }
3354
3355      @Override
3356      public boolean equalsDeep(Base other_) {
3357        if (!super.equalsDeep(other_))
3358          return false;
3359        if (!(other_ instanceof CoverageEligibilityResponse))
3360          return false;
3361        CoverageEligibilityResponse o = (CoverageEligibilityResponse) other_;
3362        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(purpose, o.purpose, true)
3363           && compareDeep(patient, o.patient, true) && compareDeep(serviced, o.serviced, true) && compareDeep(created, o.created, true)
3364           && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(request, o.request, true)
3365           && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(insurer, o.insurer, true)
3366           && compareDeep(insurance, o.insurance, true) && compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(form, o.form, true)
3367           && compareDeep(error, o.error, true);
3368      }
3369
3370      @Override
3371      public boolean equalsShallow(Base other_) {
3372        if (!super.equalsShallow(other_))
3373          return false;
3374        if (!(other_ instanceof CoverageEligibilityResponse))
3375          return false;
3376        CoverageEligibilityResponse o = (CoverageEligibilityResponse) other_;
3377        return compareValues(status, o.status, true) && compareValues(purpose, o.purpose, true) && compareValues(created, o.created, true)
3378           && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(preAuthRef, o.preAuthRef, true)
3379          ;
3380      }
3381
3382      public boolean isEmpty() {
3383        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, purpose
3384          , patient, serviced, created, requestProvider, request, outcome, disposition, insurer
3385          , insurance, preAuthRef, form, error);
3386      }
3387
3388  @Override
3389  public ResourceType getResourceType() {
3390    return ResourceType.CoverageEligibilityResponse;
3391   }
3392
3393 /**
3394   * Search parameter: <b>identifier</b>
3395   * <p>
3396   * Description: <b>The business identifier</b><br>
3397   * Type: <b>token</b><br>
3398   * Path: <b>CoverageEligibilityResponse.identifier</b><br>
3399   * </p>
3400   */
3401  @SearchParamDefinition(name="identifier", path="CoverageEligibilityResponse.identifier", description="The business identifier", type="token" )
3402  public static final String SP_IDENTIFIER = "identifier";
3403 /**
3404   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3405   * <p>
3406   * Description: <b>The business identifier</b><br>
3407   * Type: <b>token</b><br>
3408   * Path: <b>CoverageEligibilityResponse.identifier</b><br>
3409   * </p>
3410   */
3411  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3412
3413 /**
3414   * Search parameter: <b>request</b>
3415   * <p>
3416   * Description: <b>The EligibilityRequest reference</b><br>
3417   * Type: <b>reference</b><br>
3418   * Path: <b>CoverageEligibilityResponse.request</b><br>
3419   * </p>
3420   */
3421  @SearchParamDefinition(name="request", path="CoverageEligibilityResponse.request", description="The EligibilityRequest reference", type="reference", target={CoverageEligibilityRequest.class } )
3422  public static final String SP_REQUEST = "request";
3423 /**
3424   * <b>Fluent Client</b> search parameter constant for <b>request</b>
3425   * <p>
3426   * Description: <b>The EligibilityRequest reference</b><br>
3427   * Type: <b>reference</b><br>
3428   * Path: <b>CoverageEligibilityResponse.request</b><br>
3429   * </p>
3430   */
3431  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
3432
3433/**
3434   * Constant for fluent queries to be used to add include statements. Specifies
3435   * the path value of "<b>CoverageEligibilityResponse:request</b>".
3436   */
3437  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("CoverageEligibilityResponse:request").toLocked();
3438
3439 /**
3440   * Search parameter: <b>disposition</b>
3441   * <p>
3442   * Description: <b>The contents of the disposition message</b><br>
3443   * Type: <b>string</b><br>
3444   * Path: <b>CoverageEligibilityResponse.disposition</b><br>
3445   * </p>
3446   */
3447  @SearchParamDefinition(name="disposition", path="CoverageEligibilityResponse.disposition", description="The contents of the disposition message", type="string" )
3448  public static final String SP_DISPOSITION = "disposition";
3449 /**
3450   * <b>Fluent Client</b> search parameter constant for <b>disposition</b>
3451   * <p>
3452   * Description: <b>The contents of the disposition message</b><br>
3453   * Type: <b>string</b><br>
3454   * Path: <b>CoverageEligibilityResponse.disposition</b><br>
3455   * </p>
3456   */
3457  public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION);
3458
3459 /**
3460   * Search parameter: <b>patient</b>
3461   * <p>
3462   * Description: <b>The reference to the patient</b><br>
3463   * Type: <b>reference</b><br>
3464   * Path: <b>CoverageEligibilityResponse.patient</b><br>
3465   * </p>
3466   */
3467  @SearchParamDefinition(name="patient", path="CoverageEligibilityResponse.patient", description="The reference to the patient", type="reference", target={Patient.class } )
3468  public static final String SP_PATIENT = "patient";
3469 /**
3470   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3471   * <p>
3472   * Description: <b>The reference to the patient</b><br>
3473   * Type: <b>reference</b><br>
3474   * Path: <b>CoverageEligibilityResponse.patient</b><br>
3475   * </p>
3476   */
3477  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3478
3479/**
3480   * Constant for fluent queries to be used to add include statements. Specifies
3481   * the path value of "<b>CoverageEligibilityResponse:patient</b>".
3482   */
3483  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CoverageEligibilityResponse:patient").toLocked();
3484
3485 /**
3486   * Search parameter: <b>insurer</b>
3487   * <p>
3488   * Description: <b>The organization which generated this resource</b><br>
3489   * Type: <b>reference</b><br>
3490   * Path: <b>CoverageEligibilityResponse.insurer</b><br>
3491   * </p>
3492   */
3493  @SearchParamDefinition(name="insurer", path="CoverageEligibilityResponse.insurer", description="The organization which generated this resource", type="reference", target={Organization.class } )
3494  public static final String SP_INSURER = "insurer";
3495 /**
3496   * <b>Fluent Client</b> search parameter constant for <b>insurer</b>
3497   * <p>
3498   * Description: <b>The organization which generated this resource</b><br>
3499   * Type: <b>reference</b><br>
3500   * Path: <b>CoverageEligibilityResponse.insurer</b><br>
3501   * </p>
3502   */
3503  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURER);
3504
3505/**
3506   * Constant for fluent queries to be used to add include statements. Specifies
3507   * the path value of "<b>CoverageEligibilityResponse:insurer</b>".
3508   */
3509  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURER = new ca.uhn.fhir.model.api.Include("CoverageEligibilityResponse:insurer").toLocked();
3510
3511 /**
3512   * Search parameter: <b>created</b>
3513   * <p>
3514   * Description: <b>The creation date</b><br>
3515   * Type: <b>date</b><br>
3516   * Path: <b>CoverageEligibilityResponse.created</b><br>
3517   * </p>
3518   */
3519  @SearchParamDefinition(name="created", path="CoverageEligibilityResponse.created", description="The creation date", type="date" )
3520  public static final String SP_CREATED = "created";
3521 /**
3522   * <b>Fluent Client</b> search parameter constant for <b>created</b>
3523   * <p>
3524   * Description: <b>The creation date</b><br>
3525   * Type: <b>date</b><br>
3526   * Path: <b>CoverageEligibilityResponse.created</b><br>
3527   * </p>
3528   */
3529  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
3530
3531 /**
3532   * Search parameter: <b>request-provider</b>
3533   * <p>
3534   * Description: <b>The EligibilityRequest provider</b><br>
3535   * Type: <b>reference</b><br>
3536   * Path: <b>CoverageEligibilityResponse.requestProvider</b><br>
3537   * </p>
3538   */
3539  @SearchParamDefinition(name="request-provider", path="CoverageEligibilityResponse.requestProvider", description="The EligibilityRequest provider", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
3540  public static final String SP_REQUEST_PROVIDER = "request-provider";
3541 /**
3542   * <b>Fluent Client</b> search parameter constant for <b>request-provider</b>
3543   * <p>
3544   * Description: <b>The EligibilityRequest provider</b><br>
3545   * Type: <b>reference</b><br>
3546   * Path: <b>CoverageEligibilityResponse.requestProvider</b><br>
3547   * </p>
3548   */
3549  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST_PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST_PROVIDER);
3550
3551/**
3552   * Constant for fluent queries to be used to add include statements. Specifies
3553   * the path value of "<b>CoverageEligibilityResponse:request-provider</b>".
3554   */
3555  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST_PROVIDER = new ca.uhn.fhir.model.api.Include("CoverageEligibilityResponse:request-provider").toLocked();
3556
3557 /**
3558   * Search parameter: <b>outcome</b>
3559   * <p>
3560   * Description: <b>The processing outcome</b><br>
3561   * Type: <b>token</b><br>
3562   * Path: <b>CoverageEligibilityResponse.outcome</b><br>
3563   * </p>
3564   */
3565  @SearchParamDefinition(name="outcome", path="CoverageEligibilityResponse.outcome", description="The processing outcome", type="token" )
3566  public static final String SP_OUTCOME = "outcome";
3567 /**
3568   * <b>Fluent Client</b> search parameter constant for <b>outcome</b>
3569   * <p>
3570   * Description: <b>The processing outcome</b><br>
3571   * Type: <b>token</b><br>
3572   * Path: <b>CoverageEligibilityResponse.outcome</b><br>
3573   * </p>
3574   */
3575  public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME);
3576
3577 /**
3578   * Search parameter: <b>status</b>
3579   * <p>
3580   * Description: <b>The EligibilityRequest status</b><br>
3581   * Type: <b>token</b><br>
3582   * Path: <b>CoverageEligibilityResponse.status</b><br>
3583   * </p>
3584   */
3585  @SearchParamDefinition(name="status", path="CoverageEligibilityResponse.status", description="The EligibilityRequest status", type="token" )
3586  public static final String SP_STATUS = "status";
3587 /**
3588   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3589   * <p>
3590   * Description: <b>The EligibilityRequest status</b><br>
3591   * Type: <b>token</b><br>
3592   * Path: <b>CoverageEligibilityResponse.status</b><br>
3593   * </p>
3594   */
3595  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3596
3597
3598}
3599