001package org.hl7.fhir.r4b.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 Fri, Dec 31, 2021 05:58+1100 for FHIR v4.3.0-snapshot1
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r4b.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    @Block()
057    public static class ClassComponent extends BackboneElement implements IBaseBackboneElement {
058        /**
059         * The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan.
060         */
061        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
062        @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 may be used to identify a class of coverage or employer group, Policy, Plan." )
063        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-class")
064        protected CodeableConcept type;
065
066        /**
067         * The alphanumeric string value associated with the insurer issued label.
068         */
069        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true)
070        @Description(shortDefinition="Value associated with the type", formalDefinition="The alphanumeric string value associated with the insurer issued label." )
071        protected StringType value;
072
073        /**
074         * A short description for the class.
075         */
076        @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
077        @Description(shortDefinition="Human readable description of the type and value", formalDefinition="A short description for the class." )
078        protected StringType name;
079
080        private static final long serialVersionUID = -1501519769L;
081
082    /**
083     * Constructor
084     */
085      public ClassComponent() {
086        super();
087      }
088
089    /**
090     * Constructor
091     */
092      public ClassComponent(CodeableConcept type, String value) {
093        super();
094        this.setType(type);
095        this.setValue(value);
096      }
097
098        /**
099         * @return {@link #type} (The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan.)
100         */
101        public CodeableConcept getType() { 
102          if (this.type == null)
103            if (Configuration.errorOnAutoCreate())
104              throw new Error("Attempt to auto-create ClassComponent.type");
105            else if (Configuration.doAutoCreate())
106              this.type = new CodeableConcept(); // cc
107          return this.type;
108        }
109
110        public boolean hasType() { 
111          return this.type != null && !this.type.isEmpty();
112        }
113
114        /**
115         * @param value {@link #type} (The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan.)
116         */
117        public ClassComponent setType(CodeableConcept value) { 
118          this.type = value;
119          return this;
120        }
121
122        /**
123         * @return {@link #value} (The alphanumeric string value associated with the insurer issued label.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
124         */
125        public StringType getValueElement() { 
126          if (this.value == null)
127            if (Configuration.errorOnAutoCreate())
128              throw new Error("Attempt to auto-create ClassComponent.value");
129            else if (Configuration.doAutoCreate())
130              this.value = new StringType(); // bb
131          return this.value;
132        }
133
134        public boolean hasValueElement() { 
135          return this.value != null && !this.value.isEmpty();
136        }
137
138        public boolean hasValue() { 
139          return this.value != null && !this.value.isEmpty();
140        }
141
142        /**
143         * @param value {@link #value} (The alphanumeric string value associated with the insurer issued label.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
144         */
145        public ClassComponent setValueElement(StringType value) { 
146          this.value = value;
147          return this;
148        }
149
150        /**
151         * @return The alphanumeric string value associated with the insurer issued label.
152         */
153        public String getValue() { 
154          return this.value == null ? null : this.value.getValue();
155        }
156
157        /**
158         * @param value The alphanumeric string value associated with the insurer issued label.
159         */
160        public ClassComponent setValue(String value) { 
161            if (this.value == null)
162              this.value = new StringType();
163            this.value.setValue(value);
164          return this;
165        }
166
167        /**
168         * @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
169         */
170        public StringType getNameElement() { 
171          if (this.name == null)
172            if (Configuration.errorOnAutoCreate())
173              throw new Error("Attempt to auto-create ClassComponent.name");
174            else if (Configuration.doAutoCreate())
175              this.name = new StringType(); // bb
176          return this.name;
177        }
178
179        public boolean hasNameElement() { 
180          return this.name != null && !this.name.isEmpty();
181        }
182
183        public boolean hasName() { 
184          return this.name != null && !this.name.isEmpty();
185        }
186
187        /**
188         * @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
189         */
190        public ClassComponent setNameElement(StringType value) { 
191          this.name = value;
192          return this;
193        }
194
195        /**
196         * @return A short description for the class.
197         */
198        public String getName() { 
199          return this.name == null ? null : this.name.getValue();
200        }
201
202        /**
203         * @param value A short description for the class.
204         */
205        public ClassComponent setName(String value) { 
206          if (Utilities.noString(value))
207            this.name = null;
208          else {
209            if (this.name == null)
210              this.name = new StringType();
211            this.name.setValue(value);
212          }
213          return this;
214        }
215
216        protected void listChildren(List<Property> children) {
217          super.listChildren(children);
218          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 may be used to identify a class of coverage or employer group, Policy, Plan.", 0, 1, type));
219          children.add(new Property("value", "string", "The alphanumeric string value associated with the insurer issued label.", 0, 1, value));
220          children.add(new Property("name", "string", "A short description for the class.", 0, 1, name));
221        }
222
223        @Override
224        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
225          switch (_hash) {
226          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 may be used to identify a class of coverage or employer group, Policy, Plan.", 0, 1, type);
227          case 111972721: /*value*/  return new Property("value", "string", "The alphanumeric string value associated with the insurer issued label.", 0, 1, value);
228          case 3373707: /*name*/  return new Property("name", "string", "A short description for the class.", 0, 1, name);
229          default: return super.getNamedProperty(_hash, _name, _checkValid);
230          }
231
232        }
233
234      @Override
235      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
236        switch (hash) {
237        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
238        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
239        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
240        default: return super.getProperty(hash, name, checkValid);
241        }
242
243      }
244
245      @Override
246      public Base setProperty(int hash, String name, Base value) throws FHIRException {
247        switch (hash) {
248        case 3575610: // type
249          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
250          return value;
251        case 111972721: // value
252          this.value = TypeConvertor.castToString(value); // StringType
253          return value;
254        case 3373707: // name
255          this.name = TypeConvertor.castToString(value); // StringType
256          return value;
257        default: return super.setProperty(hash, name, value);
258        }
259
260      }
261
262      @Override
263      public Base setProperty(String name, Base value) throws FHIRException {
264        if (name.equals("type")) {
265          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
266        } else if (name.equals("value")) {
267          this.value = TypeConvertor.castToString(value); // StringType
268        } else if (name.equals("name")) {
269          this.name = TypeConvertor.castToString(value); // StringType
270        } else
271          return super.setProperty(name, value);
272        return value;
273      }
274
275      @Override
276      public Base makeProperty(int hash, String name) throws FHIRException {
277        switch (hash) {
278        case 3575610:  return getType();
279        case 111972721:  return getValueElement();
280        case 3373707:  return getNameElement();
281        default: return super.makeProperty(hash, name);
282        }
283
284      }
285
286      @Override
287      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
288        switch (hash) {
289        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
290        case 111972721: /*value*/ return new String[] {"string"};
291        case 3373707: /*name*/ return new String[] {"string"};
292        default: return super.getTypesForProperty(hash, name);
293        }
294
295      }
296
297      @Override
298      public Base addChild(String name) throws FHIRException {
299        if (name.equals("type")) {
300          this.type = new CodeableConcept();
301          return this.type;
302        }
303        else if (name.equals("value")) {
304          throw new FHIRException("Cannot call addChild on a primitive type Coverage.class.value");
305        }
306        else if (name.equals("name")) {
307          throw new FHIRException("Cannot call addChild on a primitive type Coverage.class.name");
308        }
309        else
310          return super.addChild(name);
311      }
312
313      public ClassComponent copy() {
314        ClassComponent dst = new ClassComponent();
315        copyValues(dst);
316        return dst;
317      }
318
319      public void copyValues(ClassComponent dst) {
320        super.copyValues(dst);
321        dst.type = type == null ? null : type.copy();
322        dst.value = value == null ? null : value.copy();
323        dst.name = name == null ? null : name.copy();
324      }
325
326      @Override
327      public boolean equalsDeep(Base other_) {
328        if (!super.equalsDeep(other_))
329          return false;
330        if (!(other_ instanceof ClassComponent))
331          return false;
332        ClassComponent o = (ClassComponent) other_;
333        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(name, o.name, true)
334          ;
335      }
336
337      @Override
338      public boolean equalsShallow(Base other_) {
339        if (!super.equalsShallow(other_))
340          return false;
341        if (!(other_ instanceof ClassComponent))
342          return false;
343        ClassComponent o = (ClassComponent) other_;
344        return compareValues(value, o.value, true) && compareValues(name, o.name, true);
345      }
346
347      public boolean isEmpty() {
348        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, name);
349      }
350
351  public String fhirType() {
352    return "Coverage.class";
353
354  }
355
356  }
357
358    @Block()
359    public static class CostToBeneficiaryComponent extends BackboneElement implements IBaseBackboneElement {
360        /**
361         * The category of patient centric costs associated with treatment.
362         */
363        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
364        @Description(shortDefinition="Cost category", formalDefinition="The category of patient centric costs associated with treatment." )
365        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-copay-type")
366        protected CodeableConcept type;
367
368        /**
369         * The amount due from the patient for the cost category.
370         */
371        @Child(name = "value", type = {Quantity.class, Money.class}, order=2, min=1, max=1, modifier=false, summary=true)
372        @Description(shortDefinition="The amount or percentage due from the beneficiary", formalDefinition="The amount due from the patient for the cost category." )
373        protected DataType value;
374
375        /**
376         * A suite of codes indicating exceptions or reductions to patient costs and their effective periods.
377         */
378        @Child(name = "exception", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
379        @Description(shortDefinition="Exceptions for patient payments", formalDefinition="A suite of codes indicating exceptions or reductions to patient costs and their effective periods." )
380        protected List<ExemptionComponent> exception;
381
382        private static final long serialVersionUID = -1531646137L;
383
384    /**
385     * Constructor
386     */
387      public CostToBeneficiaryComponent() {
388        super();
389      }
390
391    /**
392     * Constructor
393     */
394      public CostToBeneficiaryComponent(DataType value) {
395        super();
396        this.setValue(value);
397      }
398
399        /**
400         * @return {@link #type} (The category of patient centric costs associated with treatment.)
401         */
402        public CodeableConcept getType() { 
403          if (this.type == null)
404            if (Configuration.errorOnAutoCreate())
405              throw new Error("Attempt to auto-create CostToBeneficiaryComponent.type");
406            else if (Configuration.doAutoCreate())
407              this.type = new CodeableConcept(); // cc
408          return this.type;
409        }
410
411        public boolean hasType() { 
412          return this.type != null && !this.type.isEmpty();
413        }
414
415        /**
416         * @param value {@link #type} (The category of patient centric costs associated with treatment.)
417         */
418        public CostToBeneficiaryComponent setType(CodeableConcept value) { 
419          this.type = value;
420          return this;
421        }
422
423        /**
424         * @return {@link #value} (The amount due from the patient for the cost category.)
425         */
426        public DataType getValue() { 
427          return this.value;
428        }
429
430        /**
431         * @return {@link #value} (The amount due from the patient for the cost category.)
432         */
433        public Quantity getValueQuantity() throws FHIRException { 
434          if (this.value == null)
435            this.value = new Quantity();
436          if (!(this.value instanceof Quantity))
437            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
438          return (Quantity) this.value;
439        }
440
441        public boolean hasValueQuantity() { 
442          return this != null && this.value instanceof Quantity;
443        }
444
445        /**
446         * @return {@link #value} (The amount due from the patient for the cost category.)
447         */
448        public Money getValueMoney() throws FHIRException { 
449          if (this.value == null)
450            this.value = new Money();
451          if (!(this.value instanceof Money))
452            throw new FHIRException("Type mismatch: the type Money was expected, but "+this.value.getClass().getName()+" was encountered");
453          return (Money) this.value;
454        }
455
456        public boolean hasValueMoney() { 
457          return this != null && this.value instanceof Money;
458        }
459
460        public boolean hasValue() { 
461          return this.value != null && !this.value.isEmpty();
462        }
463
464        /**
465         * @param value {@link #value} (The amount due from the patient for the cost category.)
466         */
467        public CostToBeneficiaryComponent setValue(DataType value) { 
468          if (value != null && !(value instanceof Quantity || value instanceof Money))
469            throw new Error("Not the right type for Coverage.costToBeneficiary.value[x]: "+value.fhirType());
470          this.value = value;
471          return this;
472        }
473
474        /**
475         * @return {@link #exception} (A suite of codes indicating exceptions or reductions to patient costs and their effective periods.)
476         */
477        public List<ExemptionComponent> getException() { 
478          if (this.exception == null)
479            this.exception = new ArrayList<ExemptionComponent>();
480          return this.exception;
481        }
482
483        /**
484         * @return Returns a reference to <code>this</code> for easy method chaining
485         */
486        public CostToBeneficiaryComponent setException(List<ExemptionComponent> theException) { 
487          this.exception = theException;
488          return this;
489        }
490
491        public boolean hasException() { 
492          if (this.exception == null)
493            return false;
494          for (ExemptionComponent item : this.exception)
495            if (!item.isEmpty())
496              return true;
497          return false;
498        }
499
500        public ExemptionComponent addException() { //3
501          ExemptionComponent t = new ExemptionComponent();
502          if (this.exception == null)
503            this.exception = new ArrayList<ExemptionComponent>();
504          this.exception.add(t);
505          return t;
506        }
507
508        public CostToBeneficiaryComponent addException(ExemptionComponent t) { //3
509          if (t == null)
510            return this;
511          if (this.exception == null)
512            this.exception = new ArrayList<ExemptionComponent>();
513          this.exception.add(t);
514          return this;
515        }
516
517        /**
518         * @return The first repetition of repeating field {@link #exception}, creating it if it does not already exist {3}
519         */
520        public ExemptionComponent getExceptionFirstRep() { 
521          if (getException().isEmpty()) {
522            addException();
523          }
524          return getException().get(0);
525        }
526
527        protected void listChildren(List<Property> children) {
528          super.listChildren(children);
529          children.add(new Property("type", "CodeableConcept", "The category of patient centric costs associated with treatment.", 0, 1, type));
530          children.add(new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value));
531          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));
532        }
533
534        @Override
535        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
536          switch (_hash) {
537          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The category of patient centric costs associated with treatment.", 0, 1, type);
538          case -1410166417: /*value[x]*/  return new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value);
539          case 111972721: /*value*/  return new Property("value[x]", "Quantity|Money", "The amount due from the patient for the cost category.", 0, 1, value);
540          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "The amount due from the patient for the cost category.", 0, 1, value);
541          case 2026560975: /*valueMoney*/  return new Property("value[x]", "Money", "The amount due from the patient for the cost category.", 0, 1, value);
542          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);
543          default: return super.getNamedProperty(_hash, _name, _checkValid);
544          }
545
546        }
547
548      @Override
549      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
550        switch (hash) {
551        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
552        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
553        case 1481625679: /*exception*/ return this.exception == null ? new Base[0] : this.exception.toArray(new Base[this.exception.size()]); // ExemptionComponent
554        default: return super.getProperty(hash, name, checkValid);
555        }
556
557      }
558
559      @Override
560      public Base setProperty(int hash, String name, Base value) throws FHIRException {
561        switch (hash) {
562        case 3575610: // type
563          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
564          return value;
565        case 111972721: // value
566          this.value = TypeConvertor.castToType(value); // DataType
567          return value;
568        case 1481625679: // exception
569          this.getException().add((ExemptionComponent) value); // ExemptionComponent
570          return value;
571        default: return super.setProperty(hash, name, value);
572        }
573
574      }
575
576      @Override
577      public Base setProperty(String name, Base value) throws FHIRException {
578        if (name.equals("type")) {
579          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
580        } else if (name.equals("value[x]")) {
581          this.value = TypeConvertor.castToType(value); // DataType
582        } else if (name.equals("exception")) {
583          this.getException().add((ExemptionComponent) value);
584        } else
585          return super.setProperty(name, value);
586        return value;
587      }
588
589      @Override
590      public Base makeProperty(int hash, String name) throws FHIRException {
591        switch (hash) {
592        case 3575610:  return getType();
593        case -1410166417:  return getValue();
594        case 111972721:  return getValue();
595        case 1481625679:  return addException(); 
596        default: return super.makeProperty(hash, name);
597        }
598
599      }
600
601      @Override
602      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
603        switch (hash) {
604        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
605        case 111972721: /*value*/ return new String[] {"Quantity", "Money"};
606        case 1481625679: /*exception*/ return new String[] {};
607        default: return super.getTypesForProperty(hash, name);
608        }
609
610      }
611
612      @Override
613      public Base addChild(String name) throws FHIRException {
614        if (name.equals("type")) {
615          this.type = new CodeableConcept();
616          return this.type;
617        }
618        else if (name.equals("valueQuantity")) {
619          this.value = new Quantity();
620          return this.value;
621        }
622        else if (name.equals("valueMoney")) {
623          this.value = new Money();
624          return this.value;
625        }
626        else if (name.equals("exception")) {
627          return addException();
628        }
629        else
630          return super.addChild(name);
631      }
632
633      public CostToBeneficiaryComponent copy() {
634        CostToBeneficiaryComponent dst = new CostToBeneficiaryComponent();
635        copyValues(dst);
636        return dst;
637      }
638
639      public void copyValues(CostToBeneficiaryComponent dst) {
640        super.copyValues(dst);
641        dst.type = type == null ? null : type.copy();
642        dst.value = value == null ? null : value.copy();
643        if (exception != null) {
644          dst.exception = new ArrayList<ExemptionComponent>();
645          for (ExemptionComponent i : exception)
646            dst.exception.add(i.copy());
647        };
648      }
649
650      @Override
651      public boolean equalsDeep(Base other_) {
652        if (!super.equalsDeep(other_))
653          return false;
654        if (!(other_ instanceof CostToBeneficiaryComponent))
655          return false;
656        CostToBeneficiaryComponent o = (CostToBeneficiaryComponent) other_;
657        return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(exception, o.exception, true)
658          ;
659      }
660
661      @Override
662      public boolean equalsShallow(Base other_) {
663        if (!super.equalsShallow(other_))
664          return false;
665        if (!(other_ instanceof CostToBeneficiaryComponent))
666          return false;
667        CostToBeneficiaryComponent o = (CostToBeneficiaryComponent) other_;
668        return true;
669      }
670
671      public boolean isEmpty() {
672        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, value, exception);
673      }
674
675  public String fhirType() {
676    return "Coverage.costToBeneficiary";
677
678  }
679
680  }
681
682    @Block()
683    public static class ExemptionComponent extends BackboneElement implements IBaseBackboneElement {
684        /**
685         * The code for the specific exception.
686         */
687        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true)
688        @Description(shortDefinition="Exception category", formalDefinition="The code for the specific exception." )
689        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-financial-exception")
690        protected CodeableConcept type;
691
692        /**
693         * The timeframe during when the exception is in force.
694         */
695        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true)
696        @Description(shortDefinition="The effective period of the exception", formalDefinition="The timeframe during when the exception is in force." )
697        protected Period period;
698
699        private static final long serialVersionUID = 523191991L;
700
701    /**
702     * Constructor
703     */
704      public ExemptionComponent() {
705        super();
706      }
707
708    /**
709     * Constructor
710     */
711      public ExemptionComponent(CodeableConcept type) {
712        super();
713        this.setType(type);
714      }
715
716        /**
717         * @return {@link #type} (The code for the specific exception.)
718         */
719        public CodeableConcept getType() { 
720          if (this.type == null)
721            if (Configuration.errorOnAutoCreate())
722              throw new Error("Attempt to auto-create ExemptionComponent.type");
723            else if (Configuration.doAutoCreate())
724              this.type = new CodeableConcept(); // cc
725          return this.type;
726        }
727
728        public boolean hasType() { 
729          return this.type != null && !this.type.isEmpty();
730        }
731
732        /**
733         * @param value {@link #type} (The code for the specific exception.)
734         */
735        public ExemptionComponent setType(CodeableConcept value) { 
736          this.type = value;
737          return this;
738        }
739
740        /**
741         * @return {@link #period} (The timeframe during when the exception is in force.)
742         */
743        public Period getPeriod() { 
744          if (this.period == null)
745            if (Configuration.errorOnAutoCreate())
746              throw new Error("Attempt to auto-create ExemptionComponent.period");
747            else if (Configuration.doAutoCreate())
748              this.period = new Period(); // cc
749          return this.period;
750        }
751
752        public boolean hasPeriod() { 
753          return this.period != null && !this.period.isEmpty();
754        }
755
756        /**
757         * @param value {@link #period} (The timeframe during when the exception is in force.)
758         */
759        public ExemptionComponent setPeriod(Period value) { 
760          this.period = value;
761          return this;
762        }
763
764        protected void listChildren(List<Property> children) {
765          super.listChildren(children);
766          children.add(new Property("type", "CodeableConcept", "The code for the specific exception.", 0, 1, type));
767          children.add(new Property("period", "Period", "The timeframe during when the exception is in force.", 0, 1, period));
768        }
769
770        @Override
771        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
772          switch (_hash) {
773          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The code for the specific exception.", 0, 1, type);
774          case -991726143: /*period*/  return new Property("period", "Period", "The timeframe during when the exception is in force.", 0, 1, period);
775          default: return super.getNamedProperty(_hash, _name, _checkValid);
776          }
777
778        }
779
780      @Override
781      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
782        switch (hash) {
783        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
784        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
785        default: return super.getProperty(hash, name, checkValid);
786        }
787
788      }
789
790      @Override
791      public Base setProperty(int hash, String name, Base value) throws FHIRException {
792        switch (hash) {
793        case 3575610: // type
794          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
795          return value;
796        case -991726143: // period
797          this.period = TypeConvertor.castToPeriod(value); // Period
798          return value;
799        default: return super.setProperty(hash, name, value);
800        }
801
802      }
803
804      @Override
805      public Base setProperty(String name, Base value) throws FHIRException {
806        if (name.equals("type")) {
807          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
808        } else if (name.equals("period")) {
809          this.period = TypeConvertor.castToPeriod(value); // Period
810        } else
811          return super.setProperty(name, value);
812        return value;
813      }
814
815      @Override
816      public Base makeProperty(int hash, String name) throws FHIRException {
817        switch (hash) {
818        case 3575610:  return getType();
819        case -991726143:  return getPeriod();
820        default: return super.makeProperty(hash, name);
821        }
822
823      }
824
825      @Override
826      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
827        switch (hash) {
828        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
829        case -991726143: /*period*/ return new String[] {"Period"};
830        default: return super.getTypesForProperty(hash, name);
831        }
832
833      }
834
835      @Override
836      public Base addChild(String name) throws FHIRException {
837        if (name.equals("type")) {
838          this.type = new CodeableConcept();
839          return this.type;
840        }
841        else if (name.equals("period")) {
842          this.period = new Period();
843          return this.period;
844        }
845        else
846          return super.addChild(name);
847      }
848
849      public ExemptionComponent copy() {
850        ExemptionComponent dst = new ExemptionComponent();
851        copyValues(dst);
852        return dst;
853      }
854
855      public void copyValues(ExemptionComponent dst) {
856        super.copyValues(dst);
857        dst.type = type == null ? null : type.copy();
858        dst.period = period == null ? null : period.copy();
859      }
860
861      @Override
862      public boolean equalsDeep(Base other_) {
863        if (!super.equalsDeep(other_))
864          return false;
865        if (!(other_ instanceof ExemptionComponent))
866          return false;
867        ExemptionComponent o = (ExemptionComponent) other_;
868        return compareDeep(type, o.type, true) && compareDeep(period, o.period, true);
869      }
870
871      @Override
872      public boolean equalsShallow(Base other_) {
873        if (!super.equalsShallow(other_))
874          return false;
875        if (!(other_ instanceof ExemptionComponent))
876          return false;
877        ExemptionComponent o = (ExemptionComponent) other_;
878        return true;
879      }
880
881      public boolean isEmpty() {
882        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, period);
883      }
884
885  public String fhirType() {
886    return "Coverage.costToBeneficiary.exception";
887
888  }
889
890  }
891
892    /**
893     * A unique identifier assigned to this coverage.
894     */
895    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
896    @Description(shortDefinition="Business Identifier for the coverage", formalDefinition="A unique identifier assigned to this coverage." )
897    protected List<Identifier> identifier;
898
899    /**
900     * The status of the resource instance.
901     */
902    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
903    @Description(shortDefinition="active | cancelled | draft | entered-in-error", formalDefinition="The status of the resource instance." )
904    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/fm-status")
905    protected Enumeration<FinancialResourceStatusCodes> status;
906
907    /**
908     * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.
909     */
910    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
911    @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." )
912    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/coverage-type")
913    protected CodeableConcept type;
914
915    /**
916     * The party who 'owns' the insurance policy.
917     */
918    @Child(name = "policyHolder", type = {Patient.class, RelatedPerson.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
919    @Description(shortDefinition="Owner of the policy", formalDefinition="The party who 'owns' the insurance policy." )
920    protected Reference policyHolder;
921
922    /**
923     * 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.
924     */
925    @Child(name = "subscriber", type = {Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true)
926    @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." )
927    protected Reference subscriber;
928
929    /**
930     * The insurer assigned ID for the Subscriber.
931     */
932    @Child(name = "subscriberId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
933    @Description(shortDefinition="ID assigned to the subscriber", formalDefinition="The insurer assigned ID for the Subscriber." )
934    protected StringType subscriberId;
935
936    /**
937     * The party who benefits from the insurance coverage; the patient when products and/or services are provided.
938     */
939    @Child(name = "beneficiary", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true)
940    @Description(shortDefinition="Plan beneficiary", formalDefinition="The party who benefits from the insurance coverage; the patient when products and/or services are provided." )
941    protected Reference beneficiary;
942
943    /**
944     * A unique identifier for a dependent under the coverage.
945     */
946    @Child(name = "dependent", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true)
947    @Description(shortDefinition="Dependent number", formalDefinition="A unique identifier for a dependent under the coverage." )
948    protected StringType dependent;
949
950    /**
951     * The relationship of beneficiary (patient) to the subscriber.
952     */
953    @Child(name = "relationship", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false)
954    @Description(shortDefinition="Beneficiary relationship to the subscriber", formalDefinition="The relationship of beneficiary (patient) to the subscriber." )
955    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/subscriber-relationship")
956    protected CodeableConcept relationship;
957
958    /**
959     * 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.
960     */
961    @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true)
962    @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." )
963    protected Period period;
964
965    /**
966     * The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.
967     */
968    @Child(name = "payor", type = {Organization.class, Patient.class, RelatedPerson.class}, order=10, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
969    @Description(shortDefinition="Issuer of the policy", formalDefinition="The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements." )
970    protected List<Reference> payor;
971
972    /**
973     * A suite of underwriter specific classifiers.
974     */
975    @Child(name = "class", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
976    @Description(shortDefinition="Additional coverage classifications", formalDefinition="A suite of underwriter specific classifiers." )
977    protected List<ClassComponent> class_;
978
979    /**
980     * 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.
981     */
982    @Child(name = "order", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=true)
983    @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." )
984    protected PositiveIntType order;
985
986    /**
987     * 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.
988     */
989    @Child(name = "network", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true)
990    @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." )
991    protected StringType network;
992
993    /**
994     * 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.
995     */
996    @Child(name = "costToBeneficiary", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
997    @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." )
998    protected List<CostToBeneficiaryComponent> costToBeneficiary;
999
1000    /**
1001     * When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
1002     */
1003    @Child(name = "subrogation", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=false)
1004    @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." )
1005    protected BooleanType subrogation;
1006
1007    /**
1008     * The policy(s) which constitute this insurance coverage.
1009     */
1010    @Child(name = "contract", type = {Contract.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1011    @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." )
1012    protected List<Reference> contract;
1013
1014    private static final long serialVersionUID = -1520724464L;
1015
1016  /**
1017   * Constructor
1018   */
1019    public Coverage() {
1020      super();
1021    }
1022
1023  /**
1024   * Constructor
1025   */
1026    public Coverage(FinancialResourceStatusCodes status, Reference beneficiary, Reference payor) {
1027      super();
1028      this.setStatus(status);
1029      this.setBeneficiary(beneficiary);
1030      this.addPayor(payor);
1031    }
1032
1033    /**
1034     * @return {@link #identifier} (A unique identifier assigned to this coverage.)
1035     */
1036    public List<Identifier> getIdentifier() { 
1037      if (this.identifier == null)
1038        this.identifier = new ArrayList<Identifier>();
1039      return this.identifier;
1040    }
1041
1042    /**
1043     * @return Returns a reference to <code>this</code> for easy method chaining
1044     */
1045    public Coverage setIdentifier(List<Identifier> theIdentifier) { 
1046      this.identifier = theIdentifier;
1047      return this;
1048    }
1049
1050    public boolean hasIdentifier() { 
1051      if (this.identifier == null)
1052        return false;
1053      for (Identifier item : this.identifier)
1054        if (!item.isEmpty())
1055          return true;
1056      return false;
1057    }
1058
1059    public Identifier addIdentifier() { //3
1060      Identifier t = new Identifier();
1061      if (this.identifier == null)
1062        this.identifier = new ArrayList<Identifier>();
1063      this.identifier.add(t);
1064      return t;
1065    }
1066
1067    public Coverage addIdentifier(Identifier t) { //3
1068      if (t == null)
1069        return this;
1070      if (this.identifier == null)
1071        this.identifier = new ArrayList<Identifier>();
1072      this.identifier.add(t);
1073      return this;
1074    }
1075
1076    /**
1077     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1078     */
1079    public Identifier getIdentifierFirstRep() { 
1080      if (getIdentifier().isEmpty()) {
1081        addIdentifier();
1082      }
1083      return getIdentifier().get(0);
1084    }
1085
1086    /**
1087     * @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
1088     */
1089    public Enumeration<FinancialResourceStatusCodes> getStatusElement() { 
1090      if (this.status == null)
1091        if (Configuration.errorOnAutoCreate())
1092          throw new Error("Attempt to auto-create Coverage.status");
1093        else if (Configuration.doAutoCreate())
1094          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory()); // bb
1095      return this.status;
1096    }
1097
1098    public boolean hasStatusElement() { 
1099      return this.status != null && !this.status.isEmpty();
1100    }
1101
1102    public boolean hasStatus() { 
1103      return this.status != null && !this.status.isEmpty();
1104    }
1105
1106    /**
1107     * @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
1108     */
1109    public Coverage setStatusElement(Enumeration<FinancialResourceStatusCodes> value) { 
1110      this.status = value;
1111      return this;
1112    }
1113
1114    /**
1115     * @return The status of the resource instance.
1116     */
1117    public FinancialResourceStatusCodes getStatus() { 
1118      return this.status == null ? null : this.status.getValue();
1119    }
1120
1121    /**
1122     * @param value The status of the resource instance.
1123     */
1124    public Coverage setStatus(FinancialResourceStatusCodes value) { 
1125        if (this.status == null)
1126          this.status = new Enumeration<FinancialResourceStatusCodes>(new FinancialResourceStatusCodesEnumFactory());
1127        this.status.setValue(value);
1128      return this;
1129    }
1130
1131    /**
1132     * @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.)
1133     */
1134    public CodeableConcept getType() { 
1135      if (this.type == null)
1136        if (Configuration.errorOnAutoCreate())
1137          throw new Error("Attempt to auto-create Coverage.type");
1138        else if (Configuration.doAutoCreate())
1139          this.type = new CodeableConcept(); // cc
1140      return this.type;
1141    }
1142
1143    public boolean hasType() { 
1144      return this.type != null && !this.type.isEmpty();
1145    }
1146
1147    /**
1148     * @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.)
1149     */
1150    public Coverage setType(CodeableConcept value) { 
1151      this.type = value;
1152      return this;
1153    }
1154
1155    /**
1156     * @return {@link #policyHolder} (The party who 'owns' the insurance policy.)
1157     */
1158    public Reference getPolicyHolder() { 
1159      if (this.policyHolder == null)
1160        if (Configuration.errorOnAutoCreate())
1161          throw new Error("Attempt to auto-create Coverage.policyHolder");
1162        else if (Configuration.doAutoCreate())
1163          this.policyHolder = new Reference(); // cc
1164      return this.policyHolder;
1165    }
1166
1167    public boolean hasPolicyHolder() { 
1168      return this.policyHolder != null && !this.policyHolder.isEmpty();
1169    }
1170
1171    /**
1172     * @param value {@link #policyHolder} (The party who 'owns' the insurance policy.)
1173     */
1174    public Coverage setPolicyHolder(Reference value) { 
1175      this.policyHolder = value;
1176      return this;
1177    }
1178
1179    /**
1180     * @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.)
1181     */
1182    public Reference getSubscriber() { 
1183      if (this.subscriber == null)
1184        if (Configuration.errorOnAutoCreate())
1185          throw new Error("Attempt to auto-create Coverage.subscriber");
1186        else if (Configuration.doAutoCreate())
1187          this.subscriber = new Reference(); // cc
1188      return this.subscriber;
1189    }
1190
1191    public boolean hasSubscriber() { 
1192      return this.subscriber != null && !this.subscriber.isEmpty();
1193    }
1194
1195    /**
1196     * @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.)
1197     */
1198    public Coverage setSubscriber(Reference value) { 
1199      this.subscriber = value;
1200      return this;
1201    }
1202
1203    /**
1204     * @return {@link #subscriberId} (The insurer assigned ID for the Subscriber.). This is the underlying object with id, value and extensions. The accessor "getSubscriberId" gives direct access to the value
1205     */
1206    public StringType getSubscriberIdElement() { 
1207      if (this.subscriberId == null)
1208        if (Configuration.errorOnAutoCreate())
1209          throw new Error("Attempt to auto-create Coverage.subscriberId");
1210        else if (Configuration.doAutoCreate())
1211          this.subscriberId = new StringType(); // bb
1212      return this.subscriberId;
1213    }
1214
1215    public boolean hasSubscriberIdElement() { 
1216      return this.subscriberId != null && !this.subscriberId.isEmpty();
1217    }
1218
1219    public boolean hasSubscriberId() { 
1220      return this.subscriberId != null && !this.subscriberId.isEmpty();
1221    }
1222
1223    /**
1224     * @param value {@link #subscriberId} (The insurer assigned ID for the Subscriber.). This is the underlying object with id, value and extensions. The accessor "getSubscriberId" gives direct access to the value
1225     */
1226    public Coverage setSubscriberIdElement(StringType value) { 
1227      this.subscriberId = value;
1228      return this;
1229    }
1230
1231    /**
1232     * @return The insurer assigned ID for the Subscriber.
1233     */
1234    public String getSubscriberId() { 
1235      return this.subscriberId == null ? null : this.subscriberId.getValue();
1236    }
1237
1238    /**
1239     * @param value The insurer assigned ID for the Subscriber.
1240     */
1241    public Coverage setSubscriberId(String value) { 
1242      if (Utilities.noString(value))
1243        this.subscriberId = null;
1244      else {
1245        if (this.subscriberId == null)
1246          this.subscriberId = new StringType();
1247        this.subscriberId.setValue(value);
1248      }
1249      return this;
1250    }
1251
1252    /**
1253     * @return {@link #beneficiary} (The party who benefits from the insurance coverage; the patient when products and/or services are provided.)
1254     */
1255    public Reference getBeneficiary() { 
1256      if (this.beneficiary == null)
1257        if (Configuration.errorOnAutoCreate())
1258          throw new Error("Attempt to auto-create Coverage.beneficiary");
1259        else if (Configuration.doAutoCreate())
1260          this.beneficiary = new Reference(); // cc
1261      return this.beneficiary;
1262    }
1263
1264    public boolean hasBeneficiary() { 
1265      return this.beneficiary != null && !this.beneficiary.isEmpty();
1266    }
1267
1268    /**
1269     * @param value {@link #beneficiary} (The party who benefits from the insurance coverage; the patient when products and/or services are provided.)
1270     */
1271    public Coverage setBeneficiary(Reference value) { 
1272      this.beneficiary = value;
1273      return this;
1274    }
1275
1276    /**
1277     * @return {@link #dependent} (A unique identifier 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
1278     */
1279    public StringType getDependentElement() { 
1280      if (this.dependent == null)
1281        if (Configuration.errorOnAutoCreate())
1282          throw new Error("Attempt to auto-create Coverage.dependent");
1283        else if (Configuration.doAutoCreate())
1284          this.dependent = new StringType(); // bb
1285      return this.dependent;
1286    }
1287
1288    public boolean hasDependentElement() { 
1289      return this.dependent != null && !this.dependent.isEmpty();
1290    }
1291
1292    public boolean hasDependent() { 
1293      return this.dependent != null && !this.dependent.isEmpty();
1294    }
1295
1296    /**
1297     * @param value {@link #dependent} (A unique identifier 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
1298     */
1299    public Coverage setDependentElement(StringType value) { 
1300      this.dependent = value;
1301      return this;
1302    }
1303
1304    /**
1305     * @return A unique identifier for a dependent under the coverage.
1306     */
1307    public String getDependent() { 
1308      return this.dependent == null ? null : this.dependent.getValue();
1309    }
1310
1311    /**
1312     * @param value A unique identifier for a dependent under the coverage.
1313     */
1314    public Coverage setDependent(String value) { 
1315      if (Utilities.noString(value))
1316        this.dependent = null;
1317      else {
1318        if (this.dependent == null)
1319          this.dependent = new StringType();
1320        this.dependent.setValue(value);
1321      }
1322      return this;
1323    }
1324
1325    /**
1326     * @return {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.)
1327     */
1328    public CodeableConcept getRelationship() { 
1329      if (this.relationship == null)
1330        if (Configuration.errorOnAutoCreate())
1331          throw new Error("Attempt to auto-create Coverage.relationship");
1332        else if (Configuration.doAutoCreate())
1333          this.relationship = new CodeableConcept(); // cc
1334      return this.relationship;
1335    }
1336
1337    public boolean hasRelationship() { 
1338      return this.relationship != null && !this.relationship.isEmpty();
1339    }
1340
1341    /**
1342     * @param value {@link #relationship} (The relationship of beneficiary (patient) to the subscriber.)
1343     */
1344    public Coverage setRelationship(CodeableConcept value) { 
1345      this.relationship = value;
1346      return this;
1347    }
1348
1349    /**
1350     * @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.)
1351     */
1352    public Period getPeriod() { 
1353      if (this.period == null)
1354        if (Configuration.errorOnAutoCreate())
1355          throw new Error("Attempt to auto-create Coverage.period");
1356        else if (Configuration.doAutoCreate())
1357          this.period = new Period(); // cc
1358      return this.period;
1359    }
1360
1361    public boolean hasPeriod() { 
1362      return this.period != null && !this.period.isEmpty();
1363    }
1364
1365    /**
1366     * @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.)
1367     */
1368    public Coverage setPeriod(Period value) { 
1369      this.period = value;
1370      return this;
1371    }
1372
1373    /**
1374     * @return {@link #payor} (The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.)
1375     */
1376    public List<Reference> getPayor() { 
1377      if (this.payor == null)
1378        this.payor = new ArrayList<Reference>();
1379      return this.payor;
1380    }
1381
1382    /**
1383     * @return Returns a reference to <code>this</code> for easy method chaining
1384     */
1385    public Coverage setPayor(List<Reference> thePayor) { 
1386      this.payor = thePayor;
1387      return this;
1388    }
1389
1390    public boolean hasPayor() { 
1391      if (this.payor == null)
1392        return false;
1393      for (Reference item : this.payor)
1394        if (!item.isEmpty())
1395          return true;
1396      return false;
1397    }
1398
1399    public Reference addPayor() { //3
1400      Reference t = new Reference();
1401      if (this.payor == null)
1402        this.payor = new ArrayList<Reference>();
1403      this.payor.add(t);
1404      return t;
1405    }
1406
1407    public Coverage addPayor(Reference t) { //3
1408      if (t == null)
1409        return this;
1410      if (this.payor == null)
1411        this.payor = new ArrayList<Reference>();
1412      this.payor.add(t);
1413      return this;
1414    }
1415
1416    /**
1417     * @return The first repetition of repeating field {@link #payor}, creating it if it does not already exist {3}
1418     */
1419    public Reference getPayorFirstRep() { 
1420      if (getPayor().isEmpty()) {
1421        addPayor();
1422      }
1423      return getPayor().get(0);
1424    }
1425
1426    /**
1427     * @return {@link #class_} (A suite of underwriter specific classifiers.)
1428     */
1429    public List<ClassComponent> getClass_() { 
1430      if (this.class_ == null)
1431        this.class_ = new ArrayList<ClassComponent>();
1432      return this.class_;
1433    }
1434
1435    /**
1436     * @return Returns a reference to <code>this</code> for easy method chaining
1437     */
1438    public Coverage setClass_(List<ClassComponent> theClass_) { 
1439      this.class_ = theClass_;
1440      return this;
1441    }
1442
1443    public boolean hasClass_() { 
1444      if (this.class_ == null)
1445        return false;
1446      for (ClassComponent item : this.class_)
1447        if (!item.isEmpty())
1448          return true;
1449      return false;
1450    }
1451
1452    public ClassComponent addClass_() { //3
1453      ClassComponent t = new ClassComponent();
1454      if (this.class_ == null)
1455        this.class_ = new ArrayList<ClassComponent>();
1456      this.class_.add(t);
1457      return t;
1458    }
1459
1460    public Coverage addClass_(ClassComponent t) { //3
1461      if (t == null)
1462        return this;
1463      if (this.class_ == null)
1464        this.class_ = new ArrayList<ClassComponent>();
1465      this.class_.add(t);
1466      return this;
1467    }
1468
1469    /**
1470     * @return The first repetition of repeating field {@link #class_}, creating it if it does not already exist {3}
1471     */
1472    public ClassComponent getClass_FirstRep() { 
1473      if (getClass_().isEmpty()) {
1474        addClass_();
1475      }
1476      return getClass_().get(0);
1477    }
1478
1479    /**
1480     * @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.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value
1481     */
1482    public PositiveIntType getOrderElement() { 
1483      if (this.order == null)
1484        if (Configuration.errorOnAutoCreate())
1485          throw new Error("Attempt to auto-create Coverage.order");
1486        else if (Configuration.doAutoCreate())
1487          this.order = new PositiveIntType(); // bb
1488      return this.order;
1489    }
1490
1491    public boolean hasOrderElement() { 
1492      return this.order != null && !this.order.isEmpty();
1493    }
1494
1495    public boolean hasOrder() { 
1496      return this.order != null && !this.order.isEmpty();
1497    }
1498
1499    /**
1500     * @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.). This is the underlying object with id, value and extensions. The accessor "getOrder" gives direct access to the value
1501     */
1502    public Coverage setOrderElement(PositiveIntType value) { 
1503      this.order = value;
1504      return this;
1505    }
1506
1507    /**
1508     * @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.
1509     */
1510    public int getOrder() { 
1511      return this.order == null || this.order.isEmpty() ? 0 : this.order.getValue();
1512    }
1513
1514    /**
1515     * @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.
1516     */
1517    public Coverage setOrder(int value) { 
1518        if (this.order == null)
1519          this.order = new PositiveIntType();
1520        this.order.setValue(value);
1521      return this;
1522    }
1523
1524    /**
1525     * @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
1526     */
1527    public StringType getNetworkElement() { 
1528      if (this.network == null)
1529        if (Configuration.errorOnAutoCreate())
1530          throw new Error("Attempt to auto-create Coverage.network");
1531        else if (Configuration.doAutoCreate())
1532          this.network = new StringType(); // bb
1533      return this.network;
1534    }
1535
1536    public boolean hasNetworkElement() { 
1537      return this.network != null && !this.network.isEmpty();
1538    }
1539
1540    public boolean hasNetwork() { 
1541      return this.network != null && !this.network.isEmpty();
1542    }
1543
1544    /**
1545     * @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
1546     */
1547    public Coverage setNetworkElement(StringType value) { 
1548      this.network = value;
1549      return this;
1550    }
1551
1552    /**
1553     * @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.
1554     */
1555    public String getNetwork() { 
1556      return this.network == null ? null : this.network.getValue();
1557    }
1558
1559    /**
1560     * @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.
1561     */
1562    public Coverage setNetwork(String value) { 
1563      if (Utilities.noString(value))
1564        this.network = null;
1565      else {
1566        if (this.network == null)
1567          this.network = new StringType();
1568        this.network.setValue(value);
1569      }
1570      return this;
1571    }
1572
1573    /**
1574     * @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.)
1575     */
1576    public List<CostToBeneficiaryComponent> getCostToBeneficiary() { 
1577      if (this.costToBeneficiary == null)
1578        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
1579      return this.costToBeneficiary;
1580    }
1581
1582    /**
1583     * @return Returns a reference to <code>this</code> for easy method chaining
1584     */
1585    public Coverage setCostToBeneficiary(List<CostToBeneficiaryComponent> theCostToBeneficiary) { 
1586      this.costToBeneficiary = theCostToBeneficiary;
1587      return this;
1588    }
1589
1590    public boolean hasCostToBeneficiary() { 
1591      if (this.costToBeneficiary == null)
1592        return false;
1593      for (CostToBeneficiaryComponent item : this.costToBeneficiary)
1594        if (!item.isEmpty())
1595          return true;
1596      return false;
1597    }
1598
1599    public CostToBeneficiaryComponent addCostToBeneficiary() { //3
1600      CostToBeneficiaryComponent t = new CostToBeneficiaryComponent();
1601      if (this.costToBeneficiary == null)
1602        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
1603      this.costToBeneficiary.add(t);
1604      return t;
1605    }
1606
1607    public Coverage addCostToBeneficiary(CostToBeneficiaryComponent t) { //3
1608      if (t == null)
1609        return this;
1610      if (this.costToBeneficiary == null)
1611        this.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
1612      this.costToBeneficiary.add(t);
1613      return this;
1614    }
1615
1616    /**
1617     * @return The first repetition of repeating field {@link #costToBeneficiary}, creating it if it does not already exist {3}
1618     */
1619    public CostToBeneficiaryComponent getCostToBeneficiaryFirstRep() { 
1620      if (getCostToBeneficiary().isEmpty()) {
1621        addCostToBeneficiary();
1622      }
1623      return getCostToBeneficiary().get(0);
1624    }
1625
1626    /**
1627     * @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
1628     */
1629    public BooleanType getSubrogationElement() { 
1630      if (this.subrogation == null)
1631        if (Configuration.errorOnAutoCreate())
1632          throw new Error("Attempt to auto-create Coverage.subrogation");
1633        else if (Configuration.doAutoCreate())
1634          this.subrogation = new BooleanType(); // bb
1635      return this.subrogation;
1636    }
1637
1638    public boolean hasSubrogationElement() { 
1639      return this.subrogation != null && !this.subrogation.isEmpty();
1640    }
1641
1642    public boolean hasSubrogation() { 
1643      return this.subrogation != null && !this.subrogation.isEmpty();
1644    }
1645
1646    /**
1647     * @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
1648     */
1649    public Coverage setSubrogationElement(BooleanType value) { 
1650      this.subrogation = value;
1651      return this;
1652    }
1653
1654    /**
1655     * @return When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
1656     */
1657    public boolean getSubrogation() { 
1658      return this.subrogation == null || this.subrogation.isEmpty() ? false : this.subrogation.getValue();
1659    }
1660
1661    /**
1662     * @param value When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.
1663     */
1664    public Coverage setSubrogation(boolean value) { 
1665        if (this.subrogation == null)
1666          this.subrogation = new BooleanType();
1667        this.subrogation.setValue(value);
1668      return this;
1669    }
1670
1671    /**
1672     * @return {@link #contract} (The policy(s) which constitute this insurance coverage.)
1673     */
1674    public List<Reference> getContract() { 
1675      if (this.contract == null)
1676        this.contract = new ArrayList<Reference>();
1677      return this.contract;
1678    }
1679
1680    /**
1681     * @return Returns a reference to <code>this</code> for easy method chaining
1682     */
1683    public Coverage setContract(List<Reference> theContract) { 
1684      this.contract = theContract;
1685      return this;
1686    }
1687
1688    public boolean hasContract() { 
1689      if (this.contract == null)
1690        return false;
1691      for (Reference item : this.contract)
1692        if (!item.isEmpty())
1693          return true;
1694      return false;
1695    }
1696
1697    public Reference addContract() { //3
1698      Reference t = new Reference();
1699      if (this.contract == null)
1700        this.contract = new ArrayList<Reference>();
1701      this.contract.add(t);
1702      return t;
1703    }
1704
1705    public Coverage addContract(Reference t) { //3
1706      if (t == null)
1707        return this;
1708      if (this.contract == null)
1709        this.contract = new ArrayList<Reference>();
1710      this.contract.add(t);
1711      return this;
1712    }
1713
1714    /**
1715     * @return The first repetition of repeating field {@link #contract}, creating it if it does not already exist {3}
1716     */
1717    public Reference getContractFirstRep() { 
1718      if (getContract().isEmpty()) {
1719        addContract();
1720      }
1721      return getContract().get(0);
1722    }
1723
1724      protected void listChildren(List<Property> children) {
1725        super.listChildren(children);
1726        children.add(new Property("identifier", "Identifier", "A unique identifier assigned to this coverage.", 0, java.lang.Integer.MAX_VALUE, identifier));
1727        children.add(new Property("status", "code", "The status of the resource instance.", 0, 1, status));
1728        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));
1729        children.add(new Property("policyHolder", "Reference(Patient|RelatedPerson|Organization)", "The party who 'owns' the insurance policy.", 0, 1, policyHolder));
1730        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));
1731        children.add(new Property("subscriberId", "string", "The insurer assigned ID for the Subscriber.", 0, 1, subscriberId));
1732        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));
1733        children.add(new Property("dependent", "string", "A unique identifier for a dependent under the coverage.", 0, 1, dependent));
1734        children.add(new Property("relationship", "CodeableConcept", "The relationship of beneficiary (patient) to the subscriber.", 0, 1, relationship));
1735        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));
1736        children.add(new Property("payor", "Reference(Organization|Patient|RelatedPerson)", "The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.", 0, java.lang.Integer.MAX_VALUE, payor));
1737        children.add(new Property("class", "", "A suite of underwriter specific classifiers.", 0, java.lang.Integer.MAX_VALUE, class_));
1738        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.", 0, 1, order));
1739        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));
1740        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));
1741        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));
1742        children.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract));
1743      }
1744
1745      @Override
1746      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1747        switch (_hash) {
1748        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique identifier assigned to this coverage.", 0, java.lang.Integer.MAX_VALUE, identifier);
1749        case -892481550: /*status*/  return new Property("status", "code", "The status of the resource instance.", 0, 1, status);
1750        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);
1751        case 2046898558: /*policyHolder*/  return new Property("policyHolder", "Reference(Patient|RelatedPerson|Organization)", "The party who 'owns' the insurance policy.", 0, 1, policyHolder);
1752        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);
1753        case 327834531: /*subscriberId*/  return new Property("subscriberId", "string", "The insurer assigned ID for the Subscriber.", 0, 1, subscriberId);
1754        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);
1755        case -1109226753: /*dependent*/  return new Property("dependent", "string", "A unique identifier for a dependent under the coverage.", 0, 1, dependent);
1756        case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "The relationship of beneficiary (patient) to the subscriber.", 0, 1, relationship);
1757        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);
1758        case 106443915: /*payor*/  return new Property("payor", "Reference(Organization|Patient|RelatedPerson)", "The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.", 0, java.lang.Integer.MAX_VALUE, payor);
1759        case 94742904: /*class*/  return new Property("class", "", "A suite of underwriter specific classifiers.", 0, java.lang.Integer.MAX_VALUE, class_);
1760        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.", 0, 1, order);
1761        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);
1762        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);
1763        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);
1764        case -566947566: /*contract*/  return new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract);
1765        default: return super.getNamedProperty(_hash, _name, _checkValid);
1766        }
1767
1768      }
1769
1770      @Override
1771      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1772        switch (hash) {
1773        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1774        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<FinancialResourceStatusCodes>
1775        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1776        case 2046898558: /*policyHolder*/ return this.policyHolder == null ? new Base[0] : new Base[] {this.policyHolder}; // Reference
1777        case -1219769240: /*subscriber*/ return this.subscriber == null ? new Base[0] : new Base[] {this.subscriber}; // Reference
1778        case 327834531: /*subscriberId*/ return this.subscriberId == null ? new Base[0] : new Base[] {this.subscriberId}; // StringType
1779        case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Reference
1780        case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // StringType
1781        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
1782        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1783        case 106443915: /*payor*/ return this.payor == null ? new Base[0] : this.payor.toArray(new Base[this.payor.size()]); // Reference
1784        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : this.class_.toArray(new Base[this.class_.size()]); // ClassComponent
1785        case 106006350: /*order*/ return this.order == null ? new Base[0] : new Base[] {this.order}; // PositiveIntType
1786        case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // StringType
1787        case -1866474851: /*costToBeneficiary*/ return this.costToBeneficiary == null ? new Base[0] : this.costToBeneficiary.toArray(new Base[this.costToBeneficiary.size()]); // CostToBeneficiaryComponent
1788        case 837389739: /*subrogation*/ return this.subrogation == null ? new Base[0] : new Base[] {this.subrogation}; // BooleanType
1789        case -566947566: /*contract*/ return this.contract == null ? new Base[0] : this.contract.toArray(new Base[this.contract.size()]); // Reference
1790        default: return super.getProperty(hash, name, checkValid);
1791        }
1792
1793      }
1794
1795      @Override
1796      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1797        switch (hash) {
1798        case -1618432855: // identifier
1799          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1800          return value;
1801        case -892481550: // status
1802          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1803          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
1804          return value;
1805        case 3575610: // type
1806          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1807          return value;
1808        case 2046898558: // policyHolder
1809          this.policyHolder = TypeConvertor.castToReference(value); // Reference
1810          return value;
1811        case -1219769240: // subscriber
1812          this.subscriber = TypeConvertor.castToReference(value); // Reference
1813          return value;
1814        case 327834531: // subscriberId
1815          this.subscriberId = TypeConvertor.castToString(value); // StringType
1816          return value;
1817        case -565102875: // beneficiary
1818          this.beneficiary = TypeConvertor.castToReference(value); // Reference
1819          return value;
1820        case -1109226753: // dependent
1821          this.dependent = TypeConvertor.castToString(value); // StringType
1822          return value;
1823        case -261851592: // relationship
1824          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1825          return value;
1826        case -991726143: // period
1827          this.period = TypeConvertor.castToPeriod(value); // Period
1828          return value;
1829        case 106443915: // payor
1830          this.getPayor().add(TypeConvertor.castToReference(value)); // Reference
1831          return value;
1832        case 94742904: // class
1833          this.getClass_().add((ClassComponent) value); // ClassComponent
1834          return value;
1835        case 106006350: // order
1836          this.order = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1837          return value;
1838        case 1843485230: // network
1839          this.network = TypeConvertor.castToString(value); // StringType
1840          return value;
1841        case -1866474851: // costToBeneficiary
1842          this.getCostToBeneficiary().add((CostToBeneficiaryComponent) value); // CostToBeneficiaryComponent
1843          return value;
1844        case 837389739: // subrogation
1845          this.subrogation = TypeConvertor.castToBoolean(value); // BooleanType
1846          return value;
1847        case -566947566: // contract
1848          this.getContract().add(TypeConvertor.castToReference(value)); // Reference
1849          return value;
1850        default: return super.setProperty(hash, name, value);
1851        }
1852
1853      }
1854
1855      @Override
1856      public Base setProperty(String name, Base value) throws FHIRException {
1857        if (name.equals("identifier")) {
1858          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1859        } else if (name.equals("status")) {
1860          value = new FinancialResourceStatusCodesEnumFactory().fromType(TypeConvertor.castToCode(value));
1861          this.status = (Enumeration) value; // Enumeration<FinancialResourceStatusCodes>
1862        } else if (name.equals("type")) {
1863          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1864        } else if (name.equals("policyHolder")) {
1865          this.policyHolder = TypeConvertor.castToReference(value); // Reference
1866        } else if (name.equals("subscriber")) {
1867          this.subscriber = TypeConvertor.castToReference(value); // Reference
1868        } else if (name.equals("subscriberId")) {
1869          this.subscriberId = TypeConvertor.castToString(value); // StringType
1870        } else if (name.equals("beneficiary")) {
1871          this.beneficiary = TypeConvertor.castToReference(value); // Reference
1872        } else if (name.equals("dependent")) {
1873          this.dependent = TypeConvertor.castToString(value); // StringType
1874        } else if (name.equals("relationship")) {
1875          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1876        } else if (name.equals("period")) {
1877          this.period = TypeConvertor.castToPeriod(value); // Period
1878        } else if (name.equals("payor")) {
1879          this.getPayor().add(TypeConvertor.castToReference(value));
1880        } else if (name.equals("class")) {
1881          this.getClass_().add((ClassComponent) value);
1882        } else if (name.equals("order")) {
1883          this.order = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1884        } else if (name.equals("network")) {
1885          this.network = TypeConvertor.castToString(value); // StringType
1886        } else if (name.equals("costToBeneficiary")) {
1887          this.getCostToBeneficiary().add((CostToBeneficiaryComponent) value);
1888        } else if (name.equals("subrogation")) {
1889          this.subrogation = TypeConvertor.castToBoolean(value); // BooleanType
1890        } else if (name.equals("contract")) {
1891          this.getContract().add(TypeConvertor.castToReference(value));
1892        } else
1893          return super.setProperty(name, value);
1894        return value;
1895      }
1896
1897      @Override
1898      public Base makeProperty(int hash, String name) throws FHIRException {
1899        switch (hash) {
1900        case -1618432855:  return addIdentifier(); 
1901        case -892481550:  return getStatusElement();
1902        case 3575610:  return getType();
1903        case 2046898558:  return getPolicyHolder();
1904        case -1219769240:  return getSubscriber();
1905        case 327834531:  return getSubscriberIdElement();
1906        case -565102875:  return getBeneficiary();
1907        case -1109226753:  return getDependentElement();
1908        case -261851592:  return getRelationship();
1909        case -991726143:  return getPeriod();
1910        case 106443915:  return addPayor(); 
1911        case 94742904:  return addClass_(); 
1912        case 106006350:  return getOrderElement();
1913        case 1843485230:  return getNetworkElement();
1914        case -1866474851:  return addCostToBeneficiary(); 
1915        case 837389739:  return getSubrogationElement();
1916        case -566947566:  return addContract(); 
1917        default: return super.makeProperty(hash, name);
1918        }
1919
1920      }
1921
1922      @Override
1923      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1924        switch (hash) {
1925        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1926        case -892481550: /*status*/ return new String[] {"code"};
1927        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1928        case 2046898558: /*policyHolder*/ return new String[] {"Reference"};
1929        case -1219769240: /*subscriber*/ return new String[] {"Reference"};
1930        case 327834531: /*subscriberId*/ return new String[] {"string"};
1931        case -565102875: /*beneficiary*/ return new String[] {"Reference"};
1932        case -1109226753: /*dependent*/ return new String[] {"string"};
1933        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
1934        case -991726143: /*period*/ return new String[] {"Period"};
1935        case 106443915: /*payor*/ return new String[] {"Reference"};
1936        case 94742904: /*class*/ return new String[] {};
1937        case 106006350: /*order*/ return new String[] {"positiveInt"};
1938        case 1843485230: /*network*/ return new String[] {"string"};
1939        case -1866474851: /*costToBeneficiary*/ return new String[] {};
1940        case 837389739: /*subrogation*/ return new String[] {"boolean"};
1941        case -566947566: /*contract*/ return new String[] {"Reference"};
1942        default: return super.getTypesForProperty(hash, name);
1943        }
1944
1945      }
1946
1947      @Override
1948      public Base addChild(String name) throws FHIRException {
1949        if (name.equals("identifier")) {
1950          return addIdentifier();
1951        }
1952        else if (name.equals("status")) {
1953          throw new FHIRException("Cannot call addChild on a primitive type Coverage.status");
1954        }
1955        else if (name.equals("type")) {
1956          this.type = new CodeableConcept();
1957          return this.type;
1958        }
1959        else if (name.equals("policyHolder")) {
1960          this.policyHolder = new Reference();
1961          return this.policyHolder;
1962        }
1963        else if (name.equals("subscriber")) {
1964          this.subscriber = new Reference();
1965          return this.subscriber;
1966        }
1967        else if (name.equals("subscriberId")) {
1968          throw new FHIRException("Cannot call addChild on a primitive type Coverage.subscriberId");
1969        }
1970        else if (name.equals("beneficiary")) {
1971          this.beneficiary = new Reference();
1972          return this.beneficiary;
1973        }
1974        else if (name.equals("dependent")) {
1975          throw new FHIRException("Cannot call addChild on a primitive type Coverage.dependent");
1976        }
1977        else if (name.equals("relationship")) {
1978          this.relationship = new CodeableConcept();
1979          return this.relationship;
1980        }
1981        else if (name.equals("period")) {
1982          this.period = new Period();
1983          return this.period;
1984        }
1985        else if (name.equals("payor")) {
1986          return addPayor();
1987        }
1988        else if (name.equals("class")) {
1989          return addClass_();
1990        }
1991        else if (name.equals("order")) {
1992          throw new FHIRException("Cannot call addChild on a primitive type Coverage.order");
1993        }
1994        else if (name.equals("network")) {
1995          throw new FHIRException("Cannot call addChild on a primitive type Coverage.network");
1996        }
1997        else if (name.equals("costToBeneficiary")) {
1998          return addCostToBeneficiary();
1999        }
2000        else if (name.equals("subrogation")) {
2001          throw new FHIRException("Cannot call addChild on a primitive type Coverage.subrogation");
2002        }
2003        else if (name.equals("contract")) {
2004          return addContract();
2005        }
2006        else
2007          return super.addChild(name);
2008      }
2009
2010  public String fhirType() {
2011    return "Coverage";
2012
2013  }
2014
2015      public Coverage copy() {
2016        Coverage dst = new Coverage();
2017        copyValues(dst);
2018        return dst;
2019      }
2020
2021      public void copyValues(Coverage dst) {
2022        super.copyValues(dst);
2023        if (identifier != null) {
2024          dst.identifier = new ArrayList<Identifier>();
2025          for (Identifier i : identifier)
2026            dst.identifier.add(i.copy());
2027        };
2028        dst.status = status == null ? null : status.copy();
2029        dst.type = type == null ? null : type.copy();
2030        dst.policyHolder = policyHolder == null ? null : policyHolder.copy();
2031        dst.subscriber = subscriber == null ? null : subscriber.copy();
2032        dst.subscriberId = subscriberId == null ? null : subscriberId.copy();
2033        dst.beneficiary = beneficiary == null ? null : beneficiary.copy();
2034        dst.dependent = dependent == null ? null : dependent.copy();
2035        dst.relationship = relationship == null ? null : relationship.copy();
2036        dst.period = period == null ? null : period.copy();
2037        if (payor != null) {
2038          dst.payor = new ArrayList<Reference>();
2039          for (Reference i : payor)
2040            dst.payor.add(i.copy());
2041        };
2042        if (class_ != null) {
2043          dst.class_ = new ArrayList<ClassComponent>();
2044          for (ClassComponent i : class_)
2045            dst.class_.add(i.copy());
2046        };
2047        dst.order = order == null ? null : order.copy();
2048        dst.network = network == null ? null : network.copy();
2049        if (costToBeneficiary != null) {
2050          dst.costToBeneficiary = new ArrayList<CostToBeneficiaryComponent>();
2051          for (CostToBeneficiaryComponent i : costToBeneficiary)
2052            dst.costToBeneficiary.add(i.copy());
2053        };
2054        dst.subrogation = subrogation == null ? null : subrogation.copy();
2055        if (contract != null) {
2056          dst.contract = new ArrayList<Reference>();
2057          for (Reference i : contract)
2058            dst.contract.add(i.copy());
2059        };
2060      }
2061
2062      protected Coverage typedCopy() {
2063        return copy();
2064      }
2065
2066      @Override
2067      public boolean equalsDeep(Base other_) {
2068        if (!super.equalsDeep(other_))
2069          return false;
2070        if (!(other_ instanceof Coverage))
2071          return false;
2072        Coverage o = (Coverage) other_;
2073        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
2074           && compareDeep(policyHolder, o.policyHolder, true) && compareDeep(subscriber, o.subscriber, true)
2075           && compareDeep(subscriberId, o.subscriberId, true) && compareDeep(beneficiary, o.beneficiary, true)
2076           && compareDeep(dependent, o.dependent, true) && compareDeep(relationship, o.relationship, true)
2077           && compareDeep(period, o.period, true) && compareDeep(payor, o.payor, true) && compareDeep(class_, o.class_, true)
2078           && compareDeep(order, o.order, true) && compareDeep(network, o.network, true) && compareDeep(costToBeneficiary, o.costToBeneficiary, true)
2079           && compareDeep(subrogation, o.subrogation, true) && compareDeep(contract, o.contract, true);
2080      }
2081
2082      @Override
2083      public boolean equalsShallow(Base other_) {
2084        if (!super.equalsShallow(other_))
2085          return false;
2086        if (!(other_ instanceof Coverage))
2087          return false;
2088        Coverage o = (Coverage) other_;
2089        return compareValues(status, o.status, true) && compareValues(subscriberId, o.subscriberId, true) && compareValues(dependent, o.dependent, true)
2090           && compareValues(order, o.order, true) && compareValues(network, o.network, true) && compareValues(subrogation, o.subrogation, true)
2091          ;
2092      }
2093
2094      public boolean isEmpty() {
2095        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
2096          , policyHolder, subscriber, subscriberId, beneficiary, dependent, relationship, period
2097          , payor, class_, order, network, costToBeneficiary, subrogation, contract);
2098      }
2099
2100  @Override
2101  public ResourceType getResourceType() {
2102    return ResourceType.Coverage;
2103   }
2104
2105 /**
2106   * Search parameter: <b>beneficiary</b>
2107   * <p>
2108   * Description: <b>Covered party</b><br>
2109   * Type: <b>reference</b><br>
2110   * Path: <b>Coverage.beneficiary</b><br>
2111   * </p>
2112   */
2113  @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 } )
2114  public static final String SP_BENEFICIARY = "beneficiary";
2115 /**
2116   * <b>Fluent Client</b> search parameter constant for <b>beneficiary</b>
2117   * <p>
2118   * Description: <b>Covered party</b><br>
2119   * Type: <b>reference</b><br>
2120   * Path: <b>Coverage.beneficiary</b><br>
2121   * </p>
2122   */
2123  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BENEFICIARY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BENEFICIARY);
2124
2125/**
2126   * Constant for fluent queries to be used to add include statements. Specifies
2127   * the path value of "<b>Coverage:beneficiary</b>".
2128   */
2129  public static final ca.uhn.fhir.model.api.Include INCLUDE_BENEFICIARY = new ca.uhn.fhir.model.api.Include("Coverage:beneficiary").toLocked();
2130
2131 /**
2132   * Search parameter: <b>class-type</b>
2133   * <p>
2134   * Description: <b>Coverage class (eg. plan, group)</b><br>
2135   * Type: <b>token</b><br>
2136   * Path: <b>Coverage.class.type</b><br>
2137   * </p>
2138   */
2139  @SearchParamDefinition(name="class-type", path="Coverage.class.type", description="Coverage class (eg. plan, group)", type="token" )
2140  public static final String SP_CLASS_TYPE = "class-type";
2141 /**
2142   * <b>Fluent Client</b> search parameter constant for <b>class-type</b>
2143   * <p>
2144   * Description: <b>Coverage class (eg. plan, group)</b><br>
2145   * Type: <b>token</b><br>
2146   * Path: <b>Coverage.class.type</b><br>
2147   * </p>
2148   */
2149  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS_TYPE);
2150
2151 /**
2152   * Search parameter: <b>class-value</b>
2153   * <p>
2154   * Description: <b>Value of the class (eg. Plan number, group number)</b><br>
2155   * Type: <b>string</b><br>
2156   * Path: <b>Coverage.class.value</b><br>
2157   * </p>
2158   */
2159  @SearchParamDefinition(name="class-value", path="Coverage.class.value", description="Value of the class (eg. Plan number, group number)", type="string" )
2160  public static final String SP_CLASS_VALUE = "class-value";
2161 /**
2162   * <b>Fluent Client</b> search parameter constant for <b>class-value</b>
2163   * <p>
2164   * Description: <b>Value of the class (eg. Plan number, group number)</b><br>
2165   * Type: <b>string</b><br>
2166   * Path: <b>Coverage.class.value</b><br>
2167   * </p>
2168   */
2169  public static final ca.uhn.fhir.rest.gclient.StringClientParam CLASS_VALUE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CLASS_VALUE);
2170
2171 /**
2172   * Search parameter: <b>dependent</b>
2173   * <p>
2174   * Description: <b>Dependent number</b><br>
2175   * Type: <b>string</b><br>
2176   * Path: <b>Coverage.dependent</b><br>
2177   * </p>
2178   */
2179  @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="string" )
2180  public static final String SP_DEPENDENT = "dependent";
2181 /**
2182   * <b>Fluent Client</b> search parameter constant for <b>dependent</b>
2183   * <p>
2184   * Description: <b>Dependent number</b><br>
2185   * Type: <b>string</b><br>
2186   * Path: <b>Coverage.dependent</b><br>
2187   * </p>
2188   */
2189  public static final ca.uhn.fhir.rest.gclient.StringClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DEPENDENT);
2190
2191 /**
2192   * Search parameter: <b>identifier</b>
2193   * <p>
2194   * Description: <b>The primary identifier of the insured and the coverage</b><br>
2195   * Type: <b>token</b><br>
2196   * Path: <b>Coverage.identifier</b><br>
2197   * </p>
2198   */
2199  @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured and the coverage", type="token" )
2200  public static final String SP_IDENTIFIER = "identifier";
2201 /**
2202   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2203   * <p>
2204   * Description: <b>The primary identifier of the insured and the coverage</b><br>
2205   * Type: <b>token</b><br>
2206   * Path: <b>Coverage.identifier</b><br>
2207   * </p>
2208   */
2209  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2210
2211 /**
2212   * Search parameter: <b>patient</b>
2213   * <p>
2214   * Description: <b>Retrieve coverages for a patient</b><br>
2215   * Type: <b>reference</b><br>
2216   * Path: <b>Coverage.beneficiary</b><br>
2217   * </p>
2218   */
2219  @SearchParamDefinition(name="patient", path="Coverage.beneficiary", description="Retrieve coverages for a patient", type="reference", target={Patient.class } )
2220  public static final String SP_PATIENT = "patient";
2221 /**
2222   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2223   * <p>
2224   * Description: <b>Retrieve coverages for a patient</b><br>
2225   * Type: <b>reference</b><br>
2226   * Path: <b>Coverage.beneficiary</b><br>
2227   * </p>
2228   */
2229  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2230
2231/**
2232   * Constant for fluent queries to be used to add include statements. Specifies
2233   * the path value of "<b>Coverage:patient</b>".
2234   */
2235  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Coverage:patient").toLocked();
2236
2237 /**
2238   * Search parameter: <b>payor</b>
2239   * <p>
2240   * Description: <b>The identity of the insurer or party paying for services</b><br>
2241   * Type: <b>reference</b><br>
2242   * Path: <b>Coverage.payor</b><br>
2243   * </p>
2244   */
2245  @SearchParamDefinition(name="payor", path="Coverage.payor", description="The identity of the insurer or party paying 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 } )
2246  public static final String SP_PAYOR = "payor";
2247 /**
2248   * <b>Fluent Client</b> search parameter constant for <b>payor</b>
2249   * <p>
2250   * Description: <b>The identity of the insurer or party paying for services</b><br>
2251   * Type: <b>reference</b><br>
2252   * Path: <b>Coverage.payor</b><br>
2253   * </p>
2254   */
2255  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PAYOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PAYOR);
2256
2257/**
2258   * Constant for fluent queries to be used to add include statements. Specifies
2259   * the path value of "<b>Coverage:payor</b>".
2260   */
2261  public static final ca.uhn.fhir.model.api.Include INCLUDE_PAYOR = new ca.uhn.fhir.model.api.Include("Coverage:payor").toLocked();
2262
2263 /**
2264   * Search parameter: <b>policy-holder</b>
2265   * <p>
2266   * Description: <b>Reference to the policyholder</b><br>
2267   * Type: <b>reference</b><br>
2268   * Path: <b>Coverage.policyHolder</b><br>
2269   * </p>
2270   */
2271  @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 } )
2272  public static final String SP_POLICY_HOLDER = "policy-holder";
2273 /**
2274   * <b>Fluent Client</b> search parameter constant for <b>policy-holder</b>
2275   * <p>
2276   * Description: <b>Reference to the policyholder</b><br>
2277   * Type: <b>reference</b><br>
2278   * Path: <b>Coverage.policyHolder</b><br>
2279   * </p>
2280   */
2281  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam POLICY_HOLDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_POLICY_HOLDER);
2282
2283/**
2284   * Constant for fluent queries to be used to add include statements. Specifies
2285   * the path value of "<b>Coverage:policy-holder</b>".
2286   */
2287  public static final ca.uhn.fhir.model.api.Include INCLUDE_POLICY_HOLDER = new ca.uhn.fhir.model.api.Include("Coverage:policy-holder").toLocked();
2288
2289 /**
2290   * Search parameter: <b>status</b>
2291   * <p>
2292   * Description: <b>The status of the Coverage</b><br>
2293   * Type: <b>token</b><br>
2294   * Path: <b>Coverage.status</b><br>
2295   * </p>
2296   */
2297  @SearchParamDefinition(name="status", path="Coverage.status", description="The status of the Coverage", type="token" )
2298  public static final String SP_STATUS = "status";
2299 /**
2300   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2301   * <p>
2302   * Description: <b>The status of the Coverage</b><br>
2303   * Type: <b>token</b><br>
2304   * Path: <b>Coverage.status</b><br>
2305   * </p>
2306   */
2307  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2308
2309 /**
2310   * Search parameter: <b>subscriber</b>
2311   * <p>
2312   * Description: <b>Reference to the subscriber</b><br>
2313   * Type: <b>reference</b><br>
2314   * Path: <b>Coverage.subscriber</b><br>
2315   * </p>
2316   */
2317  @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 } )
2318  public static final String SP_SUBSCRIBER = "subscriber";
2319 /**
2320   * <b>Fluent Client</b> search parameter constant for <b>subscriber</b>
2321   * <p>
2322   * Description: <b>Reference to the subscriber</b><br>
2323   * Type: <b>reference</b><br>
2324   * Path: <b>Coverage.subscriber</b><br>
2325   * </p>
2326   */
2327  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSCRIBER);
2328
2329/**
2330   * Constant for fluent queries to be used to add include statements. Specifies
2331   * the path value of "<b>Coverage:subscriber</b>".
2332   */
2333  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSCRIBER = new ca.uhn.fhir.model.api.Include("Coverage:subscriber").toLocked();
2334
2335 /**
2336   * Search parameter: <b>type</b>
2337   * <p>
2338   * Description: <b>The kind of coverage (health plan, auto, Workers Compensation)</b><br>
2339   * Type: <b>token</b><br>
2340   * Path: <b>Coverage.type</b><br>
2341   * </p>
2342   */
2343  @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage (health plan, auto, Workers Compensation)", type="token" )
2344  public static final String SP_TYPE = "type";
2345 /**
2346   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2347   * <p>
2348   * Description: <b>The kind of coverage (health plan, auto, Workers Compensation)</b><br>
2349   * Type: <b>token</b><br>
2350   * Path: <b>Coverage.type</b><br>
2351   * </p>
2352   */
2353  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2354
2355
2356}
2357