001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.
052 */
053@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/StructureDefinition/Coverage")
054public class Coverage extends DomainResource {
055
056    public enum Kind {
057        /**
058         * The Coverage provides the identifiers and card-level details of an insurance policy.
059         */
060        INSURANCE, 
061        /**
062         * One or more persons and/or organizations are paying for the services rendered.
063         */
064        SELFPAY, 
065        /**
066         * Some other organization is paying for the service.
067         */
068        OTHER, 
069        /**
070         * added to help the parsers with the generic types
071         */
072        NULL;
073        public static Kind fromCode(String codeString) throws FHIRException {
074            if (codeString == null || "".equals(codeString))
075                return null;
076        if ("insurance".equals(codeString))
077          return INSURANCE;
078        if ("self-pay".equals(codeString))
079          return SELFPAY;
080        if ("other".equals(codeString))
081          return OTHER;
082        if (Configuration.isAcceptInvalidEnums())
083          return null;
084        else
085          throw new FHIRException("Unknown Kind code '"+codeString+"'");
086        }
087        public String toCode() {
088          switch (this) {
089            case INSURANCE: return "insurance";
090            case SELFPAY: return "self-pay";
091            case OTHER: return "other";
092            case NULL: return null;
093            default: return "?";
094          }
095        }
096        public String getSystem() {
097          switch (this) {
098            case INSURANCE: return "http://hl7.org/fhir/coverage-kind";
099            case SELFPAY: return "http://hl7.org/fhir/coverage-kind";
100            case OTHER: return "http://hl7.org/fhir/coverage-kind";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getDefinition() {
106          switch (this) {
107            case INSURANCE: return "The Coverage provides the identifiers and card-level details of an insurance policy.";
108            case SELFPAY: return "One or more persons and/or organizations are paying for the services rendered.";
109            case OTHER: return "Some other organization is paying for the service.";
110            case NULL: return null;
111            default: return "?";
112          }
113        }
114        public String getDisplay() {
115          switch (this) {
116            case INSURANCE: return "Insurance";
117            case SELFPAY: return "Self-pay";
118            case OTHER: return "Other";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123    }
124
125  public static class KindEnumFactory implements EnumFactory<Kind> {
126    public Kind fromCode(String codeString) throws IllegalArgumentException {
127      if (codeString == null || "".equals(codeString))
128            if (codeString == null || "".equals(codeString))
129                return null;
130        if ("insurance".equals(codeString))
131          return Kind.INSURANCE;
132        if ("self-pay".equals(codeString))
133          return Kind.SELFPAY;
134        if ("other".equals(codeString))
135          return Kind.OTHER;
136        throw new IllegalArgumentException("Unknown Kind code '"+codeString+"'");
137        }
138        public Enumeration<Kind> fromType(PrimitiveType<?> code) throws FHIRException {
139          if (code == null)
140            return null;
141          if (code.isEmpty())
142            return new Enumeration<Kind>(this, Kind.NULL, code);
143          String codeString = ((PrimitiveType) code).asStringValue();
144          if (codeString == null || "".equals(codeString))
145            return new Enumeration<Kind>(this, Kind.NULL, code);
146        if ("insurance".equals(codeString))
147          return new Enumeration<Kind>(this, Kind.INSURANCE, code);
148        if ("self-pay".equals(codeString))
149          return new Enumeration<Kind>(this, Kind.SELFPAY, code);
150        if ("other".equals(codeString))
151          return new Enumeration<Kind>(this, Kind.OTHER, code);
152        throw new FHIRException("Unknown Kind code '"+codeString+"'");
153        }
154    public String toCode(Kind code) {
155      if (code == Kind.INSURANCE)
156        return "insurance";
157      if (code == Kind.SELFPAY)
158        return "self-pay";
159      if (code == Kind.OTHER)
160        return "other";
161      return "?";
162      }
163    public String toSystem(Kind code) {
164      return code.getSystem();
165      }
166    }
167
168    @Block()
169    public static class CoveragePaymentByComponent extends BackboneElement implements IBaseBackboneElement {
170        /**
171         * The list of parties providing non-insurance payment for the treatment costs.
172         */
173        @Child(name = "party", type = {Patient.class, RelatedPerson.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=true)
174        @Description(shortDefinition="Parties performing self-payment", formalDefinition="The list of parties providing non-insurance payment for the treatment costs." )
175        protected Reference party;
176
177        /**
178         *  Description of the financial responsibility.
179         */
180        @Child(name = "responsibility", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true)
181        @Description(shortDefinition="Party's responsibility", formalDefinition=" Description of the financial responsibility." )
182        protected StringType responsibility;
183
184        private static final long serialVersionUID = -1279858336L;
185
186    /**
187     * Constructor
188     */
189      public CoveragePaymentByComponent() {
190        super();
191      }
192
193    /**
194     * Constructor
195     */
196      public CoveragePaymentByComponent(Reference party) {
197        super();
198        this.setParty(party);
199      }
200
201        /**
202         * @return {@link #party} (The list of parties providing non-insurance payment for the treatment costs.)
203         */
204        public Reference getParty() { 
205          if (this.party == null)
206            if (Configuration.errorOnAutoCreate())
207              throw new Error("Attempt to auto-create CoveragePaymentByComponent.party");
208            else if (Configuration.doAutoCreate())
209              this.party = new Reference(); // cc
210          return this.party;
211        }
212
213        public boolean hasParty() { 
214          return this.party != null && !this.party.isEmpty();
215        }
216
217        /**
218         * @param value {@link #party} (The list of parties providing non-insurance payment for the treatment costs.)
219         */
220        public CoveragePaymentByComponent setParty(Reference value) { 
221          this.party = value;
222          return this;
223        }
224
225        /**
226         * @return {@link #responsibility} ( Description of the financial responsibility.). This is the underlying object with id, value and extensions. The accessor "getResponsibility" gives direct access to the value
227         */
228        public StringType getResponsibilityElement() { 
229          if (this.responsibility == null)
230            if (Configuration.errorOnAutoCreate())
231              throw new Error("Attempt to auto-create CoveragePaymentByComponent.responsibility");
232            else if (Configuration.doAutoCreate())
233              this.responsibility = new StringType(); // bb
234          return this.responsibility;
235        }
236
237        public boolean hasResponsibilityElement() { 
238          return this.responsibility != null && !this.responsibility.isEmpty();
239        }
240
241        public boolean hasResponsibility() { 
242          return this.responsibility != null && !this.responsibility.isEmpty();
243        }
244
245        /**
246         * @param value {@link #responsibility} ( Description of the financial responsibility.). This is the underlying object with id, value and extensions. The accessor "getResponsibility" gives direct access to the value
247         */
248        public CoveragePaymentByComponent setResponsibilityElement(StringType value) { 
249          this.responsibility = value;
250          return this;
251        }
252
253        /**
254         * @return  Description of the financial responsibility.
255         */
256        public String getResponsibility() { 
257          return this.responsibility == null ? null : this.responsibility.getValue();
258        }
259
260        /**
261         * @param value  Description of the financial responsibility.
262         */
263        public CoveragePaymentByComponent setResponsibility(String value) { 
264          if (Utilities.noString(value))
265            this.responsibility = null;
266          else {
267            if (this.responsibility == null)
268              this.responsibility = new StringType();
269            this.responsibility.setValue(value);
270          }
271          return this;
272        }
273
274        protected void listChildren(List<Property> children) {
275          super.listChildren(children);
276          children.add(new Property("party", "Reference(Patient|RelatedPerson|Organization)", "The list of parties providing non-insurance payment for the treatment costs.", 0, 1, party));
277          children.add(new Property("responsibility", "string", " Description of the financial responsibility.", 0, 1, responsibility));
278        }
279
280        @Override
281        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
282          switch (_hash) {
283          case 106437350: /*party*/  return new Property("party", "Reference(Patient|RelatedPerson|Organization)", "The list of parties providing non-insurance payment for the treatment costs.", 0, 1, party);
284          case -228897266: /*responsibility*/  return new Property("responsibility", "string", " Description of the financial responsibility.", 0, 1, responsibility);
285          default: return super.getNamedProperty(_hash, _name, _checkValid);
286          }
287
288        }
289
290      @Override
291      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
292        switch (hash) {
293        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
294        case -228897266: /*responsibility*/ return this.responsibility == null ? new Base[0] : new Base[] {this.responsibility}; // StringType
295        default: return super.getProperty(hash, name, checkValid);
296        }
297
298      }
299
300      @Override
301      public Base setProperty(int hash, String name, Base value) throws FHIRException {
302        switch (hash) {
303        case 106437350: // party
304          this.party = TypeConvertor.castToReference(value); // Reference
305          return value;
306        case -228897266: // responsibility
307          this.responsibility = TypeConvertor.castToString(value); // StringType
308          return value;
309        default: return super.setProperty(hash, name, value);
310        }
311
312      }
313
314      @Override
315      public Base setProperty(String name, Base value) throws FHIRException {
316        if (name.equals("party")) {
317          this.party = TypeConvertor.castToReference(value); // Reference
318        } else if (name.equals("responsibility")) {
319          this.responsibility = TypeConvertor.castToString(value); // StringType
320        } else
321          return super.setProperty(name, value);
322        return value;
323      }
324
325  @Override
326  public void removeChild(String name, Base value) throws FHIRException {
327        if (name.equals("party")) {
328          this.party = null;
329        } else if (name.equals("responsibility")) {
330          this.responsibility = null;
331        } else
332          super.removeChild(name, value);
333        
334      }
335
336      @Override
337      public Base makeProperty(int hash, String name) throws FHIRException {
338        switch (hash) {
339        case 106437350:  return getParty();
340        case -228897266:  return getResponsibilityElement();
341        default: return super.makeProperty(hash, name);
342        }
343
344      }
345
346      @Override
347      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
348        switch (hash) {
349        case 106437350: /*party*/ return new String[] {"Reference"};
350        case -228897266: /*responsibility*/ return new String[] {"string"};
351        default: return super.getTypesForProperty(hash, name);
352        }
353
354      }
355
356      @Override
357      public Base addChild(String name) throws FHIRException {
358        if (name.equals("party")) {
359          this.party = new Reference();
360          return this.party;
361        }
362        else if (name.equals("responsibility")) {
363          throw new FHIRException("Cannot call addChild on a singleton property Coverage.paymentBy.responsibility");
364        }
365        else
366          return super.addChild(name);
367      }
368
369      public CoveragePaymentByComponent copy() {
370        CoveragePaymentByComponent dst = new CoveragePaymentByComponent();
371        copyValues(dst);
372        return dst;
373      }
374
375      public void copyValues(CoveragePaymentByComponent dst) {
376        super.copyValues(dst);
377        dst.party = party == null ? null : party.copy();
378        dst.responsibility = responsibility == null ? null : responsibility.copy();
379      }
380
381      @Override
382      public boolean equalsDeep(Base other_) {
383        if (!super.equalsDeep(other_))
384          return false;
385        if (!(other_ instanceof CoveragePaymentByComponent))
386          return false;
387        CoveragePaymentByComponent o = (CoveragePaymentByComponent) other_;
388        return compareDeep(party, o.party, true) && compareDeep(responsibility, o.responsibility, true)
389          ;
390      }
391
392      @Override
393      public boolean equalsShallow(Base other_) {
394        if (!super.equalsShallow(other_))
395          return false;
396        if (!(other_ instanceof CoveragePaymentByComponent))
397          return false;
398        CoveragePaymentByComponent o = (CoveragePaymentByComponent) other_;
399        return compareValues(responsibility, o.responsibility, true);
400      }
401
402      public boolean isEmpty() {
403        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(party, responsibility);
404      }
405
406  public String fhirType() {
407    return "Coverage.paymentBy";
408
409  }
410
411  }
412
413    @Block()
414    public static class ClassComponent extends BackboneElement implements IBaseBackboneElement {
415        /**
416         * The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan.
417         */
418        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
419        @Description(shortDefinition="Type of class such as 'group' or 'plan'", formalDefinition="The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan." )
420        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-class")
421        protected CodeableConcept type;
422
423        /**
424         * The alphanumeric identifier associated with the insurer issued label.
425         */
426        @Child(name = "value", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true)
427        @Description(shortDefinition="Value associated with the type", formalDefinition="The alphanumeric identifier associated with the insurer issued label." )
428        protected Identifier value;
429
430        /**
431         * A short description for the class.
432         */
433        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
434        @Description(shortDefinition="Human readable description of the type and value", formalDefinition="A short description for the class." )
435        protected StringType name;
436
437        private static final long serialVersionUID = 1395172201L;
438
439    /**
440     * Constructor
441     */
442      public ClassComponent() {
443        super();
444      }
445
446    /**
447     * Constructor
448     */
449      public ClassComponent(CodeableConcept type, Identifier value) {
450        super();
451        this.setType(type);
452        this.setValue(value);
453      }
454
455        /**
456         * @return {@link #type} (The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan.)
457         */
458        public CodeableConcept getType() { 
459          if (this.type == null)
460            if (Configuration.errorOnAutoCreate())
461              throw new Error("Attempt to auto-create ClassComponent.type");
462            else if (Configuration.doAutoCreate())
463              this.type = new CodeableConcept(); // cc
464          return this.type;
465        }
466
467        public boolean hasType() { 
468          return this.type != null && !this.type.isEmpty();
469        }
470
471        /**
472         * @param value {@link #type} (The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan.)
473         */
474        public ClassComponent setType(CodeableConcept value) { 
475          this.type = value;
476          return this;
477        }
478
479        /**
480         * @return {@link #value} (The alphanumeric identifier associated with the insurer issued label.)
481         */
482        public Identifier getValue() { 
483          if (this.value == null)
484            if (Configuration.errorOnAutoCreate())
485              throw new Error("Attempt to auto-create ClassComponent.value");
486            else if (Configuration.doAutoCreate())
487              this.value = new Identifier(); // cc
488          return this.value;
489        }
490
491        public boolean hasValue() { 
492          return this.value != null && !this.value.isEmpty();
493        }
494
495        /**
496         * @param value {@link #value} (The alphanumeric identifier associated with the insurer issued label.)
497         */
498        public ClassComponent setValue(Identifier value) { 
499          this.value = value;
500          return this;
501        }
502
503        /**
504         * @return {@link #name} (A short description for the class.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
505         */
506        public StringType getNameElement() { 
507          if (this.name == null)
508            if (Configuration.errorOnAutoCreate())
509              throw new Error("Attempt to auto-create ClassComponent.name");
510            else if (Configuration.doAutoCreate())
511              this.name = new StringType(); // bb
512          return this.name;
513        }
514
515        public boolean hasNameElement() { 
516          return this.name != null && !this.name.isEmpty();
517        }
518
519        public boolean hasName() { 
520          return this.name != null && !this.name.isEmpty();
521        }
522
523        /**
524         * @param value {@link #name} (A short description for the class.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
525         */
526        public ClassComponent setNameElement(StringType value) { 
527          this.name = value;
528          return this;
529        }
530
531        /**
532         * @return A short description for the class.
533         */
534        public String getName() { 
535          return this.name == null ? null : this.name.getValue();
536        }
537
538        /**
539         * @param value A short description for the class.
540         */
541        public ClassComponent setName(String value) { 
542          if (Utilities.noString(value))
543            this.name = null;
544          else {
545            if (this.name == null)
546              this.name = new StringType();
547            this.name.setValue(value);
548          }
549          return this;
550        }
551
552        protected void listChildren(List<Property> children) {
553          super.listChildren(children);
554          children.add(new Property("type", "CodeableConcept", "The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan.", 0, 1, type));
555          children.add(new Property("value", "Identifier", "The alphanumeric identifier associated with the insurer issued label.", 0, 1, value));
556          children.add(new Property("name", "string", "A short description for the class.", 0, 1, name));
557        }
558
559        @Override
560        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
561          switch (_hash) {
562          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of classification for which an insurer-specific class label or number and optional name is provided.  For example, type may be used to identify a class of coverage or employer group, policy, or plan.", 0, 1, type);
563          case 111972721: /*value*/  return new Property("value", "Identifier", "The alphanumeric identifier associated with the insurer issued label.", 0, 1, value);
564          case 3373707: /*name*/  return new Property("name", "string", "A short description for the class.", 0, 1, name);
565          default: return super.getNamedProperty(_hash, _name, _checkValid);
566          }
567
568        }
569
570      @Override
571      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
572        switch (hash) {
573        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
574        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Identifier
575        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
576        default: return super.getProperty(hash, name, checkValid);
577        }
578
579      }
580
581      @Override
582      public Base setProperty(int hash, String name, Base value) throws FHIRException {
583        switch (hash) {
584        case 3575610: // type
585          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
586          return value;
587        case 111972721: // value
588          this.value = TypeConvertor.castToIdentifier(value); // Identifier
589          return value;
590        case 3373707: // name
591          this.name = TypeConvertor.castToString(value); // StringType
592          return value;
593        default: return super.setProperty(hash, name, value);
594        }
595
596      }
597
598      @Override
599      public Base setProperty(String name, Base value) throws FHIRException {
600        if (name.equals("type")) {
601          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
602        } else if (name.equals("value")) {
603          this.value = TypeConvertor.castToIdentifier(value); // Identifier
604        } else if (name.equals("name")) {
605          this.name = TypeConvertor.castToString(value); // StringType
606        } else
607          return super.setProperty(name, value);
608        return value;
609      }
610
611  @Override
612  public void removeChild(String name, Base value) throws FHIRException {
613        if (name.equals("type")) {
614          this.type = null;
615        } else if (name.equals("value")) {
616          this.value = null;
617        } else if (name.equals("name")) {
618          this.name = null;
619        } else
620          super.removeChild(name, value);
621        
622      }
623
624      @Override
625      public Base makeProperty(int hash, String name) throws FHIRException {
626        switch (hash) {
627        case 3575610:  return getType();
628        case 111972721:  return getValue();
629        case 3373707:  return getNameElement();
630        default: return super.makeProperty(hash, name);
631        }
632
633      }
634
635      @Override
636      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
637        switch (hash) {
638        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
639        case 111972721: /*value*/ return new String[] {"Identifier"};
640        case 3373707: /*name*/ return new String[] {"string"};
641        default: return super.getTypesForProperty(hash, name);
642        }
643
644      }
645
646      @Override
647      public Base addChild(String name) throws FHIRException {
648        if (name.equals("type")) {
649          this.type = new CodeableConcept();
650          return this.type;
651        }
652        else if (name.equals("value")) {
653          this.value = new Identifier();
654          return this.value;
655        }
656        else if (name.equals("name")) {
657          throw new FHIRException("Cannot call addChild on a singleton property Coverage.class.name");
658        }
659        else
660          return super.addChild(name);
661      }
662
663      public ClassComponent copy() {
664        ClassComponent dst = new ClassComponent();
665        copyValues(dst);
666        return dst;
667      }
668
669      public void copyValues(ClassComponent dst) {
670        super.copyValues(dst);
671        dst.type = type == null ? null : type.copy();
672        dst.value = value == null ? null : value.copy();
673        dst.name = name == null ? null : name.copy();
674      }
675
676      @Override
677      public boolean equalsDeep(Base other_) {
678        if (!super.equalsDeep(other_))
679          return false;
680        if (!(other_ instanceof ClassComponent))
681          return false;
682        ClassComponent o = (ClassComponent) other_;
683        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(name, o.name, true)
684          ;
685      }
686
687      @Override
688      public boolean equalsShallow(Base other_) {
689        if (!super.equalsShallow(other_))
690          return false;
691        if (!(other_ instanceof ClassComponent))
692          return false;
693        ClassComponent o = (ClassComponent) other_;
694        return compareValues(name, o.name, true);
695      }
696
697      public boolean isEmpty() {
698        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, name);
699      }
700
701  public String fhirType() {
702    return "Coverage.class";
703
704  }
705
706  }
707
708    @Block()
709    public static class CostToBeneficiaryComponent extends BackboneElement implements IBaseBackboneElement {
710        /**
711         * The category of patient centric costs associated with treatment.
712         */
713        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
714        @Description(shortDefinition="Cost category", formalDefinition="The category of patient centric costs associated with treatment." )
715        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-copay-type")
716        protected CodeableConcept type;
717
718        /**
719         * Code to identify the general type of benefits under which products and services are provided.
720         */
721        @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
722        @Description(shortDefinition="Benefit classification", formalDefinition="Code to identify the general type of benefits under which products and services are provided." )
723        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/ex-benefitcategory")
724        protected CodeableConcept category;
725
726        /**
727         * Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.
728         */
729        @Child(name = "network", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
730        @Description(shortDefinition="In or out of network", formalDefinition="Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers." )
731        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-network")
732        protected CodeableConcept network;
733
734        /**
735         * Indicates if the benefits apply to an individual or to the family.
736         */
737        @Child(name = "unit", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
738        @Description(shortDefinition="Individual or family", formalDefinition="Indicates if the benefits apply to an individual or to the family." )
739        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-unit")
740        protected CodeableConcept unit;
741
742        /**
743         * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.
744         */
745        @Child(name = "term", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false)
746        @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'." )
747        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/benefit-term")
748        protected CodeableConcept term;
749
750        /**
751         * The amount due from the patient for the cost category.
752         */
753        @Child(name = "value", type = {Quantity.class, Money.class}, order=6, min=0, max=1, modifier=false, summary=true)
754        @Description(shortDefinition="The amount or percentage due from the beneficiary", formalDefinition="The amount due from the patient for the cost category." )
755        protected DataType value;
756
757        /**
758         * A suite of codes indicating exceptions or reductions to patient costs and their effective periods.
759         */
760        @Child(name = "exception", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
761        @Description(shortDefinition="Exceptions for patient payments", formalDefinition="A suite of codes indicating exceptions or reductions to patient costs and their effective periods." )
762        protected List<ExemptionComponent> exception;
763
764        private static final long serialVersionUID = 472499753L;
765
766    /**
767     * Constructor
768     */
769      public CostToBeneficiaryComponent() {
770        super();
771      }
772
773        /**
774         * @return {@link #type} (The category of patient centric costs associated with treatment.)
775         */
776        public CodeableConcept getType() { 
777          if (this.type == null)
778            if (Configuration.errorOnAutoCreate())
779              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.type");
780            else if (Configuration.doAutoCreate())
781              this.type = new CodeableConcept(); // cc
782          return this.type;
783        }
784
785        public boolean hasType() { 
786          return this.type != null && !this.type.isEmpty();
787        }
788
789        /**
790         * @param value {@link #type} (The category of patient centric costs associated with treatment.)
791         */
792        public CostToBeneficiaryComponent setType(CodeableConcept value) { 
793          this.type = value;
794          return this;
795        }
796
797        /**
798         * @return {@link #category} (Code to identify the general type of benefits under which products and services are provided.)
799         */
800        public CodeableConcept getCategory() { 
801          if (this.category == null)
802            if (Configuration.errorOnAutoCreate())
803              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.category");
804            else if (Configuration.doAutoCreate())
805              this.category = new CodeableConcept(); // cc
806          return this.category;
807        }
808
809        public boolean hasCategory() { 
810          return this.category != null && !this.category.isEmpty();
811        }
812
813        /**
814         * @param value {@link #category} (Code to identify the general type of benefits under which products and services are provided.)
815         */
816        public CostToBeneficiaryComponent setCategory(CodeableConcept value) { 
817          this.category = value;
818          return this;
819        }
820
821        /**
822         * @return {@link #network} (Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.)
823         */
824        public CodeableConcept getNetwork() { 
825          if (this.network == null)
826            if (Configuration.errorOnAutoCreate())
827              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.network");
828            else if (Configuration.doAutoCreate())
829              this.network = new CodeableConcept(); // cc
830          return this.network;
831        }
832
833        public boolean hasNetwork() { 
834          return this.network != null && !this.network.isEmpty();
835        }
836
837        /**
838         * @param value {@link #network} (Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.)
839         */
840        public CostToBeneficiaryComponent setNetwork(CodeableConcept value) { 
841          this.network = value;
842          return this;
843        }
844
845        /**
846         * @return {@link #unit} (Indicates if the benefits apply to an individual or to the family.)
847         */
848        public CodeableConcept getUnit() { 
849          if (this.unit == null)
850            if (Configuration.errorOnAutoCreate())
851              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.unit");
852            else if (Configuration.doAutoCreate())
853              this.unit = new CodeableConcept(); // cc
854          return this.unit;
855        }
856
857        public boolean hasUnit() { 
858          return this.unit != null && !this.unit.isEmpty();
859        }
860
861        /**
862         * @param value {@link #unit} (Indicates if the benefits apply to an individual or to the family.)
863         */
864        public CostToBeneficiaryComponent setUnit(CodeableConcept value) { 
865          this.unit = value;
866          return this;
867        }
868
869        /**
870         * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.)
871         */
872        public CodeableConcept getTerm() { 
873          if (this.term == null)
874            if (Configuration.errorOnAutoCreate())
875              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.term");
876            else if (Configuration.doAutoCreate())
877              this.term = new CodeableConcept(); // cc
878          return this.term;
879        }
880
881        public boolean hasTerm() { 
882          return this.term != null && !this.term.isEmpty();
883        }
884
885        /**
886         * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.)
887         */
888        public CostToBeneficiaryComponent setTerm(CodeableConcept value) { 
889          this.term = value;
890          return this;
891        }
892
893        /**
894         * @return {@link #value} (The amount due from the patient for the cost category.)
895         */
896        public DataType getValue() { 
897          return this.value;
898        }
899
900        /**
901         * @return {@link #value} (The amount due from the patient for the cost category.)
902         */
903        public Quantity getValueQuantity() throws FHIRException { 
904          if (this.value == null)
905            this.value = new Quantity();
906          if (!(this.value instanceof Quantity))
907            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
908          return (Quantity) this.value;
909        }
910
911        public boolean hasValueQuantity() { 
912          return this != null && this.value instanceof Quantity;
913        }
914
915        /**
916         * @return {@link #value} (The amount due from the patient for the cost category.)
917         */
918        public Money getValueMoney() throws FHIRException { 
919          if (this.value == null)
920            this.value = new Money();
921          if (!(this.value instanceof Money))
922            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
923          return (Money) this.value;
924        }
925
926        public boolean hasValueMoney() { 
927          return this != null && this.value instanceof Money;
928        }
929
930        public boolean hasValue() { 
931          return this.value != null && !this.value.isEmpty();
932        }
933
934        /**
935         * @param value {@link #value} (The amount due from the patient for the cost category.)
936         */
937        public CostToBeneficiaryComponent setValue(DataType value) { 
938          if (value != null && !(value instanceof Quantity || value instanceof Money))
939            throw new FHIRException("Not the right type for Coverage.costToBeneficiary.value[x]: "+value.fhirType());
940          this.value = value;
941          return this;
942        }
943
944        /**
945         * @return {@link #exception} (A suite of codes indicating exceptions or reductions to patient costs and their effective periods.)
946         */
947        public List<ExemptionComponent> getException() { 
948          if (this.exception == null)
949            this.exception = new ArrayList<ExemptionComponent>();
950          return this.exception;
951        }
952
953        /**
954         * @return Returns a reference to <code>this</code> for easy method chaining
955         */
956        public CostToBeneficiaryComponent setException(List<ExemptionComponent> theException) { 
957          this.exception = theException;
958          return this;
959        }
960
961        public boolean hasException() { 
962          if (this.exception == null)
963            return false;
964          for (ExemptionComponent item : this.exception)
965            if (!item.isEmpty())
966              return true;
967          return false;
968        }
969
970        public ExemptionComponent addException() { //3
971          ExemptionComponent t = new ExemptionComponent();
972          if (this.exception == null)
973            this.exception = new ArrayList<ExemptionComponent>();
974          this.exception.add(t);
975          return t;
976        }
977
978        public CostToBeneficiaryComponent addException(ExemptionComponent t) { //3
979          if (t == null)
980            return this;
981          if (this.exception == null)
982            this.exception = new ArrayList<ExemptionComponent>();
983          this.exception.add(t);
984          return this;
985        }
986
987        /**
988         * @return The first repetition of repeating field {@link #exception}, creating it if it does not already exist {3}
989         */
990        public ExemptionComponent getExceptionFirstRep() { 
991          if (getException().isEmpty()) {
992            addException();
993          }
994          return getException().get(0);
995        }
996
997        protected void listChildren(List<Property> children) {
998          super.listChildren(children);
999          children.add(new Property("type", "CodeableConcept", "The category of patient centric costs associated with treatment.", 0, 1, type));
1000          children.add(new Property("category", "CodeableConcept", "Code to identify the general type of benefits under which products and services are provided.", 0, 1, category));
1001          children.add(new Property("network", "CodeableConcept", "Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.", 0, 1, network));
1002          children.add(new Property("unit", "CodeableConcept", "Indicates if the benefits apply to an individual or to the family.", 0, 1, unit));
1003          children.add(new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.", 0, 1, term));
1004          children.add(new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value));
1005          children.add(new Property("exception", "", "A suite of codes indicating exceptions or reductions to patient costs and their effective periods.", 0, java.lang.Integer.MAX_VALUE, exception));
1006        }
1007
1008        @Override
1009        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1010          switch (_hash) {
1011          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The category of patient centric costs associated with treatment.", 0, 1, type);
1012          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Code to identify the general type of benefits under which products and services are provided.", 0, 1, category);
1013          case 1843485230: /*network*/  return new Property("network", "CodeableConcept", "Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.", 0, 1, network);
1014          case 3594628: /*unit*/  return new Property("unit", "CodeableConcept", "Indicates if the benefits apply to an individual or to the family.", 0, 1, unit);
1015          case 3556460: /*term*/  return new Property("term", "CodeableConcept", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.", 0, 1, term);
1016          case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value);
1017          case 111972721: /*value*/  return new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value);
1018          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The amount due from the patient for the cost category.", 0, 1, value);
1019          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "The amount due from the patient for the cost category.", 0, 1, value);
1020          case 1481625679: /*exception*/  return new Property("exception", "", "A suite of codes indicating exceptions or reductions to patient costs and their effective periods.", 0, java.lang.Integer.MAX_VALUE, exception);
1021          default: return super.getNamedProperty(_hash, _name, _checkValid);
1022          }
1023
1024        }
1025
1026      @Override
1027      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1028        switch (hash) {
1029        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1030        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1031        case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // CodeableConcept
1032        case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept
1033        case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept
1034        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
1035        case 1481625679: /*exception*/ return this.exception == null ? new Base[0] : this.exception.toArray(new Base[this.exception.size()]); // ExemptionComponent
1036        default: return super.getProperty(hash, name, checkValid);
1037        }
1038
1039      }
1040
1041      @Override
1042      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1043        switch (hash) {
1044        case 3575610: // type
1045          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1046          return value;
1047        case 50511102: // category
1048          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1049          return value;
1050        case 1843485230: // network
1051          this.network = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1052          return value;
1053        case 3594628: // unit
1054          this.unit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1055          return value;
1056        case 3556460: // term
1057          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1058          return value;
1059        case 111972721: // value
1060          this.value = TypeConvertor.castToType(value); // DataType
1061          return value;
1062        case 1481625679: // exception
1063          this.getException().add((ExemptionComponent) value); // ExemptionComponent
1064          return value;
1065        default: return super.setProperty(hash, name, value);
1066        }
1067
1068      }
1069
1070      @Override
1071      public Base setProperty(String name, Base value) throws FHIRException {
1072        if (name.equals("type")) {
1073          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1074        } else if (name.equals("category")) {
1075          this.category = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1076        } else if (name.equals("network")) {
1077          this.network = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1078        } else if (name.equals("unit")) {
1079          this.unit = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1080        } else if (name.equals("term")) {
1081          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1082        } else if (name.equals("value[x]")) {
1083          this.value = TypeConvertor.castToType(value); // DataType
1084        } else if (name.equals("exception")) {
1085          this.getException().add((ExemptionComponent) value);
1086        } else
1087          return super.setProperty(name, value);
1088        return value;
1089      }
1090
1091  @Override
1092  public void removeChild(String name, Base value) throws FHIRException {
1093        if (name.equals("type")) {
1094          this.type = null;
1095        } else if (name.equals("category")) {
1096          this.category = null;
1097        } else if (name.equals("network")) {
1098          this.network = null;
1099        } else if (name.equals("unit")) {
1100          this.unit = null;
1101        } else if (name.equals("term")) {
1102          this.term = null;
1103        } else if (name.equals("value[x]")) {
1104          this.value = null;
1105        } else if (name.equals("exception")) {
1106          this.getException().remove((ExemptionComponent) value);
1107        } else
1108          super.removeChild(name, value);
1109        
1110      }
1111
1112      @Override
1113      public Base makeProperty(int hash, String name) throws FHIRException {
1114        switch (hash) {
1115        case 3575610:  return getType();
1116        case 50511102:  return getCategory();
1117        case 1843485230:  return getNetwork();
1118        case 3594628:  return getUnit();
1119        case 3556460:  return getTerm();
1120        case -1410166417:  return getValue();
1121        case 111972721:  return getValue();
1122        case 1481625679:  return addException(); 
1123        default: return super.makeProperty(hash, name);
1124        }
1125
1126      }
1127
1128      @Override
1129      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1130        switch (hash) {
1131        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1132        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1133        case 1843485230: /*network*/ return new String[] {"CodeableConcept"};
1134        case 3594628: /*unit*/ return new String[] {"CodeableConcept"};
1135        case 3556460: /*term*/ return new String[] {"CodeableConcept"};
1136        case 111972721: /*value*/ return new String[] {"Quantity", "Money"};
1137        case 1481625679: /*exception*/ return new String[] {};
1138        default: return super.getTypesForProperty(hash, name);
1139        }
1140
1141      }
1142
1143      @Override
1144      public Base addChild(String name) throws FHIRException {
1145        if (name.equals("type")) {
1146          this.type = new CodeableConcept();
1147          return this.type;
1148        }
1149        else if (name.equals("category")) {
1150          this.category = new CodeableConcept();
1151          return this.category;
1152        }
1153        else if (name.equals("network")) {
1154          this.network = new CodeableConcept();
1155          return this.network;
1156        }
1157        else if (name.equals("unit")) {
1158          this.unit = new CodeableConcept();
1159          return this.unit;
1160        }
1161        else if (name.equals("term")) {
1162          this.term = new CodeableConcept();
1163          return this.term;
1164        }
1165        else if (name.equals("valueQuantity")) {
1166          this.value = new Quantity();
1167          return this.value;
1168        }
1169        else if (name.equals("valueMoney")) {
1170          this.value = new Money();
1171          return this.value;
1172        }
1173        else if (name.equals("exception")) {
1174          return addException();
1175        }
1176        else
1177          return super.addChild(name);
1178      }
1179
1180      public CostToBeneficiaryComponent copy() {
1181        CostToBeneficiaryComponent dst = new CostToBeneficiaryComponent();
1182        copyValues(dst);
1183        return dst;
1184      }
1185
1186      public void copyValues(CostToBeneficiaryComponent dst) {
1187        super.copyValues(dst);
1188        dst.type = type == null ? null : type.copy();
1189        dst.category = category == null ? null : category.copy();
1190        dst.network = network == null ? null : network.copy();
1191        dst.unit = unit == null ? null : unit.copy();
1192        dst.term = term == null ? null : term.copy();
1193        dst.value = value == null ? null : value.copy();
1194        if (exception != null) {
1195          dst.exception = new ArrayList<ExemptionComponent>();
1196          for (ExemptionComponent i : exception)
1197            dst.exception.add(i.copy());
1198        };
1199      }
1200
1201      @Override
1202      public boolean equalsDeep(Base other_) {
1203        if (!super.equalsDeep(other_))
1204          return false;
1205        if (!(other_ instanceof CostToBeneficiaryComponent))
1206          return false;
1207        CostToBeneficiaryComponent o = (CostToBeneficiaryComponent) other_;
1208        return compareDeep(type, o.type, true) && compareDeep(category, o.category, true) && compareDeep(network, o.network, true)
1209           && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) && compareDeep(value, o.value, true)
1210           && compareDeep(exception, o.exception, true);
1211      }
1212
1213      @Override
1214      public boolean equalsShallow(Base other_) {
1215        if (!super.equalsShallow(other_))
1216          return false;
1217        if (!(other_ instanceof CostToBeneficiaryComponent))
1218          return false;
1219        CostToBeneficiaryComponent o = (CostToBeneficiaryComponent) other_;
1220        return true;
1221      }
1222
1223      public boolean isEmpty() {
1224        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, category, network
1225          , unit, term, value, exception);
1226      }
1227
1228  public String fhirType() {
1229    return "Coverage.costToBeneficiary";
1230
1231  }
1232
1233  }
1234
1235    @Block()
1236    public static class ExemptionComponent extends BackboneElement implements IBaseBackboneElement {
1237        /**
1238         * The code for the specific exception.
1239         */
1240        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
1241        @Description(shortDefinition="Exception category", formalDefinition="The code for the specific exception." )
1242        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-financial-exception")
1243        protected CodeableConcept type;
1244
1245        /**
1246         * The timeframe the exception is in force.
1247         */
1248        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
1249        @Description(shortDefinition="The effective period of the exception", formalDefinition="The timeframe the exception is in force." )
1250        protected Period period;
1251
1252        private static final long serialVersionUID = 523191991L;
1253
1254    /**
1255     * Constructor
1256     */
1257      public ExemptionComponent() {
1258        super();
1259      }
1260
1261    /**
1262     * Constructor
1263     */
1264      public ExemptionComponent(CodeableConcept type) {
1265        super();
1266        this.setType(type);
1267      }
1268
1269        /**
1270         * @return {@link #type} (The code for the specific exception.)
1271         */
1272        public CodeableConcept getType() { 
1273          if (this.type == null)
1274            if (Configuration.errorOnAutoCreate())
1275              throw new Error("Attempt to auto-create ExemptionComponent.type");
1276            else if (Configuration.doAutoCreate())
1277              this.type = new CodeableConcept(); // cc
1278          return this.type;
1279        }
1280
1281        public boolean hasType() { 
1282          return this.type != null && !this.type.isEmpty();
1283        }
1284
1285        /**
1286         * @param value {@link #type} (The code for the specific exception.)
1287         */
1288        public ExemptionComponent setType(CodeableConcept value) { 
1289          this.type = value;
1290          return this;
1291        }
1292
1293        /**
1294         * @return {@link #period} (The timeframe the exception is in force.)
1295         */
1296        public Period getPeriod() { 
1297          if (this.period == null)
1298            if (Configuration.errorOnAutoCreate())
1299              throw new Error("Attempt to auto-create ExemptionComponent.period");
1300            else if (Configuration.doAutoCreate())
1301              this.period = new Period(); // cc
1302          return this.period;
1303        }
1304
1305        public boolean hasPeriod() { 
1306          return this.period != null && !this.period.isEmpty();
1307        }
1308
1309        /**
1310         * @param value {@link #period} (The timeframe the exception is in force.)
1311         */
1312        public ExemptionComponent setPeriod(Period value) { 
1313          this.period = value;
1314          return this;
1315        }
1316
1317        protected void listChildren(List<Property> children) {
1318          super.listChildren(children);
1319          children.add(new Property("type", "CodeableConcept", "The code for the specific exception.", 0, 1, type));
1320          children.add(new Property("period", "Period", "The timeframe the exception is in force.", 0, 1, period));
1321        }
1322
1323        @Override
1324        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1325          switch (_hash) {
1326          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The code for the specific exception.", 0, 1, type);
1327          case -991726143: /*period*/  return new Property("period", "Period", "The timeframe the exception is in force.", 0, 1, period);
1328          default: return super.getNamedProperty(_hash, _name, _checkValid);
1329          }
1330
1331        }
1332
1333      @Override
1334      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1335        switch (hash) {
1336        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1337        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1338        default: return super.getProperty(hash, name, checkValid);
1339        }
1340
1341      }
1342
1343      @Override
1344      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1345        switch (hash) {
1346        case 3575610: // type
1347          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1348          return value;
1349        case -991726143: // period
1350          this.period = TypeConvertor.castToPeriod(value); // Period
1351          return value;
1352        default: return super.setProperty(hash, name, value);
1353        }
1354
1355      }
1356
1357      @Override
1358      public Base setProperty(String name, Base value) throws FHIRException {
1359        if (name.equals("type")) {
1360          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1361        } else if (name.equals("period")) {
1362          this.period = TypeConvertor.castToPeriod(value); // Period
1363        } else
1364          return super.setProperty(name, value);
1365        return value;
1366      }
1367
1368  @Override
1369  public void removeChild(String name, Base value) throws FHIRException {
1370        if (name.equals("type")) {
1371          this.type = null;
1372        } else if (name.equals("period")) {
1373          this.period = null;
1374        } else
1375          super.removeChild(name, value);
1376        
1377      }
1378
1379      @Override
1380      public Base makeProperty(int hash, String name) throws FHIRException {
1381        switch (hash) {
1382        case 3575610:  return getType();
1383        case -991726143:  return getPeriod();
1384        default: return super.makeProperty(hash, name);
1385        }
1386
1387      }
1388
1389      @Override
1390      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1391        switch (hash) {
1392        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1393        case -991726143: /*period*/ return new String[] {"Period"};
1394        default: return super.getTypesForProperty(hash, name);
1395        }
1396
1397      }
1398
1399      @Override
1400      public Base addChild(String name) throws FHIRException {
1401        if (name.equals("type")) {
1402          this.type = new CodeableConcept();
1403          return this.type;
1404        }
1405        else if (name.equals("period")) {
1406          this.period = new Period();
1407          return this.period;
1408        }
1409        else
1410          return super.addChild(name);
1411      }
1412
1413      public ExemptionComponent copy() {
1414        ExemptionComponent dst = new ExemptionComponent();
1415        copyValues(dst);
1416        return dst;
1417      }
1418
1419      public void copyValues(ExemptionComponent dst) {
1420        super.copyValues(dst);
1421        dst.type = type == null ? null : type.copy();
1422        dst.period = period == null ? null : period.copy();
1423      }
1424
1425      @Override
1426      public boolean equalsDeep(Base other_) {
1427        if (!super.equalsDeep(other_))
1428          return false;
1429        if (!(other_ instanceof ExemptionComponent))
1430          return false;
1431        ExemptionComponent o = (ExemptionComponent) other_;
1432        return compareDeep(type, o.type, true) && compareDeep(period, o.period, true);
1433      }
1434
1435      @Override
1436      public boolean equalsShallow(Base other_) {
1437        if (!super.equalsShallow(other_))
1438          return false;
1439        if (!(other_ instanceof ExemptionComponent))
1440          return false;
1441        ExemptionComponent o = (ExemptionComponent) other_;
1442        return true;
1443      }
1444
1445      public boolean isEmpty() {
1446        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, period);
1447      }
1448
1449  public String fhirType() {
1450    return "Coverage.costToBeneficiary.exception";
1451
1452  }
1453
1454  }
1455
1456    /**
1457     * The identifier of the coverage as issued by the insurer.
1458     */
1459    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1460    @Description(shortDefinition="Business identifier(s) for this coverage", formalDefinition="The identifier of the coverage as issued by the insurer." )
1461    protected List<Identifier> identifier;
1462
1463    /**
1464     * The status of the resource instance.
1465     */
1466    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1467    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
1468    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
1469    protected Enumeration<FinancialResourceStatusCodes> status;
1470
1471    /**
1472     * The nature of the coverage be it insurance, or cash payment such as self-pay.
1473     */
1474    @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1475    @Description(shortDefinition="insurance | self-pay | other", formalDefinition="The nature of the coverage be it insurance, or cash payment such as self-pay." )
1476    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-kind")
1477    protected Enumeration<Kind> kind;
1478
1479    /**
1480     * Link to the paying party and optionally what specifically they will be responsible to pay.
1481     */
1482    @Child(name = "paymentBy", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1483    @Description(shortDefinition="Self-pay parties and responsibility", formalDefinition="Link to the paying party and optionally what specifically they will be responsible to pay." )
1484    protected List<CoveragePaymentByComponent> paymentBy;
1485
1486    /**
1487     * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.
1488     */
1489    @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
1490    @Description(shortDefinition="Coverage category such as medical or accident", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization." )
1491    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-type")
1492    protected CodeableConcept type;
1493
1494    /**
1495     * The party who 'owns' the insurance policy.
1496     */
1497    @Child(name = "policyHolder", type = {Patient.class, RelatedPerson.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true)
1498    @Description(shortDefinition="Owner of the policy", formalDefinition="The party who 'owns' the insurance policy." )
1499    protected Reference policyHolder;
1500
1501    /**
1502     * The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.
1503     */
1504    @Child(name = "subscriber", type = {Patient.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true)
1505    @Description(shortDefinition="Subscriber to the policy", formalDefinition="The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due." )
1506    protected Reference subscriber;
1507
1508    /**
1509     * The insurer assigned ID for the Subscriber.
1510     */
1511    @Child(name = "subscriberId", type = {Identifier.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1512    @Description(shortDefinition="ID assigned to the subscriber", formalDefinition="The insurer assigned ID for the Subscriber." )
1513    protected List<Identifier> subscriberId;
1514
1515    /**
1516     * The party who benefits from the insurance coverage; the patient when products and/or services are provided.
1517     */
1518    @Child(name = "beneficiary", type = {Patient.class}, order=8, min=1, max=1, modifier=false, summary=true)
1519    @Description(shortDefinition="Plan beneficiary", formalDefinition="The party who benefits from the insurance coverage; the patient when products and/or services are provided." )
1520    protected Reference beneficiary;
1521
1522    /**
1523     * A designator for a dependent under the coverage.
1524     */
1525    @Child(name = "dependent", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1526    @Description(shortDefinition="Dependent number", formalDefinition="A designator for a dependent under the coverage." )
1527    protected StringType dependent;
1528
1529    /**
1530     * The relationship of beneficiary (patient) to the subscriber.
1531     */
1532    @Child(name = "relationship", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false)
1533    @Description(shortDefinition="Beneficiary relationship to the subscriber", formalDefinition="The relationship of beneficiary (patient) to the subscriber." )
1534    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subscriber-relationship")
1535    protected CodeableConcept relationship;
1536
1537    /**
1538     * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.
1539     */
1540    @Child(name = "period", type = {Period.class}, order=11, min=0, max=1, modifier=false, summary=true)
1541    @Description(shortDefinition="Coverage start and end dates", formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." )
1542    protected Period period;
1543
1544    /**
1545     * The program or plan underwriter, payor, insurance company.
1546     */
1547    @Child(name = "insurer", type = {Organization.class}, order=12, min=0, max=1, modifier=false, summary=true)
1548    @Description(shortDefinition="Issuer of the policy", formalDefinition="The program or plan underwriter, payor, insurance company." )
1549    protected Reference insurer;
1550
1551    /**
1552     * A suite of underwriter specific classifiers.
1553     */
1554    @Child(name = "class", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1555    @Description(shortDefinition="Additional coverage classifications", formalDefinition="A suite of underwriter specific classifiers." )
1556    protected List<ClassComponent> class_;
1557
1558    /**
1559     * The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.
1560     */
1561    @Child(name = "order", type = {PositiveIntType.class}, order=14, min=0, max=1, modifier=false, summary=true)
1562    @Description(shortDefinition="Relative order of the coverage", formalDefinition="The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis." )
1563    protected PositiveIntType order;
1564
1565    /**
1566     * The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.
1567     */
1568    @Child(name = "network", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true)
1569    @Description(shortDefinition="Insurer network", formalDefinition="The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply." )
1570    protected StringType network;
1571
1572    /**
1573     * A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.
1574     */
1575    @Child(name = "costToBeneficiary", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1576    @Description(shortDefinition="Patient payments for services/products", formalDefinition="A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card." )
1577    protected List<CostToBeneficiaryComponent> costToBeneficiary;
1578
1579    /**
1580     * When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
1581     */
1582    @Child(name = "subrogation", type = {BooleanType.class}, order=17, min=0, max=1, modifier=false, summary=false)
1583    @Description(shortDefinition="Reimbursement to insurer", formalDefinition="When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs." )
1584    protected BooleanType subrogation;
1585
1586    /**
1587     * The policy(s) which constitute this insurance coverage.
1588     */
1589    @Child(name = "contract", type = {Contract.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1590    @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." )
1591    protected List<Reference> contract;
1592
1593    /**
1594     * The insurance plan details, benefits and costs, which constitute this insurance coverage.
1595     */
1596    @Child(name = "insurancePlan", type = {InsurancePlan.class}, order=19, min=0, max=1, modifier=false, summary=false)
1597    @Description(shortDefinition="Insurance plan details", formalDefinition="The insurance plan details, benefits and costs, which constitute this insurance coverage." )
1598    protected Reference insurancePlan;
1599
1600    private static final long serialVersionUID = -1129388911L;
1601
1602  /**
1603   * Constructor
1604   */
1605    public Coverage() {
1606      super();
1607    }
1608
1609  /**
1610   * Constructor
1611   */
1612    public Coverage(FinancialResourceStatusCodes status, Kind kind, Reference beneficiary) {
1613      super();
1614      this.setStatus(status);
1615      this.setKind(kind);
1616      this.setBeneficiary(beneficiary);
1617    }
1618
1619    /**
1620     * @return {@link #identifier} (The identifier of the coverage as issued by the insurer.)
1621     */
1622    public List<Identifier> getIdentifier() { 
1623      if (this.identifier == null)
1624        this.identifier = new ArrayList<Identifier>();
1625      return this.identifier;
1626    }
1627
1628    /**
1629     * @return Returns a reference to <code>this</code> for easy method chaining
1630     */
1631    public Coverage setIdentifier(List<Identifier> theIdentifier) { 
1632      this.identifier = theIdentifier;
1633      return this;
1634    }
1635
1636    public boolean hasIdentifier() { 
1637      if (this.identifier == null)
1638        return false;
1639      for (Identifier item : this.identifier)
1640        if (!item.isEmpty())
1641          return true;
1642      return false;
1643    }
1644
1645    public Identifier addIdentifier() { //3
1646      Identifier t = new Identifier();
1647      if (this.identifier == null)
1648        this.identifier = new ArrayList<Identifier>();
1649      this.identifier.add(t);
1650      return t;
1651    }
1652
1653    public Coverage addIdentifier(Identifier t) { //3
1654      if (t == null)
1655        return this;
1656      if (this.identifier == null)
1657        this.identifier = new ArrayList<Identifier>();
1658      this.identifier.add(t);
1659      return this;
1660    }
1661
1662    /**
1663     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1664     */
1665    public Identifier getIdentifierFirstRep() { 
1666      if (getIdentifier().isEmpty()) {
1667        addIdentifier();
1668      }
1669      return getIdentifier().get(0);
1670    }
1671
1672    /**
1673     * @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
1674     */
1675    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
1676      if (this.status == null)
1677        if (Configuration.errorOnAutoCreate())
1678          throw new Error("Attempt to auto-create Coverage.status");
1679        else if (Configuration.doAutoCreate())
1680          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
1681      return this.status;
1682    }
1683
1684    public boolean hasStatusElement() { 
1685      return this.status != null && !this.status.isEmpty();
1686    }
1687
1688    public boolean hasStatus() { 
1689      return this.status != null && !this.status.isEmpty();
1690    }
1691
1692    /**
1693     * @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
1694     */
1695    public Coverage setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
1696      this.status = value;
1697      return this;
1698    }
1699
1700    /**
1701     * @return The status of the resource instance.
1702     */
1703    public FinancialResourceStatusCodes getStatus() { 
1704      return this.status == null ? null : this.status.getValue();
1705    }
1706
1707    /**
1708     * @param value The status of the resource instance.
1709     */
1710    public Coverage setStatus(FinancialResourceStatusCodes value) { 
1711        if (this.status == null)
1712          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
1713        this.status.setValue(value);
1714      return this;
1715    }
1716
1717    /**
1718     * @return {@link #kind} (The nature of the coverage be it insurance, or cash payment such as self-pay.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
1719     */
1720    public Enumeration<Kind> getKindElement() { 
1721      if (this.kind == null)
1722        if (Configuration.errorOnAutoCreate())
1723          throw new Error("Attempt to auto-create Coverage.kind");
1724        else if (Configuration.doAutoCreate())
1725          this.kind = new Enumeration<Kind>(new KindEnumFactory()); // bb
1726      return this.kind;
1727    }
1728
1729    public boolean hasKindElement() { 
1730      return this.kind != null && !this.kind.isEmpty();
1731    }
1732
1733    public boolean hasKind() { 
1734      return this.kind != null && !this.kind.isEmpty();
1735    }
1736
1737    /**
1738     * @param value {@link #kind} (The nature of the coverage be it insurance, or cash payment such as self-pay.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
1739     */
1740    public Coverage setKindElement(Enumeration<Kind> value) { 
1741      this.kind = value;
1742      return this;
1743    }
1744
1745    /**
1746     * @return The nature of the coverage be it insurance, or cash payment such as self-pay.
1747     */
1748    public Kind getKind() { 
1749      return this.kind == null ? null : this.kind.getValue();
1750    }
1751
1752    /**
1753     * @param value The nature of the coverage be it insurance, or cash payment such as self-pay.
1754     */
1755    public Coverage setKind(Kind value) { 
1756        if (this.kind == null)
1757          this.kind = new Enumeration<Kind>(new KindEnumFactory());
1758        this.kind.setValue(value);
1759      return this;
1760    }
1761
1762    /**
1763     * @return {@link #paymentBy} (Link to the paying party and optionally what specifically they will be responsible to pay.)
1764     */
1765    public List<CoveragePaymentByComponent> getPaymentBy() { 
1766      if (this.paymentBy == null)
1767        this.paymentBy = new ArrayList<CoveragePaymentByComponent>();
1768      return this.paymentBy;
1769    }
1770
1771    /**
1772     * @return Returns a reference to <code>this</code> for easy method chaining
1773     */
1774    public Coverage setPaymentBy(List<CoveragePaymentByComponent> thePaymentBy) { 
1775      this.paymentBy = thePaymentBy;
1776      return this;
1777    }
1778
1779    public boolean hasPaymentBy() { 
1780      if (this.paymentBy == null)
1781        return false;
1782      for (CoveragePaymentByComponent item : this.paymentBy)
1783        if (!item.isEmpty())
1784          return true;
1785      return false;
1786    }
1787
1788    public CoveragePaymentByComponent addPaymentBy() { //3
1789      CoveragePaymentByComponent t = new CoveragePaymentByComponent();
1790      if (this.paymentBy == null)
1791        this.paymentBy = new ArrayList<CoveragePaymentByComponent>();
1792      this.paymentBy.add(t);
1793      return t;
1794    }
1795
1796    public Coverage addPaymentBy(CoveragePaymentByComponent t) { //3
1797      if (t == null)
1798        return this;
1799      if (this.paymentBy == null)
1800        this.paymentBy = new ArrayList<CoveragePaymentByComponent>();
1801      this.paymentBy.add(t);
1802      return this;
1803    }
1804
1805    /**
1806     * @return The first repetition of repeating field {@link #paymentBy}, creating it if it does not already exist {3}
1807     */
1808    public CoveragePaymentByComponent getPaymentByFirstRep() { 
1809      if (getPaymentBy().isEmpty()) {
1810        addPaymentBy();
1811      }
1812      return getPaymentBy().get(0);
1813    }
1814
1815    /**
1816     * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.)
1817     */
1818    public CodeableConcept getType() { 
1819      if (this.type == null)
1820        if (Configuration.errorOnAutoCreate())
1821          throw new Error("Attempt to auto-create Coverage.type");
1822        else if (Configuration.doAutoCreate())
1823          this.type = new CodeableConcept(); // cc
1824      return this.type;
1825    }
1826
1827    public boolean hasType() { 
1828      return this.type != null && !this.type.isEmpty();
1829    }
1830
1831    /**
1832     * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.)
1833     */
1834    public Coverage setType(CodeableConcept value) { 
1835      this.type = value;
1836      return this;
1837    }
1838
1839    /**
1840     * @return {@link #policyHolder} (The party who 'owns' the insurance policy.)
1841     */
1842    public Reference getPolicyHolder() { 
1843      if (this.policyHolder == null)
1844        if (Configuration.errorOnAutoCreate())
1845          throw new Error("Attempt to auto-create Coverage.policyHolder");
1846        else if (Configuration.doAutoCreate())
1847          this.policyHolder = new Reference(); // cc
1848      return this.policyHolder;
1849    }
1850
1851    public boolean hasPolicyHolder() { 
1852      return this.policyHolder != null && !this.policyHolder.isEmpty();
1853    }
1854
1855    /**
1856     * @param value {@link #policyHolder} (The party who 'owns' the insurance policy.)
1857     */
1858    public Coverage setPolicyHolder(Reference value) { 
1859      this.policyHolder = value;
1860      return this;
1861    }
1862
1863    /**
1864     * @return {@link #subscriber} (The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.)
1865     */
1866    public Reference getSubscriber() { 
1867      if (this.subscriber == null)
1868        if (Configuration.errorOnAutoCreate())
1869          throw new Error("Attempt to auto-create Coverage.subscriber");
1870        else if (Configuration.doAutoCreate())
1871          this.subscriber = new Reference(); // cc
1872      return this.subscriber;
1873    }
1874
1875    public boolean hasSubscriber() { 
1876      return this.subscriber != null && !this.subscriber.isEmpty();
1877    }
1878
1879    /**
1880     * @param value {@link #subscriber} (The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.)
1881     */
1882    public Coverage setSubscriber(Reference value) { 
1883      this.subscriber = value;
1884      return this;
1885    }
1886
1887    /**
1888     * @return {@link #subscriberId} (The insurer assigned ID for the Subscriber.)
1889     */
1890    public List<Identifier> getSubscriberId() { 
1891      if (this.subscriberId == null)
1892        this.subscriberId = new ArrayList<Identifier>();
1893      return this.subscriberId;
1894    }
1895
1896    /**
1897     * @return Returns a reference to <code>this</code> for easy method chaining
1898     */
1899    public Coverage setSubscriberId(List<Identifier> theSubscriberId) { 
1900      this.subscriberId = theSubscriberId;
1901      return this;
1902    }
1903
1904    public boolean hasSubscriberId() { 
1905      if (this.subscriberId == null)
1906        return false;
1907      for (Identifier item : this.subscriberId)
1908        if (!item.isEmpty())
1909          return true;
1910      return false;
1911    }
1912
1913    public Identifier addSubscriberId() { //3
1914      Identifier t = new Identifier();
1915      if (this.subscriberId == null)
1916        this.subscriberId = new ArrayList<Identifier>();
1917      this.subscriberId.add(t);
1918      return t;
1919    }
1920
1921    public Coverage addSubscriberId(Identifier t) { //3
1922      if (t == null)
1923        return this;
1924      if (this.subscriberId == null)
1925        this.subscriberId = new ArrayList<Identifier>();
1926      this.subscriberId.add(t);
1927      return this;
1928    }
1929
1930    /**
1931     * @return The first repetition of repeating field {@link #subscriberId}, creating it if it does not already exist {3}
1932     */
1933    public Identifier getSubscriberIdFirstRep() { 
1934      if (getSubscriberId().isEmpty()) {
1935        addSubscriberId();
1936      }
1937      return getSubscriberId().get(0);
1938    }
1939
1940    /**
1941     * @return {@link #beneficiary} (The party who benefits from the insurance coverage; the patient when products and/or services are provided.)
1942     */
1943    public Reference getBeneficiary() { 
1944      if (this.beneficiary == null)
1945        if (Configuration.errorOnAutoCreate())
1946          throw new Error("Attempt to auto-create Coverage.beneficiary");
1947        else if (Configuration.doAutoCreate())
1948          this.beneficiary = new Reference(); // cc
1949      return this.beneficiary;
1950    }
1951
1952    public boolean hasBeneficiary() { 
1953      return this.beneficiary != null && !this.beneficiary.isEmpty();
1954    }
1955
1956    /**
1957     * @param value {@link #beneficiary} (The party who benefits from the insurance coverage; the patient when products and/or services are provided.)
1958     */
1959    public Coverage setBeneficiary(Reference value) { 
1960      this.beneficiary = value;
1961      return this;
1962    }
1963
1964    /**
1965     * @return {@link #dependent} (A designator for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value
1966     */
1967    public StringType getDependentElement() { 
1968      if (this.dependent == null)
1969        if (Configuration.errorOnAutoCreate())
1970          throw new Error("Attempt to auto-create Coverage.dependent");
1971        else if (Configuration.doAutoCreate())
1972          this.dependent = new StringType(); // bb
1973      return this.dependent;
1974    }
1975
1976    public boolean hasDependentElement() { 
1977      return this.dependent != null && !this.dependent.isEmpty();
1978    }
1979
1980    public boolean hasDependent() { 
1981      return this.dependent != null && !this.dependent.isEmpty();
1982    }
1983
1984    /**
1985     * @param value {@link #dependent} (A designator for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value
1986     */
1987    public Coverage setDependentElement(StringType value) { 
1988      this.dependent = value;
1989      return this;
1990    }
1991
1992    /**
1993     * @return A designator for a dependent under the coverage.
1994     */
1995    public String getDependent() { 
1996      return this.dependent == null ? null : this.dependent.getValue();
1997    }
1998
1999    /**
2000     * @param value A designator for a dependent under the coverage.
2001     */
2002    public Coverage setDependent(String value) { 
2003      if (Utilities.noString(value))
2004        this.dependent = null;
2005      else {
2006        if (this.dependent == null)
2007          this.dependent = new StringType();
2008        this.dependent.setValue(value);
2009      }
2010      return this;
2011    }
2012
2013    /**
2014     * @return {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.)
2015     */
2016    public CodeableConcept getRelationship() { 
2017      if (this.relationship == null)
2018        if (Configuration.errorOnAutoCreate())
2019          throw new Error("Attempt to auto-create Coverage.relationship");
2020        else if (Configuration.doAutoCreate())
2021          this.relationship = new CodeableConcept(); // cc
2022      return this.relationship;
2023    }
2024
2025    public boolean hasRelationship() { 
2026      return this.relationship != null && !this.relationship.isEmpty();
2027    }
2028
2029    /**
2030     * @param value {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.)
2031     */
2032    public Coverage setRelationship(CodeableConcept value) { 
2033      this.relationship = value;
2034      return this;
2035    }
2036
2037    /**
2038     * @return {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.)
2039     */
2040    public Period getPeriod() { 
2041      if (this.period == null)
2042        if (Configuration.errorOnAutoCreate())
2043          throw new Error("Attempt to auto-create Coverage.period");
2044        else if (Configuration.doAutoCreate())
2045          this.period = new Period(); // cc
2046      return this.period;
2047    }
2048
2049    public boolean hasPeriod() { 
2050      return this.period != null && !this.period.isEmpty();
2051    }
2052
2053    /**
2054     * @param value {@link #period} (Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.)
2055     */
2056    public Coverage setPeriod(Period value) { 
2057      this.period = value;
2058      return this;
2059    }
2060
2061    /**
2062     * @return {@link #insurer} (The program or plan underwriter, payor, insurance company.)
2063     */
2064    public Reference getInsurer() { 
2065      if (this.insurer == null)
2066        if (Configuration.errorOnAutoCreate())
2067          throw new Error("Attempt to auto-create Coverage.insurer");
2068        else if (Configuration.doAutoCreate())
2069          this.insurer = new Reference(); // cc
2070      return this.insurer;
2071    }
2072
2073    public boolean hasInsurer() { 
2074      return this.insurer != null && !this.insurer.isEmpty();
2075    }
2076
2077    /**
2078     * @param value {@link #insurer} (The program or plan underwriter, payor, insurance company.)
2079     */
2080    public Coverage setInsurer(Reference value) { 
2081      this.insurer = value;
2082      return this;
2083    }
2084
2085    /**
2086     * @return {@link #class_} (A suite of underwriter specific classifiers.)
2087     */
2088    public List<ClassComponent> getClass_() { 
2089      if (this.class_ == null)
2090        this.class_ = new ArrayList<ClassComponent>();
2091      return this.class_;
2092    }
2093
2094    /**
2095     * @return Returns a reference to <code>this</code> for easy method chaining
2096     */
2097    public Coverage setClass_(List<ClassComponent> theClass_) { 
2098      this.class_ = theClass_;
2099      return this;
2100    }
2101
2102    public boolean hasClass_() { 
2103      if (this.class_ == null)
2104        return false;
2105      for (ClassComponent item : this.class_)
2106        if (!item.isEmpty())
2107          return true;
2108      return false;
2109    }
2110
2111    public ClassComponent addClass_() { //3
2112      ClassComponent t = new ClassComponent();
2113      if (this.class_ == null)
2114        this.class_ = new ArrayList<ClassComponent>();
2115      this.class_.add(t);
2116      return t;
2117    }
2118
2119    public Coverage addClass_(ClassComponent t) { //3
2120      if (t == null)
2121        return this;
2122      if (this.class_ == null)
2123        this.class_ = new ArrayList<ClassComponent>();
2124      this.class_.add(t);
2125      return this;
2126    }
2127
2128    /**
2129     * @return The first repetition of repeating field {@link #class_}, creating it if it does not already exist {3}
2130     */
2131    public ClassComponent getClass_FirstRep() { 
2132      if (getClass_().isEmpty()) {
2133        addClass_();
2134      }
2135      return getClass_().get(0);
2136    }
2137
2138    /**
2139     * @return {@link #order} (The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value
2140     */
2141    public PositiveIntType getOrderElement() { 
2142      if (this.order == null)
2143        if (Configuration.errorOnAutoCreate())
2144          throw new Error("Attempt to auto-create Coverage.order");
2145        else if (Configuration.doAutoCreate())
2146          this.order = new PositiveIntType(); // bb
2147      return this.order;
2148    }
2149
2150    public boolean hasOrderElement() { 
2151      return this.order != null && !this.order.isEmpty();
2152    }
2153
2154    public boolean hasOrder() { 
2155      return this.order != null && !this.order.isEmpty();
2156    }
2157
2158    /**
2159     * @param value {@link #order} (The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value
2160     */
2161    public Coverage setOrderElement(PositiveIntType value) { 
2162      this.order = value;
2163      return this;
2164    }
2165
2166    /**
2167     * @return The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.
2168     */
2169    public int getOrder() { 
2170      return this.order == null || this.order.isEmpty() ? 0 : this.order.getValue();
2171    }
2172
2173    /**
2174     * @param value The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.
2175     */
2176    public Coverage setOrder(int value) { 
2177        if (this.order == null)
2178          this.order = new PositiveIntType();
2179        this.order.setValue(value);
2180      return this;
2181    }
2182
2183    /**
2184     * @return {@link #network} (The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value
2185     */
2186    public StringType getNetworkElement() { 
2187      if (this.network == null)
2188        if (Configuration.errorOnAutoCreate())
2189          throw new Error("Attempt to auto-create Coverage.network");
2190        else if (Configuration.doAutoCreate())
2191          this.network = new StringType(); // bb
2192      return this.network;
2193    }
2194
2195    public boolean hasNetworkElement() { 
2196      return this.network != null && !this.network.isEmpty();
2197    }
2198
2199    public boolean hasNetwork() { 
2200      return this.network != null && !this.network.isEmpty();
2201    }
2202
2203    /**
2204     * @param value {@link #network} (The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value
2205     */
2206    public Coverage setNetworkElement(StringType value) { 
2207      this.network = value;
2208      return this;
2209    }
2210
2211    /**
2212     * @return The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.
2213     */
2214    public String getNetwork() { 
2215      return this.network == null ? null : this.network.getValue();
2216    }
2217
2218    /**
2219     * @param value The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.
2220     */
2221    public Coverage setNetwork(String value) { 
2222      if (Utilities.noString(value))
2223        this.network = null;
2224      else {
2225        if (this.network == null)
2226          this.network = new StringType();
2227        this.network.setValue(value);
2228      }
2229      return this;
2230    }
2231
2232    /**
2233     * @return {@link #costToBeneficiary} (A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.)
2234     */
2235    public List<CostToBeneficiaryComponent> getCostToBeneficiary() { 
2236      if (this.costToBeneficiary == null)
2237        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
2238      return this.costToBeneficiary;
2239    }
2240
2241    /**
2242     * @return Returns a reference to <code>this</code> for easy method chaining
2243     */
2244    public Coverage setCostToBeneficiary(List<CostToBeneficiaryComponent> theCostToBeneficiary) { 
2245      this.costToBeneficiary = theCostToBeneficiary;
2246      return this;
2247    }
2248
2249    public boolean hasCostToBeneficiary() { 
2250      if (this.costToBeneficiary == null)
2251        return false;
2252      for (CostToBeneficiaryComponent item : this.costToBeneficiary)
2253        if (!item.isEmpty())
2254          return true;
2255      return false;
2256    }
2257
2258    public CostToBeneficiaryComponent addCostToBeneficiary() { //3
2259      CostToBeneficiaryComponent t = new CostToBeneficiaryComponent();
2260      if (this.costToBeneficiary == null)
2261        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
2262      this.costToBeneficiary.add(t);
2263      return t;
2264    }
2265
2266    public Coverage addCostToBeneficiary(CostToBeneficiaryComponent t) { //3
2267      if (t == null)
2268        return this;
2269      if (this.costToBeneficiary == null)
2270        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
2271      this.costToBeneficiary.add(t);
2272      return this;
2273    }
2274
2275    /**
2276     * @return The first repetition of repeating field {@link #costToBeneficiary}, creating it if it does not already exist {3}
2277     */
2278    public CostToBeneficiaryComponent getCostToBeneficiaryFirstRep() { 
2279      if (getCostToBeneficiary().isEmpty()) {
2280        addCostToBeneficiary();
2281      }
2282      return getCostToBeneficiary().get(0);
2283    }
2284
2285    /**
2286     * @return {@link #subrogation} (When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.). This is the underlying object with id, value and extensions. The accessor "getSubrogation" gives direct access to the value
2287     */
2288    public BooleanType getSubrogationElement() { 
2289      if (this.subrogation == null)
2290        if (Configuration.errorOnAutoCreate())
2291          throw new Error("Attempt to auto-create Coverage.subrogation");
2292        else if (Configuration.doAutoCreate())
2293          this.subrogation = new BooleanType(); // bb
2294      return this.subrogation;
2295    }
2296
2297    public boolean hasSubrogationElement() { 
2298      return this.subrogation != null && !this.subrogation.isEmpty();
2299    }
2300
2301    public boolean hasSubrogation() { 
2302      return this.subrogation != null && !this.subrogation.isEmpty();
2303    }
2304
2305    /**
2306     * @param value {@link #subrogation} (When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.). This is the underlying object with id, value and extensions. The accessor "getSubrogation" gives direct access to the value
2307     */
2308    public Coverage setSubrogationElement(BooleanType value) { 
2309      this.subrogation = value;
2310      return this;
2311    }
2312
2313    /**
2314     * @return When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
2315     */
2316    public boolean getSubrogation() { 
2317      return this.subrogation == null || this.subrogation.isEmpty() ? false : this.subrogation.getValue();
2318    }
2319
2320    /**
2321     * @param value When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
2322     */
2323    public Coverage setSubrogation(boolean value) { 
2324        if (this.subrogation == null)
2325          this.subrogation = new BooleanType();
2326        this.subrogation.setValue(value);
2327      return this;
2328    }
2329
2330    /**
2331     * @return {@link #contract} (The policy(s) which constitute this insurance coverage.)
2332     */
2333    public List<Reference> getContract() { 
2334      if (this.contract == null)
2335        this.contract = new ArrayList<Reference>();
2336      return this.contract;
2337    }
2338
2339    /**
2340     * @return Returns a reference to <code>this</code> for easy method chaining
2341     */
2342    public Coverage setContract(List<Reference> theContract) { 
2343      this.contract = theContract;
2344      return this;
2345    }
2346
2347    public boolean hasContract() { 
2348      if (this.contract == null)
2349        return false;
2350      for (Reference item : this.contract)
2351        if (!item.isEmpty())
2352          return true;
2353      return false;
2354    }
2355
2356    public Reference addContract() { //3
2357      Reference t = new Reference();
2358      if (this.contract == null)
2359        this.contract = new ArrayList<Reference>();
2360      this.contract.add(t);
2361      return t;
2362    }
2363
2364    public Coverage addContract(Reference t) { //3
2365      if (t == null)
2366        return this;
2367      if (this.contract == null)
2368        this.contract = new ArrayList<Reference>();
2369      this.contract.add(t);
2370      return this;
2371    }
2372
2373    /**
2374     * @return The first repetition of repeating field {@link #contract}, creating it if it does not already exist {3}
2375     */
2376    public Reference getContractFirstRep() { 
2377      if (getContract().isEmpty()) {
2378        addContract();
2379      }
2380      return getContract().get(0);
2381    }
2382
2383    /**
2384     * @return {@link #insurancePlan} (The insurance plan details, benefits and costs, which constitute this insurance coverage.)
2385     */
2386    public Reference getInsurancePlan() { 
2387      if (this.insurancePlan == null)
2388        if (Configuration.errorOnAutoCreate())
2389          throw new Error("Attempt to auto-create Coverage.insurancePlan");
2390        else if (Configuration.doAutoCreate())
2391          this.insurancePlan = new Reference(); // cc
2392      return this.insurancePlan;
2393    }
2394
2395    public boolean hasInsurancePlan() { 
2396      return this.insurancePlan != null && !this.insurancePlan.isEmpty();
2397    }
2398
2399    /**
2400     * @param value {@link #insurancePlan} (The insurance plan details, benefits and costs, which constitute this insurance coverage.)
2401     */
2402    public Coverage setInsurancePlan(Reference value) { 
2403      this.insurancePlan = value;
2404      return this;
2405    }
2406
2407      protected void listChildren(List<Property> children) {
2408        super.listChildren(children);
2409        children.add(new Property("identifier", "Identifier", "The identifier of the coverage as issued by the insurer.", 0, java.lang.Integer.MAX_VALUE, identifier));
2410        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
2411        children.add(new Property("kind", "code", "The nature of the coverage be it insurance, or cash payment such as self-pay.", 0, 1, kind));
2412        children.add(new Property("paymentBy", "", "Link to the paying party and optionally what specifically they will be responsible to pay.", 0, java.lang.Integer.MAX_VALUE, paymentBy));
2413        children.add(new Property("type", "CodeableConcept", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.", 0, 1, type));
2414        children.add(new Property("policyHolder", "Reference(Patient|RelatedPerson|Organization)", "The party who 'owns' the insurance policy.", 0, 1, policyHolder));
2415        children.add(new Property("subscriber", "Reference(Patient|RelatedPerson)", "The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.", 0, 1, subscriber));
2416        children.add(new Property("subscriberId", "Identifier", "The insurer assigned ID for the Subscriber.", 0, java.lang.Integer.MAX_VALUE, subscriberId));
2417        children.add(new Property("beneficiary", "Reference(Patient)", "The party who benefits from the insurance coverage; the patient when products and/or services are provided.", 0, 1, beneficiary));
2418        children.add(new Property("dependent", "string", "A designator for a dependent under the coverage.", 0, 1, dependent));
2419        children.add(new Property("relationship", "CodeableConcept", "The relationship of beneficiary (patient) to the subscriber.", 0, 1, relationship));
2420        children.add(new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, 1, period));
2421        children.add(new Property("insurer", "Reference(Organization)", "The program or plan underwriter, payor, insurance company.", 0, 1, insurer));
2422        children.add(new Property("class", "", "A suite of underwriter specific classifiers.", 0, java.lang.Integer.MAX_VALUE, class_));
2423        children.add(new Property("order", "positiveInt", "The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.", 0, 1, order));
2424        children.add(new Property("network", "string", "The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.", 0, 1, network));
2425        children.add(new Property("costToBeneficiary", "", "A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.", 0, java.lang.Integer.MAX_VALUE, costToBeneficiary));
2426        children.add(new Property("subrogation", "boolean", "When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.", 0, 1, subrogation));
2427        children.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract));
2428        children.add(new Property("insurancePlan", "Reference(InsurancePlan)", "The insurance plan details, benefits and costs, which constitute this insurance coverage.", 0, 1, insurancePlan));
2429      }
2430
2431      @Override
2432      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2433        switch (_hash) {
2434        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The identifier of the coverage as issued by the insurer.", 0, java.lang.Integer.MAX_VALUE, identifier);
2435        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
2436        case 3292052: /*kind*/  return new Property("kind", "code", "The nature of the coverage be it insurance, or cash payment such as self-pay.", 0, 1, kind);
2437        case -86519555: /*paymentBy*/  return new Property("paymentBy", "", "Link to the paying party and optionally what specifically they will be responsible to pay.", 0, java.lang.Integer.MAX_VALUE, paymentBy);
2438        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.", 0, 1, type);
2439        case 2046898558: /*policyHolder*/  return new Property("policyHolder", "Reference(Patient|RelatedPerson|Organization)", "The party who 'owns' the insurance policy.", 0, 1, policyHolder);
2440        case -1219769240: /*subscriber*/  return new Property("subscriber", "Reference(Patient|RelatedPerson)", "The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.", 0, 1, subscriber);
2441        case 327834531: /*subscriberId*/  return new Property("subscriberId", "Identifier", "The insurer assigned ID for the Subscriber.", 0, java.lang.Integer.MAX_VALUE, subscriberId);
2442        case -565102875: /*beneficiary*/  return new Property("beneficiary", "Reference(Patient)", "The party who benefits from the insurance coverage; the patient when products and/or services are provided.", 0, 1, beneficiary);
2443        case -1109226753: /*dependent*/  return new Property("dependent", "string", "A designator for a dependent under the coverage.", 0, 1, dependent);
2444        case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "The relationship of beneficiary (patient) to the subscriber.", 0, 1, relationship);
2445        case -991726143: /*period*/  return new Property("period", "Period", "Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.", 0, 1, period);
2446        case 1957615864: /*insurer*/  return new Property("insurer", "Reference(Organization)", "The program or plan underwriter, payor, insurance company.", 0, 1, insurer);
2447        case 94742904: /*class*/  return new Property("class", "", "A suite of underwriter specific classifiers.", 0, java.lang.Integer.MAX_VALUE, class_);
2448        case 106006350: /*order*/  return new Property("order", "positiveInt", "The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care. For example; a patient might have (0) auto insurance (1) their own health insurance and (2) spouse's health insurance. When claiming for treatments which were not the result of an auto accident then only coverages (1) and (2) above would be applicatble and would apply in the order specified in parenthesis.", 0, 1, order);
2449        case 1843485230: /*network*/  return new Property("network", "string", "The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.", 0, 1, network);
2450        case -1866474851: /*costToBeneficiary*/  return new Property("costToBeneficiary", "", "A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.", 0, java.lang.Integer.MAX_VALUE, costToBeneficiary);
2451        case 837389739: /*subrogation*/  return new Property("subrogation", "boolean", "When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.", 0, 1, subrogation);
2452        case -566947566: /*contract*/  return new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract);
2453        case 1992141091: /*insurancePlan*/  return new Property("insurancePlan", "Reference(InsurancePlan)", "The insurance plan details, benefits and costs, which constitute this insurance coverage.", 0, 1, insurancePlan);
2454        default: return super.getNamedProperty(_hash, _name, _checkValid);
2455        }
2456
2457      }
2458
2459      @Override
2460      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2461        switch (hash) {
2462        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2463        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
2464        case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<Kind>
2465        case -86519555: /*paymentBy*/ return this.paymentBy == null ? new Base[0] : this.paymentBy.toArray(new Base[this.paymentBy.size()]); // CoveragePaymentByComponent
2466        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2467        case 2046898558: /*policyHolder*/ return this.policyHolder == null ? new Base[0] : new Base[] {this.policyHolder}; // Reference
2468        case -1219769240: /*subscriber*/ return this.subscriber == null ? new Base[0] : new Base[] {this.subscriber}; // Reference
2469        case 327834531: /*subscriberId*/ return this.subscriberId == null ? new Base[0] : this.subscriberId.toArray(new Base[this.subscriberId.size()]); // Identifier
2470        case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Reference
2471        case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // StringType
2472        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
2473        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
2474        case 1957615864: /*insurer*/ return this.insurer == null ? new Base[0] : new Base[] {this.insurer}; // Reference
2475        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : this.class_.toArray(new Base[this.class_.size()]); // ClassComponent
2476        case 106006350: /*order*/ return this.order == null ? new Base[0] : new Base[] {this.order}; // PositiveIntType
2477        case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // StringType
2478        case -1866474851: /*costToBeneficiary*/ return this.costToBeneficiary == null ? new Base[0] : this.costToBeneficiary.toArray(new Base[this.costToBeneficiary.size()]); // CostToBeneficiaryComponent
2479        case 837389739: /*subrogation*/ return this.subrogation == null ? new Base[0] : new Base[] {this.subrogation}; // BooleanType
2480        case -566947566: /*contract*/ return this.contract == null ? new Base[0] : this.contract.toArray(new Base[this.contract.size()]); // Reference
2481        case 1992141091: /*insurancePlan*/ return this.insurancePlan == null ? new Base[0] : new Base[] {this.insurancePlan}; // Reference
2482        default: return super.getProperty(hash, name, checkValid);
2483        }
2484
2485      }
2486
2487      @Override
2488      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2489        switch (hash) {
2490        case -1618432855: // identifier
2491          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2492          return value;
2493        case -892481550: // status
2494          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2495          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2496          return value;
2497        case 3292052: // kind
2498          value = new KindEnumFactory().fromType(TypeConvertor.castToCode(value));
2499          this.kind = (Enumeration) value; // Enumeration<Kind>
2500          return value;
2501        case -86519555: // paymentBy
2502          this.getPaymentBy().add((CoveragePaymentByComponent) value); // CoveragePaymentByComponent
2503          return value;
2504        case 3575610: // type
2505          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2506          return value;
2507        case 2046898558: // policyHolder
2508          this.policyHolder = TypeConvertor.castToReference(value); // Reference
2509          return value;
2510        case -1219769240: // subscriber
2511          this.subscriber = TypeConvertor.castToReference(value); // Reference
2512          return value;
2513        case 327834531: // subscriberId
2514          this.getSubscriberId().add(TypeConvertor.castToIdentifier(value)); // Identifier
2515          return value;
2516        case -565102875: // beneficiary
2517          this.beneficiary = TypeConvertor.castToReference(value); // Reference
2518          return value;
2519        case -1109226753: // dependent
2520          this.dependent = TypeConvertor.castToString(value); // StringType
2521          return value;
2522        case -261851592: // relationship
2523          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2524          return value;
2525        case -991726143: // period
2526          this.period = TypeConvertor.castToPeriod(value); // Period
2527          return value;
2528        case 1957615864: // insurer
2529          this.insurer = TypeConvertor.castToReference(value); // Reference
2530          return value;
2531        case 94742904: // class
2532          this.getClass_().add((ClassComponent) value); // ClassComponent
2533          return value;
2534        case 106006350: // order
2535          this.order = TypeConvertor.castToPositiveInt(value); // PositiveIntType
2536          return value;
2537        case 1843485230: // network
2538          this.network = TypeConvertor.castToString(value); // StringType
2539          return value;
2540        case -1866474851: // costToBeneficiary
2541          this.getCostToBeneficiary().add((CostToBeneficiaryComponent) value); // CostToBeneficiaryComponent
2542          return value;
2543        case 837389739: // subrogation
2544          this.subrogation = TypeConvertor.castToBoolean(value); // BooleanType
2545          return value;
2546        case -566947566: // contract
2547          this.getContract().add(TypeConvertor.castToReference(value)); // Reference
2548          return value;
2549        case 1992141091: // insurancePlan
2550          this.insurancePlan = TypeConvertor.castToReference(value); // Reference
2551          return value;
2552        default: return super.setProperty(hash, name, value);
2553        }
2554
2555      }
2556
2557      @Override
2558      public Base setProperty(String name, Base value) throws FHIRException {
2559        if (name.equals("identifier")) {
2560          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2561        } else if (name.equals("status")) {
2562          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2563          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2564        } else if (name.equals("kind")) {
2565          value = new KindEnumFactory().fromType(TypeConvertor.castToCode(value));
2566          this.kind = (Enumeration) value; // Enumeration<Kind>
2567        } else if (name.equals("paymentBy")) {
2568          this.getPaymentBy().add((CoveragePaymentByComponent) value);
2569        } else if (name.equals("type")) {
2570          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2571        } else if (name.equals("policyHolder")) {
2572          this.policyHolder = TypeConvertor.castToReference(value); // Reference
2573        } else if (name.equals("subscriber")) {
2574          this.subscriber = TypeConvertor.castToReference(value); // Reference
2575        } else if (name.equals("subscriberId")) {
2576          this.getSubscriberId().add(TypeConvertor.castToIdentifier(value));
2577        } else if (name.equals("beneficiary")) {
2578          this.beneficiary = TypeConvertor.castToReference(value); // Reference
2579        } else if (name.equals("dependent")) {
2580          this.dependent = TypeConvertor.castToString(value); // StringType
2581        } else if (name.equals("relationship")) {
2582          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2583        } else if (name.equals("period")) {
2584          this.period = TypeConvertor.castToPeriod(value); // Period
2585        } else if (name.equals("insurer")) {
2586          this.insurer = TypeConvertor.castToReference(value); // Reference
2587        } else if (name.equals("class")) {
2588          this.getClass_().add((ClassComponent) value);
2589        } else if (name.equals("order")) {
2590          this.order = TypeConvertor.castToPositiveInt(value); // PositiveIntType
2591        } else if (name.equals("network")) {
2592          this.network = TypeConvertor.castToString(value); // StringType
2593        } else if (name.equals("costToBeneficiary")) {
2594          this.getCostToBeneficiary().add((CostToBeneficiaryComponent) value);
2595        } else if (name.equals("subrogation")) {
2596          this.subrogation = TypeConvertor.castToBoolean(value); // BooleanType
2597        } else if (name.equals("contract")) {
2598          this.getContract().add(TypeConvertor.castToReference(value));
2599        } else if (name.equals("insurancePlan")) {
2600          this.insurancePlan = TypeConvertor.castToReference(value); // Reference
2601        } else
2602          return super.setProperty(name, value);
2603        return value;
2604      }
2605
2606  @Override
2607  public void removeChild(String name, Base value) throws FHIRException {
2608        if (name.equals("identifier")) {
2609          this.getIdentifier().remove(value);
2610        } else if (name.equals("status")) {
2611          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
2612          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
2613        } else if (name.equals("kind")) {
2614          value = new KindEnumFactory().fromType(TypeConvertor.castToCode(value));
2615          this.kind = (Enumeration) value; // Enumeration<Kind>
2616        } else if (name.equals("paymentBy")) {
2617          this.getPaymentBy().remove((CoveragePaymentByComponent) value);
2618        } else if (name.equals("type")) {
2619          this.type = null;
2620        } else if (name.equals("policyHolder")) {
2621          this.policyHolder = null;
2622        } else if (name.equals("subscriber")) {
2623          this.subscriber = null;
2624        } else if (name.equals("subscriberId")) {
2625          this.getSubscriberId().remove(value);
2626        } else if (name.equals("beneficiary")) {
2627          this.beneficiary = null;
2628        } else if (name.equals("dependent")) {
2629          this.dependent = null;
2630        } else if (name.equals("relationship")) {
2631          this.relationship = null;
2632        } else if (name.equals("period")) {
2633          this.period = null;
2634        } else if (name.equals("insurer")) {
2635          this.insurer = null;
2636        } else if (name.equals("class")) {
2637          this.getClass_().remove((ClassComponent) value);
2638        } else if (name.equals("order")) {
2639          this.order = null;
2640        } else if (name.equals("network")) {
2641          this.network = null;
2642        } else if (name.equals("costToBeneficiary")) {
2643          this.getCostToBeneficiary().remove((CostToBeneficiaryComponent) value);
2644        } else if (name.equals("subrogation")) {
2645          this.subrogation = null;
2646        } else if (name.equals("contract")) {
2647          this.getContract().remove(value);
2648        } else if (name.equals("insurancePlan")) {
2649          this.insurancePlan = null;
2650        } else
2651          super.removeChild(name, value);
2652        
2653      }
2654
2655      @Override
2656      public Base makeProperty(int hash, String name) throws FHIRException {
2657        switch (hash) {
2658        case -1618432855:  return addIdentifier(); 
2659        case -892481550:  return getStatusElement();
2660        case 3292052:  return getKindElement();
2661        case -86519555:  return addPaymentBy(); 
2662        case 3575610:  return getType();
2663        case 2046898558:  return getPolicyHolder();
2664        case -1219769240:  return getSubscriber();
2665        case 327834531:  return addSubscriberId(); 
2666        case -565102875:  return getBeneficiary();
2667        case -1109226753:  return getDependentElement();
2668        case -261851592:  return getRelationship();
2669        case -991726143:  return getPeriod();
2670        case 1957615864:  return getInsurer();
2671        case 94742904:  return addClass_(); 
2672        case 106006350:  return getOrderElement();
2673        case 1843485230:  return getNetworkElement();
2674        case -1866474851:  return addCostToBeneficiary(); 
2675        case 837389739:  return getSubrogationElement();
2676        case -566947566:  return addContract(); 
2677        case 1992141091:  return getInsurancePlan();
2678        default: return super.makeProperty(hash, name);
2679        }
2680
2681      }
2682
2683      @Override
2684      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2685        switch (hash) {
2686        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2687        case -892481550: /*status*/ return new String[] {"code"};
2688        case 3292052: /*kind*/ return new String[] {"code"};
2689        case -86519555: /*paymentBy*/ return new String[] {};
2690        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2691        case 2046898558: /*policyHolder*/ return new String[] {"Reference"};
2692        case -1219769240: /*subscriber*/ return new String[] {"Reference"};
2693        case 327834531: /*subscriberId*/ return new String[] {"Identifier"};
2694        case -565102875: /*beneficiary*/ return new String[] {"Reference"};
2695        case -1109226753: /*dependent*/ return new String[] {"string"};
2696        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
2697        case -991726143: /*period*/ return new String[] {"Period"};
2698        case 1957615864: /*insurer*/ return new String[] {"Reference"};
2699        case 94742904: /*class*/ return new String[] {};
2700        case 106006350: /*order*/ return new String[] {"positiveInt"};
2701        case 1843485230: /*network*/ return new String[] {"string"};
2702        case -1866474851: /*costToBeneficiary*/ return new String[] {};
2703        case 837389739: /*subrogation*/ return new String[] {"boolean"};
2704        case -566947566: /*contract*/ return new String[] {"Reference"};
2705        case 1992141091: /*insurancePlan*/ return new String[] {"Reference"};
2706        default: return super.getTypesForProperty(hash, name);
2707        }
2708
2709      }
2710
2711      @Override
2712      public Base addChild(String name) throws FHIRException {
2713        if (name.equals("identifier")) {
2714          return addIdentifier();
2715        }
2716        else if (name.equals("status")) {
2717          throw new FHIRException("Cannot call addChild on a singleton property Coverage.status");
2718        }
2719        else if (name.equals("kind")) {
2720          throw new FHIRException("Cannot call addChild on a singleton property Coverage.kind");
2721        }
2722        else if (name.equals("paymentBy")) {
2723          return addPaymentBy();
2724        }
2725        else if (name.equals("type")) {
2726          this.type = new CodeableConcept();
2727          return this.type;
2728        }
2729        else if (name.equals("policyHolder")) {
2730          this.policyHolder = new Reference();
2731          return this.policyHolder;
2732        }
2733        else if (name.equals("subscriber")) {
2734          this.subscriber = new Reference();
2735          return this.subscriber;
2736        }
2737        else if (name.equals("subscriberId")) {
2738          return addSubscriberId();
2739        }
2740        else if (name.equals("beneficiary")) {
2741          this.beneficiary = new Reference();
2742          return this.beneficiary;
2743        }
2744        else if (name.equals("dependent")) {
2745          throw new FHIRException("Cannot call addChild on a singleton property Coverage.dependent");
2746        }
2747        else if (name.equals("relationship")) {
2748          this.relationship = new CodeableConcept();
2749          return this.relationship;
2750        }
2751        else if (name.equals("period")) {
2752          this.period = new Period();
2753          return this.period;
2754        }
2755        else if (name.equals("insurer")) {
2756          this.insurer = new Reference();
2757          return this.insurer;
2758        }
2759        else if (name.equals("class")) {
2760          return addClass_();
2761        }
2762        else if (name.equals("order")) {
2763          throw new FHIRException("Cannot call addChild on a singleton property Coverage.order");
2764        }
2765        else if (name.equals("network")) {
2766          throw new FHIRException("Cannot call addChild on a singleton property Coverage.network");
2767        }
2768        else if (name.equals("costToBeneficiary")) {
2769          return addCostToBeneficiary();
2770        }
2771        else if (name.equals("subrogation")) {
2772          throw new FHIRException("Cannot call addChild on a singleton property Coverage.subrogation");
2773        }
2774        else if (name.equals("contract")) {
2775          return addContract();
2776        }
2777        else if (name.equals("insurancePlan")) {
2778          this.insurancePlan = new Reference();
2779          return this.insurancePlan;
2780        }
2781        else
2782          return super.addChild(name);
2783      }
2784
2785  public String fhirType() {
2786    return "Coverage";
2787
2788  }
2789
2790      public Coverage copy() {
2791        Coverage dst = new Coverage();
2792        copyValues(dst);
2793        return dst;
2794      }
2795
2796      public void copyValues(Coverage dst) {
2797        super.copyValues(dst);
2798        if (identifier != null) {
2799          dst.identifier = new ArrayList<Identifier>();
2800          for (Identifier i : identifier)
2801            dst.identifier.add(i.copy());
2802        };
2803        dst.status = status == null ? null : status.copy();
2804        dst.kind = kind == null ? null : kind.copy();
2805        if (paymentBy != null) {
2806          dst.paymentBy = new ArrayList<CoveragePaymentByComponent>();
2807          for (CoveragePaymentByComponent i : paymentBy)
2808            dst.paymentBy.add(i.copy());
2809        };
2810        dst.type = type == null ? null : type.copy();
2811        dst.policyHolder = policyHolder == null ? null : policyHolder.copy();
2812        dst.subscriber = subscriber == null ? null : subscriber.copy();
2813        if (subscriberId != null) {
2814          dst.subscriberId = new ArrayList<Identifier>();
2815          for (Identifier i : subscriberId)
2816            dst.subscriberId.add(i.copy());
2817        };
2818        dst.beneficiary = beneficiary == null ? null : beneficiary.copy();
2819        dst.dependent = dependent == null ? null : dependent.copy();
2820        dst.relationship = relationship == null ? null : relationship.copy();
2821        dst.period = period == null ? null : period.copy();
2822        dst.insurer = insurer == null ? null : insurer.copy();
2823        if (class_ != null) {
2824          dst.class_ = new ArrayList<ClassComponent>();
2825          for (ClassComponent i : class_)
2826            dst.class_.add(i.copy());
2827        };
2828        dst.order = order == null ? null : order.copy();
2829        dst.network = network == null ? null : network.copy();
2830        if (costToBeneficiary != null) {
2831          dst.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
2832          for (CostToBeneficiaryComponent i : costToBeneficiary)
2833            dst.costToBeneficiary.add(i.copy());
2834        };
2835        dst.subrogation = subrogation == null ? null : subrogation.copy();
2836        if (contract != null) {
2837          dst.contract = new ArrayList<Reference>();
2838          for (Reference i : contract)
2839            dst.contract.add(i.copy());
2840        };
2841        dst.insurancePlan = insurancePlan == null ? null : insurancePlan.copy();
2842      }
2843
2844      protected Coverage typedCopy() {
2845        return copy();
2846      }
2847
2848      @Override
2849      public boolean equalsDeep(Base other_) {
2850        if (!super.equalsDeep(other_))
2851          return false;
2852        if (!(other_ instanceof Coverage))
2853          return false;
2854        Coverage o = (Coverage) other_;
2855        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true)
2856           && compareDeep(paymentBy, o.paymentBy, true) && compareDeep(type, o.type, true) && compareDeep(policyHolder, o.policyHolder, true)
2857           && compareDeep(subscriber, o.subscriber, true) && compareDeep(subscriberId, o.subscriberId, true)
2858           && compareDeep(beneficiary, o.beneficiary, true) && compareDeep(dependent, o.dependent, true) && compareDeep(relationship, o.relationship, true)
2859           && compareDeep(period, o.period, true) && compareDeep(insurer, o.insurer, true) && compareDeep(class_, o.class_, true)
2860           && compareDeep(order, o.order, true) && compareDeep(network, o.network, true) && compareDeep(costToBeneficiary, o.costToBeneficiary, true)
2861           && compareDeep(subrogation, o.subrogation, true) && compareDeep(contract, o.contract, true) && compareDeep(insurancePlan, o.insurancePlan, true)
2862          ;
2863      }
2864
2865      @Override
2866      public boolean equalsShallow(Base other_) {
2867        if (!super.equalsShallow(other_))
2868          return false;
2869        if (!(other_ instanceof Coverage))
2870          return false;
2871        Coverage o = (Coverage) other_;
2872        return compareValues(status, o.status, true) && compareValues(kind, o.kind, true) && compareValues(dependent, o.dependent, true)
2873           && compareValues(order, o.order, true) && compareValues(network, o.network, true) && compareValues(subrogation, o.subrogation, true)
2874          ;
2875      }
2876
2877      public boolean isEmpty() {
2878        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, kind
2879          , paymentBy, type, policyHolder, subscriber, subscriberId, beneficiary, dependent
2880          , relationship, period, insurer, class_, order, network, costToBeneficiary, subrogation
2881          , contract, insurancePlan);
2882      }
2883
2884  @Override
2885  public ResourceType getResourceType() {
2886    return ResourceType.Coverage;
2887   }
2888
2889 /**
2890   * Search parameter: <b>beneficiary</b>
2891   * <p>
2892   * Description: <b>Covered party</b><br>
2893   * Type: <b>reference</b><br>
2894   * Path: <b>Coverage.beneficiary</b><br>
2895   * </p>
2896   */
2897  @SearchParamDefinition(name="beneficiary", path="Coverage.beneficiary", description="Covered party", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class } )
2898  public static final String SP_BENEFICIARY = "beneficiary";
2899 /**
2900   * <b>Fluent Client</b> search parameter constant for <b>beneficiary</b>
2901   * <p>
2902   * Description: <b>Covered party</b><br>
2903   * Type: <b>reference</b><br>
2904   * Path: <b>Coverage.beneficiary</b><br>
2905   * </p>
2906   */
2907  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BENEFICIARY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BENEFICIARY);
2908
2909/**
2910   * Constant for fluent queries to be used to add include statements. Specifies
2911   * the path value of "<b>Coverage:beneficiary</b>".
2912   */
2913  public static final ca.uhn.fhir.model.api.Include INCLUDE_BENEFICIARY = new ca.uhn.fhir.model.api.Include("Coverage:beneficiary").toLocked();
2914
2915 /**
2916   * Search parameter: <b>class-type</b>
2917   * <p>
2918   * Description: <b>Coverage class (e.g. plan, group)</b><br>
2919   * Type: <b>token</b><br>
2920   * Path: <b>Coverage.class.type</b><br>
2921   * </p>
2922   */
2923  @SearchParamDefinition(name="class-type", path="Coverage.class.type", description="Coverage class (e.g. plan, group)", type="token" )
2924  public static final String SP_CLASS_TYPE = "class-type";
2925 /**
2926   * <b>Fluent Client</b> search parameter constant for <b>class-type</b>
2927   * <p>
2928   * Description: <b>Coverage class (e.g. plan, group)</b><br>
2929   * Type: <b>token</b><br>
2930   * Path: <b>Coverage.class.type</b><br>
2931   * </p>
2932   */
2933  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS_TYPE);
2934
2935 /**
2936   * Search parameter: <b>class-value</b>
2937   * <p>
2938   * Description: <b>Value of the class (e.g. Plan number, group number)</b><br>
2939   * Type: <b>token</b><br>
2940   * Path: <b>Coverage.class.value</b><br>
2941   * </p>
2942   */
2943  @SearchParamDefinition(name="class-value", path="Coverage.class.value", description="Value of the class (e.g. Plan number, group number)", type="token" )
2944  public static final String SP_CLASS_VALUE = "class-value";
2945 /**
2946   * <b>Fluent Client</b> search parameter constant for <b>class-value</b>
2947   * <p>
2948   * Description: <b>Value of the class (e.g. Plan number, group number)</b><br>
2949   * Type: <b>token</b><br>
2950   * Path: <b>Coverage.class.value</b><br>
2951   * </p>
2952   */
2953  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS_VALUE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS_VALUE);
2954
2955 /**
2956   * Search parameter: <b>dependent</b>
2957   * <p>
2958   * Description: <b>Dependent number</b><br>
2959   * Type: <b>string</b><br>
2960   * Path: <b>Coverage.dependent</b><br>
2961   * </p>
2962   */
2963  @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="string" )
2964  public static final String SP_DEPENDENT = "dependent";
2965 /**
2966   * <b>Fluent Client</b> search parameter constant for <b>dependent</b>
2967   * <p>
2968   * Description: <b>Dependent number</b><br>
2969   * Type: <b>string</b><br>
2970   * Path: <b>Coverage.dependent</b><br>
2971   * </p>
2972   */
2973  public static final ca.uhn.fhir.rest.gclient.StringClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEPENDENT);
2974
2975 /**
2976   * Search parameter: <b>insurer</b>
2977   * <p>
2978   * Description: <b>The identity of the insurer</b><br>
2979   * Type: <b>reference</b><br>
2980   * Path: <b>Coverage.insurer</b><br>
2981   * </p>
2982   */
2983  @SearchParamDefinition(name="insurer", path="Coverage.insurer", description="The identity of the insurer", type="reference", target={Organization.class } )
2984  public static final String SP_INSURER = "insurer";
2985 /**
2986   * <b>Fluent Client</b> search parameter constant for <b>insurer</b>
2987   * <p>
2988   * Description: <b>The identity of the insurer</b><br>
2989   * Type: <b>reference</b><br>
2990   * Path: <b>Coverage.insurer</b><br>
2991   * </p>
2992   */
2993  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INSURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INSURER);
2994
2995/**
2996   * Constant for fluent queries to be used to add include statements. Specifies
2997   * the path value of "<b>Coverage:insurer</b>".
2998   */
2999  public static final ca.uhn.fhir.model.api.Include INCLUDE_INSURER = new ca.uhn.fhir.model.api.Include("Coverage:insurer").toLocked();
3000
3001 /**
3002   * Search parameter: <b>paymentby-party</b>
3003   * <p>
3004   * Description: <b>Parties who will pay for services</b><br>
3005   * Type: <b>reference</b><br>
3006   * Path: <b>Coverage.paymentBy.party</b><br>
3007   * </p>
3008   */
3009  @SearchParamDefinition(name="paymentby-party", path="Coverage.paymentBy.party", description="Parties who will pay for services", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Organization.class, Patient.class, RelatedPerson.class } )
3010  public static final String SP_PAYMENTBY_PARTY = "paymentby-party";
3011 /**
3012   * <b>Fluent Client</b> search parameter constant for <b>paymentby-party</b>
3013   * <p>
3014   * Description: <b>Parties who will pay for services</b><br>
3015   * Type: <b>reference</b><br>
3016   * Path: <b>Coverage.paymentBy.party</b><br>
3017   * </p>
3018   */
3019  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYMENTBY_PARTY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PAYMENTBY_PARTY);
3020
3021/**
3022   * Constant for fluent queries to be used to add include statements. Specifies
3023   * the path value of "<b>Coverage:paymentby-party</b>".
3024   */
3025  public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYMENTBY_PARTY = new ca.uhn.fhir.model.api.Include("Coverage:paymentby-party").toLocked();
3026
3027 /**
3028   * Search parameter: <b>policy-holder</b>
3029   * <p>
3030   * Description: <b>Reference to the policyholder</b><br>
3031   * Type: <b>reference</b><br>
3032   * Path: <b>Coverage.policyHolder</b><br>
3033   * </p>
3034   */
3035  @SearchParamDefinition(name="policy-holder", path="Coverage.policyHolder", description="Reference to the policyholder", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Organization.class, Patient.class, RelatedPerson.class } )
3036  public static final String SP_POLICY_HOLDER = "policy-holder";
3037 /**
3038   * <b>Fluent Client</b> search parameter constant for <b>policy-holder</b>
3039   * <p>
3040   * Description: <b>Reference to the policyholder</b><br>
3041   * Type: <b>reference</b><br>
3042   * Path: <b>Coverage.policyHolder</b><br>
3043   * </p>
3044   */
3045  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam POLICY_HOLDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_POLICY_HOLDER);
3046
3047/**
3048   * Constant for fluent queries to be used to add include statements. Specifies
3049   * the path value of "<b>Coverage:policy-holder</b>".
3050   */
3051  public static final ca.uhn.fhir.model.api.Include INCLUDE_POLICY_HOLDER = new ca.uhn.fhir.model.api.Include("Coverage:policy-holder").toLocked();
3052
3053 /**
3054   * Search parameter: <b>status</b>
3055   * <p>
3056   * Description: <b>The status of the Coverage</b><br>
3057   * Type: <b>token</b><br>
3058   * Path: <b>Coverage.status</b><br>
3059   * </p>
3060   */
3061  @SearchParamDefinition(name="status", path="Coverage.status", description="The status of the Coverage", type="token" )
3062  public static final String SP_STATUS = "status";
3063 /**
3064   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3065   * <p>
3066   * Description: <b>The status of the Coverage</b><br>
3067   * Type: <b>token</b><br>
3068   * Path: <b>Coverage.status</b><br>
3069   * </p>
3070   */
3071  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3072
3073 /**
3074   * Search parameter: <b>subscriber</b>
3075   * <p>
3076   * Description: <b>Reference to the subscriber</b><br>
3077   * Type: <b>reference</b><br>
3078   * Path: <b>Coverage.subscriber</b><br>
3079   * </p>
3080   */
3081  @SearchParamDefinition(name="subscriber", path="Coverage.subscriber", description="Reference to the subscriber", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Patient.class, RelatedPerson.class } )
3082  public static final String SP_SUBSCRIBER = "subscriber";
3083 /**
3084   * <b>Fluent Client</b> search parameter constant for <b>subscriber</b>
3085   * <p>
3086   * Description: <b>Reference to the subscriber</b><br>
3087   * Type: <b>reference</b><br>
3088   * Path: <b>Coverage.subscriber</b><br>
3089   * </p>
3090   */
3091  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSCRIBER);
3092
3093/**
3094   * Constant for fluent queries to be used to add include statements. Specifies
3095   * the path value of "<b>Coverage:subscriber</b>".
3096   */
3097  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSCRIBER = new ca.uhn.fhir.model.api.Include("Coverage:subscriber").toLocked();
3098
3099 /**
3100   * Search parameter: <b>subscriberid</b>
3101   * <p>
3102   * Description: <b>Identifier of the subscriber</b><br>
3103   * Type: <b>token</b><br>
3104   * Path: <b>Coverage.subscriberId</b><br>
3105   * </p>
3106   */
3107  @SearchParamDefinition(name="subscriberid", path="Coverage.subscriberId", description="Identifier of the subscriber", type="token" )
3108  public static final String SP_SUBSCRIBERID = "subscriberid";
3109 /**
3110   * <b>Fluent Client</b> search parameter constant for <b>subscriberid</b>
3111   * <p>
3112   * Description: <b>Identifier of the subscriber</b><br>
3113   * Type: <b>token</b><br>
3114   * Path: <b>Coverage.subscriberId</b><br>
3115   * </p>
3116   */
3117  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBSCRIBERID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBSCRIBERID);
3118
3119 /**
3120   * Search parameter: <b>identifier</b>
3121   * <p>
3122   * Description: <b>Multiple Resources: 
3123
3124* [Account](account.html): Account number
3125* [AdverseEvent](adverseevent.html): Business identifier for the event
3126* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3127* [Appointment](appointment.html): An Identifier of the Appointment
3128* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3129* [Basic](basic.html): Business identifier
3130* [BodyStructure](bodystructure.html): Bodystructure identifier
3131* [CarePlan](careplan.html): External Ids for this plan
3132* [CareTeam](careteam.html): External Ids for this team
3133* [ChargeItem](chargeitem.html): Business Identifier for item
3134* [Claim](claim.html): The primary identifier of the financial resource
3135* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3136* [ClinicalImpression](clinicalimpression.html): Business identifier
3137* [Communication](communication.html): Unique identifier
3138* [CommunicationRequest](communicationrequest.html): Unique identifier
3139* [Composition](composition.html): Version-independent identifier for the Composition
3140* [Condition](condition.html): A unique identifier of the condition record
3141* [Consent](consent.html): Identifier for this record (external references)
3142* [Contract](contract.html): The identity of the contract
3143* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3144* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3145* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3146* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3147* [DeviceRequest](devicerequest.html): Business identifier for request/order
3148* [DeviceUsage](deviceusage.html): Search by identifier
3149* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3150* [DocumentReference](documentreference.html): Identifier of the attachment binary
3151* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3152* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3153* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3154* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3155* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3156* [Flag](flag.html): Business identifier
3157* [Goal](goal.html): External Ids for this goal
3158* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3159* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3160* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3161* [Immunization](immunization.html): Business identifier
3162* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3163* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3164* [Invoice](invoice.html): Business Identifier for item
3165* [List](list.html): Business identifier
3166* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3167* [Medication](medication.html): Returns medications with this external identifier
3168* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3169* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3170* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3171* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3172* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3173* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3174* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3175* [Observation](observation.html): The unique id for a particular observation
3176* [Person](person.html): A person Identifier
3177* [Procedure](procedure.html): A unique identifier for a procedure
3178* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3179* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3180* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3181* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3182* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3183* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3184* [Specimen](specimen.html): The unique identifier associated with the specimen
3185* [SupplyDelivery](supplydelivery.html): External identifier
3186* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3187* [Task](task.html): Search for a task instance by its business identifier
3188* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3189</b><br>
3190   * Type: <b>token</b><br>
3191   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
3192   * </p>
3193   */
3194  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
3195  public static final String SP_IDENTIFIER = "identifier";
3196 /**
3197   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3198   * <p>
3199   * Description: <b>Multiple Resources: 
3200
3201* [Account](account.html): Account number
3202* [AdverseEvent](adverseevent.html): Business identifier for the event
3203* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3204* [Appointment](appointment.html): An Identifier of the Appointment
3205* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3206* [Basic](basic.html): Business identifier
3207* [BodyStructure](bodystructure.html): Bodystructure identifier
3208* [CarePlan](careplan.html): External Ids for this plan
3209* [CareTeam](careteam.html): External Ids for this team
3210* [ChargeItem](chargeitem.html): Business Identifier for item
3211* [Claim](claim.html): The primary identifier of the financial resource
3212* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3213* [ClinicalImpression](clinicalimpression.html): Business identifier
3214* [Communication](communication.html): Unique identifier
3215* [CommunicationRequest](communicationrequest.html): Unique identifier
3216* [Composition](composition.html): Version-independent identifier for the Composition
3217* [Condition](condition.html): A unique identifier of the condition record
3218* [Consent](consent.html): Identifier for this record (external references)
3219* [Contract](contract.html): The identity of the contract
3220* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3221* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3222* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3223* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3224* [DeviceRequest](devicerequest.html): Business identifier for request/order
3225* [DeviceUsage](deviceusage.html): Search by identifier
3226* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3227* [DocumentReference](documentreference.html): Identifier of the attachment binary
3228* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3229* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3230* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3231* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3232* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3233* [Flag](flag.html): Business identifier
3234* [Goal](goal.html): External Ids for this goal
3235* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3236* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3237* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3238* [Immunization](immunization.html): Business identifier
3239* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3240* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3241* [Invoice](invoice.html): Business Identifier for item
3242* [List](list.html): Business identifier
3243* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3244* [Medication](medication.html): Returns medications with this external identifier
3245* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3246* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3247* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3248* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3249* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3250* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3251* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3252* [Observation](observation.html): The unique id for a particular observation
3253* [Person](person.html): A person Identifier
3254* [Procedure](procedure.html): A unique identifier for a procedure
3255* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3256* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3257* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3258* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3259* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3260* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3261* [Specimen](specimen.html): The unique identifier associated with the specimen
3262* [SupplyDelivery](supplydelivery.html): External identifier
3263* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3264* [Task](task.html): Search for a task instance by its business identifier
3265* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3266</b><br>
3267   * Type: <b>token</b><br>
3268   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
3269   * </p>
3270   */
3271  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3272
3273 /**
3274   * Search parameter: <b>patient</b>
3275   * <p>
3276   * Description: <b>Multiple Resources: 
3277
3278* [Account](account.html): The entity that caused the expenses
3279* [AdverseEvent](adverseevent.html): Subject impacted by event
3280* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3281* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3282* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3283* [AuditEvent](auditevent.html): Where the activity involved patient data
3284* [Basic](basic.html): Identifies the focus of this resource
3285* [BodyStructure](bodystructure.html): Who this is about
3286* [CarePlan](careplan.html): Who the care plan is for
3287* [CareTeam](careteam.html): Who care team is for
3288* [ChargeItem](chargeitem.html): Individual service was done for/to
3289* [Claim](claim.html): Patient receiving the products or services
3290* [ClaimResponse](claimresponse.html): The subject of care
3291* [ClinicalImpression](clinicalimpression.html): Patient assessed
3292* [Communication](communication.html): Focus of message
3293* [CommunicationRequest](communicationrequest.html): Focus of message
3294* [Composition](composition.html): Who and/or what the composition is about
3295* [Condition](condition.html): Who has the condition?
3296* [Consent](consent.html): Who the consent applies to
3297* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3298* [Coverage](coverage.html): Retrieve coverages for a patient
3299* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3300* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3301* [DetectedIssue](detectedissue.html): Associated patient
3302* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3303* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3304* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3305* [DocumentReference](documentreference.html): Who/what is the subject of the document
3306* [Encounter](encounter.html): The patient present at the encounter
3307* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3308* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3309* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3310* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3311* [Flag](flag.html): The identity of a subject to list flags for
3312* [Goal](goal.html): Who this goal is intended for
3313* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3314* [ImagingSelection](imagingselection.html): Who the study is about
3315* [ImagingStudy](imagingstudy.html): Who the study is about
3316* [Immunization](immunization.html): The patient for the vaccination record
3317* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3318* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3319* [Invoice](invoice.html): Recipient(s) of goods and services
3320* [List](list.html): If all resources have the same subject
3321* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3322* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3323* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3324* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3325* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3326* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3327* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3328* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3329* [Observation](observation.html): The subject that the observation is about (if patient)
3330* [Person](person.html): The Person links to this Patient
3331* [Procedure](procedure.html): Search by subject - a patient
3332* [Provenance](provenance.html): Where the activity involved patient data
3333* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3334* [RelatedPerson](relatedperson.html): The patient this related person is related to
3335* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3336* [ResearchSubject](researchsubject.html): Who or what is part of study
3337* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3338* [ServiceRequest](servicerequest.html): Search by subject - a patient
3339* [Specimen](specimen.html): The patient the specimen comes from
3340* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3341* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3342* [Task](task.html): Search by patient
3343* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3344</b><br>
3345   * Type: <b>reference</b><br>
3346   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
3347   * </p>
3348   */
3349  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [Task](task.html): Search by patient\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
3350  public static final String SP_PATIENT = "patient";
3351 /**
3352   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3353   * <p>
3354   * Description: <b>Multiple Resources: 
3355
3356* [Account](account.html): The entity that caused the expenses
3357* [AdverseEvent](adverseevent.html): Subject impacted by event
3358* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3359* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3360* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3361* [AuditEvent](auditevent.html): Where the activity involved patient data
3362* [Basic](basic.html): Identifies the focus of this resource
3363* [BodyStructure](bodystructure.html): Who this is about
3364* [CarePlan](careplan.html): Who the care plan is for
3365* [CareTeam](careteam.html): Who care team is for
3366* [ChargeItem](chargeitem.html): Individual service was done for/to
3367* [Claim](claim.html): Patient receiving the products or services
3368* [ClaimResponse](claimresponse.html): The subject of care
3369* [ClinicalImpression](clinicalimpression.html): Patient assessed
3370* [Communication](communication.html): Focus of message
3371* [CommunicationRequest](communicationrequest.html): Focus of message
3372* [Composition](composition.html): Who and/or what the composition is about
3373* [Condition](condition.html): Who has the condition?
3374* [Consent](consent.html): Who the consent applies to
3375* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3376* [Coverage](coverage.html): Retrieve coverages for a patient
3377* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3378* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3379* [DetectedIssue](detectedissue.html): Associated patient
3380* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3381* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3382* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3383* [DocumentReference](documentreference.html): Who/what is the subject of the document
3384* [Encounter](encounter.html): The patient present at the encounter
3385* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3386* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3387* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3388* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3389* [Flag](flag.html): The identity of a subject to list flags for
3390* [Goal](goal.html): Who this goal is intended for
3391* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3392* [ImagingSelection](imagingselection.html): Who the study is about
3393* [ImagingStudy](imagingstudy.html): Who the study is about
3394* [Immunization](immunization.html): The patient for the vaccination record
3395* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3396* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3397* [Invoice](invoice.html): Recipient(s) of goods and services
3398* [List](list.html): If all resources have the same subject
3399* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3400* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3401* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3402* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3403* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3404* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3405* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3406* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3407* [Observation](observation.html): The subject that the observation is about (if patient)
3408* [Person](person.html): The Person links to this Patient
3409* [Procedure](procedure.html): Search by subject - a patient
3410* [Provenance](provenance.html): Where the activity involved patient data
3411* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3412* [RelatedPerson](relatedperson.html): The patient this related person is related to
3413* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3414* [ResearchSubject](researchsubject.html): Who or what is part of study
3415* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3416* [ServiceRequest](servicerequest.html): Search by subject - a patient
3417* [Specimen](specimen.html): The patient the specimen comes from
3418* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3419* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3420* [Task](task.html): Search by patient
3421* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3422</b><br>
3423   * Type: <b>reference</b><br>
3424   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
3425   * </p>
3426   */
3427  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
3428
3429/**
3430   * Constant for fluent queries to be used to add include statements. Specifies
3431   * the path value of "<b>Coverage:patient</b>".
3432   */
3433  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Coverage:patient").toLocked();
3434
3435 /**
3436   * Search parameter: <b>type</b>
3437   * <p>
3438   * Description: <b>Multiple Resources: 
3439
3440* [Account](account.html): E.g. patient, expense, depreciation
3441* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3442* [Composition](composition.html): Kind of composition (LOINC if possible)
3443* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
3444* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3445* [Encounter](encounter.html): Specific type of encounter
3446* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3447* [Invoice](invoice.html): Type of Invoice
3448* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
3449* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
3450* [Specimen](specimen.html): The specimen type
3451</b><br>
3452   * Type: <b>token</b><br>
3453   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
3454   * </p>
3455   */
3456  @SearchParamDefinition(name="type", path="Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type", description="Multiple Resources: \r\n\r\n* [Account](account.html): E.g. patient, expense, depreciation\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n* [Invoice](invoice.html): Type of Invoice\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type\r\n* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence\r\n* [Specimen](specimen.html): The specimen type\r\n", type="token" )
3457  public static final String SP_TYPE = "type";
3458 /**
3459   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3460   * <p>
3461   * Description: <b>Multiple Resources: 
3462
3463* [Account](account.html): E.g. patient, expense, depreciation
3464* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3465* [Composition](composition.html): Kind of composition (LOINC if possible)
3466* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
3467* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3468* [Encounter](encounter.html): Specific type of encounter
3469* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3470* [Invoice](invoice.html): Type of Invoice
3471* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
3472* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
3473* [Specimen](specimen.html): The specimen type
3474</b><br>
3475   * Type: <b>token</b><br>
3476   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
3477   * </p>
3478   */
3479  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3480
3481
3482}
3483