001package org.hl7.fhir.r5.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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.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    public enum EnrollmentOutcome {
057        /**
058         * The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.
059         */
060        QUEUED, 
061        /**
062         * The processing has completed without errors
063         */
064        COMPLETE, 
065        /**
066         * One or more errors have been detected in the Claim
067         */
068        ERROR, 
069        /**
070         * No errors have been detected in the Claim and some of the adjudication has been performed.
071         */
072        PARTIAL, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static EnrollmentOutcome fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("queued".equals(codeString))
081          return QUEUED;
082        if ("complete".equals(codeString))
083          return COMPLETE;
084        if ("error".equals(codeString))
085          return ERROR;
086        if ("partial".equals(codeString))
087          return PARTIAL;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown EnrollmentOutcome code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case QUEUED: return "queued";
096            case COMPLETE: return "complete";
097            case ERROR: return "error";
098            case PARTIAL: return "partial";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case QUEUED: return "http://hl7.org/fhir/enrollment-outcome";
106            case COMPLETE: return "http://hl7.org/fhir/enrollment-outcome";
107            case ERROR: return "http://hl7.org/fhir/enrollment-outcome";
108            case PARTIAL: return "http://hl7.org/fhir/enrollment-outcome";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case QUEUED: return "The Claim/Pre-authorization/Pre-determination has been received but processing has not begun.";
116            case COMPLETE: return "The processing has completed without errors";
117            case ERROR: return "One or more errors have been detected in the Claim";
118            case PARTIAL: return "No errors have been detected in the Claim and some of the adjudication has been performed.";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getDisplay() {
124          switch (this) {
125            case QUEUED: return "Queued";
126            case COMPLETE: return "Processing Complete";
127            case ERROR: return "Error";
128            case PARTIAL: return "Partial Processing";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133    }
134
135  public static class EnrollmentOutcomeEnumFactory implements EnumFactory<EnrollmentOutcome> {
136    public EnrollmentOutcome fromCode(String codeString) throws IllegalArgumentException {
137      if (codeString == null || "".equals(codeString))
138            if (codeString == null || "".equals(codeString))
139                return null;
140        if ("queued".equals(codeString))
141          return EnrollmentOutcome.QUEUED;
142        if ("complete".equals(codeString))
143          return EnrollmentOutcome.COMPLETE;
144        if ("error".equals(codeString))
145          return EnrollmentOutcome.ERROR;
146        if ("partial".equals(codeString))
147          return EnrollmentOutcome.PARTIAL;
148        throw new IllegalArgumentException("Unknown EnrollmentOutcome code '"+codeString+"'");
149        }
150        public Enumeration<EnrollmentOutcome> fromType(PrimitiveType<?> code) throws FHIRException {
151          if (code == null)
152            return null;
153          if (code.isEmpty())
154            return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.NULL, code);
155          String codeString = ((PrimitiveType) code).asStringValue();
156          if (codeString == null || "".equals(codeString))
157            return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.NULL, code);
158        if ("queued".equals(codeString))
159          return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.QUEUED, code);
160        if ("complete".equals(codeString))
161          return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.COMPLETE, code);
162        if ("error".equals(codeString))
163          return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.ERROR, code);
164        if ("partial".equals(codeString))
165          return new Enumeration<EnrollmentOutcome>(this, EnrollmentOutcome.PARTIAL, code);
166        throw new FHIRException("Unknown EnrollmentOutcome code '"+codeString+"'");
167        }
168    public String toCode(EnrollmentOutcome code) {
169      if (code == EnrollmentOutcome.QUEUED)
170        return "queued";
171      if (code == EnrollmentOutcome.COMPLETE)
172        return "complete";
173      if (code == EnrollmentOutcome.ERROR)
174        return "error";
175      if (code == EnrollmentOutcome.PARTIAL)
176        return "partial";
177      return "?";
178      }
179    public String toSystem(EnrollmentOutcome code) {
180      return code.getSystem();
181      }
182    }
183
184    /**
185     * The Response business identifier.
186     */
187    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
188    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
189    protected List<Identifier> identifier;
190
191    /**
192     * The status of the resource instance.
193     */
194    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
195    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
196    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
197    protected Enumeration<FinancialResourceStatusCodes> status;
198
199    /**
200     * Original request resource reference.
201     */
202    @Child(name = "request", type = {EnrollmentRequest.class}, order=2, min=0, max=1, modifier=false, summary=false)
203    @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." )
204    protected Reference request;
205
206    /**
207     * Processing status: error, complete.
208     */
209    @Child(name = "outcome", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
210    @Description(shortDefinition="queued | complete | error | partial", formalDefinition="Processing status: error, complete." )
211    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/enrollment-outcome")
212    protected Enumeration<EnrollmentOutcome> outcome;
213
214    /**
215     * A description of the status of the adjudication.
216     */
217    @Child(name = "disposition", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
218    @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." )
219    protected StringType disposition;
220
221    /**
222     * The date when the enclosed suite of services were performed or completed.
223     */
224    @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
225    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
226    protected DateTimeType created;
227
228    /**
229     * The Insurer who produced this adjudicated response.
230     */
231    @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false)
232    @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." )
233    protected Reference organization;
234
235    /**
236     * The practitioner who is responsible for the services rendered to the patient.
237     */
238    @Child(name = "requestProvider", type = {Practitioner.class, PractitionerRole.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=false)
239    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
240    protected Reference requestProvider;
241
242    private static final long serialVersionUID = -1503790623L;
243
244  /**
245   * Constructor
246   */
247    public EnrollmentResponse() {
248      super();
249    }
250
251    /**
252     * @return {@link #identifier} (The Response business identifier.)
253     */
254    public List<Identifier> getIdentifier() { 
255      if (this.identifier == null)
256        this.identifier = new ArrayList<Identifier>();
257      return this.identifier;
258    }
259
260    /**
261     * @return Returns a reference to <code>this</code> for easy method chaining
262     */
263    public EnrollmentResponse setIdentifier(List<Identifier> theIdentifier) { 
264      this.identifier = theIdentifier;
265      return this;
266    }
267
268    public boolean hasIdentifier() { 
269      if (this.identifier == null)
270        return false;
271      for (Identifier item : this.identifier)
272        if (!item.isEmpty())
273          return true;
274      return false;
275    }
276
277    public Identifier addIdentifier() { //3
278      Identifier t = new Identifier();
279      if (this.identifier == null)
280        this.identifier = new ArrayList<Identifier>();
281      this.identifier.add(t);
282      return t;
283    }
284
285    public EnrollmentResponse addIdentifier(Identifier t) { //3
286      if (t == null)
287        return this;
288      if (this.identifier == null)
289        this.identifier = new ArrayList<Identifier>();
290      this.identifier.add(t);
291      return this;
292    }
293
294    /**
295     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
296     */
297    public Identifier getIdentifierFirstRep() { 
298      if (getIdentifier().isEmpty()) {
299        addIdentifier();
300      }
301      return getIdentifier().get(0);
302    }
303
304    /**
305     * @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
306     */
307    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
308      if (this.status == null)
309        if (Configuration.errorOnAutoCreate())
310          throw new Error("Attempt to auto-create EnrollmentResponse.status");
311        else if (Configuration.doAutoCreate())
312          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
313      return this.status;
314    }
315
316    public boolean hasStatusElement() { 
317      return this.status != null && !this.status.isEmpty();
318    }
319
320    public boolean hasStatus() { 
321      return this.status != null && !this.status.isEmpty();
322    }
323
324    /**
325     * @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
326     */
327    public EnrollmentResponse setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
328      this.status = value;
329      return this;
330    }
331
332    /**
333     * @return The status of the resource instance.
334     */
335    public FinancialResourceStatusCodes getStatus() { 
336      return this.status == null ? null : this.status.getValue();
337    }
338
339    /**
340     * @param value The status of the resource instance.
341     */
342    public EnrollmentResponse setStatus(FinancialResourceStatusCodes value) { 
343      if (value == null)
344        this.status = null;
345      else {
346        if (this.status == null)
347          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
348        this.status.setValue(value);
349      }
350      return this;
351    }
352
353    /**
354     * @return {@link #request} (Original request resource reference.)
355     */
356    public Reference getRequest() { 
357      if (this.request == null)
358        if (Configuration.errorOnAutoCreate())
359          throw new Error("Attempt to auto-create EnrollmentResponse.request");
360        else if (Configuration.doAutoCreate())
361          this.request = new Reference(); // cc
362      return this.request;
363    }
364
365    public boolean hasRequest() { 
366      return this.request != null && !this.request.isEmpty();
367    }
368
369    /**
370     * @param value {@link #request} (Original request resource reference.)
371     */
372    public EnrollmentResponse setRequest(Reference value) { 
373      this.request = value;
374      return this;
375    }
376
377    /**
378     * @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
379     */
380    public Enumeration<EnrollmentOutcome> getOutcomeElement() { 
381      if (this.outcome == null)
382        if (Configuration.errorOnAutoCreate())
383          throw new Error("Attempt to auto-create EnrollmentResponse.outcome");
384        else if (Configuration.doAutoCreate())
385          this.outcome = new Enumeration<EnrollmentOutcome>(new EnrollmentOutcomeEnumFactory()); // bb
386      return this.outcome;
387    }
388
389    public boolean hasOutcomeElement() { 
390      return this.outcome != null && !this.outcome.isEmpty();
391    }
392
393    public boolean hasOutcome() { 
394      return this.outcome != null && !this.outcome.isEmpty();
395    }
396
397    /**
398     * @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
399     */
400    public EnrollmentResponse setOutcomeElement(Enumeration<EnrollmentOutcome> value) { 
401      this.outcome = value;
402      return this;
403    }
404
405    /**
406     * @return Processing status: error, complete.
407     */
408    public EnrollmentOutcome getOutcome() { 
409      return this.outcome == null ? null : this.outcome.getValue();
410    }
411
412    /**
413     * @param value Processing status: error, complete.
414     */
415    public EnrollmentResponse setOutcome(EnrollmentOutcome value) { 
416      if (value == null)
417        this.outcome = null;
418      else {
419        if (this.outcome == null)
420          this.outcome = new Enumeration<EnrollmentOutcome>(new EnrollmentOutcomeEnumFactory());
421        this.outcome.setValue(value);
422      }
423      return this;
424    }
425
426    /**
427     * @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
428     */
429    public StringType getDispositionElement() { 
430      if (this.disposition == null)
431        if (Configuration.errorOnAutoCreate())
432          throw new Error("Attempt to auto-create EnrollmentResponse.disposition");
433        else if (Configuration.doAutoCreate())
434          this.disposition = new StringType(); // bb
435      return this.disposition;
436    }
437
438    public boolean hasDispositionElement() { 
439      return this.disposition != null && !this.disposition.isEmpty();
440    }
441
442    public boolean hasDisposition() { 
443      return this.disposition != null && !this.disposition.isEmpty();
444    }
445
446    /**
447     * @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
448     */
449    public EnrollmentResponse setDispositionElement(StringType value) { 
450      this.disposition = value;
451      return this;
452    }
453
454    /**
455     * @return A description of the status of the adjudication.
456     */
457    public String getDisposition() { 
458      return this.disposition == null ? null : this.disposition.getValue();
459    }
460
461    /**
462     * @param value A description of the status of the adjudication.
463     */
464    public EnrollmentResponse setDisposition(String value) { 
465      if (Utilities.noString(value))
466        this.disposition = null;
467      else {
468        if (this.disposition == null)
469          this.disposition = new StringType();
470        this.disposition.setValue(value);
471      }
472      return this;
473    }
474
475    /**
476     * @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
477     */
478    public DateTimeType getCreatedElement() { 
479      if (this.created == null)
480        if (Configuration.errorOnAutoCreate())
481          throw new Error("Attempt to auto-create EnrollmentResponse.created");
482        else if (Configuration.doAutoCreate())
483          this.created = new DateTimeType(); // bb
484      return this.created;
485    }
486
487    public boolean hasCreatedElement() { 
488      return this.created != null && !this.created.isEmpty();
489    }
490
491    public boolean hasCreated() { 
492      return this.created != null && !this.created.isEmpty();
493    }
494
495    /**
496     * @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
497     */
498    public EnrollmentResponse setCreatedElement(DateTimeType value) { 
499      this.created = value;
500      return this;
501    }
502
503    /**
504     * @return The date when the enclosed suite of services were performed or completed.
505     */
506    public Date getCreated() { 
507      return this.created == null ? null : this.created.getValue();
508    }
509
510    /**
511     * @param value The date when the enclosed suite of services were performed or completed.
512     */
513    public EnrollmentResponse setCreated(Date value) { 
514      if (value == null)
515        this.created = null;
516      else {
517        if (this.created == null)
518          this.created = new DateTimeType();
519        this.created.setValue(value);
520      }
521      return this;
522    }
523
524    /**
525     * @return {@link #organization} (The Insurer who produced this adjudicated response.)
526     */
527    public Reference getOrganization() { 
528      if (this.organization == null)
529        if (Configuration.errorOnAutoCreate())
530          throw new Error("Attempt to auto-create EnrollmentResponse.organization");
531        else if (Configuration.doAutoCreate())
532          this.organization = new Reference(); // cc
533      return this.organization;
534    }
535
536    public boolean hasOrganization() { 
537      return this.organization != null && !this.organization.isEmpty();
538    }
539
540    /**
541     * @param value {@link #organization} (The Insurer who produced this adjudicated response.)
542     */
543    public EnrollmentResponse setOrganization(Reference value) { 
544      this.organization = value;
545      return this;
546    }
547
548    /**
549     * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
550     */
551    public Reference getRequestProvider() { 
552      if (this.requestProvider == null)
553        if (Configuration.errorOnAutoCreate())
554          throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider");
555        else if (Configuration.doAutoCreate())
556          this.requestProvider = new Reference(); // cc
557      return this.requestProvider;
558    }
559
560    public boolean hasRequestProvider() { 
561      return this.requestProvider != null && !this.requestProvider.isEmpty();
562    }
563
564    /**
565     * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.)
566     */
567    public EnrollmentResponse setRequestProvider(Reference value) { 
568      this.requestProvider = value;
569      return this;
570    }
571
572      protected void listChildren(List<Property> children) {
573        super.listChildren(children);
574        children.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
575        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
576        children.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, 1, request));
577        children.add(new Property("outcome", "code", "Processing status: error, complete.", 0, 1, outcome));
578        children.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition));
579        children.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created));
580        children.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, organization));
581        children.add(new Property("requestProvider", "Reference(Practitioner|PractitionerRole|Organization)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider));
582      }
583
584      @Override
585      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
586        switch (_hash) {
587        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier);
588        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
589        case 1095692943: /*request*/  return new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, 1, request);
590        case -1106507950: /*outcome*/  return new Property("outcome", "code", "Processing status: error, complete.", 0, 1, outcome);
591        case 583380919: /*disposition*/  return new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition);
592        case 1028554472: /*created*/  return new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, 1, created);
593        case 1178922291: /*organization*/  return new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, 1, organization);
594        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);
595        default: return super.getNamedProperty(_hash, _name, _checkValid);
596        }
597
598      }
599
600      @Override
601      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
602        switch (hash) {
603        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
604        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
605        case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
606        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<EnrollmentOutcome>
607        case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
608        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
609        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference
610        case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference
611        default: return super.getProperty(hash, name, checkValid);
612        }
613
614      }
615
616      @Override
617      public Base setProperty(int hash, String name, Base value) throws FHIRException {
618        switch (hash) {
619        case -1618432855: // identifier
620          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
621          return value;
622        case -892481550: // status
623          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
624          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
625          return value;
626        case 1095692943: // request
627          this.request = TypeConvertor.castToReference(value); // Reference
628          return value;
629        case -1106507950: // outcome
630          value = new EnrollmentOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
631          this.outcome = (Enumeration) value; // Enumeration<EnrollmentOutcome>
632          return value;
633        case 583380919: // disposition
634          this.disposition = TypeConvertor.castToString(value); // StringType
635          return value;
636        case 1028554472: // created
637          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
638          return value;
639        case 1178922291: // organization
640          this.organization = TypeConvertor.castToReference(value); // Reference
641          return value;
642        case 1601527200: // requestProvider
643          this.requestProvider = TypeConvertor.castToReference(value); // Reference
644          return value;
645        default: return super.setProperty(hash, name, value);
646        }
647
648      }
649
650      @Override
651      public Base setProperty(String name, Base value) throws FHIRException {
652        if (name.equals("identifier")) {
653          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
654        } else if (name.equals("status")) {
655          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
656          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
657        } else if (name.equals("request")) {
658          this.request = TypeConvertor.castToReference(value); // Reference
659        } else if (name.equals("outcome")) {
660          value = new EnrollmentOutcomeEnumFactory().fromType(TypeConvertor.castToCode(value));
661          this.outcome = (Enumeration) value; // Enumeration<EnrollmentOutcome>
662        } else if (name.equals("disposition")) {
663          this.disposition = TypeConvertor.castToString(value); // StringType
664        } else if (name.equals("created")) {
665          this.created = TypeConvertor.castToDateTime(value); // DateTimeType
666        } else if (name.equals("organization")) {
667          this.organization = TypeConvertor.castToReference(value); // Reference
668        } else if (name.equals("requestProvider")) {
669          this.requestProvider = TypeConvertor.castToReference(value); // Reference
670        } else
671          return super.setProperty(name, value);
672        return value;
673      }
674
675      @Override
676      public Base makeProperty(int hash, String name) throws FHIRException {
677        switch (hash) {
678        case -1618432855:  return addIdentifier(); 
679        case -892481550:  return getStatusElement();
680        case 1095692943:  return getRequest();
681        case -1106507950:  return getOutcomeElement();
682        case 583380919:  return getDispositionElement();
683        case 1028554472:  return getCreatedElement();
684        case 1178922291:  return getOrganization();
685        case 1601527200:  return getRequestProvider();
686        default: return super.makeProperty(hash, name);
687        }
688
689      }
690
691      @Override
692      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
693        switch (hash) {
694        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
695        case -892481550: /*status*/ return new String[] {"code"};
696        case 1095692943: /*request*/ return new String[] {"Reference"};
697        case -1106507950: /*outcome*/ return new String[] {"code"};
698        case 583380919: /*disposition*/ return new String[] {"string"};
699        case 1028554472: /*created*/ return new String[] {"dateTime"};
700        case 1178922291: /*organization*/ return new String[] {"Reference"};
701        case 1601527200: /*requestProvider*/ return new String[] {"Reference"};
702        default: return super.getTypesForProperty(hash, name);
703        }
704
705      }
706
707      @Override
708      public Base addChild(String name) throws FHIRException {
709        if (name.equals("identifier")) {
710          return addIdentifier();
711        }
712        else if (name.equals("status")) {
713          throw new FHIRException("Cannot call addChild on a singleton property EnrollmentResponse.status");
714        }
715        else if (name.equals("request")) {
716          this.request = new Reference();
717          return this.request;
718        }
719        else if (name.equals("outcome")) {
720          throw new FHIRException("Cannot call addChild on a singleton property EnrollmentResponse.outcome");
721        }
722        else if (name.equals("disposition")) {
723          throw new FHIRException("Cannot call addChild on a singleton property EnrollmentResponse.disposition");
724        }
725        else if (name.equals("created")) {
726          throw new FHIRException("Cannot call addChild on a singleton property EnrollmentResponse.created");
727        }
728        else if (name.equals("organization")) {
729          this.organization = new Reference();
730          return this.organization;
731        }
732        else if (name.equals("requestProvider")) {
733          this.requestProvider = new Reference();
734          return this.requestProvider;
735        }
736        else
737          return super.addChild(name);
738      }
739
740  public String fhirType() {
741    return "EnrollmentResponse";
742
743  }
744
745      public EnrollmentResponse copy() {
746        EnrollmentResponse dst = new EnrollmentResponse();
747        copyValues(dst);
748        return dst;
749      }
750
751      public void copyValues(EnrollmentResponse dst) {
752        super.copyValues(dst);
753        if (identifier != null) {
754          dst.identifier = new ArrayList<Identifier>();
755          for (Identifier i : identifier)
756            dst.identifier.add(i.copy());
757        };
758        dst.status = status == null ? null : status.copy();
759        dst.request = request == null ? null : request.copy();
760        dst.outcome = outcome == null ? null : outcome.copy();
761        dst.disposition = disposition == null ? null : disposition.copy();
762        dst.created = created == null ? null : created.copy();
763        dst.organization = organization == null ? null : organization.copy();
764        dst.requestProvider = requestProvider == null ? null : requestProvider.copy();
765      }
766
767      protected EnrollmentResponse typedCopy() {
768        return copy();
769      }
770
771      @Override
772      public boolean equalsDeep(Base other_) {
773        if (!super.equalsDeep(other_))
774          return false;
775        if (!(other_ instanceof EnrollmentResponse))
776          return false;
777        EnrollmentResponse o = (EnrollmentResponse) other_;
778        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(request, o.request, true)
779           && compareDeep(outcome, o.outcome, true) && compareDeep(disposition, o.disposition, true) && compareDeep(created, o.created, true)
780           && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true)
781          ;
782      }
783
784      @Override
785      public boolean equalsShallow(Base other_) {
786        if (!super.equalsShallow(other_))
787          return false;
788        if (!(other_ instanceof EnrollmentResponse))
789          return false;
790        EnrollmentResponse o = (EnrollmentResponse) other_;
791        return compareValues(status, o.status, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true)
792           && compareValues(created, o.created, true);
793      }
794
795      public boolean isEmpty() {
796        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, request
797          , outcome, disposition, created, organization, requestProvider);
798      }
799
800  @Override
801  public ResourceType getResourceType() {
802    return ResourceType.EnrollmentResponse;
803   }
804
805 /**
806   * Search parameter: <b>identifier</b>
807   * <p>
808   * Description: <b>The business identifier of the EnrollmentResponse</b><br>
809   * Type: <b>token</b><br>
810   * Path: <b>EnrollmentResponse.identifier</b><br>
811   * </p>
812   */
813  @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the EnrollmentResponse", type="token" )
814  public static final String SP_IDENTIFIER = "identifier";
815 /**
816   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
817   * <p>
818   * Description: <b>The business identifier of the EnrollmentResponse</b><br>
819   * Type: <b>token</b><br>
820   * Path: <b>EnrollmentResponse.identifier</b><br>
821   * </p>
822   */
823  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
824
825 /**
826   * Search parameter: <b>request</b>
827   * <p>
828   * Description: <b>The reference to the claim</b><br>
829   * Type: <b>reference</b><br>
830   * Path: <b>EnrollmentResponse.request</b><br>
831   * </p>
832   */
833  @SearchParamDefinition(name="request", path="EnrollmentResponse.request", description="The reference to the claim", type="reference", target={EnrollmentRequest.class } )
834  public static final String SP_REQUEST = "request";
835 /**
836   * <b>Fluent Client</b> search parameter constant for <b>request</b>
837   * <p>
838   * Description: <b>The reference to the claim</b><br>
839   * Type: <b>reference</b><br>
840   * Path: <b>EnrollmentResponse.request</b><br>
841   * </p>
842   */
843  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
844
845/**
846   * Constant for fluent queries to be used to add include statements. Specifies
847   * the path value of "<b>EnrollmentResponse:request</b>".
848   */
849  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("EnrollmentResponse:request").toLocked();
850
851 /**
852   * Search parameter: <b>status</b>
853   * <p>
854   * Description: <b>The status of the enrollment response</b><br>
855   * Type: <b>token</b><br>
856   * Path: <b>EnrollmentResponse.status</b><br>
857   * </p>
858   */
859  @SearchParamDefinition(name="status", path="EnrollmentResponse.status", description="The status of the enrollment response", type="token" )
860  public static final String SP_STATUS = "status";
861 /**
862   * <b>Fluent Client</b> search parameter constant for <b>status</b>
863   * <p>
864   * Description: <b>The status of the enrollment response</b><br>
865   * Type: <b>token</b><br>
866   * Path: <b>EnrollmentResponse.status</b><br>
867   * </p>
868   */
869  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
870
871
872}
873