001package org.hl7.fhir.instance.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.*;
034
035import org.hl7.fhir.exceptions.FHIRException;
036import org.hl7.fhir.instance.model.Enumerations.RemittanceOutcome;
037import org.hl7.fhir.instance.model.Enumerations.RemittanceOutcomeEnumFactory;
038import org.hl7.fhir.utilities.Utilities;
039
040import ca.uhn.fhir.model.api.annotation.*;
041/**
042 * This resource provides eligibility and plan details from the processing of an Eligibility resource.
043 */
044@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse")
045public class EligibilityResponse extends DomainResource {
046
047    /**
048     * The Response business identifier.
049     */
050    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
051    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
052    protected List<Identifier> identifier;
053
054    /**
055     * Original request resource reference.
056     */
057    @Child(name = "request", type = {EligibilityRequest.class}, order=1, min=0, max=1, modifier=false, summary=true)
058    @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." )
059    protected Reference request;
060
061    /**
062     * The actual object that is the target of the reference (Original request resource reference.)
063     */
064    protected EligibilityRequest requestTarget;
065
066    /**
067     * Transaction status: error, complete.
068     */
069    @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
070    @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." )
071    protected Enumeration<RemittanceOutcome> outcome;
072
073    /**
074     * A description of the status of the adjudication.
075     */
076    @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
077    @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." )
078    protected StringType disposition;
079
080    /**
081     * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.
082     */
083    @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true)
084    @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." )
085    protected Coding ruleset;
086
087    /**
088     * The style (standard) and version of the original material which was converted into this resource.
089     */
090    @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true)
091    @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
092    protected Coding originalRuleset;
093
094    /**
095     * The date when the enclosed suite of services were performed or completed.
096     */
097    @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true)
098    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
099    protected DateTimeType created;
100
101    /**
102     * The Insurer who produced this adjudicated response.
103     */
104    @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
105    @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." )
106    protected Reference organization;
107
108    /**
109     * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.)
110     */
111    protected Organization organizationTarget;
112
113    /**
114     * The practitioner who is responsible for the services rendered to the patient.
115     */
116    @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true)
117    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
118    protected Reference requestProvider;
119
120    /**
121     * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
122     */
123    protected Practitioner requestProviderTarget;
124
125    /**
126     * The organization which is responsible for the services rendered to the patient.
127     */
128    @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=true)
129    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
130    protected Reference requestOrganization;
131
132    /**
133     * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.)
134     */
135    protected Organization requestOrganizationTarget;
136
137    private static final long serialVersionUID = -299931023L;
138
139  /*
140   * Constructor
141   */
142    public EligibilityResponse() {
143      super();
144    }
145
146    /**
147     * @return {@link #identifier} (The Response business identifier.)
148     */
149    public List<Identifier> getIdentifier() { 
150      if (this.identifier == null)
151        this.identifier = new ArrayList<Identifier>();
152      return this.identifier;
153    }
154
155    public boolean hasIdentifier() { 
156      if (this.identifier == null)
157        return false;
158      for (Identifier item : this.identifier)
159        if (!item.isEmpty())
160          return true;
161      return false;
162    }
163
164    /**
165     * @return {@link #identifier} (The Response business identifier.)
166     */
167    // syntactic sugar
168    public Identifier addIdentifier() { //3
169      Identifier t = new Identifier();
170      if (this.identifier == null)
171        this.identifier = new ArrayList<Identifier>();
172      this.identifier.add(t);
173      return t;
174    }
175
176    // syntactic sugar
177    public EligibilityResponse addIdentifier(Identifier t) { //3
178      if (t == null)
179        return this;
180      if (this.identifier == null)
181        this.identifier = new ArrayList<Identifier>();
182      this.identifier.add(t);
183      return this;
184    }
185
186    /**
187     * @return {@link #request} (Original request resource reference.)
188     */
189    public Reference getRequest() { 
190      if (this.request == null)
191        if (Configuration.errorOnAutoCreate())
192          throw new Error("Attempt to auto-create EligibilityResponse.request");
193        else if (Configuration.doAutoCreate())
194          this.request = new Reference(); // cc
195      return this.request;
196    }
197
198    public boolean hasRequest() { 
199      return this.request != null && !this.request.isEmpty();
200    }
201
202    /**
203     * @param value {@link #request} (Original request resource reference.)
204     */
205    public EligibilityResponse setRequest(Reference value) { 
206      this.request = value;
207      return this;
208    }
209
210    /**
211     * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
212     */
213    public EligibilityRequest getRequestTarget() { 
214      if (this.requestTarget == null)
215        if (Configuration.errorOnAutoCreate())
216          throw new Error("Attempt to auto-create EligibilityResponse.request");
217        else if (Configuration.doAutoCreate())
218          this.requestTarget = new EligibilityRequest(); // aa
219      return this.requestTarget;
220    }
221
222    /**
223     * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.)
224     */
225    public EligibilityResponse setRequestTarget(EligibilityRequest value) { 
226      this.requestTarget = value;
227      return this;
228    }
229
230    /**
231     * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
232     */
233    public Enumeration<RemittanceOutcome> getOutcomeElement() { 
234      if (this.outcome == null)
235        if (Configuration.errorOnAutoCreate())
236          throw new Error("Attempt to auto-create EligibilityResponse.outcome");
237        else if (Configuration.doAutoCreate())
238          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
239      return this.outcome;
240    }
241
242    public boolean hasOutcomeElement() { 
243      return this.outcome != null && !this.outcome.isEmpty();
244    }
245
246    public boolean hasOutcome() { 
247      return this.outcome != null && !this.outcome.isEmpty();
248    }
249
250    /**
251     * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
252     */
253    public EligibilityResponse setOutcomeElement(Enumeration<RemittanceOutcome> value) { 
254      this.outcome = value;
255      return this;
256    }
257
258    /**
259     * @return Transaction status: error, complete.
260     */
261    public RemittanceOutcome getOutcome() { 
262      return this.outcome == null ? null : this.outcome.getValue();
263    }
264
265    /**
266     * @param value Transaction status: error, complete.
267     */
268    public EligibilityResponse setOutcome(RemittanceOutcome value) { 
269      if (value == null)
270        this.outcome = null;
271      else {
272        if (this.outcome == null)
273          this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
274        this.outcome.setValue(value);
275      }
276      return this;
277    }
278
279    /**
280     * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
281     */
282    public StringType getDispositionElement() { 
283      if (this.disposition == null)
284        if (Configuration.errorOnAutoCreate())
285          throw new Error("Attempt to auto-create EligibilityResponse.disposition");
286        else if (Configuration.doAutoCreate())
287          this.disposition = new StringType(); // bb
288      return this.disposition;
289    }
290
291    public boolean hasDispositionElement() { 
292      return this.disposition != null && !this.disposition.isEmpty();
293    }
294
295    public boolean hasDisposition() { 
296      return this.disposition != null && !this.disposition.isEmpty();
297    }
298
299    /**
300     * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value
301     */
302    public EligibilityResponse setDispositionElement(StringType value) { 
303      this.disposition = value;
304      return this;
305    }
306
307    /**
308     * @return A description of the status of the adjudication.
309     */
310    public String getDisposition() { 
311      return this.disposition == null ? null : this.disposition.getValue();
312    }
313
314    /**
315     * @param value A description of the status of the adjudication.
316     */
317    public EligibilityResponse setDisposition(String value) { 
318      if (Utilities.noString(value))
319        this.disposition = null;
320      else {
321        if (this.disposition == null)
322          this.disposition = new StringType();
323        this.disposition.setValue(value);
324      }
325      return this;
326    }
327
328    /**
329     * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
330     */
331    public Coding getRuleset() { 
332      if (this.ruleset == null)
333        if (Configuration.errorOnAutoCreate())
334          throw new Error("Attempt to auto-create EligibilityResponse.ruleset");
335        else if (Configuration.doAutoCreate())
336          this.ruleset = new Coding(); // cc
337      return this.ruleset;
338    }
339
340    public boolean hasRuleset() { 
341      return this.ruleset != null && !this.ruleset.isEmpty();
342    }
343
344    /**
345     * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
346     */
347    public EligibilityResponse setRuleset(Coding value) { 
348      this.ruleset = value;
349      return this;
350    }
351
352    /**
353     * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
354     */
355    public Coding getOriginalRuleset() { 
356      if (this.originalRuleset == null)
357        if (Configuration.errorOnAutoCreate())
358          throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset");
359        else if (Configuration.doAutoCreate())
360          this.originalRuleset = new Coding(); // cc
361      return this.originalRuleset;
362    }
363
364    public boolean hasOriginalRuleset() { 
365      return this.originalRuleset != null && !this.originalRuleset.isEmpty();
366    }
367
368    /**
369     * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
370     */
371    public EligibilityResponse setOriginalRuleset(Coding value) { 
372      this.originalRuleset = value;
373      return this;
374    }
375
376    /**
377     * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
378     */
379    public DateTimeType getCreatedElement() { 
380      if (this.created == null)
381        if (Configuration.errorOnAutoCreate())
382          throw new Error("Attempt to auto-create EligibilityResponse.created");
383        else if (Configuration.doAutoCreate())
384          this.created = new DateTimeType(); // bb
385      return this.created;
386    }
387
388    public boolean hasCreatedElement() { 
389      return this.created != null && !this.created.isEmpty();
390    }
391
392    public boolean hasCreated() { 
393      return this.created != null && !this.created.isEmpty();
394    }
395
396    /**
397     * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
398     */
399    public EligibilityResponse setCreatedElement(DateTimeType value) { 
400      this.created = value;
401      return this;
402    }
403
404    /**
405     * @return The date when the enclosed suite of services were performed or completed.
406     */
407    public Date getCreated() { 
408      return this.created == null ? null : this.created.getValue();
409    }
410
411    /**
412     * @param value The date when the enclosed suite of services were performed or completed.
413     */
414    public EligibilityResponse setCreated(Date value) { 
415      if (value == null)
416        this.created = null;
417      else {
418        if (this.created == null)
419          this.created = new DateTimeType();
420        this.created.setValue(value);
421      }
422      return this;
423    }
424
425    /**
426     * @return {@link #organization} (The Insurer who produced this adjudicated response.)
427     */
428    public Reference getOrganization() { 
429      if (this.organization == null)
430        if (Configuration.errorOnAutoCreate())
431          throw new Error("Attempt to auto-create EligibilityResponse.organization");
432        else if (Configuration.doAutoCreate())
433          this.organization = new Reference(); // cc
434      return this.organization;
435    }
436
437    public boolean hasOrganization() { 
438      return this.organization != null && !this.organization.isEmpty();
439    }
440
441    /**
442     * @param value {@link #organization} (The Insurer who produced this adjudicated response.)
443     */
444    public EligibilityResponse setOrganization(Reference value) { 
445      this.organization = value;
446      return this;
447    }
448
449    /**
450     * @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 Insurer who produced this adjudicated response.)
451     */
452    public Organization getOrganizationTarget() { 
453      if (this.organizationTarget == null)
454        if (Configuration.errorOnAutoCreate())
455          throw new Error("Attempt to auto-create EligibilityResponse.organization");
456        else if (Configuration.doAutoCreate())
457          this.organizationTarget = new Organization(); // aa
458      return this.organizationTarget;
459    }
460
461    /**
462     * @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 Insurer who produced this adjudicated response.)
463     */
464    public EligibilityResponse setOrganizationTarget(Organization value) { 
465      this.organizationTarget = value;
466      return this;
467    }
468
469    /**
470     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
471     */
472    public Reference getRequestProvider() { 
473      if (this.requestProvider == null)
474        if (Configuration.errorOnAutoCreate())
475          throw new Error("Attempt to auto-create EligibilityResponse.requestProvider");
476        else if (Configuration.doAutoCreate())
477          this.requestProvider = new Reference(); // cc
478      return this.requestProvider;
479    }
480
481    public boolean hasRequestProvider() { 
482      return this.requestProvider != null && !this.requestProvider.isEmpty();
483    }
484
485    /**
486     * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
487     */
488    public EligibilityResponse setRequestProvider(Reference value) { 
489      this.requestProvider = value;
490      return this;
491    }
492
493    /**
494     * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
495     */
496    public Practitioner getRequestProviderTarget() { 
497      if (this.requestProviderTarget == null)
498        if (Configuration.errorOnAutoCreate())
499          throw new Error("Attempt to auto-create EligibilityResponse.requestProvider");
500        else if (Configuration.doAutoCreate())
501          this.requestProviderTarget = new Practitioner(); // aa
502      return this.requestProviderTarget;
503    }
504
505    /**
506     * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.)
507     */
508    public EligibilityResponse setRequestProviderTarget(Practitioner value) { 
509      this.requestProviderTarget = value;
510      return this;
511    }
512
513    /**
514     * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
515     */
516    public Reference getRequestOrganization() { 
517      if (this.requestOrganization == null)
518        if (Configuration.errorOnAutoCreate())
519          throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization");
520        else if (Configuration.doAutoCreate())
521          this.requestOrganization = new Reference(); // cc
522      return this.requestOrganization;
523    }
524
525    public boolean hasRequestOrganization() { 
526      return this.requestOrganization != null && !this.requestOrganization.isEmpty();
527    }
528
529    /**
530     * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.)
531     */
532    public EligibilityResponse setRequestOrganization(Reference value) { 
533      this.requestOrganization = value;
534      return this;
535    }
536
537    /**
538     * @return {@link #requestOrganization} 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.)
539     */
540    public Organization getRequestOrganizationTarget() { 
541      if (this.requestOrganizationTarget == null)
542        if (Configuration.errorOnAutoCreate())
543          throw new Error("Attempt to auto-create EligibilityResponse.requestOrganization");
544        else if (Configuration.doAutoCreate())
545          this.requestOrganizationTarget = new Organization(); // aa
546      return this.requestOrganizationTarget;
547    }
548
549    /**
550     * @param value {@link #requestOrganization} 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.)
551     */
552    public EligibilityResponse setRequestOrganizationTarget(Organization value) { 
553      this.requestOrganizationTarget = value;
554      return this;
555    }
556
557      protected void listChildren(List<Property> childrenList) {
558        super.listChildren(childrenList);
559        childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
560        childrenList.add(new Property("request", "Reference(EligibilityRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request));
561        childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome));
562        childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition));
563        childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
564        childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
565        childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
566        childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization));
567        childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider));
568        childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization));
569      }
570
571      @Override
572      public void setProperty(String name, Base value) throws FHIRException {
573        if (name.equals("identifier"))
574          this.getIdentifier().add(castToIdentifier(value));
575        else if (name.equals("request"))
576          this.request = castToReference(value); // Reference
577        else if (name.equals("outcome"))
578          this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration<RemittanceOutcome>
579        else if (name.equals("disposition"))
580          this.disposition = castToString(value); // StringType
581        else if (name.equals("ruleset"))
582          this.ruleset = castToCoding(value); // Coding
583        else if (name.equals("originalRuleset"))
584          this.originalRuleset = castToCoding(value); // Coding
585        else if (name.equals("created"))
586          this.created = castToDateTime(value); // DateTimeType
587        else if (name.equals("organization"))
588          this.organization = castToReference(value); // Reference
589        else if (name.equals("requestProvider"))
590          this.requestProvider = castToReference(value); // Reference
591        else if (name.equals("requestOrganization"))
592          this.requestOrganization = castToReference(value); // Reference
593        else
594          super.setProperty(name, value);
595      }
596
597      @Override
598      public Base addChild(String name) throws FHIRException {
599        if (name.equals("identifier")) {
600          return addIdentifier();
601        }
602        else if (name.equals("request")) {
603          this.request = new Reference();
604          return this.request;
605        }
606        else if (name.equals("outcome")) {
607          throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.outcome");
608        }
609        else if (name.equals("disposition")) {
610          throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.disposition");
611        }
612        else if (name.equals("ruleset")) {
613          this.ruleset = new Coding();
614          return this.ruleset;
615        }
616        else if (name.equals("originalRuleset")) {
617          this.originalRuleset = new Coding();
618          return this.originalRuleset;
619        }
620        else if (name.equals("created")) {
621          throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.created");
622        }
623        else if (name.equals("organization")) {
624          this.organization = new Reference();
625          return this.organization;
626        }
627        else if (name.equals("requestProvider")) {
628          this.requestProvider = new Reference();
629          return this.requestProvider;
630        }
631        else if (name.equals("requestOrganization")) {
632          this.requestOrganization = new Reference();
633          return this.requestOrganization;
634        }
635        else
636          return super.addChild(name);
637      }
638
639  public String fhirType() {
640    return "EligibilityResponse";
641
642  }
643
644      public EligibilityResponse copy() {
645        EligibilityResponse dst = new EligibilityResponse();
646        copyValues(dst);
647        if (identifier != null) {
648          dst.identifier = new ArrayList<Identifier>();
649          for (Identifier i : identifier)
650            dst.identifier.add(i.copy());
651        };
652        dst.request = request == null ? null : request.copy();
653        dst.outcome = outcome == null ? null : outcome.copy();
654        dst.disposition = disposition == null ? null : disposition.copy();
655        dst.ruleset = ruleset == null ? null : ruleset.copy();
656        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
657        dst.created = created == null ? null : created.copy();
658        dst.organization = organization == null ? null : organization.copy();
659        dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
660        dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy();
661        return dst;
662      }
663
664      protected EligibilityResponse typedCopy() {
665        return copy();
666      }
667
668      @Override
669      public boolean equalsDeep(Base other) {
670        if (!super.equalsDeep(other))
671          return false;
672        if (!(other instanceof EligibilityResponse))
673          return false;
674        EligibilityResponse o = (EligibilityResponse) other;
675        return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true)
676           && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true)
677           && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true)
678           && compareDeep(requestOrganization, o.requestOrganization, true);
679      }
680
681      @Override
682      public boolean equalsShallow(Base other) {
683        if (!super.equalsShallow(other))
684          return false;
685        if (!(other instanceof EligibilityResponse))
686          return false;
687        EligibilityResponse o = (EligibilityResponse) other;
688        return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true)
689          ;
690      }
691
692      public boolean isEmpty() {
693        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty())
694           && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty())
695           && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty())
696           && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty())
697           && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty())
698          ;
699      }
700
701  @Override
702  public ResourceType getResourceType() {
703    return ResourceType.EligibilityResponse;
704   }
705
706  @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" )
707  public static final String SP_IDENTIFIER = "identifier";
708
709}
710