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