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