001package org.hl7.fhir.r5.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.ICompositeType;
058
059import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
060import org.hl7.fhir.utilities.Utilities;
061import ca.uhn.fhir.model.api.annotation.ResourceDef;
062import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
063import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
064import ca.uhn.fhir.model.api.annotation.Child;
065import ca.uhn.fhir.model.api.annotation.ChildOrder;
066import ca.uhn.fhir.model.api.annotation.Description;
067import ca.uhn.fhir.model.api.annotation.Block;
068/**
069 * The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.
070 */
071@ResourceDef(name="CoverageEligibilityRequest", profile="http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest")
072public class CoverageEligibilityRequest extends DomainResource {
073
074    public enum EligibilityRequestStatus {
075        /**
076         * The instance is currently in-force.
077         */
078        ACTIVE, 
079        /**
080         * The instance is withdrawn, rescinded or reversed.
081         */
082        CANCELLED, 
083        /**
084         * A new instance the contents of which is not complete.
085         */
086        DRAFT, 
087        /**
088         * The instance was entered in error.
089         */
090        ENTEREDINERROR, 
091        /**
092         * added to help the parsers with the generic types
093         */
094        NULL;
095        public static EligibilityRequestStatus fromCode(String codeString) throws FHIRException {
096            if (codeString == null || "".equals(codeString))
097                return null;
098        if ("active".equals(codeString))
099          return ACTIVE;
100        if ("cancelled".equals(codeString))
101          return CANCELLED;
102        if ("draft".equals(codeString))
103          return DRAFT;
104        if ("entered-in-error".equals(codeString))
105          return ENTEREDINERROR;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown EligibilityRequestStatus code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case ACTIVE: return "active";
114            case CANCELLED: return "cancelled";
115            case DRAFT: return "draft";
116            case ENTEREDINERROR: return "entered-in-error";
117            default: return "?";
118          }
119        }
120        public String getSystem() {
121          switch (this) {
122            case ACTIVE: return "http://hl7.org/fhir/fm-status";
123            case CANCELLED: return "http://hl7.org/fhir/fm-status";
124            case DRAFT: return "http://hl7.org/fhir/fm-status";
125            case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status";
126            default: return "?";
127          }
128        }
129        public String getDefinition() {
130          switch (this) {
131            case ACTIVE: return "The instance is currently in-force.";
132            case CANCELLED: return "The instance is withdrawn, rescinded or reversed.";
133            case DRAFT: return "A new instance the contents of which is not complete.";
134            case ENTEREDINERROR: return "The instance was entered in error.";
135            default: return "?";
136          }
137        }
138        public String getDisplay() {
139          switch (this) {
140            case ACTIVE: return "Active";
141            case CANCELLED: return "Cancelled";
142            case DRAFT: return "Draft";
143            case ENTEREDINERROR: return "Entered in Error";
144            default: return "?";
145          }
146        }
147    }
148
149  public static class EligibilityRequestStatusEnumFactory implements EnumFactory<EligibilityRequestStatus> {
150    public EligibilityRequestStatus fromCode(String codeString) throws IllegalArgumentException {
151      if (codeString == null || "".equals(codeString))
152            if (codeString == null || "".equals(codeString))
153                return null;
154        if ("active".equals(codeString))
155          return EligibilityRequestStatus.ACTIVE;
156        if ("cancelled".equals(codeString))
157          return EligibilityRequestStatus.CANCELLED;
158        if ("draft".equals(codeString))
159          return EligibilityRequestStatus.DRAFT;
160        if ("entered-in-error".equals(codeString))
161          return EligibilityRequestStatus.ENTEREDINERROR;
162        throw new IllegalArgumentException("Unknown EligibilityRequestStatus code '"+codeString+"'");
163        }
164        public Enumeration<EligibilityRequestStatus> fromType(Base code) throws FHIRException {
165          if (code == null)
166            return null;
167          if (code.isEmpty())
168            return new Enumeration<EligibilityRequestStatus>(this);
169          String codeString = ((PrimitiveType) code).asStringValue();
170          if (codeString == null || "".equals(codeString))
171            return null;
172        if ("active".equals(codeString))
173          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.ACTIVE);
174        if ("cancelled".equals(codeString))
175          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.CANCELLED);
176        if ("draft".equals(codeString))
177          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.DRAFT);
178        if ("entered-in-error".equals(codeString))
179          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.ENTEREDINERROR);
180        throw new FHIRException("Unknown EligibilityRequestStatus code '"+codeString+"'");
181        }
182    public String toCode(EligibilityRequestStatus code) {
183      if (code == EligibilityRequestStatus.ACTIVE)
184        return "active";
185      if (code == EligibilityRequestStatus.CANCELLED)
186        return "cancelled";
187      if (code == EligibilityRequestStatus.DRAFT)
188        return "draft";
189      if (code == EligibilityRequestStatus.ENTEREDINERROR)
190        return "entered-in-error";
191      return "?";
192      }
193    public String toSystem(EligibilityRequestStatus code) {
194      return code.getSystem();
195      }
196    }
197
198    public enum EligibilityRequestPurpose {
199        /**
200         * The prior authorization requirements for the listed, or discovered if specified, converages for the categories of service and/or specifed biling codes are requested.
201         */
202        AUTHREQUIREMENTS, 
203        /**
204         * The plan benefits and optionally benefits consumed  for the listed, or discovered if specified, converages are requested.
205         */
206        BENEFITS, 
207        /**
208         * The insurer is requested to report on any coverages which they are aware of in addition to any specifed.
209         */
210        DISCOVERY, 
211        /**
212         * A check that the specified coverages are in-force is requested.
213         */
214        VALIDATION, 
215        /**
216         * added to help the parsers with the generic types
217         */
218        NULL;
219        public static EligibilityRequestPurpose fromCode(String codeString) throws FHIRException {
220            if (codeString == null || "".equals(codeString))
221                return null;
222        if ("auth-requirements".equals(codeString))
223          return AUTHREQUIREMENTS;
224        if ("benefits".equals(codeString))
225          return BENEFITS;
226        if ("discovery".equals(codeString))
227          return DISCOVERY;
228        if ("validation".equals(codeString))
229          return VALIDATION;
230        if (Configuration.isAcceptInvalidEnums())
231          return null;
232        else
233          throw new FHIRException("Unknown EligibilityRequestPurpose code '"+codeString+"'");
234        }
235        public String toCode() {
236          switch (this) {
237            case AUTHREQUIREMENTS: return "auth-requirements";
238            case BENEFITS: return "benefits";
239            case DISCOVERY: return "discovery";
240            case VALIDATION: return "validation";
241            default: return "?";
242          }
243        }
244        public String getSystem() {
245          switch (this) {
246            case AUTHREQUIREMENTS: return "http://hl7.org/fhir/eligibilityrequest-purpose";
247            case BENEFITS: return "http://hl7.org/fhir/eligibilityrequest-purpose";
248            case DISCOVERY: return "http://hl7.org/fhir/eligibilityrequest-purpose";
249            case VALIDATION: return "http://hl7.org/fhir/eligibilityrequest-purpose";
250            default: return "?";
251          }
252        }
253        public String getDefinition() {
254          switch (this) {
255            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.";
256            case BENEFITS: return "The plan benefits and optionally benefits consumed  for the listed, or discovered if specified, converages are requested.";
257            case DISCOVERY: return "The insurer is requested to report on any coverages which they are aware of in addition to any specifed.";
258            case VALIDATION: return "A check that the specified coverages are in-force is requested.";
259            default: return "?";
260          }
261        }
262        public String getDisplay() {
263          switch (this) {
264            case AUTHREQUIREMENTS: return "Coverage auth-requirements";
265            case BENEFITS: return "Coverage benefits";
266            case DISCOVERY: return "Coverage Discovery";
267            case VALIDATION: return "Coverage Validation";
268            default: return "?";
269          }
270        }
271    }
272
273  public static class EligibilityRequestPurposeEnumFactory implements EnumFactory<EligibilityRequestPurpose> {
274    public EligibilityRequestPurpose fromCode(String codeString) throws IllegalArgumentException {
275      if (codeString == null || "".equals(codeString))
276            if (codeString == null || "".equals(codeString))
277                return null;
278        if ("auth-requirements".equals(codeString))
279          return EligibilityRequestPurpose.AUTHREQUIREMENTS;
280        if ("benefits".equals(codeString))
281          return EligibilityRequestPurpose.BENEFITS;
282        if ("discovery".equals(codeString))
283          return EligibilityRequestPurpose.DISCOVERY;
284        if ("validation".equals(codeString))
285          return EligibilityRequestPurpose.VALIDATION;
286        throw new IllegalArgumentException("Unknown EligibilityRequestPurpose code '"+codeString+"'");
287        }
288        public Enumeration<EligibilityRequestPurpose> fromType(Base code) throws FHIRException {
289          if (code == null)
290            return null;
291          if (code.isEmpty())
292            return new Enumeration<EligibilityRequestPurpose>(this);
293          String codeString = ((PrimitiveType) code).asStringValue();
294          if (codeString == null || "".equals(codeString))
295            return null;
296        if ("auth-requirements".equals(codeString))
297          return new Enumeration<EligibilityRequestPurpose>(this, EligibilityRequestPurpose.AUTHREQUIREMENTS);
298        if ("benefits".equals(codeString))
299          return new Enumeration<EligibilityRequestPurpose>(this, EligibilityRequestPurpose.BENEFITS);
300        if ("discovery".equals(codeString))
301          return new Enumeration<EligibilityRequestPurpose>(this, EligibilityRequestPurpose.DISCOVERY);
302        if ("validation".equals(codeString))
303          return new Enumeration<EligibilityRequestPurpose>(this, EligibilityRequestPurpose.VALIDATION);
304        throw new FHIRException("Unknown EligibilityRequestPurpose code '"+codeString+"'");
305        }
306    public String toCode(EligibilityRequestPurpose code) {
307      if (code == EligibilityRequestPurpose.AUTHREQUIREMENTS)
308        return "auth-requirements";
309      if (code == EligibilityRequestPurpose.BENEFITS)
310        return "benefits";
311      if (code == EligibilityRequestPurpose.DISCOVERY)
312        return "discovery";
313      if (code == EligibilityRequestPurpose.VALIDATION)
314        return "validation";
315      return "?";
316      }
317    public String toSystem(EligibilityRequestPurpose code) {
318      return code.getSystem();
319      }
320    }
321
322    @Block()
323    public static class SupportingInformationComponent extends BackboneElement implements IBaseBackboneElement {
324        /**
325         * A number to uniquely identify supporting information entries.
326         */
327        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false)
328        @Description(shortDefinition="Information instance identifier", formalDefinition="A number to uniquely identify supporting information entries." )
329        protected PositiveIntType sequence;
330
331        /**
332         * Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.
333         */
334        @Child(name = "information", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=false)
335        @Description(shortDefinition="Data to be provided", formalDefinition="Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data." )
336        protected Reference information;
337
338        /**
339         * The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.
340         */
341        @Child(name = "appliesToAll", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
342        @Description(shortDefinition="Applies to all items", formalDefinition="The supporting materials are applicable for all detail items, product/servce categories and specific billing codes." )
343        protected BooleanType appliesToAll;
344
345        private static final long serialVersionUID = -1430960090L;
346
347    /**
348     * Constructor
349     */
350      public SupportingInformationComponent() {
351        super();
352      }
353
354    /**
355     * Constructor
356     */
357      public SupportingInformationComponent(PositiveIntType sequence, Reference information) {
358        super();
359        this.sequence = sequence;
360        this.information = information;
361      }
362
363        /**
364         * @return {@link #sequence} (A number to uniquely identify supporting information entries.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
365         */
366        public PositiveIntType getSequenceElement() { 
367          if (this.sequence == null)
368            if (Configuration.errorOnAutoCreate())
369              throw new Error("Attempt to auto-create SupportingInformationComponent.sequence");
370            else if (Configuration.doAutoCreate())
371              this.sequence = new PositiveIntType(); // bb
372          return this.sequence;
373        }
374
375        public boolean hasSequenceElement() { 
376          return this.sequence != null && !this.sequence.isEmpty();
377        }
378
379        public boolean hasSequence() { 
380          return this.sequence != null && !this.sequence.isEmpty();
381        }
382
383        /**
384         * @param value {@link #sequence} (A number to uniquely identify supporting information entries.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
385         */
386        public SupportingInformationComponent setSequenceElement(PositiveIntType value) { 
387          this.sequence = value;
388          return this;
389        }
390
391        /**
392         * @return A number to uniquely identify supporting information entries.
393         */
394        public int getSequence() { 
395          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
396        }
397
398        /**
399         * @param value A number to uniquely identify supporting information entries.
400         */
401        public SupportingInformationComponent setSequence(int value) { 
402            if (this.sequence == null)
403              this.sequence = new PositiveIntType();
404            this.sequence.setValue(value);
405          return this;
406        }
407
408        /**
409         * @return {@link #information} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.)
410         */
411        public Reference getInformation() { 
412          if (this.information == null)
413            if (Configuration.errorOnAutoCreate())
414              throw new Error("Attempt to auto-create SupportingInformationComponent.information");
415            else if (Configuration.doAutoCreate())
416              this.information = new Reference(); // cc
417          return this.information;
418        }
419
420        public boolean hasInformation() { 
421          return this.information != null && !this.information.isEmpty();
422        }
423
424        /**
425         * @param value {@link #information} (Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.)
426         */
427        public SupportingInformationComponent setInformation(Reference value) { 
428          this.information = value;
429          return this;
430        }
431
432        /**
433         * @return {@link #appliesToAll} (The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.). This is the underlying object with id, value and extensions. The accessor "getAppliesToAll" gives direct access to the value
434         */
435        public BooleanType getAppliesToAllElement() { 
436          if (this.appliesToAll == null)
437            if (Configuration.errorOnAutoCreate())
438              throw new Error("Attempt to auto-create SupportingInformationComponent.appliesToAll");
439            else if (Configuration.doAutoCreate())
440              this.appliesToAll = new BooleanType(); // bb
441          return this.appliesToAll;
442        }
443
444        public boolean hasAppliesToAllElement() { 
445          return this.appliesToAll != null && !this.appliesToAll.isEmpty();
446        }
447
448        public boolean hasAppliesToAll() { 
449          return this.appliesToAll != null && !this.appliesToAll.isEmpty();
450        }
451
452        /**
453         * @param value {@link #appliesToAll} (The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.). This is the underlying object with id, value and extensions. The accessor "getAppliesToAll" gives direct access to the value
454         */
455        public SupportingInformationComponent setAppliesToAllElement(BooleanType value) { 
456          this.appliesToAll = value;
457          return this;
458        }
459
460        /**
461         * @return The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.
462         */
463        public boolean getAppliesToAll() { 
464          return this.appliesToAll == null || this.appliesToAll.isEmpty() ? false : this.appliesToAll.getValue();
465        }
466
467        /**
468         * @param value The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.
469         */
470        public SupportingInformationComponent setAppliesToAll(boolean value) { 
471            if (this.appliesToAll == null)
472              this.appliesToAll = new BooleanType();
473            this.appliesToAll.setValue(value);
474          return this;
475        }
476
477        protected void listChildren(List<Property> children) {
478          super.listChildren(children);
479          children.add(new Property("sequence", "positiveInt", "A number to uniquely identify supporting information entries.", 0, 1, sequence));
480          children.add(new Property("information", "Reference(Any)", "Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.", 0, 1, information));
481          children.add(new Property("appliesToAll", "boolean", "The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.", 0, 1, appliesToAll));
482        }
483
484        @Override
485        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
486          switch (_hash) {
487          case 1349547969: /*sequence*/  return new Property("sequence", "positiveInt", "A number to uniquely identify supporting information entries.", 0, 1, sequence);
488          case 1968600364: /*information*/  return new Property("information", "Reference(Any)", "Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.", 0, 1, information);
489          case -1096846342: /*appliesToAll*/  return new Property("appliesToAll", "boolean", "The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.", 0, 1, appliesToAll);
490          default: return super.getNamedProperty(_hash, _name, _checkValid);
491          }
492
493        }
494
495      @Override
496      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
497        switch (hash) {
498        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
499        case 1968600364: /*information*/ return this.information == null ? new Base[0] : new Base[] {this.information}; // Reference
500        case -1096846342: /*appliesToAll*/ return this.appliesToAll == null ? new Base[0] : new Base[] {this.appliesToAll}; // BooleanType
501        default: return super.getProperty(hash, name, checkValid);
502        }
503
504      }
505
506      @Override
507      public Base setProperty(int hash, String name, Base value) throws FHIRException {
508        switch (hash) {
509        case 1349547969: // sequence
510          this.sequence = castToPositiveInt(value); // PositiveIntType
511          return value;
512        case 1968600364: // information
513          this.information = castToReference(value); // Reference
514          return value;
515        case -1096846342: // appliesToAll
516          this.appliesToAll = castToBoolean(value); // BooleanType
517          return value;
518        default: return super.setProperty(hash, name, value);
519        }
520
521      }
522
523      @Override
524      public Base setProperty(String name, Base value) throws FHIRException {
525        if (name.equals("sequence")) {
526          this.sequence = castToPositiveInt(value); // PositiveIntType
527        } else if (name.equals("information")) {
528          this.information = castToReference(value); // Reference
529        } else if (name.equals("appliesToAll")) {
530          this.appliesToAll = castToBoolean(value); // BooleanType
531        } else
532          return super.setProperty(name, value);
533        return value;
534      }
535
536      @Override
537      public Base makeProperty(int hash, String name) throws FHIRException {
538        switch (hash) {
539        case 1349547969:  return getSequenceElement();
540        case 1968600364:  return getInformation();
541        case -1096846342:  return getAppliesToAllElement();
542        default: return super.makeProperty(hash, name);
543        }
544
545      }
546
547      @Override
548      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
549        switch (hash) {
550        case 1349547969: /*sequence*/ return new String[] {"positiveInt"};
551        case 1968600364: /*information*/ return new String[] {"Reference"};
552        case -1096846342: /*appliesToAll*/ return new String[] {"boolean"};
553        default: return super.getTypesForProperty(hash, name);
554        }
555
556      }
557
558      @Override
559      public Base addChild(String name) throws FHIRException {
560        if (name.equals("sequence")) {
561          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.sequence");
562        }
563        else if (name.equals("information")) {
564          this.information = new Reference();
565          return this.information;
566        }
567        else if (name.equals("appliesToAll")) {
568          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.appliesToAll");
569        }
570        else
571          return super.addChild(name);
572      }
573
574      public SupportingInformationComponent copy() {
575        SupportingInformationComponent dst = new SupportingInformationComponent();
576        copyValues(dst);
577        return dst;
578      }
579
580      public void copyValues(SupportingInformationComponent dst) {
581        super.copyValues(dst);
582        dst.sequence = sequence == null ? null : sequence.copy();
583        dst.information = information == null ? null : information.copy();
584        dst.appliesToAll = appliesToAll == null ? null : appliesToAll.copy();
585      }
586
587      @Override
588      public boolean equalsDeep(Base other_) {
589        if (!super.equalsDeep(other_))
590          return false;
591        if (!(other_ instanceof SupportingInformationComponent))
592          return false;
593        SupportingInformationComponent o = (SupportingInformationComponent) other_;
594        return compareDeep(sequence, o.sequence, true) && compareDeep(information, o.information, true)
595           && compareDeep(appliesToAll, o.appliesToAll, true);
596      }
597
598      @Override
599      public boolean equalsShallow(Base other_) {
600        if (!super.equalsShallow(other_))
601          return false;
602        if (!(other_ instanceof SupportingInformationComponent))
603          return false;
604        SupportingInformationComponent o = (SupportingInformationComponent) other_;
605        return compareValues(sequence, o.sequence, true) && compareValues(appliesToAll, o.appliesToAll, true)
606          ;
607      }
608
609      public boolean isEmpty() {
610        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, information, appliesToAll
611          );
612      }
613
614  public String fhirType() {
615    return "CoverageEligibilityRequest.supportingInfo";
616
617  }
618
619  }
620
621    @Block()
622    public static class InsuranceComponent extends BackboneElement implements IBaseBackboneElement {
623        /**
624         * A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.
625         */
626        @Child(name = "focal", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
627        @Description(shortDefinition="Applicable coverage", formalDefinition="A flag to indicate that this Coverage is to be used for evaluation of this request when set to true." )
628        protected BooleanType focal;
629
630        /**
631         * Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.
632         */
633        @Child(name = "coverage", type = {Coverage.class}, order=2, min=1, max=1, modifier=false, summary=false)
634        @Description(shortDefinition="Insurance information", formalDefinition="Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system." )
635        protected Reference coverage;
636
637        /**
638         * A business agreement number established between the provider and the insurer for special business processing purposes.
639         */
640        @Child(name = "businessArrangement", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
641        @Description(shortDefinition="Additional provider contract number", formalDefinition="A business agreement number established between the provider and the insurer for special business processing purposes." )
642        protected StringType businessArrangement;
643
644        private static final long serialVersionUID = -1656150261L;
645
646    /**
647     * Constructor
648     */
649      public InsuranceComponent() {
650        super();
651      }
652
653    /**
654     * Constructor
655     */
656      public InsuranceComponent(Reference coverage) {
657        super();
658        this.coverage = coverage;
659      }
660
661        /**
662         * @return {@link #focal} (A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
663         */
664        public BooleanType getFocalElement() { 
665          if (this.focal == null)
666            if (Configuration.errorOnAutoCreate())
667              throw new Error("Attempt to auto-create InsuranceComponent.focal");
668            else if (Configuration.doAutoCreate())
669              this.focal = new BooleanType(); // bb
670          return this.focal;
671        }
672
673        public boolean hasFocalElement() { 
674          return this.focal != null && !this.focal.isEmpty();
675        }
676
677        public boolean hasFocal() { 
678          return this.focal != null && !this.focal.isEmpty();
679        }
680
681        /**
682         * @param value {@link #focal} (A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
683         */
684        public InsuranceComponent setFocalElement(BooleanType value) { 
685          this.focal = value;
686          return this;
687        }
688
689        /**
690         * @return A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.
691         */
692        public boolean getFocal() { 
693          return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue();
694        }
695
696        /**
697         * @param value A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.
698         */
699        public InsuranceComponent setFocal(boolean value) { 
700            if (this.focal == null)
701              this.focal = new BooleanType();
702            this.focal.setValue(value);
703          return this;
704        }
705
706        /**
707         * @return {@link #coverage} (Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.)
708         */
709        public Reference getCoverage() { 
710          if (this.coverage == null)
711            if (Configuration.errorOnAutoCreate())
712              throw new Error("Attempt to auto-create InsuranceComponent.coverage");
713            else if (Configuration.doAutoCreate())
714              this.coverage = new Reference(); // cc
715          return this.coverage;
716        }
717
718        public boolean hasCoverage() { 
719          return this.coverage != null && !this.coverage.isEmpty();
720        }
721
722        /**
723         * @param value {@link #coverage} (Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.)
724         */
725        public InsuranceComponent setCoverage(Reference value) { 
726          this.coverage = value;
727          return this;
728        }
729
730        /**
731         * @return {@link #businessArrangement} (A business agreement number established between the provider and the insurer for special business processing purposes.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
732         */
733        public StringType getBusinessArrangementElement() { 
734          if (this.businessArrangement == null)
735            if (Configuration.errorOnAutoCreate())
736              throw new Error("Attempt to auto-create InsuranceComponent.businessArrangement");
737            else if (Configuration.doAutoCreate())
738              this.businessArrangement = new StringType(); // bb
739          return this.businessArrangement;
740        }
741
742        public boolean hasBusinessArrangementElement() { 
743          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
744        }
745
746        public boolean hasBusinessArrangement() { 
747          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
748        }
749
750        /**
751         * @param value {@link #businessArrangement} (A business agreement number established between the provider and the insurer for special business processing purposes.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
752         */
753        public InsuranceComponent setBusinessArrangementElement(StringType value) { 
754          this.businessArrangement = value;
755          return this;
756        }
757
758        /**
759         * @return A business agreement number established between the provider and the insurer for special business processing purposes.
760         */
761        public String getBusinessArrangement() { 
762          return this.businessArrangement == null ? null : this.businessArrangement.getValue();
763        }
764
765        /**
766         * @param value A business agreement number established between the provider and the insurer for special business processing purposes.
767         */
768        public InsuranceComponent setBusinessArrangement(String value) { 
769          if (Utilities.noString(value))
770            this.businessArrangement = null;
771          else {
772            if (this.businessArrangement == null)
773              this.businessArrangement = new StringType();
774            this.businessArrangement.setValue(value);
775          }
776          return this;
777        }
778
779        protected void listChildren(List<Property> children) {
780          super.listChildren(children);
781          children.add(new Property("focal", "boolean", "A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.", 0, 1, focal));
782          children.add(new Property("coverage", "Reference(Coverage)", "Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.", 0, 1, coverage));
783          children.add(new Property("businessArrangement", "string", "A business agreement number established between the provider and the insurer for special business processing purposes.", 0, 1, businessArrangement));
784        }
785
786        @Override
787        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
788          switch (_hash) {
789          case 97604197: /*focal*/  return new Property("focal", "boolean", "A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.", 0, 1, focal);
790          case -351767064: /*coverage*/  return new Property("coverage", "Reference(Coverage)", "Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.", 0, 1, coverage);
791          case 259920682: /*businessArrangement*/  return new Property("businessArrangement", "string", "A business agreement number established between the provider and the insurer for special business processing purposes.", 0, 1, businessArrangement);
792          default: return super.getNamedProperty(_hash, _name, _checkValid);
793          }
794
795        }
796
797      @Override
798      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
799        switch (hash) {
800        case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType
801        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
802        case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
803        default: return super.getProperty(hash, name, checkValid);
804        }
805
806      }
807
808      @Override
809      public Base setProperty(int hash, String name, Base value) throws FHIRException {
810        switch (hash) {
811        case 97604197: // focal
812          this.focal = castToBoolean(value); // BooleanType
813          return value;
814        case -351767064: // coverage
815          this.coverage = castToReference(value); // Reference
816          return value;
817        case 259920682: // businessArrangement
818          this.businessArrangement = castToString(value); // StringType
819          return value;
820        default: return super.setProperty(hash, name, value);
821        }
822
823      }
824
825      @Override
826      public Base setProperty(String name, Base value) throws FHIRException {
827        if (name.equals("focal")) {
828          this.focal = castToBoolean(value); // BooleanType
829        } else if (name.equals("coverage")) {
830          this.coverage = castToReference(value); // Reference
831        } else if (name.equals("businessArrangement")) {
832          this.businessArrangement = castToString(value); // StringType
833        } else
834          return super.setProperty(name, value);
835        return value;
836      }
837
838      @Override
839      public Base makeProperty(int hash, String name) throws FHIRException {
840        switch (hash) {
841        case 97604197:  return getFocalElement();
842        case -351767064:  return getCoverage();
843        case 259920682:  return getBusinessArrangementElement();
844        default: return super.makeProperty(hash, name);
845        }
846
847      }
848
849      @Override
850      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
851        switch (hash) {
852        case 97604197: /*focal*/ return new String[] {"boolean"};
853        case -351767064: /*coverage*/ return new String[] {"Reference"};
854        case 259920682: /*businessArrangement*/ return new String[] {"string"};
855        default: return super.getTypesForProperty(hash, name);
856        }
857
858      }
859
860      @Override
861      public Base addChild(String name) throws FHIRException {
862        if (name.equals("focal")) {
863          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.focal");
864        }
865        else if (name.equals("coverage")) {
866          this.coverage = new Reference();
867          return this.coverage;
868        }
869        else if (name.equals("businessArrangement")) {
870          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.businessArrangement");
871        }
872        else
873          return super.addChild(name);
874      }
875
876      public InsuranceComponent copy() {
877        InsuranceComponent dst = new InsuranceComponent();
878        copyValues(dst);
879        return dst;
880      }
881
882      public void copyValues(InsuranceComponent dst) {
883        super.copyValues(dst);
884        dst.focal = focal == null ? null : focal.copy();
885        dst.coverage = coverage == null ? null : coverage.copy();
886        dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
887      }
888
889      @Override
890      public boolean equalsDeep(Base other_) {
891        if (!super.equalsDeep(other_))
892          return false;
893        if (!(other_ instanceof InsuranceComponent))
894          return false;
895        InsuranceComponent o = (InsuranceComponent) other_;
896        return compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) && compareDeep(businessArrangement, o.businessArrangement, true)
897          ;
898      }
899
900      @Override
901      public boolean equalsShallow(Base other_) {
902        if (!super.equalsShallow(other_))
903          return false;
904        if (!(other_ instanceof InsuranceComponent))
905          return false;
906        InsuranceComponent o = (InsuranceComponent) other_;
907        return compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true)
908          ;
909      }
910
911      public boolean isEmpty() {
912        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(focal, coverage, businessArrangement
913          );
914      }
915
916  public String fhirType() {
917    return "CoverageEligibilityRequest.insurance";
918
919  }
920
921  }
922
923    @Block()
924    public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement {
925        /**
926         * Exceptions, special conditions and supporting information applicable for this service or product line.
927         */
928        @Child(name = "supportingInfoSequence", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
929        @Description(shortDefinition="Applicable exception or supporting information", formalDefinition="Exceptions, special conditions and supporting information applicable for this service or product line." )
930        protected List<PositiveIntType> supportingInfoSequence;
931
932        /**
933         * Code to identify the general type of benefits under which products and services are provided.
934         */
935        @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
936        @Description(shortDefinition="Benefit classification", formalDefinition="Code to identify the general type of benefits under which products and services are provided." )
937        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-benefitcategory")
938        protected CodeableConcept category;
939
940        /**
941         * This contains the product, service, drug or other billing code for the item.
942         */
943        @Child(name = "productOrService", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
944        @Description(shortDefinition="Billing, service, product, or drug code", formalDefinition="This contains the product, service, drug or other billing code for the item." )
945        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-uscls")
946        protected CodeableConcept productOrService;
947
948        /**
949         * Item typification or modifiers codes to convey additional context for the product or service.
950         */
951        @Child(name = "modifier", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
952        @Description(shortDefinition="Product or service billing modifiers", formalDefinition="Item typification or modifiers codes to convey additional context for the product or service." )
953        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/claim-modifiers")
954        protected List<CodeableConcept> modifier;
955
956        /**
957         * The practitioner who is responsible for the product or service to be rendered to the patient.
958         */
959        @Child(name = "provider", type = {Practitioner.class, PractitionerRole.class}, order=5, min=0, max=1, modifier=false, summary=false)
960        @Description(shortDefinition="Perfoming practitioner", formalDefinition="The practitioner who is responsible for the product or service to be rendered to the patient." )
961        protected Reference provider;
962
963        /**
964         * The number of repetitions of a service or product.
965         */
966        @Child(name = "quantity", type = {Quantity.class}, order=6, min=0, max=1, modifier=false, summary=false)
967        @Description(shortDefinition="Count of products or services", formalDefinition="The number of repetitions of a service or product." )
968        protected Quantity quantity;
969
970        /**
971         * The amount charged to the patient by the provider for a single unit.
972         */
973        @Child(name = "unitPrice", type = {Money.class}, order=7, min=0, max=1, modifier=false, summary=false)
974        @Description(shortDefinition="Fee, charge or cost per item", formalDefinition="The amount charged to the patient by the provider for a single unit." )
975        protected Money unitPrice;
976
977        /**
978         * Facility where the services will be provided.
979         */
980        @Child(name = "facility", type = {Location.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
981        @Description(shortDefinition="Servicing facility", formalDefinition="Facility where the services will be provided." )
982        protected Reference facility;
983
984        /**
985         * Patient diagnosis for which care is sought.
986         */
987        @Child(name = "diagnosis", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
988        @Description(shortDefinition="Applicable diagnosis", formalDefinition="Patient diagnosis for which care is sought." )
989        protected List<DiagnosisComponent> diagnosis;
990
991        /**
992         * The plan/proposal/order describing the proposed service in detail.
993         */
994        @Child(name = "detail", type = {Reference.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
995        @Description(shortDefinition="Product or service details", formalDefinition="The plan/proposal/order describing the proposed service in detail." )
996        protected List<Reference> detail;
997
998        private static final long serialVersionUID = 1615052611L;
999
1000    /**
1001     * Constructor
1002     */
1003      public DetailsComponent() {
1004        super();
1005      }
1006
1007        /**
1008         * @return {@link #supportingInfoSequence} (Exceptions, special conditions and supporting information applicable for this service or product line.)
1009         */
1010        public List<PositiveIntType> getSupportingInfoSequence() { 
1011          if (this.supportingInfoSequence == null)
1012            this.supportingInfoSequence = new ArrayList<PositiveIntType>();
1013          return this.supportingInfoSequence;
1014        }
1015
1016        /**
1017         * @return Returns a reference to <code>this</code> for easy method chaining
1018         */
1019        public DetailsComponent setSupportingInfoSequence(List<PositiveIntType> theSupportingInfoSequence) { 
1020          this.supportingInfoSequence = theSupportingInfoSequence;
1021          return this;
1022        }
1023
1024        public boolean hasSupportingInfoSequence() { 
1025          if (this.supportingInfoSequence == null)
1026            return false;
1027          for (PositiveIntType item : this.supportingInfoSequence)
1028            if (!item.isEmpty())
1029              return true;
1030          return false;
1031        }
1032
1033        /**
1034         * @return {@link #supportingInfoSequence} (Exceptions, special conditions and supporting information applicable for this service or product line.)
1035         */
1036        public PositiveIntType addSupportingInfoSequenceElement() {//2 
1037          PositiveIntType t = new PositiveIntType();
1038          if (this.supportingInfoSequence == null)
1039            this.supportingInfoSequence = new ArrayList<PositiveIntType>();
1040          this.supportingInfoSequence.add(t);
1041          return t;
1042        }
1043
1044        /**
1045         * @param value {@link #supportingInfoSequence} (Exceptions, special conditions and supporting information applicable for this service or product line.)
1046         */
1047        public DetailsComponent addSupportingInfoSequence(int value) { //1
1048          PositiveIntType t = new PositiveIntType();
1049          t.setValue(value);
1050          if (this.supportingInfoSequence == null)
1051            this.supportingInfoSequence = new ArrayList<PositiveIntType>();
1052          this.supportingInfoSequence.add(t);
1053          return this;
1054        }
1055
1056        /**
1057         * @param value {@link #supportingInfoSequence} (Exceptions, special conditions and supporting information applicable for this service or product line.)
1058         */
1059        public boolean hasSupportingInfoSequence(int value) { 
1060          if (this.supportingInfoSequence == null)
1061            return false;
1062          for (PositiveIntType v : this.supportingInfoSequence)
1063            if (v.getValue().equals(value)) // positiveInt
1064              return true;
1065          return false;
1066        }
1067
1068        /**
1069         * @return {@link #category} (Code to identify the general type of benefits under which products and services are provided.)
1070         */
1071        public CodeableConcept getCategory() { 
1072          if (this.category == null)
1073            if (Configuration.errorOnAutoCreate())
1074              throw new Error("Attempt to auto-create DetailsComponent.category");
1075            else if (Configuration.doAutoCreate())
1076              this.category = new CodeableConcept(); // cc
1077          return this.category;
1078        }
1079
1080        public boolean hasCategory() { 
1081          return this.category != null && !this.category.isEmpty();
1082        }
1083
1084        /**
1085         * @param value {@link #category} (Code to identify the general type of benefits under which products and services are provided.)
1086         */
1087        public DetailsComponent setCategory(CodeableConcept value) { 
1088          this.category = value;
1089          return this;
1090        }
1091
1092        /**
1093         * @return {@link #productOrService} (This contains the product, service, drug or other billing code for the item.)
1094         */
1095        public CodeableConcept getProductOrService() { 
1096          if (this.productOrService == null)
1097            if (Configuration.errorOnAutoCreate())
1098              throw new Error("Attempt to auto-create DetailsComponent.productOrService");
1099            else if (Configuration.doAutoCreate())
1100              this.productOrService = new CodeableConcept(); // cc
1101          return this.productOrService;
1102        }
1103
1104        public boolean hasProductOrService() { 
1105          return this.productOrService != null && !this.productOrService.isEmpty();
1106        }
1107
1108        /**
1109         * @param value {@link #productOrService} (This contains the product, service, drug or other billing code for the item.)
1110         */
1111        public DetailsComponent setProductOrService(CodeableConcept value) { 
1112          this.productOrService = value;
1113          return this;
1114        }
1115
1116        /**
1117         * @return {@link #modifier} (Item typification or modifiers codes to convey additional context for the product or service.)
1118         */
1119        public List<CodeableConcept> getModifier() { 
1120          if (this.modifier == null)
1121            this.modifier = new ArrayList<CodeableConcept>();
1122          return this.modifier;
1123        }
1124
1125        /**
1126         * @return Returns a reference to <code>this</code> for easy method chaining
1127         */
1128        public DetailsComponent setModifier(List<CodeableConcept> theModifier) { 
1129          this.modifier = theModifier;
1130          return this;
1131        }
1132
1133        public boolean hasModifier() { 
1134          if (this.modifier == null)
1135            return false;
1136          for (CodeableConcept item : this.modifier)
1137            if (!item.isEmpty())
1138              return true;
1139          return false;
1140        }
1141
1142        public CodeableConcept addModifier() { //3
1143          CodeableConcept t = new CodeableConcept();
1144          if (this.modifier == null)
1145            this.modifier = new ArrayList<CodeableConcept>();
1146          this.modifier.add(t);
1147          return t;
1148        }
1149
1150        public DetailsComponent addModifier(CodeableConcept t) { //3
1151          if (t == null)
1152            return this;
1153          if (this.modifier == null)
1154            this.modifier = new ArrayList<CodeableConcept>();
1155          this.modifier.add(t);
1156          return this;
1157        }
1158
1159        /**
1160         * @return The first repetition of repeating field {@link #modifier}, creating it if it does not already exist
1161         */
1162        public CodeableConcept getModifierFirstRep() { 
1163          if (getModifier().isEmpty()) {
1164            addModifier();
1165          }
1166          return getModifier().get(0);
1167        }
1168
1169        /**
1170         * @return {@link #provider} (The practitioner who is responsible for the product or service to be rendered to the patient.)
1171         */
1172        public Reference getProvider() { 
1173          if (this.provider == null)
1174            if (Configuration.errorOnAutoCreate())
1175              throw new Error("Attempt to auto-create DetailsComponent.provider");
1176            else if (Configuration.doAutoCreate())
1177              this.provider = new Reference(); // cc
1178          return this.provider;
1179        }
1180
1181        public boolean hasProvider() { 
1182          return this.provider != null && !this.provider.isEmpty();
1183        }
1184
1185        /**
1186         * @param value {@link #provider} (The practitioner who is responsible for the product or service to be rendered to the patient.)
1187         */
1188        public DetailsComponent setProvider(Reference value) { 
1189          this.provider = value;
1190          return this;
1191        }
1192
1193        /**
1194         * @return {@link #quantity} (The number of repetitions of a service or product.)
1195         */
1196        public Quantity getQuantity() { 
1197          if (this.quantity == null)
1198            if (Configuration.errorOnAutoCreate())
1199              throw new Error("Attempt to auto-create DetailsComponent.quantity");
1200            else if (Configuration.doAutoCreate())
1201              this.quantity = new Quantity(); // cc
1202          return this.quantity;
1203        }
1204
1205        public boolean hasQuantity() { 
1206          return this.quantity != null && !this.quantity.isEmpty();
1207        }
1208
1209        /**
1210         * @param value {@link #quantity} (The number of repetitions of a service or product.)
1211         */
1212        public DetailsComponent setQuantity(Quantity value) { 
1213          this.quantity = value;
1214          return this;
1215        }
1216
1217        /**
1218         * @return {@link #unitPrice} (The amount charged to the patient by the provider for a single unit.)
1219         */
1220        public Money getUnitPrice() { 
1221          if (this.unitPrice == null)
1222            if (Configuration.errorOnAutoCreate())
1223              throw new Error("Attempt to auto-create DetailsComponent.unitPrice");
1224            else if (Configuration.doAutoCreate())
1225              this.unitPrice = new Money(); // cc
1226          return this.unitPrice;
1227        }
1228
1229        public boolean hasUnitPrice() { 
1230          return this.unitPrice != null && !this.unitPrice.isEmpty();
1231        }
1232
1233        /**
1234         * @param value {@link #unitPrice} (The amount charged to the patient by the provider for a single unit.)
1235         */
1236        public DetailsComponent setUnitPrice(Money value) { 
1237          this.unitPrice = value;
1238          return this;
1239        }
1240
1241        /**
1242         * @return {@link #facility} (Facility where the services will be provided.)
1243         */
1244        public Reference getFacility() { 
1245          if (this.facility == null)
1246            if (Configuration.errorOnAutoCreate())
1247              throw new Error("Attempt to auto-create DetailsComponent.facility");
1248            else if (Configuration.doAutoCreate())
1249              this.facility = new Reference(); // cc
1250          return this.facility;
1251        }
1252
1253        public boolean hasFacility() { 
1254          return this.facility != null && !this.facility.isEmpty();
1255        }
1256
1257        /**
1258         * @param value {@link #facility} (Facility where the services will be provided.)
1259         */
1260        public DetailsComponent setFacility(Reference value) { 
1261          this.facility = value;
1262          return this;
1263        }
1264
1265        /**
1266         * @return {@link #diagnosis} (Patient diagnosis for which care is sought.)
1267         */
1268        public List<DiagnosisComponent> getDiagnosis() { 
1269          if (this.diagnosis == null)
1270            this.diagnosis = new ArrayList<DiagnosisComponent>();
1271          return this.diagnosis;
1272        }
1273
1274        /**
1275         * @return Returns a reference to <code>this</code> for easy method chaining
1276         */
1277        public DetailsComponent setDiagnosis(List<DiagnosisComponent> theDiagnosis) { 
1278          this.diagnosis = theDiagnosis;
1279          return this;
1280        }
1281
1282        public boolean hasDiagnosis() { 
1283          if (this.diagnosis == null)
1284            return false;
1285          for (DiagnosisComponent item : this.diagnosis)
1286            if (!item.isEmpty())
1287              return true;
1288          return false;
1289        }
1290
1291        public DiagnosisComponent addDiagnosis() { //3
1292          DiagnosisComponent t = new DiagnosisComponent();
1293          if (this.diagnosis == null)
1294            this.diagnosis = new ArrayList<DiagnosisComponent>();
1295          this.diagnosis.add(t);
1296          return t;
1297        }
1298
1299        public DetailsComponent addDiagnosis(DiagnosisComponent t) { //3
1300          if (t == null)
1301            return this;
1302          if (this.diagnosis == null)
1303            this.diagnosis = new ArrayList<DiagnosisComponent>();
1304          this.diagnosis.add(t);
1305          return this;
1306        }
1307
1308        /**
1309         * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist
1310         */
1311        public DiagnosisComponent getDiagnosisFirstRep() { 
1312          if (getDiagnosis().isEmpty()) {
1313            addDiagnosis();
1314          }
1315          return getDiagnosis().get(0);
1316        }
1317
1318        /**
1319         * @return {@link #detail} (The plan/proposal/order describing the proposed service in detail.)
1320         */
1321        public List<Reference> getDetail() { 
1322          if (this.detail == null)
1323            this.detail = new ArrayList<Reference>();
1324          return this.detail;
1325        }
1326
1327        /**
1328         * @return Returns a reference to <code>this</code> for easy method chaining
1329         */
1330        public DetailsComponent setDetail(List<Reference> theDetail) { 
1331          this.detail = theDetail;
1332          return this;
1333        }
1334
1335        public boolean hasDetail() { 
1336          if (this.detail == null)
1337            return false;
1338          for (Reference item : this.detail)
1339            if (!item.isEmpty())
1340              return true;
1341          return false;
1342        }
1343
1344        public Reference addDetail() { //3
1345          Reference t = new Reference();
1346          if (this.detail == null)
1347            this.detail = new ArrayList<Reference>();
1348          this.detail.add(t);
1349          return t;
1350        }
1351
1352        public DetailsComponent addDetail(Reference t) { //3
1353          if (t == null)
1354            return this;
1355          if (this.detail == null)
1356            this.detail = new ArrayList<Reference>();
1357          this.detail.add(t);
1358          return this;
1359        }
1360
1361        /**
1362         * @return The first repetition of repeating field {@link #detail}, creating it if it does not already exist
1363         */
1364        public Reference getDetailFirstRep() { 
1365          if (getDetail().isEmpty()) {
1366            addDetail();
1367          }
1368          return getDetail().get(0);
1369        }
1370
1371        protected void listChildren(List<Property> children) {
1372          super.listChildren(children);
1373          children.add(new Property("supportingInfoSequence", "positiveInt", "Exceptions, special conditions and supporting information applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, supportingInfoSequence));
1374          children.add(new Property("category", "CodeableConcept", "Code to identify the general type of benefits under which products and services are provided.", 0, 1, category));
1375          children.add(new Property("productOrService", "CodeableConcept", "This contains the product, service, drug or other billing code for the item.", 0, 1, productOrService));
1376          children.add(new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier));
1377          children.add(new Property("provider", "Reference(Practitioner|PractitionerRole)", "The practitioner who is responsible for the product or service to be rendered to the patient.", 0, 1, provider));
1378          children.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, 1, quantity));
1379          children.add(new Property("unitPrice", "Money", "The amount charged to the patient by the provider for a single unit.", 0, 1, unitPrice));
1380          children.add(new Property("facility", "Reference(Location|Organization)", "Facility where the services will be provided.", 0, 1, facility));
1381          children.add(new Property("diagnosis", "", "Patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
1382          children.add(new Property("detail", "Reference(Any)", "The plan/proposal/order describing the proposed service in detail.", 0, java.lang.Integer.MAX_VALUE, detail));
1383        }
1384
1385        @Override
1386        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1387          switch (_hash) {
1388          case -595860510: /*supportingInfoSequence*/  return new Property("supportingInfoSequence", "positiveInt", "Exceptions, special conditions and supporting information applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, supportingInfoSequence);
1389          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Code to identify the general type of benefits under which products and services are provided.", 0, 1, category);
1390          case 1957227299: /*productOrService*/  return new Property("productOrService", "CodeableConcept", "This contains the product, service, drug or other billing code for the item.", 0, 1, productOrService);
1391          case -615513385: /*modifier*/  return new Property("modifier", "CodeableConcept", "Item typification or modifiers codes to convey additional context for the product or service.", 0, java.lang.Integer.MAX_VALUE, modifier);
1392          case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner|PractitionerRole)", "The practitioner who is responsible for the product or service to be rendered to the patient.", 0, 1, provider);
1393          case -1285004149: /*quantity*/  return new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, 1, quantity);
1394          case -486196699: /*unitPrice*/  return new Property("unitPrice", "Money", "The amount charged to the patient by the provider for a single unit.", 0, 1, unitPrice);
1395          case 501116579: /*facility*/  return new Property("facility", "Reference(Location|Organization)", "Facility where the services will be provided.", 0, 1, facility);
1396          case 1196993265: /*diagnosis*/  return new Property("diagnosis", "", "Patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis);
1397          case -1335224239: /*detail*/  return new Property("detail", "Reference(Any)", "The plan/proposal/order describing the proposed service in detail.", 0, java.lang.Integer.MAX_VALUE, detail);
1398          default: return super.getNamedProperty(_hash, _name, _checkValid);
1399          }
1400
1401        }
1402
1403      @Override
1404      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1405        switch (hash) {
1406        case -595860510: /*supportingInfoSequence*/ return this.supportingInfoSequence == null ? new Base[0] : this.supportingInfoSequence.toArray(new Base[this.supportingInfoSequence.size()]); // PositiveIntType
1407        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1408        case 1957227299: /*productOrService*/ return this.productOrService == null ? new Base[0] : new Base[] {this.productOrService}; // CodeableConcept
1409        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept
1410        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference
1411        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity
1412        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
1413        case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference
1414        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent
1415        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference
1416        default: return super.getProperty(hash, name, checkValid);
1417        }
1418
1419      }
1420
1421      @Override
1422      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1423        switch (hash) {
1424        case -595860510: // supportingInfoSequence
1425          this.getSupportingInfoSequence().add(castToPositiveInt(value)); // PositiveIntType
1426          return value;
1427        case 50511102: // category
1428          this.category = castToCodeableConcept(value); // CodeableConcept
1429          return value;
1430        case 1957227299: // productOrService
1431          this.productOrService = castToCodeableConcept(value); // CodeableConcept
1432          return value;
1433        case -615513385: // modifier
1434          this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept
1435          return value;
1436        case -987494927: // provider
1437          this.provider = castToReference(value); // Reference
1438          return value;
1439        case -1285004149: // quantity
1440          this.quantity = castToQuantity(value); // Quantity
1441          return value;
1442        case -486196699: // unitPrice
1443          this.unitPrice = castToMoney(value); // Money
1444          return value;
1445        case 501116579: // facility
1446          this.facility = castToReference(value); // Reference
1447          return value;
1448        case 1196993265: // diagnosis
1449          this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent
1450          return value;
1451        case -1335224239: // detail
1452          this.getDetail().add(castToReference(value)); // Reference
1453          return value;
1454        default: return super.setProperty(hash, name, value);
1455        }
1456
1457      }
1458
1459      @Override
1460      public Base setProperty(String name, Base value) throws FHIRException {
1461        if (name.equals("supportingInfoSequence")) {
1462          this.getSupportingInfoSequence().add(castToPositiveInt(value));
1463        } else if (name.equals("category")) {
1464          this.category = castToCodeableConcept(value); // CodeableConcept
1465        } else if (name.equals("productOrService")) {
1466          this.productOrService = castToCodeableConcept(value); // CodeableConcept
1467        } else if (name.equals("modifier")) {
1468          this.getModifier().add(castToCodeableConcept(value));
1469        } else if (name.equals("provider")) {
1470          this.provider = castToReference(value); // Reference
1471        } else if (name.equals("quantity")) {
1472          this.quantity = castToQuantity(value); // Quantity
1473        } else if (name.equals("unitPrice")) {
1474          this.unitPrice = castToMoney(value); // Money
1475        } else if (name.equals("facility")) {
1476          this.facility = castToReference(value); // Reference
1477        } else if (name.equals("diagnosis")) {
1478          this.getDiagnosis().add((DiagnosisComponent) value);
1479        } else if (name.equals("detail")) {
1480          this.getDetail().add(castToReference(value));
1481        } else
1482          return super.setProperty(name, value);
1483        return value;
1484      }
1485
1486      @Override
1487      public Base makeProperty(int hash, String name) throws FHIRException {
1488        switch (hash) {
1489        case -595860510:  return addSupportingInfoSequenceElement();
1490        case 50511102:  return getCategory();
1491        case 1957227299:  return getProductOrService();
1492        case -615513385:  return addModifier(); 
1493        case -987494927:  return getProvider();
1494        case -1285004149:  return getQuantity();
1495        case -486196699:  return getUnitPrice();
1496        case 501116579:  return getFacility();
1497        case 1196993265:  return addDiagnosis(); 
1498        case -1335224239:  return addDetail(); 
1499        default: return super.makeProperty(hash, name);
1500        }
1501
1502      }
1503
1504      @Override
1505      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1506        switch (hash) {
1507        case -595860510: /*supportingInfoSequence*/ return new String[] {"positiveInt"};
1508        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1509        case 1957227299: /*productOrService*/ return new String[] {"CodeableConcept"};
1510        case -615513385: /*modifier*/ return new String[] {"CodeableConcept"};
1511        case -987494927: /*provider*/ return new String[] {"Reference"};
1512        case -1285004149: /*quantity*/ return new String[] {"SimpleQuantity"};
1513        case -486196699: /*unitPrice*/ return new String[] {"Money"};
1514        case 501116579: /*facility*/ return new String[] {"Reference"};
1515        case 1196993265: /*diagnosis*/ return new String[] {};
1516        case -1335224239: /*detail*/ return new String[] {"Reference"};
1517        default: return super.getTypesForProperty(hash, name);
1518        }
1519
1520      }
1521
1522      @Override
1523      public Base addChild(String name) throws FHIRException {
1524        if (name.equals("supportingInfoSequence")) {
1525          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.supportingInfoSequence");
1526        }
1527        else if (name.equals("category")) {
1528          this.category = new CodeableConcept();
1529          return this.category;
1530        }
1531        else if (name.equals("productOrService")) {
1532          this.productOrService = new CodeableConcept();
1533          return this.productOrService;
1534        }
1535        else if (name.equals("modifier")) {
1536          return addModifier();
1537        }
1538        else if (name.equals("provider")) {
1539          this.provider = new Reference();
1540          return this.provider;
1541        }
1542        else if (name.equals("quantity")) {
1543          this.quantity = new Quantity();
1544          return this.quantity;
1545        }
1546        else if (name.equals("unitPrice")) {
1547          this.unitPrice = new Money();
1548          return this.unitPrice;
1549        }
1550        else if (name.equals("facility")) {
1551          this.facility = new Reference();
1552          return this.facility;
1553        }
1554        else if (name.equals("diagnosis")) {
1555          return addDiagnosis();
1556        }
1557        else if (name.equals("detail")) {
1558          return addDetail();
1559        }
1560        else
1561          return super.addChild(name);
1562      }
1563
1564      public DetailsComponent copy() {
1565        DetailsComponent dst = new DetailsComponent();
1566        copyValues(dst);
1567        return dst;
1568      }
1569
1570      public void copyValues(DetailsComponent dst) {
1571        super.copyValues(dst);
1572        if (supportingInfoSequence != null) {
1573          dst.supportingInfoSequence = new ArrayList<PositiveIntType>();
1574          for (PositiveIntType i : supportingInfoSequence)
1575            dst.supportingInfoSequence.add(i.copy());
1576        };
1577        dst.category = category == null ? null : category.copy();
1578        dst.productOrService = productOrService == null ? null : productOrService.copy();
1579        if (modifier != null) {
1580          dst.modifier = new ArrayList<CodeableConcept>();
1581          for (CodeableConcept i : modifier)
1582            dst.modifier.add(i.copy());
1583        };
1584        dst.provider = provider == null ? null : provider.copy();
1585        dst.quantity = quantity == null ? null : quantity.copy();
1586        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
1587        dst.facility = facility == null ? null : facility.copy();
1588        if (diagnosis != null) {
1589          dst.diagnosis = new ArrayList<DiagnosisComponent>();
1590          for (DiagnosisComponent i : diagnosis)
1591            dst.diagnosis.add(i.copy());
1592        };
1593        if (detail != null) {
1594          dst.detail = new ArrayList<Reference>();
1595          for (Reference i : detail)
1596            dst.detail.add(i.copy());
1597        };
1598      }
1599
1600      @Override
1601      public boolean equalsDeep(Base other_) {
1602        if (!super.equalsDeep(other_))
1603          return false;
1604        if (!(other_ instanceof DetailsComponent))
1605          return false;
1606        DetailsComponent o = (DetailsComponent) other_;
1607        return compareDeep(supportingInfoSequence, o.supportingInfoSequence, true) && compareDeep(category, o.category, true)
1608           && compareDeep(productOrService, o.productOrService, true) && compareDeep(modifier, o.modifier, true)
1609           && compareDeep(provider, o.provider, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true)
1610           && compareDeep(facility, o.facility, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(detail, o.detail, true)
1611          ;
1612      }
1613
1614      @Override
1615      public boolean equalsShallow(Base other_) {
1616        if (!super.equalsShallow(other_))
1617          return false;
1618        if (!(other_ instanceof DetailsComponent))
1619          return false;
1620        DetailsComponent o = (DetailsComponent) other_;
1621        return compareValues(supportingInfoSequence, o.supportingInfoSequence, true);
1622      }
1623
1624      public boolean isEmpty() {
1625        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(supportingInfoSequence, category
1626          , productOrService, modifier, provider, quantity, unitPrice, facility, diagnosis
1627          , detail);
1628      }
1629
1630  public String fhirType() {
1631    return "CoverageEligibilityRequest.item";
1632
1633  }
1634
1635  }
1636
1637    @Block()
1638    public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement {
1639        /**
1640         * The nature of illness or problem in a coded form or as a reference to an external defined Condition.
1641         */
1642        @Child(name = "diagnosis", type = {CodeableConcept.class, Condition.class}, order=1, min=0, max=1, modifier=false, summary=false)
1643        @Description(shortDefinition="Nature of illness or problem", formalDefinition="The nature of illness or problem in a coded form or as a reference to an external defined Condition." )
1644        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/icd-10")
1645        protected Type diagnosis;
1646
1647        private static final long serialVersionUID = -454532709L;
1648
1649    /**
1650     * Constructor
1651     */
1652      public DiagnosisComponent() {
1653        super();
1654      }
1655
1656        /**
1657         * @return {@link #diagnosis} (The nature of illness or problem in a coded form or as a reference to an external defined Condition.)
1658         */
1659        public Type getDiagnosis() { 
1660          return this.diagnosis;
1661        }
1662
1663        /**
1664         * @return {@link #diagnosis} (The nature of illness or problem in a coded form or as a reference to an external defined Condition.)
1665         */
1666        public CodeableConcept getDiagnosisCodeableConcept() throws FHIRException { 
1667          if (this.diagnosis == null)
1668            this.diagnosis = new CodeableConcept();
1669          if (!(this.diagnosis instanceof CodeableConcept))
1670            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.diagnosis.getClass().getName()+" was encountered");
1671          return (CodeableConcept) this.diagnosis;
1672        }
1673
1674        public boolean hasDiagnosisCodeableConcept() { 
1675          return this != null && this.diagnosis instanceof CodeableConcept;
1676        }
1677
1678        /**
1679         * @return {@link #diagnosis} (The nature of illness or problem in a coded form or as a reference to an external defined Condition.)
1680         */
1681        public Reference getDiagnosisReference() throws FHIRException { 
1682          if (this.diagnosis == null)
1683            this.diagnosis = new Reference();
1684          if (!(this.diagnosis instanceof Reference))
1685            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.diagnosis.getClass().getName()+" was encountered");
1686          return (Reference) this.diagnosis;
1687        }
1688
1689        public boolean hasDiagnosisReference() { 
1690          return this != null && this.diagnosis instanceof Reference;
1691        }
1692
1693        public boolean hasDiagnosis() { 
1694          return this.diagnosis != null && !this.diagnosis.isEmpty();
1695        }
1696
1697        /**
1698         * @param value {@link #diagnosis} (The nature of illness or problem in a coded form or as a reference to an external defined Condition.)
1699         */
1700        public DiagnosisComponent setDiagnosis(Type value) { 
1701          if (value != null && !(value instanceof CodeableConcept || value instanceof Reference))
1702            throw new Error("Not the right type for CoverageEligibilityRequest.item.diagnosis.diagnosis[x]: "+value.fhirType());
1703          this.diagnosis = value;
1704          return this;
1705        }
1706
1707        protected void listChildren(List<Property> children) {
1708          super.listChildren(children);
1709          children.add(new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The nature of illness or problem in a coded form or as a reference to an external defined Condition.", 0, 1, diagnosis));
1710        }
1711
1712        @Override
1713        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1714          switch (_hash) {
1715          case -1487009809: /*diagnosis[x]*/  return new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The nature of illness or problem in a coded form or as a reference to an external defined Condition.", 0, 1, diagnosis);
1716          case 1196993265: /*diagnosis*/  return new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The nature of illness or problem in a coded form or as a reference to an external defined Condition.", 0, 1, diagnosis);
1717          case 277781616: /*diagnosisCodeableConcept*/  return new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The nature of illness or problem in a coded form or as a reference to an external defined Condition.", 0, 1, diagnosis);
1718          case 2050454362: /*diagnosisReference*/  return new Property("diagnosis[x]", "CodeableConcept|Reference(Condition)", "The nature of illness or problem in a coded form or as a reference to an external defined Condition.", 0, 1, diagnosis);
1719          default: return super.getNamedProperty(_hash, _name, _checkValid);
1720          }
1721
1722        }
1723
1724      @Override
1725      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1726        switch (hash) {
1727        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Type
1728        default: return super.getProperty(hash, name, checkValid);
1729        }
1730
1731      }
1732
1733      @Override
1734      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1735        switch (hash) {
1736        case 1196993265: // diagnosis
1737          this.diagnosis = castToType(value); // Type
1738          return value;
1739        default: return super.setProperty(hash, name, value);
1740        }
1741
1742      }
1743
1744      @Override
1745      public Base setProperty(String name, Base value) throws FHIRException {
1746        if (name.equals("diagnosis[x]")) {
1747          this.diagnosis = castToType(value); // Type
1748        } else
1749          return super.setProperty(name, value);
1750        return value;
1751      }
1752
1753      @Override
1754      public Base makeProperty(int hash, String name) throws FHIRException {
1755        switch (hash) {
1756        case -1487009809:  return getDiagnosis();
1757        case 1196993265:  return getDiagnosis();
1758        default: return super.makeProperty(hash, name);
1759        }
1760
1761      }
1762
1763      @Override
1764      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1765        switch (hash) {
1766        case 1196993265: /*diagnosis*/ return new String[] {"CodeableConcept", "Reference"};
1767        default: return super.getTypesForProperty(hash, name);
1768        }
1769
1770      }
1771
1772      @Override
1773      public Base addChild(String name) throws FHIRException {
1774        if (name.equals("diagnosisCodeableConcept")) {
1775          this.diagnosis = new CodeableConcept();
1776          return this.diagnosis;
1777        }
1778        else if (name.equals("diagnosisReference")) {
1779          this.diagnosis = new Reference();
1780          return this.diagnosis;
1781        }
1782        else
1783          return super.addChild(name);
1784      }
1785
1786      public DiagnosisComponent copy() {
1787        DiagnosisComponent dst = new DiagnosisComponent();
1788        copyValues(dst);
1789        return dst;
1790      }
1791
1792      public void copyValues(DiagnosisComponent dst) {
1793        super.copyValues(dst);
1794        dst.diagnosis = diagnosis == null ? null : diagnosis.copy();
1795      }
1796
1797      @Override
1798      public boolean equalsDeep(Base other_) {
1799        if (!super.equalsDeep(other_))
1800          return false;
1801        if (!(other_ instanceof DiagnosisComponent))
1802          return false;
1803        DiagnosisComponent o = (DiagnosisComponent) other_;
1804        return compareDeep(diagnosis, o.diagnosis, true);
1805      }
1806
1807      @Override
1808      public boolean equalsShallow(Base other_) {
1809        if (!super.equalsShallow(other_))
1810          return false;
1811        if (!(other_ instanceof DiagnosisComponent))
1812          return false;
1813        DiagnosisComponent o = (DiagnosisComponent) other_;
1814        return true;
1815      }
1816
1817      public boolean isEmpty() {
1818        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(diagnosis);
1819      }
1820
1821  public String fhirType() {
1822    return "CoverageEligibilityRequest.item.diagnosis";
1823
1824  }
1825
1826  }
1827
1828    /**
1829     * A unique identifier assigned to this coverage eligiblity request.
1830     */
1831    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1832    @Description(shortDefinition="Business Identifier for coverage eligiblity request", formalDefinition="A unique identifier assigned to this coverage eligiblity request." )
1833    protected List<Identifier> identifier;
1834
1835    /**
1836     * The status of the resource instance.
1837     */
1838    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1839    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
1840    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
1841    protected Enumeration<EligibilityRequestStatus> status;
1842
1843    /**
1844     * When the requestor expects the processor to complete processing.
1845     */
1846    @Child(name = "priority", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1847    @Description(shortDefinition="Desired processing priority", formalDefinition="When the requestor expects the processor to complete processing." )
1848    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-priority")
1849    protected CodeableConcept priority;
1850
1851    /**
1852     * Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.
1853     */
1854    @Child(name = "purpose", type = {CodeType.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1855    @Description(shortDefinition="auth-requirements | benefits | discovery | validation", formalDefinition="Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified." )
1856    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/eligibilityrequest-purpose")
1857    protected List<Enumeration<EligibilityRequestPurpose>> purpose;
1858
1859    /**
1860     * The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.
1861     */
1862    @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=true)
1863    @Description(shortDefinition="Intended recipient of products and services", formalDefinition="The party who is the beneficiary of the supplied coverage and for whom eligibility is sought." )
1864    protected Reference patient;
1865
1866    /**
1867     * The date or dates when the enclosed suite of services were performed or completed.
1868     */
1869    @Child(name = "serviced", type = {DateType.class, Period.class}, order=5, min=0, max=1, modifier=false, summary=false)
1870    @Description(shortDefinition="Estimated date or dates of service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." )
1871    protected Type serviced;
1872
1873    /**
1874     * The date when this resource was created.
1875     */
1876    @Child(name = "created", type = {DateTimeType.class}, order=6, min=1, max=1, modifier=false, summary=true)
1877    @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
1878    protected DateTimeType created;
1879
1880    /**
1881     * Person who created the request.
1882     */
1883    @Child(name = "enterer", type = {Practitioner.class, PractitionerRole.class}, order=7, min=0, max=1, modifier=false, summary=false)
1884    @Description(shortDefinition="Author", formalDefinition="Person who created the request." )
1885    protected Reference enterer;
1886
1887    /**
1888     * The provider which is responsible for the request.
1889     */
1890    @Child(name = "provider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
1891    @Description(shortDefinition="Party responsible for the request", formalDefinition="The provider which is responsible for the request." )
1892    protected Reference provider;
1893
1894    /**
1895     * The Insurer who issued the coverage in question and is the recipient of the request.
1896     */
1897    @Child(name = "insurer", type = {Organization.class}, order=9, min=1, max=1, modifier=false, summary=true)
1898    @Description(shortDefinition="Coverage issuer", formalDefinition="The Insurer who issued the coverage in question and is the recipient of the request." )
1899    protected Reference insurer;
1900
1901    /**
1902     * Facility where the services are intended to be provided.
1903     */
1904    @Child(name = "facility", type = {Location.class}, order=10, min=0, max=1, modifier=false, summary=false)
1905    @Description(shortDefinition="Servicing facility", formalDefinition="Facility where the services are intended to be provided." )
1906    protected Reference facility;
1907
1908    /**
1909     * Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.
1910     */
1911    @Child(name = "supportingInfo", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1912    @Description(shortDefinition="Supporting information", formalDefinition="Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues." )
1913    protected List<SupportingInformationComponent> supportingInfo;
1914
1915    /**
1916     * Financial instruments for reimbursement for the health care products and services.
1917     */
1918    @Child(name = "insurance", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1919    @Description(shortDefinition="Patient insurance information", formalDefinition="Financial instruments for reimbursement for the health care products and services." )
1920    protected List<InsuranceComponent> insurance;
1921
1922    /**
1923     * Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.
1924     */
1925    @Child(name = "item", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1926    @Description(shortDefinition="Item to be evaluated for eligibiity", formalDefinition="Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor." )
1927    protected List<DetailsComponent> item;
1928
1929    private static final long serialVersionUID = 707883224L;
1930
1931  /**
1932   * Constructor
1933   */
1934    public CoverageEligibilityRequest() {
1935      super();
1936    }
1937
1938  /**
1939   * Constructor
1940   */
1941    public CoverageEligibilityRequest(Enumeration<EligibilityRequestStatus> status, Reference patient, DateTimeType created, Reference insurer) {
1942      super();
1943      this.status = status;
1944      this.patient = patient;
1945      this.created = created;
1946      this.insurer = insurer;
1947    }
1948
1949    /**
1950     * @return {@link #identifier} (A unique identifier assigned to this coverage eligiblity request.)
1951     */
1952    public List<Identifier> getIdentifier() { 
1953      if (this.identifier == null)
1954        this.identifier = new ArrayList<Identifier>();
1955      return this.identifier;
1956    }
1957
1958    /**
1959     * @return Returns a reference to <code>this</code> for easy method chaining
1960     */
1961    public CoverageEligibilityRequest setIdentifier(List<Identifier> theIdentifier) { 
1962      this.identifier = theIdentifier;
1963      return this;
1964    }
1965
1966    public boolean hasIdentifier() { 
1967      if (this.identifier == null)
1968        return false;
1969      for (Identifier item : this.identifier)
1970        if (!item.isEmpty())
1971          return true;
1972      return false;
1973    }
1974
1975    public Identifier addIdentifier() { //3
1976      Identifier t = new Identifier();
1977      if (this.identifier == null)
1978        this.identifier = new ArrayList<Identifier>();
1979      this.identifier.add(t);
1980      return t;
1981    }
1982
1983    public CoverageEligibilityRequest addIdentifier(Identifier t) { //3
1984      if (t == null)
1985        return this;
1986      if (this.identifier == null)
1987        this.identifier = new ArrayList<Identifier>();
1988      this.identifier.add(t);
1989      return this;
1990    }
1991
1992    /**
1993     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1994     */
1995    public Identifier getIdentifierFirstRep() { 
1996      if (getIdentifier().isEmpty()) {
1997        addIdentifier();
1998      }
1999      return getIdentifier().get(0);
2000    }
2001
2002    /**
2003     * @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
2004     */
2005    public Enumeration<EligibilityRequestStatus> getStatusElement() { 
2006      if (this.status == null)
2007        if (Configuration.errorOnAutoCreate())
2008          throw new Error("Attempt to auto-create CoverageEligibilityRequest.status");
2009        else if (Configuration.doAutoCreate())
2010          this.status = new Enumeration<EligibilityRequestStatus>(new EligibilityRequestStatusEnumFactory()); // bb
2011      return this.status;
2012    }
2013
2014    public boolean hasStatusElement() { 
2015      return this.status != null && !this.status.isEmpty();
2016    }
2017
2018    public boolean hasStatus() { 
2019      return this.status != null && !this.status.isEmpty();
2020    }
2021
2022    /**
2023     * @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
2024     */
2025    public CoverageEligibilityRequest setStatusElement(Enumeration<EligibilityRequestStatus> value) { 
2026      this.status = value;
2027      return this;
2028    }
2029
2030    /**
2031     * @return The status of the resource instance.
2032     */
2033    public EligibilityRequestStatus getStatus() { 
2034      return this.status == null ? null : this.status.getValue();
2035    }
2036
2037    /**
2038     * @param value The status of the resource instance.
2039     */
2040    public CoverageEligibilityRequest setStatus(EligibilityRequestStatus value) { 
2041        if (this.status == null)
2042          this.status = new Enumeration<EligibilityRequestStatus>(new EligibilityRequestStatusEnumFactory());
2043        this.status.setValue(value);
2044      return this;
2045    }
2046
2047    /**
2048     * @return {@link #priority} (When the requestor expects the processor to complete processing.)
2049     */
2050    public CodeableConcept getPriority() { 
2051      if (this.priority == null)
2052        if (Configuration.errorOnAutoCreate())
2053          throw new Error("Attempt to auto-create CoverageEligibilityRequest.priority");
2054        else if (Configuration.doAutoCreate())
2055          this.priority = new CodeableConcept(); // cc
2056      return this.priority;
2057    }
2058
2059    public boolean hasPriority() { 
2060      return this.priority != null && !this.priority.isEmpty();
2061    }
2062
2063    /**
2064     * @param value {@link #priority} (When the requestor expects the processor to complete processing.)
2065     */
2066    public CoverageEligibilityRequest setPriority(CodeableConcept value) { 
2067      this.priority = value;
2068      return this;
2069    }
2070
2071    /**
2072     * @return {@link #purpose} (Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2073     */
2074    public List<Enumeration<EligibilityRequestPurpose>> getPurpose() { 
2075      if (this.purpose == null)
2076        this.purpose = new ArrayList<Enumeration<EligibilityRequestPurpose>>();
2077      return this.purpose;
2078    }
2079
2080    /**
2081     * @return Returns a reference to <code>this</code> for easy method chaining
2082     */
2083    public CoverageEligibilityRequest setPurpose(List<Enumeration<EligibilityRequestPurpose>> thePurpose) { 
2084      this.purpose = thePurpose;
2085      return this;
2086    }
2087
2088    public boolean hasPurpose() { 
2089      if (this.purpose == null)
2090        return false;
2091      for (Enumeration<EligibilityRequestPurpose> item : this.purpose)
2092        if (!item.isEmpty())
2093          return true;
2094      return false;
2095    }
2096
2097    /**
2098     * @return {@link #purpose} (Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2099     */
2100    public Enumeration<EligibilityRequestPurpose> addPurposeElement() {//2 
2101      Enumeration<EligibilityRequestPurpose> t = new Enumeration<EligibilityRequestPurpose>(new EligibilityRequestPurposeEnumFactory());
2102      if (this.purpose == null)
2103        this.purpose = new ArrayList<Enumeration<EligibilityRequestPurpose>>();
2104      this.purpose.add(t);
2105      return t;
2106    }
2107
2108    /**
2109     * @param value {@link #purpose} (Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2110     */
2111    public CoverageEligibilityRequest addPurpose(EligibilityRequestPurpose value) { //1
2112      Enumeration<EligibilityRequestPurpose> t = new Enumeration<EligibilityRequestPurpose>(new EligibilityRequestPurposeEnumFactory());
2113      t.setValue(value);
2114      if (this.purpose == null)
2115        this.purpose = new ArrayList<Enumeration<EligibilityRequestPurpose>>();
2116      this.purpose.add(t);
2117      return this;
2118    }
2119
2120    /**
2121     * @param value {@link #purpose} (Code to 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 the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.)
2122     */
2123    public boolean hasPurpose(EligibilityRequestPurpose value) { 
2124      if (this.purpose == null)
2125        return false;
2126      for (Enumeration<EligibilityRequestPurpose> v : this.purpose)
2127        if (v.getValue().equals(value)) // code
2128          return true;
2129      return false;
2130    }
2131
2132    /**
2133     * @return {@link #patient} (The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.)
2134     */
2135    public Reference getPatient() { 
2136      if (this.patient == null)
2137        if (Configuration.errorOnAutoCreate())
2138          throw new Error("Attempt to auto-create CoverageEligibilityRequest.patient");
2139        else if (Configuration.doAutoCreate())
2140          this.patient = new Reference(); // cc
2141      return this.patient;
2142    }
2143
2144    public boolean hasPatient() { 
2145      return this.patient != null && !this.patient.isEmpty();
2146    }
2147
2148    /**
2149     * @param value {@link #patient} (The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.)
2150     */
2151    public CoverageEligibilityRequest setPatient(Reference value) { 
2152      this.patient = value;
2153      return this;
2154    }
2155
2156    /**
2157     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2158     */
2159    public Type getServiced() { 
2160      return this.serviced;
2161    }
2162
2163    /**
2164     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2165     */
2166    public DateType getServicedDateType() throws FHIRException { 
2167      if (this.serviced == null)
2168        this.serviced = new DateType();
2169      if (!(this.serviced instanceof DateType))
2170        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered");
2171      return (DateType) this.serviced;
2172    }
2173
2174    public boolean hasServicedDateType() { 
2175      return this != null && this.serviced instanceof DateType;
2176    }
2177
2178    /**
2179     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2180     */
2181    public Period getServicedPeriod() throws FHIRException { 
2182      if (this.serviced == null)
2183        this.serviced = new Period();
2184      if (!(this.serviced instanceof Period))
2185        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered");
2186      return (Period) this.serviced;
2187    }
2188
2189    public boolean hasServicedPeriod() { 
2190      return this != null && this.serviced instanceof Period;
2191    }
2192
2193    public boolean hasServiced() { 
2194      return this.serviced != null && !this.serviced.isEmpty();
2195    }
2196
2197    /**
2198     * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2199     */
2200    public CoverageEligibilityRequest setServiced(Type value) { 
2201      if (value != null && !(value instanceof DateType || value instanceof Period))
2202        throw new Error("Not the right type for CoverageEligibilityRequest.serviced[x]: "+value.fhirType());
2203      this.serviced = value;
2204      return this;
2205    }
2206
2207    /**
2208     * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
2209     */
2210    public DateTimeType getCreatedElement() { 
2211      if (this.created == null)
2212        if (Configuration.errorOnAutoCreate())
2213          throw new Error("Attempt to auto-create CoverageEligibilityRequest.created");
2214        else if (Configuration.doAutoCreate())
2215          this.created = new DateTimeType(); // bb
2216      return this.created;
2217    }
2218
2219    public boolean hasCreatedElement() { 
2220      return this.created != null && !this.created.isEmpty();
2221    }
2222
2223    public boolean hasCreated() { 
2224      return this.created != null && !this.created.isEmpty();
2225    }
2226
2227    /**
2228     * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
2229     */
2230    public CoverageEligibilityRequest setCreatedElement(DateTimeType value) { 
2231      this.created = value;
2232      return this;
2233    }
2234
2235    /**
2236     * @return The date when this resource was created.
2237     */
2238    public Date getCreated() { 
2239      return this.created == null ? null : this.created.getValue();
2240    }
2241
2242    /**
2243     * @param value The date when this resource was created.
2244     */
2245    public CoverageEligibilityRequest setCreated(Date value) { 
2246        if (this.created == null)
2247          this.created = new DateTimeType();
2248        this.created.setValue(value);
2249      return this;
2250    }
2251
2252    /**
2253     * @return {@link #enterer} (Person who created the request.)
2254     */
2255    public Reference getEnterer() { 
2256      if (this.enterer == null)
2257        if (Configuration.errorOnAutoCreate())
2258          throw new Error("Attempt to auto-create CoverageEligibilityRequest.enterer");
2259        else if (Configuration.doAutoCreate())
2260          this.enterer = new Reference(); // cc
2261      return this.enterer;
2262    }
2263
2264    public boolean hasEnterer() { 
2265      return this.enterer != null && !this.enterer.isEmpty();
2266    }
2267
2268    /**
2269     * @param value {@link #enterer} (Person who created the request.)
2270     */
2271    public CoverageEligibilityRequest setEnterer(Reference value) { 
2272      this.enterer = value;
2273      return this;
2274    }
2275
2276    /**
2277     * @return {@link #provider} (The provider which is responsible for the request.)
2278     */
2279    public Reference getProvider() { 
2280      if (this.provider == null)
2281        if (Configuration.errorOnAutoCreate())
2282          throw new Error("Attempt to auto-create CoverageEligibilityRequest.provider");
2283        else if (Configuration.doAutoCreate())
2284          this.provider = new Reference(); // cc
2285      return this.provider;
2286    }
2287
2288    public boolean hasProvider() { 
2289      return this.provider != null && !this.provider.isEmpty();
2290    }
2291
2292    /**
2293     * @param value {@link #provider} (The provider which is responsible for the request.)
2294     */
2295    public CoverageEligibilityRequest setProvider(Reference value) { 
2296      this.provider = value;
2297      return this;
2298    }
2299
2300    /**
2301     * @return {@link #insurer} (The Insurer who issued the coverage in question and is the recipient of the request.)
2302     */
2303    public Reference getInsurer() { 
2304      if (this.insurer == null)
2305        if (Configuration.errorOnAutoCreate())
2306          throw new Error("Attempt to auto-create CoverageEligibilityRequest.insurer");
2307        else if (Configuration.doAutoCreate())
2308          this.insurer = new Reference(); // cc
2309      return this.insurer;
2310    }
2311
2312    public boolean hasInsurer() { 
2313      return this.insurer != null && !this.insurer.isEmpty();
2314    }
2315
2316    /**
2317     * @param value {@link #insurer} (The Insurer who issued the coverage in question and is the recipient of the request.)
2318     */
2319    public CoverageEligibilityRequest setInsurer(Reference value) { 
2320      this.insurer = value;
2321      return this;
2322    }
2323
2324    /**
2325     * @return {@link #facility} (Facility where the services are intended to be provided.)
2326     */
2327    public Reference getFacility() { 
2328      if (this.facility == null)
2329        if (Configuration.errorOnAutoCreate())
2330          throw new Error("Attempt to auto-create CoverageEligibilityRequest.facility");
2331        else if (Configuration.doAutoCreate())
2332          this.facility = new Reference(); // cc
2333      return this.facility;
2334    }
2335
2336    public boolean hasFacility() { 
2337      return this.facility != null && !this.facility.isEmpty();
2338    }
2339
2340    /**
2341     * @param value {@link #facility} (Facility where the services are intended to be provided.)
2342     */
2343    public CoverageEligibilityRequest setFacility(Reference value) { 
2344      this.facility = value;
2345      return this;
2346    }
2347
2348    /**
2349     * @return {@link #supportingInfo} (Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.)
2350     */
2351    public List<SupportingInformationComponent> getSupportingInfo() { 
2352      if (this.supportingInfo == null)
2353        this.supportingInfo = new ArrayList<SupportingInformationComponent>();
2354      return this.supportingInfo;
2355    }
2356
2357    /**
2358     * @return Returns a reference to <code>this</code> for easy method chaining
2359     */
2360    public CoverageEligibilityRequest setSupportingInfo(List<SupportingInformationComponent> theSupportingInfo) { 
2361      this.supportingInfo = theSupportingInfo;
2362      return this;
2363    }
2364
2365    public boolean hasSupportingInfo() { 
2366      if (this.supportingInfo == null)
2367        return false;
2368      for (SupportingInformationComponent item : this.supportingInfo)
2369        if (!item.isEmpty())
2370          return true;
2371      return false;
2372    }
2373
2374    public SupportingInformationComponent addSupportingInfo() { //3
2375      SupportingInformationComponent t = new SupportingInformationComponent();
2376      if (this.supportingInfo == null)
2377        this.supportingInfo = new ArrayList<SupportingInformationComponent>();
2378      this.supportingInfo.add(t);
2379      return t;
2380    }
2381
2382    public CoverageEligibilityRequest addSupportingInfo(SupportingInformationComponent t) { //3
2383      if (t == null)
2384        return this;
2385      if (this.supportingInfo == null)
2386        this.supportingInfo = new ArrayList<SupportingInformationComponent>();
2387      this.supportingInfo.add(t);
2388      return this;
2389    }
2390
2391    /**
2392     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist
2393     */
2394    public SupportingInformationComponent getSupportingInfoFirstRep() { 
2395      if (getSupportingInfo().isEmpty()) {
2396        addSupportingInfo();
2397      }
2398      return getSupportingInfo().get(0);
2399    }
2400
2401    /**
2402     * @return {@link #insurance} (Financial instruments for reimbursement for the health care products and services.)
2403     */
2404    public List<InsuranceComponent> getInsurance() { 
2405      if (this.insurance == null)
2406        this.insurance = new ArrayList<InsuranceComponent>();
2407      return this.insurance;
2408    }
2409
2410    /**
2411     * @return Returns a reference to <code>this</code> for easy method chaining
2412     */
2413    public CoverageEligibilityRequest setInsurance(List<InsuranceComponent> theInsurance) { 
2414      this.insurance = theInsurance;
2415      return this;
2416    }
2417
2418    public boolean hasInsurance() { 
2419      if (this.insurance == null)
2420        return false;
2421      for (InsuranceComponent item : this.insurance)
2422        if (!item.isEmpty())
2423          return true;
2424      return false;
2425    }
2426
2427    public InsuranceComponent addInsurance() { //3
2428      InsuranceComponent t = new InsuranceComponent();
2429      if (this.insurance == null)
2430        this.insurance = new ArrayList<InsuranceComponent>();
2431      this.insurance.add(t);
2432      return t;
2433    }
2434
2435    public CoverageEligibilityRequest addInsurance(InsuranceComponent t) { //3
2436      if (t == null)
2437        return this;
2438      if (this.insurance == null)
2439        this.insurance = new ArrayList<InsuranceComponent>();
2440      this.insurance.add(t);
2441      return this;
2442    }
2443
2444    /**
2445     * @return The first repetition of repeating field {@link #insurance}, creating it if it does not already exist
2446     */
2447    public InsuranceComponent getInsuranceFirstRep() { 
2448      if (getInsurance().isEmpty()) {
2449        addInsurance();
2450      }
2451      return getInsurance().get(0);
2452    }
2453
2454    /**
2455     * @return {@link #item} (Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.)
2456     */
2457    public List<DetailsComponent> getItem() { 
2458      if (this.item == null)
2459        this.item = new ArrayList<DetailsComponent>();
2460      return this.item;
2461    }
2462
2463    /**
2464     * @return Returns a reference to <code>this</code> for easy method chaining
2465     */
2466    public CoverageEligibilityRequest setItem(List<DetailsComponent> theItem) { 
2467      this.item = theItem;
2468      return this;
2469    }
2470
2471    public boolean hasItem() { 
2472      if (this.item == null)
2473        return false;
2474      for (DetailsComponent item : this.item)
2475        if (!item.isEmpty())
2476          return true;
2477      return false;
2478    }
2479
2480    public DetailsComponent addItem() { //3
2481      DetailsComponent t = new DetailsComponent();
2482      if (this.item == null)
2483        this.item = new ArrayList<DetailsComponent>();
2484      this.item.add(t);
2485      return t;
2486    }
2487
2488    public CoverageEligibilityRequest addItem(DetailsComponent t) { //3
2489      if (t == null)
2490        return this;
2491      if (this.item == null)
2492        this.item = new ArrayList<DetailsComponent>();
2493      this.item.add(t);
2494      return this;
2495    }
2496
2497    /**
2498     * @return The first repetition of repeating field {@link #item}, creating it if it does not already exist
2499     */
2500    public DetailsComponent getItemFirstRep() { 
2501      if (getItem().isEmpty()) {
2502        addItem();
2503      }
2504      return getItem().get(0);
2505    }
2506
2507      protected void listChildren(List<Property> children) {
2508        super.listChildren(children);
2509        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this coverage eligiblity request.", 0, java.lang.Integer.MAX_VALUE, identifier));
2510        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
2511        children.add(new Property("priority", "CodeableConcept", "When the requestor expects the processor to complete processing.", 0, 1, priority));
2512        children.add(new Property("purpose", "code", "Code to 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 the 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));
2513        children.add(new Property("patient", "Reference(Patient)", "The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.", 0, 1, patient));
2514        children.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced));
2515        children.add(new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created));
2516        children.add(new Property("enterer", "Reference(Practitioner|PractitionerRole)", "Person who created the request.", 0, 1, enterer));
2517        children.add(new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The provider which is responsible for the request.", 0, 1, provider));
2518        children.add(new Property("insurer", "Reference(Organization)", "The Insurer who issued the coverage in question and is the recipient of the request.", 0, 1, insurer));
2519        children.add(new Property("facility", "Reference(Location)", "Facility where the services are intended to be provided.", 0, 1, facility));
2520        children.add(new Property("supportingInfo", "", "Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
2521        children.add(new Property("insurance", "", "Financial instruments for reimbursement for the health care products and services.", 0, java.lang.Integer.MAX_VALUE, insurance));
2522        children.add(new Property("item", "", "Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.", 0, java.lang.Integer.MAX_VALUE, item));
2523      }
2524
2525      @Override
2526      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2527        switch (_hash) {
2528        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this coverage eligiblity request.", 0, java.lang.Integer.MAX_VALUE, identifier);
2529        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
2530        case -1165461084: /*priority*/  return new Property("priority", "CodeableConcept", "When the requestor expects the processor to complete processing.", 0, 1, priority);
2531        case -220463842: /*purpose*/  return new Property("purpose", "code", "Code to 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 the 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);
2532        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.", 0, 1, patient);
2533        case -1927922223: /*serviced[x]*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
2534        case 1379209295: /*serviced*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
2535        case 363246749: /*servicedDate*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
2536        case 1534966512: /*servicedPeriod*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
2537        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created);
2538        case -1591951995: /*enterer*/  return new Property("enterer", "Reference(Practitioner|PractitionerRole)", "Person who created the request.", 0, 1, enterer);
2539        case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner|PractitionerRole|Organization)", "The provider which is responsible for the request.", 0, 1, provider);
2540        case 1957615864: /*insurer*/  return new Property("insurer", "Reference(Organization)", "The Insurer who issued the coverage in question and is the recipient of the request.", 0, 1, insurer);
2541        case 501116579: /*facility*/  return new Property("facility", "Reference(Location)", "Facility where the services are intended to be provided.", 0, 1, facility);
2542        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "", "Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
2543        case 73049818: /*insurance*/  return new Property("insurance", "", "Financial instruments for reimbursement for the health care products and services.", 0, java.lang.Integer.MAX_VALUE, insurance);
2544        case 3242771: /*item*/  return new Property("item", "", "Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.", 0, java.lang.Integer.MAX_VALUE, item);
2545        default: return super.getNamedProperty(_hash, _name, _checkValid);
2546        }
2547
2548      }
2549
2550      @Override
2551      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2552        switch (hash) {
2553        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2554        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EligibilityRequestStatus>
2555        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept
2556        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : this.purpose.toArray(new Base[this.purpose.size()]); // Enumeration<EligibilityRequestPurpose>
2557        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
2558        case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type
2559        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
2560        case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference
2561        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference
2562        case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference
2563        case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference
2564        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // SupportingInformationComponent
2565        case 73049818: /*insurance*/ return this.insurance == null ? new Base[0] : this.insurance.toArray(new Base[this.insurance.size()]); // InsuranceComponent
2566        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // DetailsComponent
2567        default: return super.getProperty(hash, name, checkValid);
2568        }
2569
2570      }
2571
2572      @Override
2573      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2574        switch (hash) {
2575        case -1618432855: // identifier
2576          this.getIdentifier().add(castToIdentifier(value)); // Identifier
2577          return value;
2578        case -892481550: // status
2579          value = new EligibilityRequestStatusEnumFactory().fromType(castToCode(value));
2580          this.status = (Enumeration) value; // Enumeration<EligibilityRequestStatus>
2581          return value;
2582        case -1165461084: // priority
2583          this.priority = castToCodeableConcept(value); // CodeableConcept
2584          return value;
2585        case -220463842: // purpose
2586          value = new EligibilityRequestPurposeEnumFactory().fromType(castToCode(value));
2587          this.getPurpose().add((Enumeration) value); // Enumeration<EligibilityRequestPurpose>
2588          return value;
2589        case -791418107: // patient
2590          this.patient = castToReference(value); // Reference
2591          return value;
2592        case 1379209295: // serviced
2593          this.serviced = castToType(value); // Type
2594          return value;
2595        case 1028554472: // created
2596          this.created = castToDateTime(value); // DateTimeType
2597          return value;
2598        case -1591951995: // enterer
2599          this.enterer = castToReference(value); // Reference
2600          return value;
2601        case -987494927: // provider
2602          this.provider = castToReference(value); // Reference
2603          return value;
2604        case 1957615864: // insurer
2605          this.insurer = castToReference(value); // Reference
2606          return value;
2607        case 501116579: // facility
2608          this.facility = castToReference(value); // Reference
2609          return value;
2610        case 1922406657: // supportingInfo
2611          this.getSupportingInfo().add((SupportingInformationComponent) value); // SupportingInformationComponent
2612          return value;
2613        case 73049818: // insurance
2614          this.getInsurance().add((InsuranceComponent) value); // InsuranceComponent
2615          return value;
2616        case 3242771: // item
2617          this.getItem().add((DetailsComponent) value); // DetailsComponent
2618          return value;
2619        default: return super.setProperty(hash, name, value);
2620        }
2621
2622      }
2623
2624      @Override
2625      public Base setProperty(String name, Base value) throws FHIRException {
2626        if (name.equals("identifier")) {
2627          this.getIdentifier().add(castToIdentifier(value));
2628        } else if (name.equals("status")) {
2629          value = new EligibilityRequestStatusEnumFactory().fromType(castToCode(value));
2630          this.status = (Enumeration) value; // Enumeration<EligibilityRequestStatus>
2631        } else if (name.equals("priority")) {
2632          this.priority = castToCodeableConcept(value); // CodeableConcept
2633        } else if (name.equals("purpose")) {
2634          value = new EligibilityRequestPurposeEnumFactory().fromType(castToCode(value));
2635          this.getPurpose().add((Enumeration) value);
2636        } else if (name.equals("patient")) {
2637          this.patient = castToReference(value); // Reference
2638        } else if (name.equals("serviced[x]")) {
2639          this.serviced = castToType(value); // Type
2640        } else if (name.equals("created")) {
2641          this.created = castToDateTime(value); // DateTimeType
2642        } else if (name.equals("enterer")) {
2643          this.enterer = castToReference(value); // Reference
2644        } else if (name.equals("provider")) {
2645          this.provider = castToReference(value); // Reference
2646        } else if (name.equals("insurer")) {
2647          this.insurer = castToReference(value); // Reference
2648        } else if (name.equals("facility")) {
2649          this.facility = castToReference(value); // Reference
2650        } else if (name.equals("supportingInfo")) {
2651          this.getSupportingInfo().add((SupportingInformationComponent) value);
2652        } else if (name.equals("insurance")) {
2653          this.getInsurance().add((InsuranceComponent) value);
2654        } else if (name.equals("item")) {
2655          this.getItem().add((DetailsComponent) value);
2656        } else
2657          return super.setProperty(name, value);
2658        return value;
2659      }
2660
2661      @Override
2662      public Base makeProperty(int hash, String name) throws FHIRException {
2663        switch (hash) {
2664        case -1618432855:  return addIdentifier(); 
2665        case -892481550:  return getStatusElement();
2666        case -1165461084:  return getPriority();
2667        case -220463842:  return addPurposeElement();
2668        case -791418107:  return getPatient();
2669        case -1927922223:  return getServiced();
2670        case 1379209295:  return getServiced();
2671        case 1028554472:  return getCreatedElement();
2672        case -1591951995:  return getEnterer();
2673        case -987494927:  return getProvider();
2674        case 1957615864:  return getInsurer();
2675        case 501116579:  return getFacility();
2676        case 1922406657:  return addSupportingInfo(); 
2677        case 73049818:  return addInsurance(); 
2678        case 3242771:  return addItem(); 
2679        default: return super.makeProperty(hash, name);
2680        }
2681
2682      }
2683
2684      @Override
2685      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2686        switch (hash) {
2687        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2688        case -892481550: /*status*/ return new String[] {"code"};
2689        case -1165461084: /*priority*/ return new String[] {"CodeableConcept"};
2690        case -220463842: /*purpose*/ return new String[] {"code"};
2691        case -791418107: /*patient*/ return new String[] {"Reference"};
2692        case 1379209295: /*serviced*/ return new String[] {"date", "Period"};
2693        case 1028554472: /*created*/ return new String[] {"dateTime"};
2694        case -1591951995: /*enterer*/ return new String[] {"Reference"};
2695        case -987494927: /*provider*/ return new String[] {"Reference"};
2696        case 1957615864: /*insurer*/ return new String[] {"Reference"};
2697        case 501116579: /*facility*/ return new String[] {"Reference"};
2698        case 1922406657: /*supportingInfo*/ return new String[] {};
2699        case 73049818: /*insurance*/ return new String[] {};
2700        case 3242771: /*item*/ return new String[] {};
2701        default: return super.getTypesForProperty(hash, name);
2702        }
2703
2704      }
2705
2706      @Override
2707      public Base addChild(String name) throws FHIRException {
2708        if (name.equals("identifier")) {
2709          return addIdentifier();
2710        }
2711        else if (name.equals("status")) {
2712          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.status");
2713        }
2714        else if (name.equals("priority")) {
2715          this.priority = new CodeableConcept();
2716          return this.priority;
2717        }
2718        else if (name.equals("purpose")) {
2719          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.purpose");
2720        }
2721        else if (name.equals("patient")) {
2722          this.patient = new Reference();
2723          return this.patient;
2724        }
2725        else if (name.equals("servicedDate")) {
2726          this.serviced = new DateType();
2727          return this.serviced;
2728        }
2729        else if (name.equals("servicedPeriod")) {
2730          this.serviced = new Period();
2731          return this.serviced;
2732        }
2733        else if (name.equals("created")) {
2734          throw new FHIRException("Cannot call addChild on a primitive type CoverageEligibilityRequest.created");
2735        }
2736        else if (name.equals("enterer")) {
2737          this.enterer = new Reference();
2738          return this.enterer;
2739        }
2740        else if (name.equals("provider")) {
2741          this.provider = new Reference();
2742          return this.provider;
2743        }
2744        else if (name.equals("insurer")) {
2745          this.insurer = new Reference();
2746          return this.insurer;
2747        }
2748        else if (name.equals("facility")) {
2749          this.facility = new Reference();
2750          return this.facility;
2751        }
2752        else if (name.equals("supportingInfo")) {
2753          return addSupportingInfo();
2754        }
2755        else if (name.equals("insurance")) {
2756          return addInsurance();
2757        }
2758        else if (name.equals("item")) {
2759          return addItem();
2760        }
2761        else
2762          return super.addChild(name);
2763      }
2764
2765  public String fhirType() {
2766    return "CoverageEligibilityRequest";
2767
2768  }
2769
2770      public CoverageEligibilityRequest copy() {
2771        CoverageEligibilityRequest dst = new CoverageEligibilityRequest();
2772        copyValues(dst);
2773        return dst;
2774      }
2775
2776      public void copyValues(CoverageEligibilityRequest dst) {
2777        super.copyValues(dst);
2778        if (identifier != null) {
2779          dst.identifier = new ArrayList<Identifier>();
2780          for (Identifier i : identifier)
2781            dst.identifier.add(i.copy());
2782        };
2783        dst.status = status == null ? null : status.copy();
2784        dst.priority = priority == null ? null : priority.copy();
2785        if (purpose != null) {
2786          dst.purpose = new ArrayList<Enumeration<EligibilityRequestPurpose>>();
2787          for (Enumeration<EligibilityRequestPurpose> i : purpose)
2788            dst.purpose.add(i.copy());
2789        };
2790        dst.patient = patient == null ? null : patient.copy();
2791        dst.serviced = serviced == null ? null : serviced.copy();
2792        dst.created = created == null ? null : created.copy();
2793        dst.enterer = enterer == null ? null : enterer.copy();
2794        dst.provider = provider == null ? null : provider.copy();
2795        dst.insurer = insurer == null ? null : insurer.copy();
2796        dst.facility = facility == null ? null : facility.copy();
2797        if (supportingInfo != null) {
2798          dst.supportingInfo = new ArrayList<SupportingInformationComponent>();
2799          for (SupportingInformationComponent i : supportingInfo)
2800            dst.supportingInfo.add(i.copy());
2801        };
2802        if (insurance != null) {
2803          dst.insurance = new ArrayList<InsuranceComponent>();
2804          for (InsuranceComponent i : insurance)
2805            dst.insurance.add(i.copy());
2806        };
2807        if (item != null) {
2808          dst.item = new ArrayList<DetailsComponent>();
2809          for (DetailsComponent i : item)
2810            dst.item.add(i.copy());
2811        };
2812      }
2813
2814      protected CoverageEligibilityRequest typedCopy() {
2815        return copy();
2816      }
2817
2818      @Override
2819      public boolean equalsDeep(Base other_) {
2820        if (!super.equalsDeep(other_))
2821          return false;
2822        if (!(other_ instanceof CoverageEligibilityRequest))
2823          return false;
2824        CoverageEligibilityRequest o = (CoverageEligibilityRequest) other_;
2825        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true)
2826           && compareDeep(purpose, o.purpose, true) && compareDeep(patient, o.patient, true) && compareDeep(serviced, o.serviced, true)
2827           && compareDeep(created, o.created, true) && compareDeep(enterer, o.enterer, true) && compareDeep(provider, o.provider, true)
2828           && compareDeep(insurer, o.insurer, true) && compareDeep(facility, o.facility, true) && compareDeep(supportingInfo, o.supportingInfo, true)
2829           && compareDeep(insurance, o.insurance, true) && compareDeep(item, o.item, true);
2830      }
2831
2832      @Override
2833      public boolean equalsShallow(Base other_) {
2834        if (!super.equalsShallow(other_))
2835          return false;
2836        if (!(other_ instanceof CoverageEligibilityRequest))
2837          return false;
2838        CoverageEligibilityRequest o = (CoverageEligibilityRequest) other_;
2839        return compareValues(status, o.status, true) && compareValues(purpose, o.purpose, true) && compareValues(created, o.created, true)
2840          ;
2841      }
2842
2843      public boolean isEmpty() {
2844        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, priority
2845          , purpose, patient, serviced, created, enterer, provider, insurer, facility
2846          , supportingInfo, insurance, item);
2847      }
2848
2849  @Override
2850  public ResourceType getResourceType() {
2851    return ResourceType.CoverageEligibilityRequest;
2852   }
2853
2854 /**
2855   * Search parameter: <b>identifier</b>
2856   * <p>
2857   * Description: <b>The business identifier of the Eligibility</b><br>
2858   * Type: <b>token</b><br>
2859   * Path: <b>CoverageEligibilityRequest.identifier</b><br>
2860   * </p>
2861   */
2862  @SearchParamDefinition(name="identifier", path="CoverageEligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" )
2863  public static final String SP_IDENTIFIER = "identifier";
2864 /**
2865   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2866   * <p>
2867   * Description: <b>The business identifier of the Eligibility</b><br>
2868   * Type: <b>token</b><br>
2869   * Path: <b>CoverageEligibilityRequest.identifier</b><br>
2870   * </p>
2871   */
2872  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2873
2874 /**
2875   * Search parameter: <b>provider</b>
2876   * <p>
2877   * Description: <b>The reference to the provider</b><br>
2878   * Type: <b>reference</b><br>
2879   * Path: <b>CoverageEligibilityRequest.provider</b><br>
2880   * </p>
2881   */
2882  @SearchParamDefinition(name="provider", path="CoverageEligibilityRequest.provider", description="The reference to the provider", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Practitioner.class, PractitionerRole.class } )
2883  public static final String SP_PROVIDER = "provider";
2884 /**
2885   * <b>Fluent Client</b> search parameter constant for <b>provider</b>
2886   * <p>
2887   * Description: <b>The reference to the provider</b><br>
2888   * Type: <b>reference</b><br>
2889   * Path: <b>CoverageEligibilityRequest.provider</b><br>
2890   * </p>
2891   */
2892  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER);
2893
2894/**
2895   * Constant for fluent queries to be used to add include statements. Specifies
2896   * the path value of "<b>CoverageEligibilityRequest:provider</b>".
2897   */
2898  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("CoverageEligibilityRequest:provider").toLocked();
2899
2900 /**
2901   * Search parameter: <b>patient</b>
2902   * <p>
2903   * Description: <b>The reference to the patient</b><br>
2904   * Type: <b>reference</b><br>
2905   * Path: <b>CoverageEligibilityRequest.patient</b><br>
2906   * </p>
2907   */
2908  @SearchParamDefinition(name="patient", path="CoverageEligibilityRequest.patient", description="The reference to the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
2909  public static final String SP_PATIENT = "patient";
2910 /**
2911   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2912   * <p>
2913   * Description: <b>The reference to the patient</b><br>
2914   * Type: <b>reference</b><br>
2915   * Path: <b>CoverageEligibilityRequest.patient</b><br>
2916   * </p>
2917   */
2918  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2919
2920/**
2921   * Constant for fluent queries to be used to add include statements. Specifies
2922   * the path value of "<b>CoverageEligibilityRequest:patient</b>".
2923   */
2924  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CoverageEligibilityRequest:patient").toLocked();
2925
2926 /**
2927   * Search parameter: <b>created</b>
2928   * <p>
2929   * Description: <b>The creation date for the EOB</b><br>
2930   * Type: <b>date</b><br>
2931   * Path: <b>CoverageEligibilityRequest.created</b><br>
2932   * </p>
2933   */
2934  @SearchParamDefinition(name="created", path="CoverageEligibilityRequest.created", description="The creation date for the EOB", type="date" )
2935  public static final String SP_CREATED = "created";
2936 /**
2937   * <b>Fluent Client</b> search parameter constant for <b>created</b>
2938   * <p>
2939   * Description: <b>The creation date for the EOB</b><br>
2940   * Type: <b>date</b><br>
2941   * Path: <b>CoverageEligibilityRequest.created</b><br>
2942   * </p>
2943   */
2944  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
2945
2946 /**
2947   * Search parameter: <b>enterer</b>
2948   * <p>
2949   * Description: <b>The party who is responsible for the request</b><br>
2950   * Type: <b>reference</b><br>
2951   * Path: <b>CoverageEligibilityRequest.enterer</b><br>
2952   * </p>
2953   */
2954  @SearchParamDefinition(name="enterer", path="CoverageEligibilityRequest.enterer", description="The party who is responsible for the request", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class, PractitionerRole.class } )
2955  public static final String SP_ENTERER = "enterer";
2956 /**
2957   * <b>Fluent Client</b> search parameter constant for <b>enterer</b>
2958   * <p>
2959   * Description: <b>The party who is responsible for the request</b><br>
2960   * Type: <b>reference</b><br>
2961   * Path: <b>CoverageEligibilityRequest.enterer</b><br>
2962   * </p>
2963   */
2964  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTERER);
2965
2966/**
2967   * Constant for fluent queries to be used to add include statements. Specifies
2968   * the path value of "<b>CoverageEligibilityRequest:enterer</b>".
2969   */
2970  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTERER = new ca.uhn.fhir.model.api.Include("CoverageEligibilityRequest:enterer").toLocked();
2971
2972 /**
2973   * Search parameter: <b>facility</b>
2974   * <p>
2975   * Description: <b>Facility responsible for the goods and services</b><br>
2976   * Type: <b>reference</b><br>
2977   * Path: <b>CoverageEligibilityRequest.facility</b><br>
2978   * </p>
2979   */
2980  @SearchParamDefinition(name="facility", path="CoverageEligibilityRequest.facility", description="Facility responsible for the goods and services", type="reference", target={Location.class } )
2981  public static final String SP_FACILITY = "facility";
2982 /**
2983   * <b>Fluent Client</b> search parameter constant for <b>facility</b>
2984   * <p>
2985   * Description: <b>Facility responsible for the goods and services</b><br>
2986   * Type: <b>reference</b><br>
2987   * Path: <b>CoverageEligibilityRequest.facility</b><br>
2988   * </p>
2989   */
2990  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITY);
2991
2992/**
2993   * Constant for fluent queries to be used to add include statements. Specifies
2994   * the path value of "<b>CoverageEligibilityRequest:facility</b>".
2995   */
2996  public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITY = new ca.uhn.fhir.model.api.Include("CoverageEligibilityRequest:facility").toLocked();
2997
2998 /**
2999   * Search parameter: <b>status</b>
3000   * <p>
3001   * Description: <b>The status of the EligibilityRequest</b><br>
3002   * Type: <b>token</b><br>
3003   * Path: <b>CoverageEligibilityRequest.status</b><br>
3004   * </p>
3005   */
3006  @SearchParamDefinition(name="status", path="CoverageEligibilityRequest.status", description="The status of the EligibilityRequest", type="token" )
3007  public static final String SP_STATUS = "status";
3008 /**
3009   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3010   * <p>
3011   * Description: <b>The status of the EligibilityRequest</b><br>
3012   * Type: <b>token</b><br>
3013   * Path: <b>CoverageEligibilityRequest.status</b><br>
3014   * </p>
3015   */
3016  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3017
3018
3019}
3020