001package org.hl7.fhir.instance.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 Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
033import java.util.*;
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037import ca.uhn.fhir.model.api.annotation.*;
038/**
039 * This resource provides the insurance enrollment details to the insurer regarding a specified coverage.
040 */
041@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest")
042public class EnrollmentRequest extends DomainResource {
043
044    /**
045     * The Response business identifier.
046     */
047    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
048    @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." )
049    protected List<Identifier> identifier;
050
051    /**
052     * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.
053     */
054    @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true)
055    @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." )
056    protected Coding ruleset;
057
058    /**
059     * The style (standard) and version of the original material which was converted into this resource.
060     */
061    @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
062    @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
063    protected Coding originalRuleset;
064
065    /**
066     * The date when this resource was created.
067     */
068    @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
069    @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." )
070    protected DateTimeType created;
071
072    /**
073     * The Insurer who is target  of the request.
074     */
075    @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=true)
076    @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target  of the request." )
077    protected Reference target;
078
079    /**
080     * The actual object that is the target of the reference (The Insurer who is target  of the request.)
081     */
082    protected Organization targetTarget;
083
084    /**
085     * The practitioner who is responsible for the services rendered to the patient.
086     */
087    @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true)
088    @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
089    protected Reference provider;
090
091    /**
092     * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.)
093     */
094    protected Practitioner providerTarget;
095
096    /**
097     * The organization which is responsible for the services rendered to the patient.
098     */
099    @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
100    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." )
101    protected Reference organization;
102
103    /**
104     * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.)
105     */
106    protected Organization organizationTarget;
107
108    /**
109     * Patient Resource.
110     */
111    @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true)
112    @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." )
113    protected Reference subject;
114
115    /**
116     * The actual object that is the target of the reference (Patient Resource.)
117     */
118    protected Patient subjectTarget;
119
120    /**
121     * Reference to the program or plan identification, underwriter or payor.
122     */
123    @Child(name = "coverage", type = {Coverage.class}, order=8, min=1, max=1, modifier=false, summary=true)
124    @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." )
125    protected Reference coverage;
126
127    /**
128     * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.)
129     */
130    protected Coverage coverageTarget;
131
132    /**
133     * The relationship of the patient to the subscriber.
134     */
135    @Child(name = "relationship", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true)
136    @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." )
137    protected Coding relationship;
138
139    private static final long serialVersionUID = -1656505325L;
140
141  /*
142   * Constructor
143   */
144    public EnrollmentRequest() {
145      super();
146    }
147
148  /*
149   * Constructor
150   */
151    public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) {
152      super();
153      this.subject = subject;
154      this.coverage = coverage;
155      this.relationship = relationship;
156    }
157
158    /**
159     * @return {@link #identifier} (The Response business identifier.)
160     */
161    public List<Identifier> getIdentifier() { 
162      if (this.identifier == null)
163        this.identifier = new ArrayList<Identifier>();
164      return this.identifier;
165    }
166
167    public boolean hasIdentifier() { 
168      if (this.identifier == null)
169        return false;
170      for (Identifier item : this.identifier)
171        if (!item.isEmpty())
172          return true;
173      return false;
174    }
175
176    /**
177     * @return {@link #identifier} (The Response business identifier.)
178     */
179    // syntactic sugar
180    public Identifier addIdentifier() { //3
181      Identifier t = new Identifier();
182      if (this.identifier == null)
183        this.identifier = new ArrayList<Identifier>();
184      this.identifier.add(t);
185      return t;
186    }
187
188    // syntactic sugar
189    public EnrollmentRequest addIdentifier(Identifier t) { //3
190      if (t == null)
191        return this;
192      if (this.identifier == null)
193        this.identifier = new ArrayList<Identifier>();
194      this.identifier.add(t);
195      return this;
196    }
197
198    /**
199     * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
200     */
201    public Coding getRuleset() { 
202      if (this.ruleset == null)
203        if (Configuration.errorOnAutoCreate())
204          throw new Error("Attempt to auto-create EnrollmentRequest.ruleset");
205        else if (Configuration.doAutoCreate())
206          this.ruleset = new Coding(); // cc
207      return this.ruleset;
208    }
209
210    public boolean hasRuleset() { 
211      return this.ruleset != null && !this.ruleset.isEmpty();
212    }
213
214    /**
215     * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.)
216     */
217    public EnrollmentRequest setRuleset(Coding value) { 
218      this.ruleset = value;
219      return this;
220    }
221
222    /**
223     * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
224     */
225    public Coding getOriginalRuleset() { 
226      if (this.originalRuleset == null)
227        if (Configuration.errorOnAutoCreate())
228          throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset");
229        else if (Configuration.doAutoCreate())
230          this.originalRuleset = new Coding(); // cc
231      return this.originalRuleset;
232    }
233
234    public boolean hasOriginalRuleset() { 
235      return this.originalRuleset != null && !this.originalRuleset.isEmpty();
236    }
237
238    /**
239     * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
240     */
241    public EnrollmentRequest setOriginalRuleset(Coding value) { 
242      this.originalRuleset = value;
243      return this;
244    }
245
246    /**
247     * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
248     */
249    public DateTimeType getCreatedElement() { 
250      if (this.created == null)
251        if (Configuration.errorOnAutoCreate())
252          throw new Error("Attempt to auto-create EnrollmentRequest.created");
253        else if (Configuration.doAutoCreate())
254          this.created = new DateTimeType(); // bb
255      return this.created;
256    }
257
258    public boolean hasCreatedElement() { 
259      return this.created != null && !this.created.isEmpty();
260    }
261
262    public boolean hasCreated() { 
263      return this.created != null && !this.created.isEmpty();
264    }
265
266    /**
267     * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
268     */
269    public EnrollmentRequest setCreatedElement(DateTimeType value) { 
270      this.created = value;
271      return this;
272    }
273
274    /**
275     * @return The date when this resource was created.
276     */
277    public Date getCreated() { 
278      return this.created == null ? null : this.created.getValue();
279    }
280
281    /**
282     * @param value The date when this resource was created.
283     */
284    public EnrollmentRequest setCreated(Date value) { 
285      if (value == null)
286        this.created = null;
287      else {
288        if (this.created == null)
289          this.created = new DateTimeType();
290        this.created.setValue(value);
291      }
292      return this;
293    }
294
295    /**
296     * @return {@link #target} (The Insurer who is target  of the request.)
297     */
298    public Reference getTarget() { 
299      if (this.target == null)
300        if (Configuration.errorOnAutoCreate())
301          throw new Error("Attempt to auto-create EnrollmentRequest.target");
302        else if (Configuration.doAutoCreate())
303          this.target = new Reference(); // cc
304      return this.target;
305    }
306
307    public boolean hasTarget() { 
308      return this.target != null && !this.target.isEmpty();
309    }
310
311    /**
312     * @param value {@link #target} (The Insurer who is target  of the request.)
313     */
314    public EnrollmentRequest setTarget(Reference value) { 
315      this.target = value;
316      return this;
317    }
318
319    /**
320     * @return {@link #target} 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 is target  of the request.)
321     */
322    public Organization getTargetTarget() { 
323      if (this.targetTarget == null)
324        if (Configuration.errorOnAutoCreate())
325          throw new Error("Attempt to auto-create EnrollmentRequest.target");
326        else if (Configuration.doAutoCreate())
327          this.targetTarget = new Organization(); // aa
328      return this.targetTarget;
329    }
330
331    /**
332     * @param value {@link #target} 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 is target  of the request.)
333     */
334    public EnrollmentRequest setTargetTarget(Organization value) { 
335      this.targetTarget = value;
336      return this;
337    }
338
339    /**
340     * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
341     */
342    public Reference getProvider() { 
343      if (this.provider == null)
344        if (Configuration.errorOnAutoCreate())
345          throw new Error("Attempt to auto-create EnrollmentRequest.provider");
346        else if (Configuration.doAutoCreate())
347          this.provider = new Reference(); // cc
348      return this.provider;
349    }
350
351    public boolean hasProvider() { 
352      return this.provider != null && !this.provider.isEmpty();
353    }
354
355    /**
356     * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
357     */
358    public EnrollmentRequest setProvider(Reference value) { 
359      this.provider = value;
360      return this;
361    }
362
363    /**
364     * @return {@link #provider} 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.)
365     */
366    public Practitioner getProviderTarget() { 
367      if (this.providerTarget == null)
368        if (Configuration.errorOnAutoCreate())
369          throw new Error("Attempt to auto-create EnrollmentRequest.provider");
370        else if (Configuration.doAutoCreate())
371          this.providerTarget = new Practitioner(); // aa
372      return this.providerTarget;
373    }
374
375    /**
376     * @param value {@link #provider} 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.)
377     */
378    public EnrollmentRequest setProviderTarget(Practitioner value) { 
379      this.providerTarget = value;
380      return this;
381    }
382
383    /**
384     * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.)
385     */
386    public Reference getOrganization() { 
387      if (this.organization == null)
388        if (Configuration.errorOnAutoCreate())
389          throw new Error("Attempt to auto-create EnrollmentRequest.organization");
390        else if (Configuration.doAutoCreate())
391          this.organization = new Reference(); // cc
392      return this.organization;
393    }
394
395    public boolean hasOrganization() { 
396      return this.organization != null && !this.organization.isEmpty();
397    }
398
399    /**
400     * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.)
401     */
402    public EnrollmentRequest setOrganization(Reference value) { 
403      this.organization = value;
404      return this;
405    }
406
407    /**
408     * @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 organization which is responsible for the services rendered to the patient.)
409     */
410    public Organization getOrganizationTarget() { 
411      if (this.organizationTarget == null)
412        if (Configuration.errorOnAutoCreate())
413          throw new Error("Attempt to auto-create EnrollmentRequest.organization");
414        else if (Configuration.doAutoCreate())
415          this.organizationTarget = new Organization(); // aa
416      return this.organizationTarget;
417    }
418
419    /**
420     * @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 organization which is responsible for the services rendered to the patient.)
421     */
422    public EnrollmentRequest setOrganizationTarget(Organization value) { 
423      this.organizationTarget = value;
424      return this;
425    }
426
427    /**
428     * @return {@link #subject} (Patient Resource.)
429     */
430    public Reference getSubject() { 
431      if (this.subject == null)
432        if (Configuration.errorOnAutoCreate())
433          throw new Error("Attempt to auto-create EnrollmentRequest.subject");
434        else if (Configuration.doAutoCreate())
435          this.subject = new Reference(); // cc
436      return this.subject;
437    }
438
439    public boolean hasSubject() { 
440      return this.subject != null && !this.subject.isEmpty();
441    }
442
443    /**
444     * @param value {@link #subject} (Patient Resource.)
445     */
446    public EnrollmentRequest setSubject(Reference value) { 
447      this.subject = value;
448      return this;
449    }
450
451    /**
452     * @return {@link #subject} 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. (Patient Resource.)
453     */
454    public Patient getSubjectTarget() { 
455      if (this.subjectTarget == null)
456        if (Configuration.errorOnAutoCreate())
457          throw new Error("Attempt to auto-create EnrollmentRequest.subject");
458        else if (Configuration.doAutoCreate())
459          this.subjectTarget = new Patient(); // aa
460      return this.subjectTarget;
461    }
462
463    /**
464     * @param value {@link #subject} 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. (Patient Resource.)
465     */
466    public EnrollmentRequest setSubjectTarget(Patient value) { 
467      this.subjectTarget = value;
468      return this;
469    }
470
471    /**
472     * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
473     */
474    public Reference getCoverage() { 
475      if (this.coverage == null)
476        if (Configuration.errorOnAutoCreate())
477          throw new Error("Attempt to auto-create EnrollmentRequest.coverage");
478        else if (Configuration.doAutoCreate())
479          this.coverage = new Reference(); // cc
480      return this.coverage;
481    }
482
483    public boolean hasCoverage() { 
484      return this.coverage != null && !this.coverage.isEmpty();
485    }
486
487    /**
488     * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
489     */
490    public EnrollmentRequest setCoverage(Reference value) { 
491      this.coverage = value;
492      return this;
493    }
494
495    /**
496     * @return {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.)
497     */
498    public Coverage getCoverageTarget() { 
499      if (this.coverageTarget == null)
500        if (Configuration.errorOnAutoCreate())
501          throw new Error("Attempt to auto-create EnrollmentRequest.coverage");
502        else if (Configuration.doAutoCreate())
503          this.coverageTarget = new Coverage(); // aa
504      return this.coverageTarget;
505    }
506
507    /**
508     * @param value {@link #coverage} 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. (Reference to the program or plan identification, underwriter or payor.)
509     */
510    public EnrollmentRequest setCoverageTarget(Coverage value) { 
511      this.coverageTarget = value;
512      return this;
513    }
514
515    /**
516     * @return {@link #relationship} (The relationship of the patient to the subscriber.)
517     */
518    public Coding getRelationship() { 
519      if (this.relationship == null)
520        if (Configuration.errorOnAutoCreate())
521          throw new Error("Attempt to auto-create EnrollmentRequest.relationship");
522        else if (Configuration.doAutoCreate())
523          this.relationship = new Coding(); // cc
524      return this.relationship;
525    }
526
527    public boolean hasRelationship() { 
528      return this.relationship != null && !this.relationship.isEmpty();
529    }
530
531    /**
532     * @param value {@link #relationship} (The relationship of the patient to the subscriber.)
533     */
534    public EnrollmentRequest setRelationship(Coding value) { 
535      this.relationship = value;
536      return this;
537    }
538
539      protected void listChildren(List<Property> childrenList) {
540        super.listChildren(childrenList);
541        childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier));
542        childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset));
543        childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
544        childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created));
545        childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target  of the request.", 0, java.lang.Integer.MAX_VALUE, target));
546        childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
547        childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization));
548        childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject));
549        childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage));
550        childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship));
551      }
552
553      @Override
554      public void setProperty(String name, Base value) throws FHIRException {
555        if (name.equals("identifier"))
556          this.getIdentifier().add(castToIdentifier(value));
557        else if (name.equals("ruleset"))
558          this.ruleset = castToCoding(value); // Coding
559        else if (name.equals("originalRuleset"))
560          this.originalRuleset = castToCoding(value); // Coding
561        else if (name.equals("created"))
562          this.created = castToDateTime(value); // DateTimeType
563        else if (name.equals("target"))
564          this.target = castToReference(value); // Reference
565        else if (name.equals("provider"))
566          this.provider = castToReference(value); // Reference
567        else if (name.equals("organization"))
568          this.organization = castToReference(value); // Reference
569        else if (name.equals("subject"))
570          this.subject = castToReference(value); // Reference
571        else if (name.equals("coverage"))
572          this.coverage = castToReference(value); // Reference
573        else if (name.equals("relationship"))
574          this.relationship = castToCoding(value); // Coding
575        else
576          super.setProperty(name, value);
577      }
578
579      @Override
580      public Base addChild(String name) throws FHIRException {
581        if (name.equals("identifier")) {
582          return addIdentifier();
583        }
584        else if (name.equals("ruleset")) {
585          this.ruleset = new Coding();
586          return this.ruleset;
587        }
588        else if (name.equals("originalRuleset")) {
589          this.originalRuleset = new Coding();
590          return this.originalRuleset;
591        }
592        else if (name.equals("created")) {
593          throw new FHIRException("Cannot call addChild on a primitive type EnrollmentRequest.created");
594        }
595        else if (name.equals("target")) {
596          this.target = new Reference();
597          return this.target;
598        }
599        else if (name.equals("provider")) {
600          this.provider = new Reference();
601          return this.provider;
602        }
603        else if (name.equals("organization")) {
604          this.organization = new Reference();
605          return this.organization;
606        }
607        else if (name.equals("subject")) {
608          this.subject = new Reference();
609          return this.subject;
610        }
611        else if (name.equals("coverage")) {
612          this.coverage = new Reference();
613          return this.coverage;
614        }
615        else if (name.equals("relationship")) {
616          this.relationship = new Coding();
617          return this.relationship;
618        }
619        else
620          return super.addChild(name);
621      }
622
623  public String fhirType() {
624    return "EnrollmentRequest";
625
626  }
627
628      public EnrollmentRequest copy() {
629        EnrollmentRequest dst = new EnrollmentRequest();
630        copyValues(dst);
631        if (identifier != null) {
632          dst.identifier = new ArrayList<Identifier>();
633          for (Identifier i : identifier)
634            dst.identifier.add(i.copy());
635        };
636        dst.ruleset = ruleset == null ? null : ruleset.copy();
637        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
638        dst.created = created == null ? null : created.copy();
639        dst.target = target == null ? null : target.copy();
640        dst.provider = provider == null ? null : provider.copy();
641        dst.organization = organization == null ? null : organization.copy();
642        dst.subject = subject == null ? null : subject.copy();
643        dst.coverage = coverage == null ? null : coverage.copy();
644        dst.relationship = relationship == null ? null : relationship.copy();
645        return dst;
646      }
647
648      protected EnrollmentRequest typedCopy() {
649        return copy();
650      }
651
652      @Override
653      public boolean equalsDeep(Base other) {
654        if (!super.equalsDeep(other))
655          return false;
656        if (!(other instanceof EnrollmentRequest))
657          return false;
658        EnrollmentRequest o = (EnrollmentRequest) other;
659        return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true)
660           && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true)
661           && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true)
662           && compareDeep(relationship, o.relationship, true);
663      }
664
665      @Override
666      public boolean equalsShallow(Base other) {
667        if (!super.equalsShallow(other))
668          return false;
669        if (!(other instanceof EnrollmentRequest))
670          return false;
671        EnrollmentRequest o = (EnrollmentRequest) other;
672        return compareValues(created, o.created, true);
673      }
674
675      public boolean isEmpty() {
676        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
677           && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
678           && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
679           && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty())
680          ;
681      }
682
683  @Override
684  public ResourceType getResourceType() {
685    return ResourceType.EnrollmentRequest;
686   }
687
688  @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" )
689  public static final String SP_IDENTIFIER = "identifier";
690  @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" )
691  public static final String SP_SUBJECT = "subject";
692  @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" )
693  public static final String SP_PATIENT = "patient";
694
695}
696