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