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