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