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