001package org.hl7.fhir.dstu3.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.dstu3
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
053import java.util.ArrayList;
054import java.util.Date;
055import java.util.List;
056
057import org.hl7.fhir.exceptions.FHIRException;
058import org.hl7.fhir.exceptions.FHIRFormatError;
059import org.hl7.fhir.utilities.Utilities;
060
061import ca.uhn.fhir.model.api.annotation.Child;
062import ca.uhn.fhir.model.api.annotation.Description;
063import ca.uhn.fhir.model.api.annotation.ResourceDef;
064import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
065/**
066 * The EligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an EligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.
067 */
068@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest")
069public class EligibilityRequest extends DomainResource {
070
071    public enum EligibilityRequestStatus {
072        /**
073         * The instance is currently in-force.
074         */
075        ACTIVE, 
076        /**
077         * The instance is withdrawn, rescinded or reversed.
078         */
079        CANCELLED, 
080        /**
081         * A new instance the contents of which is not complete.
082         */
083        DRAFT, 
084        /**
085         * The instance was entered in error.
086         */
087        ENTEREDINERROR, 
088        /**
089         * added to help the parsers with the generic types
090         */
091        NULL;
092        public static EligibilityRequestStatus fromCode(String codeString) throws FHIRException {
093            if (codeString == null || "".equals(codeString))
094                return null;
095        if ("active".equals(codeString))
096          return ACTIVE;
097        if ("cancelled".equals(codeString))
098          return CANCELLED;
099        if ("draft".equals(codeString))
100          return DRAFT;
101        if ("entered-in-error".equals(codeString))
102          return ENTEREDINERROR;
103        if (Configuration.isAcceptInvalidEnums())
104          return null;
105        else
106          throw new FHIRException("Unknown EligibilityRequestStatus code '"+codeString+"'");
107        }
108        public String toCode() {
109          switch (this) {
110            case ACTIVE: return "active";
111            case CANCELLED: return "cancelled";
112            case DRAFT: return "draft";
113            case ENTEREDINERROR: return "entered-in-error";
114            default: return "?";
115          }
116        }
117        public String getSystem() {
118          switch (this) {
119            case ACTIVE: return "http://hl7.org/fhir/fm-status";
120            case CANCELLED: return "http://hl7.org/fhir/fm-status";
121            case DRAFT: return "http://hl7.org/fhir/fm-status";
122            case ENTEREDINERROR: return "http://hl7.org/fhir/fm-status";
123            default: return "?";
124          }
125        }
126        public String getDefinition() {
127          switch (this) {
128            case ACTIVE: return "The instance is currently in-force.";
129            case CANCELLED: return "The instance is withdrawn, rescinded or reversed.";
130            case DRAFT: return "A new instance the contents of which is not complete.";
131            case ENTEREDINERROR: return "The instance was entered in error.";
132            default: return "?";
133          }
134        }
135        public String getDisplay() {
136          switch (this) {
137            case ACTIVE: return "Active";
138            case CANCELLED: return "Cancelled";
139            case DRAFT: return "Draft";
140            case ENTEREDINERROR: return "Entered in Error";
141            default: return "?";
142          }
143        }
144    }
145
146  public static class EligibilityRequestStatusEnumFactory implements EnumFactory<EligibilityRequestStatus> {
147    public EligibilityRequestStatus fromCode(String codeString) throws IllegalArgumentException {
148      if (codeString == null || "".equals(codeString))
149            if (codeString == null || "".equals(codeString))
150                return null;
151        if ("active".equals(codeString))
152          return EligibilityRequestStatus.ACTIVE;
153        if ("cancelled".equals(codeString))
154          return EligibilityRequestStatus.CANCELLED;
155        if ("draft".equals(codeString))
156          return EligibilityRequestStatus.DRAFT;
157        if ("entered-in-error".equals(codeString))
158          return EligibilityRequestStatus.ENTEREDINERROR;
159        throw new IllegalArgumentException("Unknown EligibilityRequestStatus code '"+codeString+"'");
160        }
161        public Enumeration<EligibilityRequestStatus> fromType(Base code) throws FHIRException {
162          if (code == null)
163            return null;
164          if (code.isEmpty())
165            return new Enumeration<EligibilityRequestStatus>(this);
166          String codeString = ((PrimitiveType) code).asStringValue();
167          if (codeString == null || "".equals(codeString))
168            return null;
169        if ("active".equals(codeString))
170          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.ACTIVE);
171        if ("cancelled".equals(codeString))
172          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.CANCELLED);
173        if ("draft".equals(codeString))
174          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.DRAFT);
175        if ("entered-in-error".equals(codeString))
176          return new Enumeration<EligibilityRequestStatus>(this, EligibilityRequestStatus.ENTEREDINERROR);
177        throw new FHIRException("Unknown EligibilityRequestStatus code '"+codeString+"'");
178        }
179    public String toCode(EligibilityRequestStatus code) {
180      if (code == EligibilityRequestStatus.ACTIVE)
181        return "active";
182      if (code == EligibilityRequestStatus.CANCELLED)
183        return "cancelled";
184      if (code == EligibilityRequestStatus.DRAFT)
185        return "draft";
186      if (code == EligibilityRequestStatus.ENTEREDINERROR)
187        return "entered-in-error";
188      return "?";
189      }
190    public String toSystem(EligibilityRequestStatus code) {
191      return code.getSystem();
192      }
193    }
194
195    /**
196     * The Response business identifier.
197     */
198    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
199    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
200    protected List<Identifier> identifier;
201
202    /**
203     * The status of the resource instance.
204     */
205    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
206    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
207    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
208    protected Enumeration<EligibilityRequestStatus> status;
209
210    /**
211     * Immediate (STAT), best effort (NORMAL), deferred (DEFER).
212     */
213    @Child(name = "priority", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
214    @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." )
215    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/process-priority")
216    protected CodeableConcept priority;
217
218    /**
219     * Patient Resource.
220     */
221    @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=false)
222    @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." )
223    protected Reference patient;
224
225    /**
226     * The actual object that is the target of the reference (Patient Resource.)
227     */
228    protected Patient patientTarget;
229
230    /**
231     * The date or dates when the enclosed suite of services were performed or completed.
232     */
233    @Child(name = "serviced", type = {DateType.class, Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
234    @Description(shortDefinition="Estimated date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." )
235    protected Type serviced;
236
237    /**
238     * The date when this resource was created.
239     */
240    @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
241    @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
242    protected DateTimeType created;
243
244    /**
245     * Person who created the invoice/claim/pre-determination or pre-authorization.
246     */
247    @Child(name = "enterer", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=false)
248    @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." )
249    protected Reference enterer;
250
251    /**
252     * The actual object that is the target of the reference (Person who created the invoice/claim/pre-determination or pre-authorization.)
253     */
254    protected Practitioner entererTarget;
255
256    /**
257     * The practitioner who is responsible for the services rendered to the patient.
258     */
259    @Child(name = "provider", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false)
260    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
261    protected Reference provider;
262
263    /**
264     * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
265     */
266    protected Practitioner providerTarget;
267
268    /**
269     * The organization which is responsible for the services rendered to the patient.
270     */
271    @Child(name = "organization", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=false)
272    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
273    protected Reference organization;
274
275    /**
276     * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.)
277     */
278    protected Organization organizationTarget;
279
280    /**
281     * The Insurer who is target  of the request.
282     */
283    @Child(name = "insurer", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=false)
284    @Description(shortDefinition="Target", formalDefinition="The Insurer who is target  of the request." )
285    protected Reference insurer;
286
287    /**
288     * The actual object that is the target of the reference (The Insurer who is target  of the request.)
289     */
290    protected Organization insurerTarget;
291
292    /**
293     * Facility where the services were provided.
294     */
295    @Child(name = "facility", type = {Location.class}, order=10, min=0, max=1, modifier=false, summary=false)
296    @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." )
297    protected Reference facility;
298
299    /**
300     * The actual object that is the target of the reference (Facility where the services were provided.)
301     */
302    protected Location facilityTarget;
303
304    /**
305     * Financial instrument by which payment information for health care.
306     */
307    @Child(name = "coverage", type = {Coverage.class}, order=11, min=0, max=1, modifier=false, summary=false)
308    @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." )
309    protected Reference coverage;
310
311    /**
312     * The actual object that is the target of the reference (Financial instrument by which payment information for health care.)
313     */
314    protected Coverage coverageTarget;
315
316    /**
317     * The contract number of a business agreement which describes the terms and conditions.
318     */
319    @Child(name = "businessArrangement", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
320    @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." )
321    protected StringType businessArrangement;
322
323    /**
324     * Dental, Vision, Medical, Pharmacy, Rehab etc.
325     */
326    @Child(name = "benefitCategory", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false)
327    @Description(shortDefinition="Type of services covered", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." )
328    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-category")
329    protected CodeableConcept benefitCategory;
330
331    /**
332     * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.
333     */
334    @Child(name = "benefitSubCategory", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
335    @Description(shortDefinition="Detailed services covered within the type", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." )
336    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-subcategory")
337    protected CodeableConcept benefitSubCategory;
338
339    private static final long serialVersionUID = 899259023L;
340
341  /**
342   * Constructor
343   */
344    public EligibilityRequest() {
345      super();
346    }
347
348    /**
349     * @return {@link #identifier} (The Response business identifier.)
350     */
351    public List<Identifier> getIdentifier() { 
352      if (this.identifier == null)
353        this.identifier = new ArrayList<Identifier>();
354      return this.identifier;
355    }
356
357    /**
358     * @return Returns a reference to <code>this</code> for easy method chaining
359     */
360    public EligibilityRequest setIdentifier(List<Identifier> theIdentifier) { 
361      this.identifier = theIdentifier;
362      return this;
363    }
364
365    public boolean hasIdentifier() { 
366      if (this.identifier == null)
367        return false;
368      for (Identifier item : this.identifier)
369        if (!item.isEmpty())
370          return true;
371      return false;
372    }
373
374    public Identifier addIdentifier() { //3
375      Identifier t = new Identifier();
376      if (this.identifier == null)
377        this.identifier = new ArrayList<Identifier>();
378      this.identifier.add(t);
379      return t;
380    }
381
382    public EligibilityRequest addIdentifier(Identifier t) { //3
383      if (t == null)
384        return this;
385      if (this.identifier == null)
386        this.identifier = new ArrayList<Identifier>();
387      this.identifier.add(t);
388      return this;
389    }
390
391    /**
392     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
393     */
394    public Identifier getIdentifierFirstRep() { 
395      if (getIdentifier().isEmpty()) {
396        addIdentifier();
397      }
398      return getIdentifier().get(0);
399    }
400
401    /**
402     * @return {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
403     */
404    public Enumeration<EligibilityRequestStatus> getStatusElement() { 
405      if (this.status == null)
406        if (Configuration.errorOnAutoCreate())
407          throw new Error("Attempt to auto-create EligibilityRequest.status");
408        else if (Configuration.doAutoCreate())
409          this.status = new Enumeration<EligibilityRequestStatus>(new EligibilityRequestStatusEnumFactory()); // bb
410      return this.status;
411    }
412
413    public boolean hasStatusElement() { 
414      return this.status != null && !this.status.isEmpty();
415    }
416
417    public boolean hasStatus() { 
418      return this.status != null && !this.status.isEmpty();
419    }
420
421    /**
422     * @param value {@link #status} (The status of the resource instance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
423     */
424    public EligibilityRequest setStatusElement(Enumeration<EligibilityRequestStatus> value) { 
425      this.status = value;
426      return this;
427    }
428
429    /**
430     * @return The status of the resource instance.
431     */
432    public EligibilityRequestStatus getStatus() { 
433      return this.status == null ? null : this.status.getValue();
434    }
435
436    /**
437     * @param value The status of the resource instance.
438     */
439    public EligibilityRequest setStatus(EligibilityRequestStatus value) { 
440      if (value == null)
441        this.status = null;
442      else {
443        if (this.status == null)
444          this.status = new Enumeration<EligibilityRequestStatus>(new EligibilityRequestStatusEnumFactory());
445        this.status.setValue(value);
446      }
447      return this;
448    }
449
450    /**
451     * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).)
452     */
453    public CodeableConcept getPriority() { 
454      if (this.priority == null)
455        if (Configuration.errorOnAutoCreate())
456          throw new Error("Attempt to auto-create EligibilityRequest.priority");
457        else if (Configuration.doAutoCreate())
458          this.priority = new CodeableConcept(); // cc
459      return this.priority;
460    }
461
462    public boolean hasPriority() { 
463      return this.priority != null && !this.priority.isEmpty();
464    }
465
466    /**
467     * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).)
468     */
469    public EligibilityRequest setPriority(CodeableConcept value)  { 
470      this.priority = value;
471      return this;
472    }
473
474    /**
475     * @return {@link #patient} (Patient Resource.)
476     */
477    public Reference getPatient() { 
478      if (this.patient == null)
479        if (Configuration.errorOnAutoCreate())
480          throw new Error("Attempt to auto-create EligibilityRequest.patient");
481        else if (Configuration.doAutoCreate())
482          this.patient = new Reference(); // cc
483      return this.patient;
484    }
485
486    public boolean hasPatient() { 
487      return this.patient != null && !this.patient.isEmpty();
488    }
489
490    /**
491     * @param value {@link #patient} (Patient Resource.)
492     */
493    public EligibilityRequest setPatient(Reference value)  { 
494      this.patient = value;
495      return this;
496    }
497
498    /**
499     * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.)
500     */
501    public Patient getPatientTarget() { 
502      if (this.patientTarget == null)
503        if (Configuration.errorOnAutoCreate())
504          throw new Error("Attempt to auto-create EligibilityRequest.patient");
505        else if (Configuration.doAutoCreate())
506          this.patientTarget = new Patient(); // aa
507      return this.patientTarget;
508    }
509
510    /**
511     * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.)
512     */
513    public EligibilityRequest setPatientTarget(Patient value) { 
514      this.patientTarget = value;
515      return this;
516    }
517
518    /**
519     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
520     */
521    public Type getServiced() { 
522      return this.serviced;
523    }
524
525    /**
526     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
527     */
528    public DateType getServicedDateType() throws FHIRException { 
529      if (this.serviced == null)
530        return null;
531      if (!(this.serviced instanceof DateType))
532        throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered");
533      return (DateType) this.serviced;
534    }
535
536    public boolean hasServicedDateType() { 
537      return this != null && this.serviced instanceof DateType;
538    }
539
540    /**
541     * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
542     */
543    public Period getServicedPeriod() throws FHIRException { 
544      if (this.serviced == null)
545        return null;
546      if (!(this.serviced instanceof Period))
547        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered");
548      return (Period) this.serviced;
549    }
550
551    public boolean hasServicedPeriod() { 
552      return this != null && this.serviced instanceof Period;
553    }
554
555    public boolean hasServiced() { 
556      return this.serviced != null && !this.serviced.isEmpty();
557    }
558
559    /**
560     * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
561     */
562    public EligibilityRequest setServiced(Type value) throws FHIRFormatError { 
563      if (value != null && !(value instanceof DateType || value instanceof Period))
564        throw new FHIRFormatError("Not the right type for EligibilityRequest.serviced[x]: "+value.fhirType());
565      this.serviced = value;
566      return this;
567    }
568
569    /**
570     * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
571     */
572    public DateTimeType getCreatedElement() { 
573      if (this.created == null)
574        if (Configuration.errorOnAutoCreate())
575          throw new Error("Attempt to auto-create EligibilityRequest.created");
576        else if (Configuration.doAutoCreate())
577          this.created = new DateTimeType(); // bb
578      return this.created;
579    }
580
581    public boolean hasCreatedElement() { 
582      return this.created != null && !this.created.isEmpty();
583    }
584
585    public boolean hasCreated() { 
586      return this.created != null && !this.created.isEmpty();
587    }
588
589    /**
590     * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
591     */
592    public EligibilityRequest setCreatedElement(DateTimeType value) { 
593      this.created = value;
594      return this;
595    }
596
597    /**
598     * @return The date when this resource was created.
599     */
600    public Date getCreated() { 
601      return this.created == null ? null : this.created.getValue();
602    }
603
604    /**
605     * @param value The date when this resource was created.
606     */
607    public EligibilityRequest setCreated(Date value) { 
608      if (value == null)
609        this.created = null;
610      else {
611        if (this.created == null)
612          this.created = new DateTimeType();
613        this.created.setValue(value);
614      }
615      return this;
616    }
617
618    /**
619     * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
620     */
621    public Reference getEnterer() { 
622      if (this.enterer == null)
623        if (Configuration.errorOnAutoCreate())
624          throw new Error("Attempt to auto-create EligibilityRequest.enterer");
625        else if (Configuration.doAutoCreate())
626          this.enterer = new Reference(); // cc
627      return this.enterer;
628    }
629
630    public boolean hasEnterer() { 
631      return this.enterer != null && !this.enterer.isEmpty();
632    }
633
634    /**
635     * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
636     */
637    public EligibilityRequest setEnterer(Reference value)  { 
638      this.enterer = value;
639      return this;
640    }
641
642    /**
643     * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.)
644     */
645    public Practitioner getEntererTarget() { 
646      if (this.entererTarget == null)
647        if (Configuration.errorOnAutoCreate())
648          throw new Error("Attempt to auto-create EligibilityRequest.enterer");
649        else if (Configuration.doAutoCreate())
650          this.entererTarget = new Practitioner(); // aa
651      return this.entererTarget;
652    }
653
654    /**
655     * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who created the invoice/claim/pre-determination or pre-authorization.)
656     */
657    public EligibilityRequest setEntererTarget(Practitioner value) { 
658      this.entererTarget = value;
659      return this;
660    }
661
662    /**
663     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
664     */
665    public Reference getProvider() { 
666      if (this.provider == null)
667        if (Configuration.errorOnAutoCreate())
668          throw new Error("Attempt to auto-create EligibilityRequest.provider");
669        else if (Configuration.doAutoCreate())
670          this.provider = new Reference(); // cc
671      return this.provider;
672    }
673
674    public boolean hasProvider() { 
675      return this.provider != null && !this.provider.isEmpty();
676    }
677
678    /**
679     * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
680     */
681    public EligibilityRequest setProvider(Reference value)  { 
682      this.provider = value;
683      return this;
684    }
685
686    /**
687     * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
688     */
689    public Practitioner getProviderTarget() { 
690      if (this.providerTarget == null)
691        if (Configuration.errorOnAutoCreate())
692          throw new Error("Attempt to auto-create EligibilityRequest.provider");
693        else if (Configuration.doAutoCreate())
694          this.providerTarget = new Practitioner(); // aa
695      return this.providerTarget;
696    }
697
698    /**
699     * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
700     */
701    public EligibilityRequest setProviderTarget(Practitioner value) { 
702      this.providerTarget = value;
703      return this;
704    }
705
706    /**
707     * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.)
708     */
709    public Reference getOrganization() { 
710      if (this.organization == null)
711        if (Configuration.errorOnAutoCreate())
712          throw new Error("Attempt to auto-create EligibilityRequest.organization");
713        else if (Configuration.doAutoCreate())
714          this.organization = new Reference(); // cc
715      return this.organization;
716    }
717
718    public boolean hasOrganization() { 
719      return this.organization != null && !this.organization.isEmpty();
720    }
721
722    /**
723     * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.)
724     */
725    public EligibilityRequest setOrganization(Reference value)  { 
726      this.organization = value;
727      return this;
728    }
729
730    /**
731     * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
732     */
733    public Organization getOrganizationTarget() { 
734      if (this.organizationTarget == null)
735        if (Configuration.errorOnAutoCreate())
736          throw new Error("Attempt to auto-create EligibilityRequest.organization");
737        else if (Configuration.doAutoCreate())
738          this.organizationTarget = new Organization(); // aa
739      return this.organizationTarget;
740    }
741
742    /**
743     * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.)
744     */
745    public EligibilityRequest setOrganizationTarget(Organization value) { 
746      this.organizationTarget = value;
747      return this;
748    }
749
750    /**
751     * @return {@link #insurer} (The Insurer who is target  of the request.)
752     */
753    public Reference getInsurer() { 
754      if (this.insurer == null)
755        if (Configuration.errorOnAutoCreate())
756          throw new Error("Attempt to auto-create EligibilityRequest.insurer");
757        else if (Configuration.doAutoCreate())
758          this.insurer = new Reference(); // cc
759      return this.insurer;
760    }
761
762    public boolean hasInsurer() { 
763      return this.insurer != null && !this.insurer.isEmpty();
764    }
765
766    /**
767     * @param value {@link #insurer} (The Insurer who is target  of the request.)
768     */
769    public EligibilityRequest setInsurer(Reference value)  { 
770      this.insurer = value;
771      return this;
772    }
773
774    /**
775     * @return {@link #insurer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who is target  of the request.)
776     */
777    public Organization getInsurerTarget() { 
778      if (this.insurerTarget == null)
779        if (Configuration.errorOnAutoCreate())
780          throw new Error("Attempt to auto-create EligibilityRequest.insurer");
781        else if (Configuration.doAutoCreate())
782          this.insurerTarget = new Organization(); // aa
783      return this.insurerTarget;
784    }
785
786    /**
787     * @param value {@link #insurer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target  of the request.)
788     */
789    public EligibilityRequest setInsurerTarget(Organization value) { 
790      this.insurerTarget = value;
791      return this;
792    }
793
794    /**
795     * @return {@link #facility} (Facility where the services were provided.)
796     */
797    public Reference getFacility() { 
798      if (this.facility == null)
799        if (Configuration.errorOnAutoCreate())
800          throw new Error("Attempt to auto-create EligibilityRequest.facility");
801        else if (Configuration.doAutoCreate())
802          this.facility = new Reference(); // cc
803      return this.facility;
804    }
805
806    public boolean hasFacility() { 
807      return this.facility != null && !this.facility.isEmpty();
808    }
809
810    /**
811     * @param value {@link #facility} (Facility where the services were provided.)
812     */
813    public EligibilityRequest setFacility(Reference value)  { 
814      this.facility = value;
815      return this;
816    }
817
818    /**
819     * @return {@link #facility} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.)
820     */
821    public Location getFacilityTarget() { 
822      if (this.facilityTarget == null)
823        if (Configuration.errorOnAutoCreate())
824          throw new Error("Attempt to auto-create EligibilityRequest.facility");
825        else if (Configuration.doAutoCreate())
826          this.facilityTarget = new Location(); // aa
827      return this.facilityTarget;
828    }
829
830    /**
831     * @param value {@link #facility} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Facility where the services were provided.)
832     */
833    public EligibilityRequest setFacilityTarget(Location value) { 
834      this.facilityTarget = value;
835      return this;
836    }
837
838    /**
839     * @return {@link #coverage} (Financial instrument by which payment information for health care.)
840     */
841    public Reference getCoverage() { 
842      if (this.coverage == null)
843        if (Configuration.errorOnAutoCreate())
844          throw new Error("Attempt to auto-create EligibilityRequest.coverage");
845        else if (Configuration.doAutoCreate())
846          this.coverage = new Reference(); // cc
847      return this.coverage;
848    }
849
850    public boolean hasCoverage() { 
851      return this.coverage != null && !this.coverage.isEmpty();
852    }
853
854    /**
855     * @param value {@link #coverage} (Financial instrument by which payment information for health care.)
856     */
857    public EligibilityRequest setCoverage(Reference value)  { 
858      this.coverage = value;
859      return this;
860    }
861
862    /**
863     * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Financial instrument by which payment information for health care.)
864     */
865    public Coverage getCoverageTarget() { 
866      if (this.coverageTarget == null)
867        if (Configuration.errorOnAutoCreate())
868          throw new Error("Attempt to auto-create EligibilityRequest.coverage");
869        else if (Configuration.doAutoCreate())
870          this.coverageTarget = new Coverage(); // aa
871      return this.coverageTarget;
872    }
873
874    /**
875     * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Financial instrument by which payment information for health care.)
876     */
877    public EligibilityRequest setCoverageTarget(Coverage value) { 
878      this.coverageTarget = value;
879      return this;
880    }
881
882    /**
883     * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
884     */
885    public StringType getBusinessArrangementElement() { 
886      if (this.businessArrangement == null)
887        if (Configuration.errorOnAutoCreate())
888          throw new Error("Attempt to auto-create EligibilityRequest.businessArrangement");
889        else if (Configuration.doAutoCreate())
890          this.businessArrangement = new StringType(); // bb
891      return this.businessArrangement;
892    }
893
894    public boolean hasBusinessArrangementElement() { 
895      return this.businessArrangement != null && !this.businessArrangement.isEmpty();
896    }
897
898    public boolean hasBusinessArrangement() { 
899      return this.businessArrangement != null && !this.businessArrangement.isEmpty();
900    }
901
902    /**
903     * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
904     */
905    public EligibilityRequest setBusinessArrangementElement(StringType value) { 
906      this.businessArrangement = value;
907      return this;
908    }
909
910    /**
911     * @return The contract number of a business agreement which describes the terms and conditions.
912     */
913    public String getBusinessArrangement() { 
914      return this.businessArrangement == null ? null : this.businessArrangement.getValue();
915    }
916
917    /**
918     * @param value The contract number of a business agreement which describes the terms and conditions.
919     */
920    public EligibilityRequest setBusinessArrangement(String value) { 
921      if (Utilities.noString(value))
922        this.businessArrangement = null;
923      else {
924        if (this.businessArrangement == null)
925          this.businessArrangement = new StringType();
926        this.businessArrangement.setValue(value);
927      }
928      return this;
929    }
930
931    /**
932     * @return {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.)
933     */
934    public CodeableConcept getBenefitCategory() { 
935      if (this.benefitCategory == null)
936        if (Configuration.errorOnAutoCreate())
937          throw new Error("Attempt to auto-create EligibilityRequest.benefitCategory");
938        else if (Configuration.doAutoCreate())
939          this.benefitCategory = new CodeableConcept(); // cc
940      return this.benefitCategory;
941    }
942
943    public boolean hasBenefitCategory() { 
944      return this.benefitCategory != null && !this.benefitCategory.isEmpty();
945    }
946
947    /**
948     * @param value {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.)
949     */
950    public EligibilityRequest setBenefitCategory(CodeableConcept value)  { 
951      this.benefitCategory = value;
952      return this;
953    }
954
955    /**
956     * @return {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.)
957     */
958    public CodeableConcept getBenefitSubCategory() { 
959      if (this.benefitSubCategory == null)
960        if (Configuration.errorOnAutoCreate())
961          throw new Error("Attempt to auto-create EligibilityRequest.benefitSubCategory");
962        else if (Configuration.doAutoCreate())
963          this.benefitSubCategory = new CodeableConcept(); // cc
964      return this.benefitSubCategory;
965    }
966
967    public boolean hasBenefitSubCategory() { 
968      return this.benefitSubCategory != null && !this.benefitSubCategory.isEmpty();
969    }
970
971    /**
972     * @param value {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.)
973     */
974    public EligibilityRequest setBenefitSubCategory(CodeableConcept value)  { 
975      this.benefitSubCategory = value;
976      return this;
977    }
978
979      protected void listChildren(List<Property> children) {
980        super.listChildren(children);
981        children.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
982        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
983        children.add(new Property("priority", "CodeableConcept", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, 1, priority));
984        children.add(new Property("patient", "Reference(Patient)", "Patient Resource.", 0, 1, patient));
985        children.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced));
986        children.add(new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created));
987        children.add(new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, 1, enterer));
988        children.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider));
989        children.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, organization));
990        children.add(new Property("insurer", "Reference(Organization)", "The Insurer who is target  of the request.", 0, 1, insurer));
991        children.add(new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, 1, facility));
992        children.add(new Property("coverage", "Reference(Coverage)", "Financial instrument by which payment information for health care.", 0, 1, coverage));
993        children.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, 1, businessArrangement));
994        children.add(new Property("benefitCategory", "CodeableConcept", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, 1, benefitCategory));
995        children.add(new Property("benefitSubCategory", "CodeableConcept", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, 1, benefitSubCategory));
996      }
997
998      @Override
999      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1000        switch (_hash) {
1001        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
1002        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
1003        case -1165461084: /*priority*/  return new Property("priority", "CodeableConcept", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, 1, priority);
1004        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "Patient Resource.", 0, 1, patient);
1005        case -1927922223: /*serviced[x]*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
1006        case 1379209295: /*serviced*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
1007        case 363246749: /*servicedDate*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
1008        case 1534966512: /*servicedPeriod*/  return new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, 1, serviced);
1009        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when this resource was created.", 0, 1, created);
1010        case -1591951995: /*enterer*/  return new Property("enterer", "Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, 1, enterer);
1011        case -987494927: /*provider*/  return new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, provider);
1012        case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, organization);
1013        case 1957615864: /*insurer*/  return new Property("insurer", "Reference(Organization)", "The Insurer who is target  of the request.", 0, 1, insurer);
1014        case 501116579: /*facility*/  return new Property("facility", "Reference(Location)", "Facility where the services were provided.", 0, 1, facility);
1015        case -351767064: /*coverage*/  return new Property("coverage", "Reference(Coverage)", "Financial instrument by which payment information for health care.", 0, 1, coverage);
1016        case 259920682: /*businessArrangement*/  return new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, 1, businessArrangement);
1017        case -1023390027: /*benefitCategory*/  return new Property("benefitCategory", "CodeableConcept", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, 1, benefitCategory);
1018        case 1987878471: /*benefitSubCategory*/  return new Property("benefitSubCategory", "CodeableConcept", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, 1, benefitSubCategory);
1019        default: return super.getNamedProperty(_hash, _name, _checkValid);
1020        }
1021
1022      }
1023
1024      @Override
1025      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1026        switch (hash) {
1027        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1028        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EligibilityRequestStatus>
1029        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept
1030        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1031        case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type
1032        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
1033        case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference
1034        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference
1035        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
1036        case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference
1037        case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Reference
1038        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
1039        case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
1040        case -1023390027: /*benefitCategory*/ return this.benefitCategory == null ? new Base[0] : new Base[] {this.benefitCategory}; // CodeableConcept
1041        case 1987878471: /*benefitSubCategory*/ return this.benefitSubCategory == null ? new Base[0] : new Base[] {this.benefitSubCategory}; // CodeableConcept
1042        default: return super.getProperty(hash, name, checkValid);
1043        }
1044
1045      }
1046
1047      @Override
1048      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1049        switch (hash) {
1050        case -1618432855: // identifier
1051          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1052          return value;
1053        case -892481550: // status
1054          value = new EligibilityRequestStatusEnumFactory().fromType(castToCode(value));
1055          this.status = (Enumeration) value; // Enumeration<EligibilityRequestStatus>
1056          return value;
1057        case -1165461084: // priority
1058          this.priority = castToCodeableConcept(value); // CodeableConcept
1059          return value;
1060        case -791418107: // patient
1061          this.patient = castToReference(value); // Reference
1062          return value;
1063        case 1379209295: // serviced
1064          this.serviced = castToType(value); // Type
1065          return value;
1066        case 1028554472: // created
1067          this.created = castToDateTime(value); // DateTimeType
1068          return value;
1069        case -1591951995: // enterer
1070          this.enterer = castToReference(value); // Reference
1071          return value;
1072        case -987494927: // provider
1073          this.provider = castToReference(value); // Reference
1074          return value;
1075        case 1178922291: // organization
1076          this.organization = castToReference(value); // Reference
1077          return value;
1078        case 1957615864: // insurer
1079          this.insurer = castToReference(value); // Reference
1080          return value;
1081        case 501116579: // facility
1082          this.facility = castToReference(value); // Reference
1083          return value;
1084        case -351767064: // coverage
1085          this.coverage = castToReference(value); // Reference
1086          return value;
1087        case 259920682: // businessArrangement
1088          this.businessArrangement = castToString(value); // StringType
1089          return value;
1090        case -1023390027: // benefitCategory
1091          this.benefitCategory = castToCodeableConcept(value); // CodeableConcept
1092          return value;
1093        case 1987878471: // benefitSubCategory
1094          this.benefitSubCategory = castToCodeableConcept(value); // CodeableConcept
1095          return value;
1096        default: return super.setProperty(hash, name, value);
1097        }
1098
1099      }
1100
1101      @Override
1102      public Base setProperty(String name, Base value) throws FHIRException {
1103        if (name.equals("identifier")) {
1104          this.getIdentifier().add(castToIdentifier(value));
1105        } else if (name.equals("status")) {
1106          value = new EligibilityRequestStatusEnumFactory().fromType(castToCode(value));
1107          this.status = (Enumeration) value; // Enumeration<EligibilityRequestStatus>
1108        } else if (name.equals("priority")) {
1109          this.priority = castToCodeableConcept(value); // CodeableConcept
1110        } else if (name.equals("patient")) {
1111          this.patient = castToReference(value); // Reference
1112        } else if (name.equals("serviced[x]")) {
1113          this.serviced = castToType(value); // Type
1114        } else if (name.equals("created")) {
1115          this.created = castToDateTime(value); // DateTimeType
1116        } else if (name.equals("enterer")) {
1117          this.enterer = castToReference(value); // Reference
1118        } else if (name.equals("provider")) {
1119          this.provider = castToReference(value); // Reference
1120        } else if (name.equals("organization")) {
1121          this.organization = castToReference(value); // Reference
1122        } else if (name.equals("insurer")) {
1123          this.insurer = castToReference(value); // Reference
1124        } else if (name.equals("facility")) {
1125          this.facility = castToReference(value); // Reference
1126        } else if (name.equals("coverage")) {
1127          this.coverage = castToReference(value); // Reference
1128        } else if (name.equals("businessArrangement")) {
1129          this.businessArrangement = castToString(value); // StringType
1130        } else if (name.equals("benefitCategory")) {
1131          this.benefitCategory = castToCodeableConcept(value); // CodeableConcept
1132        } else if (name.equals("benefitSubCategory")) {
1133          this.benefitSubCategory = castToCodeableConcept(value); // CodeableConcept
1134        } else
1135          return super.setProperty(name, value);
1136        return value;
1137      }
1138
1139      @Override
1140      public Base makeProperty(int hash, String name) throws FHIRException {
1141        switch (hash) {
1142        case -1618432855:  return addIdentifier(); 
1143        case -892481550:  return getStatusElement();
1144        case -1165461084:  return getPriority(); 
1145        case -791418107:  return getPatient(); 
1146        case -1927922223:  return getServiced(); 
1147        case 1379209295:  return getServiced(); 
1148        case 1028554472:  return getCreatedElement();
1149        case -1591951995:  return getEnterer(); 
1150        case -987494927:  return getProvider(); 
1151        case 1178922291:  return getOrganization(); 
1152        case 1957615864:  return getInsurer(); 
1153        case 501116579:  return getFacility(); 
1154        case -351767064:  return getCoverage(); 
1155        case 259920682:  return getBusinessArrangementElement();
1156        case -1023390027:  return getBenefitCategory(); 
1157        case 1987878471:  return getBenefitSubCategory(); 
1158        default: return super.makeProperty(hash, name);
1159        }
1160
1161      }
1162
1163      @Override
1164      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1165        switch (hash) {
1166        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1167        case -892481550: /*status*/ return new String[] {"code"};
1168        case -1165461084: /*priority*/ return new String[] {"CodeableConcept"};
1169        case -791418107: /*patient*/ return new String[] {"Reference"};
1170        case 1379209295: /*serviced*/ return new String[] {"date", "Period"};
1171        case 1028554472: /*created*/ return new String[] {"dateTime"};
1172        case -1591951995: /*enterer*/ return new String[] {"Reference"};
1173        case -987494927: /*provider*/ return new String[] {"Reference"};
1174        case 1178922291: /*organization*/ return new String[] {"Reference"};
1175        case 1957615864: /*insurer*/ return new String[] {"Reference"};
1176        case 501116579: /*facility*/ return new String[] {"Reference"};
1177        case -351767064: /*coverage*/ return new String[] {"Reference"};
1178        case 259920682: /*businessArrangement*/ return new String[] {"string"};
1179        case -1023390027: /*benefitCategory*/ return new String[] {"CodeableConcept"};
1180        case 1987878471: /*benefitSubCategory*/ return new String[] {"CodeableConcept"};
1181        default: return super.getTypesForProperty(hash, name);
1182        }
1183
1184      }
1185
1186      @Override
1187      public Base addChild(String name) throws FHIRException {
1188        if (name.equals("identifier")) {
1189          return addIdentifier();
1190        }
1191        else if (name.equals("status")) {
1192          throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.status");
1193        }
1194        else if (name.equals("priority")) {
1195          this.priority = new CodeableConcept();
1196          return this.priority;
1197        }
1198        else if (name.equals("patient")) {
1199          this.patient = new Reference();
1200          return this.patient;
1201        }
1202        else if (name.equals("servicedDate")) {
1203          this.serviced = new DateType();
1204          return this.serviced;
1205        }
1206        else if (name.equals("servicedPeriod")) {
1207          this.serviced = new Period();
1208          return this.serviced;
1209        }
1210        else if (name.equals("created")) {
1211          throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.created");
1212        }
1213        else if (name.equals("enterer")) {
1214          this.enterer = new Reference();
1215          return this.enterer;
1216        }
1217        else if (name.equals("provider")) {
1218          this.provider = new Reference();
1219          return this.provider;
1220        }
1221        else if (name.equals("organization")) {
1222          this.organization = new Reference();
1223          return this.organization;
1224        }
1225        else if (name.equals("insurer")) {
1226          this.insurer = new Reference();
1227          return this.insurer;
1228        }
1229        else if (name.equals("facility")) {
1230          this.facility = new Reference();
1231          return this.facility;
1232        }
1233        else if (name.equals("coverage")) {
1234          this.coverage = new Reference();
1235          return this.coverage;
1236        }
1237        else if (name.equals("businessArrangement")) {
1238          throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.businessArrangement");
1239        }
1240        else if (name.equals("benefitCategory")) {
1241          this.benefitCategory = new CodeableConcept();
1242          return this.benefitCategory;
1243        }
1244        else if (name.equals("benefitSubCategory")) {
1245          this.benefitSubCategory = new CodeableConcept();
1246          return this.benefitSubCategory;
1247        }
1248        else
1249          return super.addChild(name);
1250      }
1251
1252  public String fhirType() {
1253    return "EligibilityRequest";
1254
1255  }
1256
1257      public EligibilityRequest copy() {
1258        EligibilityRequest dst = new EligibilityRequest();
1259        copyValues(dst);
1260        if (identifier != null) {
1261          dst.identifier = new ArrayList<Identifier>();
1262          for (Identifier i : identifier)
1263            dst.identifier.add(i.copy());
1264        };
1265        dst.status = status == null ? null : status.copy();
1266        dst.priority = priority == null ? null : priority.copy();
1267        dst.patient = patient == null ? null : patient.copy();
1268        dst.serviced = serviced == null ? null : serviced.copy();
1269        dst.created = created == null ? null : created.copy();
1270        dst.enterer = enterer == null ? null : enterer.copy();
1271        dst.provider = provider == null ? null : provider.copy();
1272        dst.organization = organization == null ? null : organization.copy();
1273        dst.insurer = insurer == null ? null : insurer.copy();
1274        dst.facility = facility == null ? null : facility.copy();
1275        dst.coverage = coverage == null ? null : coverage.copy();
1276        dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
1277        dst.benefitCategory = benefitCategory == null ? null : benefitCategory.copy();
1278        dst.benefitSubCategory = benefitSubCategory == null ? null : benefitSubCategory.copy();
1279        return dst;
1280      }
1281
1282      protected EligibilityRequest typedCopy() {
1283        return copy();
1284      }
1285
1286      @Override
1287      public boolean equalsDeep(Base other_) {
1288        if (!super.equalsDeep(other_))
1289          return false;
1290        if (!(other_ instanceof EligibilityRequest))
1291          return false;
1292        EligibilityRequest o = (EligibilityRequest) other_;
1293        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true)
1294           && compareDeep(patient, o.patient, true) && compareDeep(serviced, o.serviced, true) && compareDeep(created, o.created, true)
1295           && compareDeep(enterer, o.enterer, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true)
1296           && compareDeep(insurer, o.insurer, true) && compareDeep(facility, o.facility, true) && compareDeep(coverage, o.coverage, true)
1297           && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(benefitCategory, o.benefitCategory, true)
1298           && compareDeep(benefitSubCategory, o.benefitSubCategory, true);
1299      }
1300
1301      @Override
1302      public boolean equalsShallow(Base other_) {
1303        if (!super.equalsShallow(other_))
1304          return false;
1305        if (!(other_ instanceof EligibilityRequest))
1306          return false;
1307        EligibilityRequest o = (EligibilityRequest) other_;
1308        return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(businessArrangement, o.businessArrangement, true)
1309          ;
1310      }
1311
1312      public boolean isEmpty() {
1313        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, priority
1314          , patient, serviced, created, enterer, provider, organization, insurer, facility
1315          , coverage, businessArrangement, benefitCategory, benefitSubCategory);
1316      }
1317
1318  @Override
1319  public ResourceType getResourceType() {
1320    return ResourceType.EligibilityRequest;
1321   }
1322
1323 /**
1324   * Search parameter: <b>identifier</b>
1325   * <p>
1326   * Description: <b>The business identifier of the Eligibility</b><br>
1327   * Type: <b>token</b><br>
1328   * Path: <b>EligibilityRequest.identifier</b><br>
1329   * </p>
1330   */
1331  @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" )
1332  public static final String SP_IDENTIFIER = "identifier";
1333 /**
1334   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1335   * <p>
1336   * Description: <b>The business identifier of the Eligibility</b><br>
1337   * Type: <b>token</b><br>
1338   * Path: <b>EligibilityRequest.identifier</b><br>
1339   * </p>
1340   */
1341  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1342
1343 /**
1344   * Search parameter: <b>provider</b>
1345   * <p>
1346   * Description: <b>The reference to the provider</b><br>
1347   * Type: <b>reference</b><br>
1348   * Path: <b>EligibilityRequest.provider</b><br>
1349   * </p>
1350   */
1351  @SearchParamDefinition(name="provider", path="EligibilityRequest.provider", description="The reference to the provider", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1352  public static final String SP_PROVIDER = "provider";
1353 /**
1354   * <b>Fluent Client</b> search parameter constant for <b>provider</b>
1355   * <p>
1356   * Description: <b>The reference to the provider</b><br>
1357   * Type: <b>reference</b><br>
1358   * Path: <b>EligibilityRequest.provider</b><br>
1359   * </p>
1360   */
1361  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER);
1362
1363/**
1364   * Constant for fluent queries to be used to add include statements. Specifies
1365   * the path value of "<b>EligibilityRequest:provider</b>".
1366   */
1367  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("EligibilityRequest:provider").toLocked();
1368
1369 /**
1370   * Search parameter: <b>patient</b>
1371   * <p>
1372   * Description: <b>The reference to the patient</b><br>
1373   * Type: <b>reference</b><br>
1374   * Path: <b>EligibilityRequest.patient</b><br>
1375   * </p>
1376   */
1377  @SearchParamDefinition(name="patient", path="EligibilityRequest.patient", description="The reference to the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
1378  public static final String SP_PATIENT = "patient";
1379 /**
1380   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1381   * <p>
1382   * Description: <b>The reference to the patient</b><br>
1383   * Type: <b>reference</b><br>
1384   * Path: <b>EligibilityRequest.patient</b><br>
1385   * </p>
1386   */
1387  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1388
1389/**
1390   * Constant for fluent queries to be used to add include statements. Specifies
1391   * the path value of "<b>EligibilityRequest:patient</b>".
1392   */
1393  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EligibilityRequest:patient").toLocked();
1394
1395 /**
1396   * Search parameter: <b>created</b>
1397   * <p>
1398   * Description: <b>The creation date for the EOB</b><br>
1399   * Type: <b>date</b><br>
1400   * Path: <b>EligibilityRequest.created</b><br>
1401   * </p>
1402   */
1403  @SearchParamDefinition(name="created", path="EligibilityRequest.created", description="The creation date for the EOB", type="date" )
1404  public static final String SP_CREATED = "created";
1405 /**
1406   * <b>Fluent Client</b> search parameter constant for <b>created</b>
1407   * <p>
1408   * Description: <b>The creation date for the EOB</b><br>
1409   * Type: <b>date</b><br>
1410   * Path: <b>EligibilityRequest.created</b><br>
1411   * </p>
1412   */
1413  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
1414
1415 /**
1416   * Search parameter: <b>organization</b>
1417   * <p>
1418   * Description: <b>The reference to the providing organization</b><br>
1419   * Type: <b>reference</b><br>
1420   * Path: <b>EligibilityRequest.organization</b><br>
1421   * </p>
1422   */
1423  @SearchParamDefinition(name="organization", path="EligibilityRequest.organization", description="The reference to the providing organization", type="reference", target={Organization.class } )
1424  public static final String SP_ORGANIZATION = "organization";
1425 /**
1426   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1427   * <p>
1428   * Description: <b>The reference to the providing organization</b><br>
1429   * Type: <b>reference</b><br>
1430   * Path: <b>EligibilityRequest.organization</b><br>
1431   * </p>
1432   */
1433  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1434
1435/**
1436   * Constant for fluent queries to be used to add include statements. Specifies
1437   * the path value of "<b>EligibilityRequest:organization</b>".
1438   */
1439  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EligibilityRequest:organization").toLocked();
1440
1441 /**
1442   * Search parameter: <b>enterer</b>
1443   * <p>
1444   * Description: <b>The party who is responsible for the request</b><br>
1445   * Type: <b>reference</b><br>
1446   * Path: <b>EligibilityRequest.enterer</b><br>
1447   * </p>
1448   */
1449  @SearchParamDefinition(name="enterer", path="EligibilityRequest.enterer", description="The party who is responsible for the request", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Practitioner.class } )
1450  public static final String SP_ENTERER = "enterer";
1451 /**
1452   * <b>Fluent Client</b> search parameter constant for <b>enterer</b>
1453   * <p>
1454   * Description: <b>The party who is responsible for the request</b><br>
1455   * Type: <b>reference</b><br>
1456   * Path: <b>EligibilityRequest.enterer</b><br>
1457   * </p>
1458   */
1459  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTERER);
1460
1461/**
1462   * Constant for fluent queries to be used to add include statements. Specifies
1463   * the path value of "<b>EligibilityRequest:enterer</b>".
1464   */
1465  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTERER = new ca.uhn.fhir.model.api.Include("EligibilityRequest:enterer").toLocked();
1466
1467 /**
1468   * Search parameter: <b>facility</b>
1469   * <p>
1470   * Description: <b>Facility responsible for the goods and services</b><br>
1471   * Type: <b>reference</b><br>
1472   * Path: <b>EligibilityRequest.facility</b><br>
1473   * </p>
1474   */
1475  @SearchParamDefinition(name="facility", path="EligibilityRequest.facility", description="Facility responsible for the goods and services", type="reference", target={Location.class } )
1476  public static final String SP_FACILITY = "facility";
1477 /**
1478   * <b>Fluent Client</b> search parameter constant for <b>facility</b>
1479   * <p>
1480   * Description: <b>Facility responsible for the goods and services</b><br>
1481   * Type: <b>reference</b><br>
1482   * Path: <b>EligibilityRequest.facility</b><br>
1483   * </p>
1484   */
1485  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITY);
1486
1487/**
1488   * Constant for fluent queries to be used to add include statements. Specifies
1489   * the path value of "<b>EligibilityRequest:facility</b>".
1490   */
1491  public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITY = new ca.uhn.fhir.model.api.Include("EligibilityRequest:facility").toLocked();
1492
1493
1494}
1495