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