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