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