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