001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import org.hl7.fhir.r4.model.Enumerations.*;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * Details of a Health Insurance product/plan provided by an organization.
051 */
052@ResourceDef(name="InsurancePlan", profile="http://hl7.org/fhir/StructureDefinition/InsurancePlan")
053public class InsurancePlan extends DomainResource {
054
055    @Block()
056    public static class InsurancePlanContactComponent extends BackboneElement implements IBaseBackboneElement {
057        /**
058         * Indicates a purpose for which the contact can be reached.
059         */
060        @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
061        @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." )
062        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/contactentity-type")
063        protected CodeableConcept purpose;
064
065        /**
066         * A name associated with the contact.
067         */
068        @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false)
069        @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." )
070        protected HumanName name;
071
072        /**
073         * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.
074         */
075        @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
076        @Description(shortDefinition="Contact details (telephone, email, etc.)  for a contact", formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." )
077        protected List<ContactPoint> telecom;
078
079        /**
080         * Visiting or postal addresses for the contact.
081         */
082        @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false)
083        @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." )
084        protected Address address;
085
086        private static final long serialVersionUID = 1831121305L;
087
088    /**
089     * Constructor
090     */
091      public InsurancePlanContactComponent() {
092        super();
093      }
094
095        /**
096         * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.)
097         */
098        public CodeableConcept getPurpose() { 
099          if (this.purpose == null)
100            if (Configuration.errorOnAutoCreate())
101              throw new Error("Attempt to auto-create InsurancePlanContactComponent.purpose");
102            else if (Configuration.doAutoCreate())
103              this.purpose = new CodeableConcept(); // cc
104          return this.purpose;
105        }
106
107        public boolean hasPurpose() { 
108          return this.purpose != null && !this.purpose.isEmpty();
109        }
110
111        /**
112         * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.)
113         */
114        public InsurancePlanContactComponent setPurpose(CodeableConcept value) { 
115          this.purpose = value;
116          return this;
117        }
118
119        /**
120         * @return {@link #name} (A name associated with the contact.)
121         */
122        public HumanName getName() { 
123          if (this.name == null)
124            if (Configuration.errorOnAutoCreate())
125              throw new Error("Attempt to auto-create InsurancePlanContactComponent.name");
126            else if (Configuration.doAutoCreate())
127              this.name = new HumanName(); // cc
128          return this.name;
129        }
130
131        public boolean hasName() { 
132          return this.name != null && !this.name.isEmpty();
133        }
134
135        /**
136         * @param value {@link #name} (A name associated with the contact.)
137         */
138        public InsurancePlanContactComponent setName(HumanName value) { 
139          this.name = value;
140          return this;
141        }
142
143        /**
144         * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.)
145         */
146        public List<ContactPoint> getTelecom() { 
147          if (this.telecom == null)
148            this.telecom = new ArrayList<ContactPoint>();
149          return this.telecom;
150        }
151
152        /**
153         * @return Returns a reference to <code>this</code> for easy method chaining
154         */
155        public InsurancePlanContactComponent setTelecom(List<ContactPoint> theTelecom) { 
156          this.telecom = theTelecom;
157          return this;
158        }
159
160        public boolean hasTelecom() { 
161          if (this.telecom == null)
162            return false;
163          for (ContactPoint item : this.telecom)
164            if (!item.isEmpty())
165              return true;
166          return false;
167        }
168
169        public ContactPoint addTelecom() { //3
170          ContactPoint t = new ContactPoint();
171          if (this.telecom == null)
172            this.telecom = new ArrayList<ContactPoint>();
173          this.telecom.add(t);
174          return t;
175        }
176
177        public InsurancePlanContactComponent addTelecom(ContactPoint t) { //3
178          if (t == null)
179            return this;
180          if (this.telecom == null)
181            this.telecom = new ArrayList<ContactPoint>();
182          this.telecom.add(t);
183          return this;
184        }
185
186        /**
187         * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
188         */
189        public ContactPoint getTelecomFirstRep() { 
190          if (getTelecom().isEmpty()) {
191            addTelecom();
192          }
193          return getTelecom().get(0);
194        }
195
196        /**
197         * @return {@link #address} (Visiting or postal addresses for the contact.)
198         */
199        public Address getAddress() { 
200          if (this.address == null)
201            if (Configuration.errorOnAutoCreate())
202              throw new Error("Attempt to auto-create InsurancePlanContactComponent.address");
203            else if (Configuration.doAutoCreate())
204              this.address = new Address(); // cc
205          return this.address;
206        }
207
208        public boolean hasAddress() { 
209          return this.address != null && !this.address.isEmpty();
210        }
211
212        /**
213         * @param value {@link #address} (Visiting or postal addresses for the contact.)
214         */
215        public InsurancePlanContactComponent setAddress(Address value) { 
216          this.address = value;
217          return this;
218        }
219
220        protected void listChildren(List<Property> children) {
221          super.listChildren(children);
222          children.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, 1, purpose));
223          children.add(new Property("name", "HumanName", "A name associated with the contact.", 0, 1, name));
224          children.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom));
225          children.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, 1, address));
226        }
227
228        @Override
229        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
230          switch (_hash) {
231          case -220463842: /*purpose*/  return new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, 1, purpose);
232          case 3373707: /*name*/  return new Property("name", "HumanName", "A name associated with the contact.", 0, 1, name);
233          case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom);
234          case -1147692044: /*address*/  return new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, 1, address);
235          default: return super.getNamedProperty(_hash, _name, _checkValid);
236          }
237
238        }
239
240      @Override
241      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
242        switch (hash) {
243        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // CodeableConcept
244        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName
245        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
246        case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address
247        default: return super.getProperty(hash, name, checkValid);
248        }
249
250      }
251
252      @Override
253      public Base setProperty(int hash, String name, Base value) throws FHIRException {
254        switch (hash) {
255        case -220463842: // purpose
256          this.purpose = castToCodeableConcept(value); // CodeableConcept
257          return value;
258        case 3373707: // name
259          this.name = castToHumanName(value); // HumanName
260          return value;
261        case -1429363305: // telecom
262          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
263          return value;
264        case -1147692044: // address
265          this.address = castToAddress(value); // Address
266          return value;
267        default: return super.setProperty(hash, name, value);
268        }
269
270      }
271
272      @Override
273      public Base setProperty(String name, Base value) throws FHIRException {
274        if (name.equals("purpose")) {
275          this.purpose = castToCodeableConcept(value); // CodeableConcept
276        } else if (name.equals("name")) {
277          this.name = castToHumanName(value); // HumanName
278        } else if (name.equals("telecom")) {
279          this.getTelecom().add(castToContactPoint(value));
280        } else if (name.equals("address")) {
281          this.address = castToAddress(value); // Address
282        } else
283          return super.setProperty(name, value);
284        return value;
285      }
286
287      @Override
288      public Base makeProperty(int hash, String name) throws FHIRException {
289        switch (hash) {
290        case -220463842:  return getPurpose(); 
291        case 3373707:  return getName(); 
292        case -1429363305:  return addTelecom(); 
293        case -1147692044:  return getAddress(); 
294        default: return super.makeProperty(hash, name);
295        }
296
297      }
298
299      @Override
300      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
301        switch (hash) {
302        case -220463842: /*purpose*/ return new String[] {"CodeableConcept"};
303        case 3373707: /*name*/ return new String[] {"HumanName"};
304        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
305        case -1147692044: /*address*/ return new String[] {"Address"};
306        default: return super.getTypesForProperty(hash, name);
307        }
308
309      }
310
311      @Override
312      public Base addChild(String name) throws FHIRException {
313        if (name.equals("purpose")) {
314          this.purpose = new CodeableConcept();
315          return this.purpose;
316        }
317        else if (name.equals("name")) {
318          this.name = new HumanName();
319          return this.name;
320        }
321        else if (name.equals("telecom")) {
322          return addTelecom();
323        }
324        else if (name.equals("address")) {
325          this.address = new Address();
326          return this.address;
327        }
328        else
329          return super.addChild(name);
330      }
331
332      public InsurancePlanContactComponent copy() {
333        InsurancePlanContactComponent dst = new InsurancePlanContactComponent();
334        copyValues(dst);
335        return dst;
336      }
337
338      public void copyValues(InsurancePlanContactComponent dst) {
339        super.copyValues(dst);
340        dst.purpose = purpose == null ? null : purpose.copy();
341        dst.name = name == null ? null : name.copy();
342        if (telecom != null) {
343          dst.telecom = new ArrayList<ContactPoint>();
344          for (ContactPoint i : telecom)
345            dst.telecom.add(i.copy());
346        };
347        dst.address = address == null ? null : address.copy();
348      }
349
350      @Override
351      public boolean equalsDeep(Base other_) {
352        if (!super.equalsDeep(other_))
353          return false;
354        if (!(other_ instanceof InsurancePlanContactComponent))
355          return false;
356        InsurancePlanContactComponent o = (InsurancePlanContactComponent) other_;
357        return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true)
358           && compareDeep(address, o.address, true);
359      }
360
361      @Override
362      public boolean equalsShallow(Base other_) {
363        if (!super.equalsShallow(other_))
364          return false;
365        if (!(other_ instanceof InsurancePlanContactComponent))
366          return false;
367        InsurancePlanContactComponent o = (InsurancePlanContactComponent) other_;
368        return true;
369      }
370
371      public boolean isEmpty() {
372        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(purpose, name, telecom, address
373          );
374      }
375
376  public String fhirType() {
377    return "InsurancePlan.contact";
378
379  }
380
381  }
382
383    @Block()
384    public static class InsurancePlanCoverageComponent extends BackboneElement implements IBaseBackboneElement {
385        /**
386         * Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).
387         */
388        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
389        @Description(shortDefinition="Type of coverage", formalDefinition="Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health)." )
390        protected CodeableConcept type;
391
392        /**
393         * Reference to the network that providing the type of coverage.
394         */
395        @Child(name = "network", type = {Organization.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
396        @Description(shortDefinition="What networks provide coverage", formalDefinition="Reference to the network that providing the type of coverage." )
397        protected List<Reference> network;
398        /**
399         * The actual objects that are the target of the reference (Reference to the network that providing the type of coverage.)
400         */
401        protected List<Organization> networkTarget;
402
403
404        /**
405         * Specific benefits under this type of coverage.
406         */
407        @Child(name = "benefit", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
408        @Description(shortDefinition="List of benefits", formalDefinition="Specific benefits under this type of coverage." )
409        protected List<CoverageBenefitComponent> benefit;
410
411        private static final long serialVersionUID = -1186191877L;
412
413    /**
414     * Constructor
415     */
416      public InsurancePlanCoverageComponent() {
417        super();
418      }
419
420    /**
421     * Constructor
422     */
423      public InsurancePlanCoverageComponent(CodeableConcept type) {
424        super();
425        this.type = type;
426      }
427
428        /**
429         * @return {@link #type} (Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).)
430         */
431        public CodeableConcept getType() { 
432          if (this.type == null)
433            if (Configuration.errorOnAutoCreate())
434              throw new Error("Attempt to auto-create InsurancePlanCoverageComponent.type");
435            else if (Configuration.doAutoCreate())
436              this.type = new CodeableConcept(); // cc
437          return this.type;
438        }
439
440        public boolean hasType() { 
441          return this.type != null && !this.type.isEmpty();
442        }
443
444        /**
445         * @param value {@link #type} (Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).)
446         */
447        public InsurancePlanCoverageComponent setType(CodeableConcept value) { 
448          this.type = value;
449          return this;
450        }
451
452        /**
453         * @return {@link #network} (Reference to the network that providing the type of coverage.)
454         */
455        public List<Reference> getNetwork() { 
456          if (this.network == null)
457            this.network = new ArrayList<Reference>();
458          return this.network;
459        }
460
461        /**
462         * @return Returns a reference to <code>this</code> for easy method chaining
463         */
464        public InsurancePlanCoverageComponent setNetwork(List<Reference> theNetwork) { 
465          this.network = theNetwork;
466          return this;
467        }
468
469        public boolean hasNetwork() { 
470          if (this.network == null)
471            return false;
472          for (Reference item : this.network)
473            if (!item.isEmpty())
474              return true;
475          return false;
476        }
477
478        public Reference addNetwork() { //3
479          Reference t = new Reference();
480          if (this.network == null)
481            this.network = new ArrayList<Reference>();
482          this.network.add(t);
483          return t;
484        }
485
486        public InsurancePlanCoverageComponent addNetwork(Reference t) { //3
487          if (t == null)
488            return this;
489          if (this.network == null)
490            this.network = new ArrayList<Reference>();
491          this.network.add(t);
492          return this;
493        }
494
495        /**
496         * @return The first repetition of repeating field {@link #network}, creating it if it does not already exist
497         */
498        public Reference getNetworkFirstRep() { 
499          if (getNetwork().isEmpty()) {
500            addNetwork();
501          }
502          return getNetwork().get(0);
503        }
504
505        /**
506         * @deprecated Use Reference#setResource(IBaseResource) instead
507         */
508        @Deprecated
509        public List<Organization> getNetworkTarget() { 
510          if (this.networkTarget == null)
511            this.networkTarget = new ArrayList<Organization>();
512          return this.networkTarget;
513        }
514
515        /**
516         * @deprecated Use Reference#setResource(IBaseResource) instead
517         */
518        @Deprecated
519        public Organization addNetworkTarget() { 
520          Organization r = new Organization();
521          if (this.networkTarget == null)
522            this.networkTarget = new ArrayList<Organization>();
523          this.networkTarget.add(r);
524          return r;
525        }
526
527        /**
528         * @return {@link #benefit} (Specific benefits under this type of coverage.)
529         */
530        public List<CoverageBenefitComponent> getBenefit() { 
531          if (this.benefit == null)
532            this.benefit = new ArrayList<CoverageBenefitComponent>();
533          return this.benefit;
534        }
535
536        /**
537         * @return Returns a reference to <code>this</code> for easy method chaining
538         */
539        public InsurancePlanCoverageComponent setBenefit(List<CoverageBenefitComponent> theBenefit) { 
540          this.benefit = theBenefit;
541          return this;
542        }
543
544        public boolean hasBenefit() { 
545          if (this.benefit == null)
546            return false;
547          for (CoverageBenefitComponent item : this.benefit)
548            if (!item.isEmpty())
549              return true;
550          return false;
551        }
552
553        public CoverageBenefitComponent addBenefit() { //3
554          CoverageBenefitComponent t = new CoverageBenefitComponent();
555          if (this.benefit == null)
556            this.benefit = new ArrayList<CoverageBenefitComponent>();
557          this.benefit.add(t);
558          return t;
559        }
560
561        public InsurancePlanCoverageComponent addBenefit(CoverageBenefitComponent t) { //3
562          if (t == null)
563            return this;
564          if (this.benefit == null)
565            this.benefit = new ArrayList<CoverageBenefitComponent>();
566          this.benefit.add(t);
567          return this;
568        }
569
570        /**
571         * @return The first repetition of repeating field {@link #benefit}, creating it if it does not already exist
572         */
573        public CoverageBenefitComponent getBenefitFirstRep() { 
574          if (getBenefit().isEmpty()) {
575            addBenefit();
576          }
577          return getBenefit().get(0);
578        }
579
580        protected void listChildren(List<Property> children) {
581          super.listChildren(children);
582          children.add(new Property("type", "CodeableConcept", "Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).", 0, 1, type));
583          children.add(new Property("network", "Reference(Organization)", "Reference to the network that providing the type of coverage.", 0, java.lang.Integer.MAX_VALUE, network));
584          children.add(new Property("benefit", "", "Specific benefits under this type of coverage.", 0, java.lang.Integer.MAX_VALUE, benefit));
585        }
586
587        @Override
588        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
589          switch (_hash) {
590          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).", 0, 1, type);
591          case 1843485230: /*network*/  return new Property("network", "Reference(Organization)", "Reference to the network that providing the type of coverage.", 0, java.lang.Integer.MAX_VALUE, network);
592          case -222710633: /*benefit*/  return new Property("benefit", "", "Specific benefits under this type of coverage.", 0, java.lang.Integer.MAX_VALUE, benefit);
593          default: return super.getNamedProperty(_hash, _name, _checkValid);
594          }
595
596        }
597
598      @Override
599      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
600        switch (hash) {
601        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
602        case 1843485230: /*network*/ return this.network == null ? new Base[0] : this.network.toArray(new Base[this.network.size()]); // Reference
603        case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : this.benefit.toArray(new Base[this.benefit.size()]); // CoverageBenefitComponent
604        default: return super.getProperty(hash, name, checkValid);
605        }
606
607      }
608
609      @Override
610      public Base setProperty(int hash, String name, Base value) throws FHIRException {
611        switch (hash) {
612        case 3575610: // type
613          this.type = castToCodeableConcept(value); // CodeableConcept
614          return value;
615        case 1843485230: // network
616          this.getNetwork().add(castToReference(value)); // Reference
617          return value;
618        case -222710633: // benefit
619          this.getBenefit().add((CoverageBenefitComponent) value); // CoverageBenefitComponent
620          return value;
621        default: return super.setProperty(hash, name, value);
622        }
623
624      }
625
626      @Override
627      public Base setProperty(String name, Base value) throws FHIRException {
628        if (name.equals("type")) {
629          this.type = castToCodeableConcept(value); // CodeableConcept
630        } else if (name.equals("network")) {
631          this.getNetwork().add(castToReference(value));
632        } else if (name.equals("benefit")) {
633          this.getBenefit().add((CoverageBenefitComponent) value);
634        } else
635          return super.setProperty(name, value);
636        return value;
637      }
638
639      @Override
640      public Base makeProperty(int hash, String name) throws FHIRException {
641        switch (hash) {
642        case 3575610:  return getType(); 
643        case 1843485230:  return addNetwork(); 
644        case -222710633:  return addBenefit(); 
645        default: return super.makeProperty(hash, name);
646        }
647
648      }
649
650      @Override
651      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
652        switch (hash) {
653        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
654        case 1843485230: /*network*/ return new String[] {"Reference"};
655        case -222710633: /*benefit*/ return new String[] {};
656        default: return super.getTypesForProperty(hash, name);
657        }
658
659      }
660
661      @Override
662      public Base addChild(String name) throws FHIRException {
663        if (name.equals("type")) {
664          this.type = new CodeableConcept();
665          return this.type;
666        }
667        else if (name.equals("network")) {
668          return addNetwork();
669        }
670        else if (name.equals("benefit")) {
671          return addBenefit();
672        }
673        else
674          return super.addChild(name);
675      }
676
677      public InsurancePlanCoverageComponent copy() {
678        InsurancePlanCoverageComponent dst = new InsurancePlanCoverageComponent();
679        copyValues(dst);
680        return dst;
681      }
682
683      public void copyValues(InsurancePlanCoverageComponent dst) {
684        super.copyValues(dst);
685        dst.type = type == null ? null : type.copy();
686        if (network != null) {
687          dst.network = new ArrayList<Reference>();
688          for (Reference i : network)
689            dst.network.add(i.copy());
690        };
691        if (benefit != null) {
692          dst.benefit = new ArrayList<CoverageBenefitComponent>();
693          for (CoverageBenefitComponent i : benefit)
694            dst.benefit.add(i.copy());
695        };
696      }
697
698      @Override
699      public boolean equalsDeep(Base other_) {
700        if (!super.equalsDeep(other_))
701          return false;
702        if (!(other_ instanceof InsurancePlanCoverageComponent))
703          return false;
704        InsurancePlanCoverageComponent o = (InsurancePlanCoverageComponent) other_;
705        return compareDeep(type, o.type, true) && compareDeep(network, o.network, true) && compareDeep(benefit, o.benefit, true)
706          ;
707      }
708
709      @Override
710      public boolean equalsShallow(Base other_) {
711        if (!super.equalsShallow(other_))
712          return false;
713        if (!(other_ instanceof InsurancePlanCoverageComponent))
714          return false;
715        InsurancePlanCoverageComponent o = (InsurancePlanCoverageComponent) other_;
716        return true;
717      }
718
719      public boolean isEmpty() {
720        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, network, benefit);
721      }
722
723  public String fhirType() {
724    return "InsurancePlan.coverage";
725
726  }
727
728  }
729
730    @Block()
731    public static class CoverageBenefitComponent extends BackboneElement implements IBaseBackboneElement {
732        /**
733         * Type of benefit (primary care; speciality care; inpatient; outpatient).
734         */
735        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
736        @Description(shortDefinition="Type of benefit", formalDefinition="Type of benefit (primary care; speciality care; inpatient; outpatient)." )
737        protected CodeableConcept type;
738
739        /**
740         * The referral requirements to have access/coverage for this benefit.
741         */
742        @Child(name = "requirement", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
743        @Description(shortDefinition="Referral requirements", formalDefinition="The referral requirements to have access/coverage for this benefit." )
744        protected StringType requirement;
745
746        /**
747         * The specific limits on the benefit.
748         */
749        @Child(name = "limit", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
750        @Description(shortDefinition="Benefit limits", formalDefinition="The specific limits on the benefit." )
751        protected List<CoverageBenefitLimitComponent> limit;
752
753        private static final long serialVersionUID = -113658449L;
754
755    /**
756     * Constructor
757     */
758      public CoverageBenefitComponent() {
759        super();
760      }
761
762    /**
763     * Constructor
764     */
765      public CoverageBenefitComponent(CodeableConcept type) {
766        super();
767        this.type = type;
768      }
769
770        /**
771         * @return {@link #type} (Type of benefit (primary care; speciality care; inpatient; outpatient).)
772         */
773        public CodeableConcept getType() { 
774          if (this.type == null)
775            if (Configuration.errorOnAutoCreate())
776              throw new Error("Attempt to auto-create CoverageBenefitComponent.type");
777            else if (Configuration.doAutoCreate())
778              this.type = new CodeableConcept(); // cc
779          return this.type;
780        }
781
782        public boolean hasType() { 
783          return this.type != null && !this.type.isEmpty();
784        }
785
786        /**
787         * @param value {@link #type} (Type of benefit (primary care; speciality care; inpatient; outpatient).)
788         */
789        public CoverageBenefitComponent setType(CodeableConcept value) { 
790          this.type = value;
791          return this;
792        }
793
794        /**
795         * @return {@link #requirement} (The referral requirements to have access/coverage for this benefit.). This is the underlying object with id, value and extensions. The accessor "getRequirement" gives direct access to the value
796         */
797        public StringType getRequirementElement() { 
798          if (this.requirement == null)
799            if (Configuration.errorOnAutoCreate())
800              throw new Error("Attempt to auto-create CoverageBenefitComponent.requirement");
801            else if (Configuration.doAutoCreate())
802              this.requirement = new StringType(); // bb
803          return this.requirement;
804        }
805
806        public boolean hasRequirementElement() { 
807          return this.requirement != null && !this.requirement.isEmpty();
808        }
809
810        public boolean hasRequirement() { 
811          return this.requirement != null && !this.requirement.isEmpty();
812        }
813
814        /**
815         * @param value {@link #requirement} (The referral requirements to have access/coverage for this benefit.). This is the underlying object with id, value and extensions. The accessor "getRequirement" gives direct access to the value
816         */
817        public CoverageBenefitComponent setRequirementElement(StringType value) { 
818          this.requirement = value;
819          return this;
820        }
821
822        /**
823         * @return The referral requirements to have access/coverage for this benefit.
824         */
825        public String getRequirement() { 
826          return this.requirement == null ? null : this.requirement.getValue();
827        }
828
829        /**
830         * @param value The referral requirements to have access/coverage for this benefit.
831         */
832        public CoverageBenefitComponent setRequirement(String value) { 
833          if (Utilities.noString(value))
834            this.requirement = null;
835          else {
836            if (this.requirement == null)
837              this.requirement = new StringType();
838            this.requirement.setValue(value);
839          }
840          return this;
841        }
842
843        /**
844         * @return {@link #limit} (The specific limits on the benefit.)
845         */
846        public List<CoverageBenefitLimitComponent> getLimit() { 
847          if (this.limit == null)
848            this.limit = new ArrayList<CoverageBenefitLimitComponent>();
849          return this.limit;
850        }
851
852        /**
853         * @return Returns a reference to <code>this</code> for easy method chaining
854         */
855        public CoverageBenefitComponent setLimit(List<CoverageBenefitLimitComponent> theLimit) { 
856          this.limit = theLimit;
857          return this;
858        }
859
860        public boolean hasLimit() { 
861          if (this.limit == null)
862            return false;
863          for (CoverageBenefitLimitComponent item : this.limit)
864            if (!item.isEmpty())
865              return true;
866          return false;
867        }
868
869        public CoverageBenefitLimitComponent addLimit() { //3
870          CoverageBenefitLimitComponent t = new CoverageBenefitLimitComponent();
871          if (this.limit == null)
872            this.limit = new ArrayList<CoverageBenefitLimitComponent>();
873          this.limit.add(t);
874          return t;
875        }
876
877        public CoverageBenefitComponent addLimit(CoverageBenefitLimitComponent t) { //3
878          if (t == null)
879            return this;
880          if (this.limit == null)
881            this.limit = new ArrayList<CoverageBenefitLimitComponent>();
882          this.limit.add(t);
883          return this;
884        }
885
886        /**
887         * @return The first repetition of repeating field {@link #limit}, creating it if it does not already exist
888         */
889        public CoverageBenefitLimitComponent getLimitFirstRep() { 
890          if (getLimit().isEmpty()) {
891            addLimit();
892          }
893          return getLimit().get(0);
894        }
895
896        protected void listChildren(List<Property> children) {
897          super.listChildren(children);
898          children.add(new Property("type", "CodeableConcept", "Type of benefit (primary care; speciality care; inpatient; outpatient).", 0, 1, type));
899          children.add(new Property("requirement", "string", "The referral requirements to have access/coverage for this benefit.", 0, 1, requirement));
900          children.add(new Property("limit", "", "The specific limits on the benefit.", 0, java.lang.Integer.MAX_VALUE, limit));
901        }
902
903        @Override
904        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
905          switch (_hash) {
906          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of benefit (primary care; speciality care; inpatient; outpatient).", 0, 1, type);
907          case 363387971: /*requirement*/  return new Property("requirement", "string", "The referral requirements to have access/coverage for this benefit.", 0, 1, requirement);
908          case 102976443: /*limit*/  return new Property("limit", "", "The specific limits on the benefit.", 0, java.lang.Integer.MAX_VALUE, limit);
909          default: return super.getNamedProperty(_hash, _name, _checkValid);
910          }
911
912        }
913
914      @Override
915      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
916        switch (hash) {
917        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
918        case 363387971: /*requirement*/ return this.requirement == null ? new Base[0] : new Base[] {this.requirement}; // StringType
919        case 102976443: /*limit*/ return this.limit == null ? new Base[0] : this.limit.toArray(new Base[this.limit.size()]); // CoverageBenefitLimitComponent
920        default: return super.getProperty(hash, name, checkValid);
921        }
922
923      }
924
925      @Override
926      public Base setProperty(int hash, String name, Base value) throws FHIRException {
927        switch (hash) {
928        case 3575610: // type
929          this.type = castToCodeableConcept(value); // CodeableConcept
930          return value;
931        case 363387971: // requirement
932          this.requirement = castToString(value); // StringType
933          return value;
934        case 102976443: // limit
935          this.getLimit().add((CoverageBenefitLimitComponent) value); // CoverageBenefitLimitComponent
936          return value;
937        default: return super.setProperty(hash, name, value);
938        }
939
940      }
941
942      @Override
943      public Base setProperty(String name, Base value) throws FHIRException {
944        if (name.equals("type")) {
945          this.type = castToCodeableConcept(value); // CodeableConcept
946        } else if (name.equals("requirement")) {
947          this.requirement = castToString(value); // StringType
948        } else if (name.equals("limit")) {
949          this.getLimit().add((CoverageBenefitLimitComponent) value);
950        } else
951          return super.setProperty(name, value);
952        return value;
953      }
954
955      @Override
956      public Base makeProperty(int hash, String name) throws FHIRException {
957        switch (hash) {
958        case 3575610:  return getType(); 
959        case 363387971:  return getRequirementElement();
960        case 102976443:  return addLimit(); 
961        default: return super.makeProperty(hash, name);
962        }
963
964      }
965
966      @Override
967      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
968        switch (hash) {
969        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
970        case 363387971: /*requirement*/ return new String[] {"string"};
971        case 102976443: /*limit*/ return new String[] {};
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("requirement")) {
984          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.requirement");
985        }
986        else if (name.equals("limit")) {
987          return addLimit();
988        }
989        else
990          return super.addChild(name);
991      }
992
993      public CoverageBenefitComponent copy() {
994        CoverageBenefitComponent dst = new CoverageBenefitComponent();
995        copyValues(dst);
996        return dst;
997      }
998
999      public void copyValues(CoverageBenefitComponent dst) {
1000        super.copyValues(dst);
1001        dst.type = type == null ? null : type.copy();
1002        dst.requirement = requirement == null ? null : requirement.copy();
1003        if (limit != null) {
1004          dst.limit = new ArrayList<CoverageBenefitLimitComponent>();
1005          for (CoverageBenefitLimitComponent i : limit)
1006            dst.limit.add(i.copy());
1007        };
1008      }
1009
1010      @Override
1011      public boolean equalsDeep(Base other_) {
1012        if (!super.equalsDeep(other_))
1013          return false;
1014        if (!(other_ instanceof CoverageBenefitComponent))
1015          return false;
1016        CoverageBenefitComponent o = (CoverageBenefitComponent) other_;
1017        return compareDeep(type, o.type, true) && compareDeep(requirement, o.requirement, true) && compareDeep(limit, o.limit, true)
1018          ;
1019      }
1020
1021      @Override
1022      public boolean equalsShallow(Base other_) {
1023        if (!super.equalsShallow(other_))
1024          return false;
1025        if (!(other_ instanceof CoverageBenefitComponent))
1026          return false;
1027        CoverageBenefitComponent o = (CoverageBenefitComponent) other_;
1028        return compareValues(requirement, o.requirement, true);
1029      }
1030
1031      public boolean isEmpty() {
1032        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, requirement, limit
1033          );
1034      }
1035
1036  public String fhirType() {
1037    return "InsurancePlan.coverage.benefit";
1038
1039  }
1040
1041  }
1042
1043    @Block()
1044    public static class CoverageBenefitLimitComponent extends BackboneElement implements IBaseBackboneElement {
1045        /**
1046         * The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.
1047         */
1048        @Child(name = "value", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=false)
1049        @Description(shortDefinition="Maximum value allowed", formalDefinition="The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses." )
1050        protected Quantity value;
1051
1052        /**
1053         * The specific limit on the benefit.
1054         */
1055        @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1056        @Description(shortDefinition="Benefit limit details", formalDefinition="The specific limit on the benefit." )
1057        protected CodeableConcept code;
1058
1059        private static final long serialVersionUID = -304318128L;
1060
1061    /**
1062     * Constructor
1063     */
1064      public CoverageBenefitLimitComponent() {
1065        super();
1066      }
1067
1068        /**
1069         * @return {@link #value} (The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.)
1070         */
1071        public Quantity getValue() { 
1072          if (this.value == null)
1073            if (Configuration.errorOnAutoCreate())
1074              throw new Error("Attempt to auto-create CoverageBenefitLimitComponent.value");
1075            else if (Configuration.doAutoCreate())
1076              this.value = new Quantity(); // cc
1077          return this.value;
1078        }
1079
1080        public boolean hasValue() { 
1081          return this.value != null && !this.value.isEmpty();
1082        }
1083
1084        /**
1085         * @param value {@link #value} (The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.)
1086         */
1087        public CoverageBenefitLimitComponent setValue(Quantity value) { 
1088          this.value = value;
1089          return this;
1090        }
1091
1092        /**
1093         * @return {@link #code} (The specific limit on the benefit.)
1094         */
1095        public CodeableConcept getCode() { 
1096          if (this.code == null)
1097            if (Configuration.errorOnAutoCreate())
1098              throw new Error("Attempt to auto-create CoverageBenefitLimitComponent.code");
1099            else if (Configuration.doAutoCreate())
1100              this.code = new CodeableConcept(); // cc
1101          return this.code;
1102        }
1103
1104        public boolean hasCode() { 
1105          return this.code != null && !this.code.isEmpty();
1106        }
1107
1108        /**
1109         * @param value {@link #code} (The specific limit on the benefit.)
1110         */
1111        public CoverageBenefitLimitComponent setCode(CodeableConcept value) { 
1112          this.code = value;
1113          return this;
1114        }
1115
1116        protected void listChildren(List<Property> children) {
1117          super.listChildren(children);
1118          children.add(new Property("value", "Quantity", "The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.", 0, 1, value));
1119          children.add(new Property("code", "CodeableConcept", "The specific limit on the benefit.", 0, 1, code));
1120        }
1121
1122        @Override
1123        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1124          switch (_hash) {
1125          case 111972721: /*value*/  return new Property("value", "Quantity", "The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.", 0, 1, value);
1126          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "The specific limit on the benefit.", 0, 1, code);
1127          default: return super.getNamedProperty(_hash, _name, _checkValid);
1128          }
1129
1130        }
1131
1132      @Override
1133      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1134        switch (hash) {
1135        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Quantity
1136        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1137        default: return super.getProperty(hash, name, checkValid);
1138        }
1139
1140      }
1141
1142      @Override
1143      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1144        switch (hash) {
1145        case 111972721: // value
1146          this.value = castToQuantity(value); // Quantity
1147          return value;
1148        case 3059181: // code
1149          this.code = castToCodeableConcept(value); // CodeableConcept
1150          return value;
1151        default: return super.setProperty(hash, name, value);
1152        }
1153
1154      }
1155
1156      @Override
1157      public Base setProperty(String name, Base value) throws FHIRException {
1158        if (name.equals("value")) {
1159          this.value = castToQuantity(value); // Quantity
1160        } else if (name.equals("code")) {
1161          this.code = castToCodeableConcept(value); // CodeableConcept
1162        } else
1163          return super.setProperty(name, value);
1164        return value;
1165      }
1166
1167      @Override
1168      public Base makeProperty(int hash, String name) throws FHIRException {
1169        switch (hash) {
1170        case 111972721:  return getValue(); 
1171        case 3059181:  return getCode(); 
1172        default: return super.makeProperty(hash, name);
1173        }
1174
1175      }
1176
1177      @Override
1178      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1179        switch (hash) {
1180        case 111972721: /*value*/ return new String[] {"Quantity"};
1181        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1182        default: return super.getTypesForProperty(hash, name);
1183        }
1184
1185      }
1186
1187      @Override
1188      public Base addChild(String name) throws FHIRException {
1189        if (name.equals("value")) {
1190          this.value = new Quantity();
1191          return this.value;
1192        }
1193        else if (name.equals("code")) {
1194          this.code = new CodeableConcept();
1195          return this.code;
1196        }
1197        else
1198          return super.addChild(name);
1199      }
1200
1201      public CoverageBenefitLimitComponent copy() {
1202        CoverageBenefitLimitComponent dst = new CoverageBenefitLimitComponent();
1203        copyValues(dst);
1204        return dst;
1205      }
1206
1207      public void copyValues(CoverageBenefitLimitComponent dst) {
1208        super.copyValues(dst);
1209        dst.value = value == null ? null : value.copy();
1210        dst.code = code == null ? null : code.copy();
1211      }
1212
1213      @Override
1214      public boolean equalsDeep(Base other_) {
1215        if (!super.equalsDeep(other_))
1216          return false;
1217        if (!(other_ instanceof CoverageBenefitLimitComponent))
1218          return false;
1219        CoverageBenefitLimitComponent o = (CoverageBenefitLimitComponent) other_;
1220        return compareDeep(value, o.value, true) && compareDeep(code, o.code, true);
1221      }
1222
1223      @Override
1224      public boolean equalsShallow(Base other_) {
1225        if (!super.equalsShallow(other_))
1226          return false;
1227        if (!(other_ instanceof CoverageBenefitLimitComponent))
1228          return false;
1229        CoverageBenefitLimitComponent o = (CoverageBenefitLimitComponent) other_;
1230        return true;
1231      }
1232
1233      public boolean isEmpty() {
1234        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(value, code);
1235      }
1236
1237  public String fhirType() {
1238    return "InsurancePlan.coverage.benefit.limit";
1239
1240  }
1241
1242  }
1243
1244    @Block()
1245    public static class InsurancePlanPlanComponent extends BackboneElement implements IBaseBackboneElement {
1246        /**
1247         * Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.
1248         */
1249        @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1250        @Description(shortDefinition="Business Identifier for Product", formalDefinition="Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server." )
1251        protected List<Identifier> identifier;
1252
1253        /**
1254         * Type of plan. For example, "Platinum" or "High Deductable".
1255         */
1256        @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1257        @Description(shortDefinition="Type of plan", formalDefinition="Type of plan. For example, \"Platinum\" or \"High Deductable\"." )
1258        protected CodeableConcept type;
1259
1260        /**
1261         * The geographic region in which a health insurance plan's benefits apply.
1262         */
1263        @Child(name = "coverageArea", type = {Location.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1264        @Description(shortDefinition="Where product applies", formalDefinition="The geographic region in which a health insurance plan's benefits apply." )
1265        protected List<Reference> coverageArea;
1266        /**
1267         * The actual objects that are the target of the reference (The geographic region in which a health insurance plan's benefits apply.)
1268         */
1269        protected List<Location> coverageAreaTarget;
1270
1271
1272        /**
1273         * Reference to the network that providing the type of coverage.
1274         */
1275        @Child(name = "network", type = {Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1276        @Description(shortDefinition="What networks provide coverage", formalDefinition="Reference to the network that providing the type of coverage." )
1277        protected List<Reference> network;
1278        /**
1279         * The actual objects that are the target of the reference (Reference to the network that providing the type of coverage.)
1280         */
1281        protected List<Organization> networkTarget;
1282
1283
1284        /**
1285         * Overall costs associated with the plan.
1286         */
1287        @Child(name = "generalCost", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1288        @Description(shortDefinition="Overall costs", formalDefinition="Overall costs associated with the plan." )
1289        protected List<InsurancePlanPlanGeneralCostComponent> generalCost;
1290
1291        /**
1292         * Costs associated with the coverage provided by the product.
1293         */
1294        @Child(name = "specificCost", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1295        @Description(shortDefinition="Specific costs", formalDefinition="Costs associated with the coverage provided by the product." )
1296        protected List<InsurancePlanPlanSpecificCostComponent> specificCost;
1297
1298        private static final long serialVersionUID = -2063324071L;
1299
1300    /**
1301     * Constructor
1302     */
1303      public InsurancePlanPlanComponent() {
1304        super();
1305      }
1306
1307        /**
1308         * @return {@link #identifier} (Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.)
1309         */
1310        public List<Identifier> getIdentifier() { 
1311          if (this.identifier == null)
1312            this.identifier = new ArrayList<Identifier>();
1313          return this.identifier;
1314        }
1315
1316        /**
1317         * @return Returns a reference to <code>this</code> for easy method chaining
1318         */
1319        public InsurancePlanPlanComponent setIdentifier(List<Identifier> theIdentifier) { 
1320          this.identifier = theIdentifier;
1321          return this;
1322        }
1323
1324        public boolean hasIdentifier() { 
1325          if (this.identifier == null)
1326            return false;
1327          for (Identifier item : this.identifier)
1328            if (!item.isEmpty())
1329              return true;
1330          return false;
1331        }
1332
1333        public Identifier addIdentifier() { //3
1334          Identifier t = new Identifier();
1335          if (this.identifier == null)
1336            this.identifier = new ArrayList<Identifier>();
1337          this.identifier.add(t);
1338          return t;
1339        }
1340
1341        public InsurancePlanPlanComponent addIdentifier(Identifier t) { //3
1342          if (t == null)
1343            return this;
1344          if (this.identifier == null)
1345            this.identifier = new ArrayList<Identifier>();
1346          this.identifier.add(t);
1347          return this;
1348        }
1349
1350        /**
1351         * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1352         */
1353        public Identifier getIdentifierFirstRep() { 
1354          if (getIdentifier().isEmpty()) {
1355            addIdentifier();
1356          }
1357          return getIdentifier().get(0);
1358        }
1359
1360        /**
1361         * @return {@link #type} (Type of plan. For example, "Platinum" or "High Deductable".)
1362         */
1363        public CodeableConcept getType() { 
1364          if (this.type == null)
1365            if (Configuration.errorOnAutoCreate())
1366              throw new Error("Attempt to auto-create InsurancePlanPlanComponent.type");
1367            else if (Configuration.doAutoCreate())
1368              this.type = new CodeableConcept(); // cc
1369          return this.type;
1370        }
1371
1372        public boolean hasType() { 
1373          return this.type != null && !this.type.isEmpty();
1374        }
1375
1376        /**
1377         * @param value {@link #type} (Type of plan. For example, "Platinum" or "High Deductable".)
1378         */
1379        public InsurancePlanPlanComponent setType(CodeableConcept value) { 
1380          this.type = value;
1381          return this;
1382        }
1383
1384        /**
1385         * @return {@link #coverageArea} (The geographic region in which a health insurance plan's benefits apply.)
1386         */
1387        public List<Reference> getCoverageArea() { 
1388          if (this.coverageArea == null)
1389            this.coverageArea = new ArrayList<Reference>();
1390          return this.coverageArea;
1391        }
1392
1393        /**
1394         * @return Returns a reference to <code>this</code> for easy method chaining
1395         */
1396        public InsurancePlanPlanComponent setCoverageArea(List<Reference> theCoverageArea) { 
1397          this.coverageArea = theCoverageArea;
1398          return this;
1399        }
1400
1401        public boolean hasCoverageArea() { 
1402          if (this.coverageArea == null)
1403            return false;
1404          for (Reference item : this.coverageArea)
1405            if (!item.isEmpty())
1406              return true;
1407          return false;
1408        }
1409
1410        public Reference addCoverageArea() { //3
1411          Reference t = new Reference();
1412          if (this.coverageArea == null)
1413            this.coverageArea = new ArrayList<Reference>();
1414          this.coverageArea.add(t);
1415          return t;
1416        }
1417
1418        public InsurancePlanPlanComponent addCoverageArea(Reference t) { //3
1419          if (t == null)
1420            return this;
1421          if (this.coverageArea == null)
1422            this.coverageArea = new ArrayList<Reference>();
1423          this.coverageArea.add(t);
1424          return this;
1425        }
1426
1427        /**
1428         * @return The first repetition of repeating field {@link #coverageArea}, creating it if it does not already exist
1429         */
1430        public Reference getCoverageAreaFirstRep() { 
1431          if (getCoverageArea().isEmpty()) {
1432            addCoverageArea();
1433          }
1434          return getCoverageArea().get(0);
1435        }
1436
1437        /**
1438         * @deprecated Use Reference#setResource(IBaseResource) instead
1439         */
1440        @Deprecated
1441        public List<Location> getCoverageAreaTarget() { 
1442          if (this.coverageAreaTarget == null)
1443            this.coverageAreaTarget = new ArrayList<Location>();
1444          return this.coverageAreaTarget;
1445        }
1446
1447        /**
1448         * @deprecated Use Reference#setResource(IBaseResource) instead
1449         */
1450        @Deprecated
1451        public Location addCoverageAreaTarget() { 
1452          Location r = new Location();
1453          if (this.coverageAreaTarget == null)
1454            this.coverageAreaTarget = new ArrayList<Location>();
1455          this.coverageAreaTarget.add(r);
1456          return r;
1457        }
1458
1459        /**
1460         * @return {@link #network} (Reference to the network that providing the type of coverage.)
1461         */
1462        public List<Reference> getNetwork() { 
1463          if (this.network == null)
1464            this.network = new ArrayList<Reference>();
1465          return this.network;
1466        }
1467
1468        /**
1469         * @return Returns a reference to <code>this</code> for easy method chaining
1470         */
1471        public InsurancePlanPlanComponent setNetwork(List<Reference> theNetwork) { 
1472          this.network = theNetwork;
1473          return this;
1474        }
1475
1476        public boolean hasNetwork() { 
1477          if (this.network == null)
1478            return false;
1479          for (Reference item : this.network)
1480            if (!item.isEmpty())
1481              return true;
1482          return false;
1483        }
1484
1485        public Reference addNetwork() { //3
1486          Reference t = new Reference();
1487          if (this.network == null)
1488            this.network = new ArrayList<Reference>();
1489          this.network.add(t);
1490          return t;
1491        }
1492
1493        public InsurancePlanPlanComponent addNetwork(Reference t) { //3
1494          if (t == null)
1495            return this;
1496          if (this.network == null)
1497            this.network = new ArrayList<Reference>();
1498          this.network.add(t);
1499          return this;
1500        }
1501
1502        /**
1503         * @return The first repetition of repeating field {@link #network}, creating it if it does not already exist
1504         */
1505        public Reference getNetworkFirstRep() { 
1506          if (getNetwork().isEmpty()) {
1507            addNetwork();
1508          }
1509          return getNetwork().get(0);
1510        }
1511
1512        /**
1513         * @deprecated Use Reference#setResource(IBaseResource) instead
1514         */
1515        @Deprecated
1516        public List<Organization> getNetworkTarget() { 
1517          if (this.networkTarget == null)
1518            this.networkTarget = new ArrayList<Organization>();
1519          return this.networkTarget;
1520        }
1521
1522        /**
1523         * @deprecated Use Reference#setResource(IBaseResource) instead
1524         */
1525        @Deprecated
1526        public Organization addNetworkTarget() { 
1527          Organization r = new Organization();
1528          if (this.networkTarget == null)
1529            this.networkTarget = new ArrayList<Organization>();
1530          this.networkTarget.add(r);
1531          return r;
1532        }
1533
1534        /**
1535         * @return {@link #generalCost} (Overall costs associated with the plan.)
1536         */
1537        public List<InsurancePlanPlanGeneralCostComponent> getGeneralCost() { 
1538          if (this.generalCost == null)
1539            this.generalCost = new ArrayList<InsurancePlanPlanGeneralCostComponent>();
1540          return this.generalCost;
1541        }
1542
1543        /**
1544         * @return Returns a reference to <code>this</code> for easy method chaining
1545         */
1546        public InsurancePlanPlanComponent setGeneralCost(List<InsurancePlanPlanGeneralCostComponent> theGeneralCost) { 
1547          this.generalCost = theGeneralCost;
1548          return this;
1549        }
1550
1551        public boolean hasGeneralCost() { 
1552          if (this.generalCost == null)
1553            return false;
1554          for (InsurancePlanPlanGeneralCostComponent item : this.generalCost)
1555            if (!item.isEmpty())
1556              return true;
1557          return false;
1558        }
1559
1560        public InsurancePlanPlanGeneralCostComponent addGeneralCost() { //3
1561          InsurancePlanPlanGeneralCostComponent t = new InsurancePlanPlanGeneralCostComponent();
1562          if (this.generalCost == null)
1563            this.generalCost = new ArrayList<InsurancePlanPlanGeneralCostComponent>();
1564          this.generalCost.add(t);
1565          return t;
1566        }
1567
1568        public InsurancePlanPlanComponent addGeneralCost(InsurancePlanPlanGeneralCostComponent t) { //3
1569          if (t == null)
1570            return this;
1571          if (this.generalCost == null)
1572            this.generalCost = new ArrayList<InsurancePlanPlanGeneralCostComponent>();
1573          this.generalCost.add(t);
1574          return this;
1575        }
1576
1577        /**
1578         * @return The first repetition of repeating field {@link #generalCost}, creating it if it does not already exist
1579         */
1580        public InsurancePlanPlanGeneralCostComponent getGeneralCostFirstRep() { 
1581          if (getGeneralCost().isEmpty()) {
1582            addGeneralCost();
1583          }
1584          return getGeneralCost().get(0);
1585        }
1586
1587        /**
1588         * @return {@link #specificCost} (Costs associated with the coverage provided by the product.)
1589         */
1590        public List<InsurancePlanPlanSpecificCostComponent> getSpecificCost() { 
1591          if (this.specificCost == null)
1592            this.specificCost = new ArrayList<InsurancePlanPlanSpecificCostComponent>();
1593          return this.specificCost;
1594        }
1595
1596        /**
1597         * @return Returns a reference to <code>this</code> for easy method chaining
1598         */
1599        public InsurancePlanPlanComponent setSpecificCost(List<InsurancePlanPlanSpecificCostComponent> theSpecificCost) { 
1600          this.specificCost = theSpecificCost;
1601          return this;
1602        }
1603
1604        public boolean hasSpecificCost() { 
1605          if (this.specificCost == null)
1606            return false;
1607          for (InsurancePlanPlanSpecificCostComponent item : this.specificCost)
1608            if (!item.isEmpty())
1609              return true;
1610          return false;
1611        }
1612
1613        public InsurancePlanPlanSpecificCostComponent addSpecificCost() { //3
1614          InsurancePlanPlanSpecificCostComponent t = new InsurancePlanPlanSpecificCostComponent();
1615          if (this.specificCost == null)
1616            this.specificCost = new ArrayList<InsurancePlanPlanSpecificCostComponent>();
1617          this.specificCost.add(t);
1618          return t;
1619        }
1620
1621        public InsurancePlanPlanComponent addSpecificCost(InsurancePlanPlanSpecificCostComponent t) { //3
1622          if (t == null)
1623            return this;
1624          if (this.specificCost == null)
1625            this.specificCost = new ArrayList<InsurancePlanPlanSpecificCostComponent>();
1626          this.specificCost.add(t);
1627          return this;
1628        }
1629
1630        /**
1631         * @return The first repetition of repeating field {@link #specificCost}, creating it if it does not already exist
1632         */
1633        public InsurancePlanPlanSpecificCostComponent getSpecificCostFirstRep() { 
1634          if (getSpecificCost().isEmpty()) {
1635            addSpecificCost();
1636          }
1637          return getSpecificCost().get(0);
1638        }
1639
1640        protected void listChildren(List<Property> children) {
1641          super.listChildren(children);
1642          children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1643          children.add(new Property("type", "CodeableConcept", "Type of plan. For example, \"Platinum\" or \"High Deductable\".", 0, 1, type));
1644          children.add(new Property("coverageArea", "Reference(Location)", "The geographic region in which a health insurance plan's benefits apply.", 0, java.lang.Integer.MAX_VALUE, coverageArea));
1645          children.add(new Property("network", "Reference(Organization)", "Reference to the network that providing the type of coverage.", 0, java.lang.Integer.MAX_VALUE, network));
1646          children.add(new Property("generalCost", "", "Overall costs associated with the plan.", 0, java.lang.Integer.MAX_VALUE, generalCost));
1647          children.add(new Property("specificCost", "", "Costs associated with the coverage provided by the product.", 0, java.lang.Integer.MAX_VALUE, specificCost));
1648        }
1649
1650        @Override
1651        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1652          switch (_hash) {
1653          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
1654          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of plan. For example, \"Platinum\" or \"High Deductable\".", 0, 1, type);
1655          case -1532328299: /*coverageArea*/  return new Property("coverageArea", "Reference(Location)", "The geographic region in which a health insurance plan's benefits apply.", 0, java.lang.Integer.MAX_VALUE, coverageArea);
1656          case 1843485230: /*network*/  return new Property("network", "Reference(Organization)", "Reference to the network that providing the type of coverage.", 0, java.lang.Integer.MAX_VALUE, network);
1657          case 878344405: /*generalCost*/  return new Property("generalCost", "", "Overall costs associated with the plan.", 0, java.lang.Integer.MAX_VALUE, generalCost);
1658          case -1205656545: /*specificCost*/  return new Property("specificCost", "", "Costs associated with the coverage provided by the product.", 0, java.lang.Integer.MAX_VALUE, specificCost);
1659          default: return super.getNamedProperty(_hash, _name, _checkValid);
1660          }
1661
1662        }
1663
1664      @Override
1665      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1666        switch (hash) {
1667        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1668        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1669        case -1532328299: /*coverageArea*/ return this.coverageArea == null ? new Base[0] : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference
1670        case 1843485230: /*network*/ return this.network == null ? new Base[0] : this.network.toArray(new Base[this.network.size()]); // Reference
1671        case 878344405: /*generalCost*/ return this.generalCost == null ? new Base[0] : this.generalCost.toArray(new Base[this.generalCost.size()]); // InsurancePlanPlanGeneralCostComponent
1672        case -1205656545: /*specificCost*/ return this.specificCost == null ? new Base[0] : this.specificCost.toArray(new Base[this.specificCost.size()]); // InsurancePlanPlanSpecificCostComponent
1673        default: return super.getProperty(hash, name, checkValid);
1674        }
1675
1676      }
1677
1678      @Override
1679      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1680        switch (hash) {
1681        case -1618432855: // identifier
1682          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1683          return value;
1684        case 3575610: // type
1685          this.type = castToCodeableConcept(value); // CodeableConcept
1686          return value;
1687        case -1532328299: // coverageArea
1688          this.getCoverageArea().add(castToReference(value)); // Reference
1689          return value;
1690        case 1843485230: // network
1691          this.getNetwork().add(castToReference(value)); // Reference
1692          return value;
1693        case 878344405: // generalCost
1694          this.getGeneralCost().add((InsurancePlanPlanGeneralCostComponent) value); // InsurancePlanPlanGeneralCostComponent
1695          return value;
1696        case -1205656545: // specificCost
1697          this.getSpecificCost().add((InsurancePlanPlanSpecificCostComponent) value); // InsurancePlanPlanSpecificCostComponent
1698          return value;
1699        default: return super.setProperty(hash, name, value);
1700        }
1701
1702      }
1703
1704      @Override
1705      public Base setProperty(String name, Base value) throws FHIRException {
1706        if (name.equals("identifier")) {
1707          this.getIdentifier().add(castToIdentifier(value));
1708        } else if (name.equals("type")) {
1709          this.type = castToCodeableConcept(value); // CodeableConcept
1710        } else if (name.equals("coverageArea")) {
1711          this.getCoverageArea().add(castToReference(value));
1712        } else if (name.equals("network")) {
1713          this.getNetwork().add(castToReference(value));
1714        } else if (name.equals("generalCost")) {
1715          this.getGeneralCost().add((InsurancePlanPlanGeneralCostComponent) value);
1716        } else if (name.equals("specificCost")) {
1717          this.getSpecificCost().add((InsurancePlanPlanSpecificCostComponent) value);
1718        } else
1719          return super.setProperty(name, value);
1720        return value;
1721      }
1722
1723      @Override
1724      public Base makeProperty(int hash, String name) throws FHIRException {
1725        switch (hash) {
1726        case -1618432855:  return addIdentifier(); 
1727        case 3575610:  return getType(); 
1728        case -1532328299:  return addCoverageArea(); 
1729        case 1843485230:  return addNetwork(); 
1730        case 878344405:  return addGeneralCost(); 
1731        case -1205656545:  return addSpecificCost(); 
1732        default: return super.makeProperty(hash, name);
1733        }
1734
1735      }
1736
1737      @Override
1738      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1739        switch (hash) {
1740        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1741        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1742        case -1532328299: /*coverageArea*/ return new String[] {"Reference"};
1743        case 1843485230: /*network*/ return new String[] {"Reference"};
1744        case 878344405: /*generalCost*/ return new String[] {};
1745        case -1205656545: /*specificCost*/ return new String[] {};
1746        default: return super.getTypesForProperty(hash, name);
1747        }
1748
1749      }
1750
1751      @Override
1752      public Base addChild(String name) throws FHIRException {
1753        if (name.equals("identifier")) {
1754          return addIdentifier();
1755        }
1756        else if (name.equals("type")) {
1757          this.type = new CodeableConcept();
1758          return this.type;
1759        }
1760        else if (name.equals("coverageArea")) {
1761          return addCoverageArea();
1762        }
1763        else if (name.equals("network")) {
1764          return addNetwork();
1765        }
1766        else if (name.equals("generalCost")) {
1767          return addGeneralCost();
1768        }
1769        else if (name.equals("specificCost")) {
1770          return addSpecificCost();
1771        }
1772        else
1773          return super.addChild(name);
1774      }
1775
1776      public InsurancePlanPlanComponent copy() {
1777        InsurancePlanPlanComponent dst = new InsurancePlanPlanComponent();
1778        copyValues(dst);
1779        return dst;
1780      }
1781
1782      public void copyValues(InsurancePlanPlanComponent dst) {
1783        super.copyValues(dst);
1784        if (identifier != null) {
1785          dst.identifier = new ArrayList<Identifier>();
1786          for (Identifier i : identifier)
1787            dst.identifier.add(i.copy());
1788        };
1789        dst.type = type == null ? null : type.copy();
1790        if (coverageArea != null) {
1791          dst.coverageArea = new ArrayList<Reference>();
1792          for (Reference i : coverageArea)
1793            dst.coverageArea.add(i.copy());
1794        };
1795        if (network != null) {
1796          dst.network = new ArrayList<Reference>();
1797          for (Reference i : network)
1798            dst.network.add(i.copy());
1799        };
1800        if (generalCost != null) {
1801          dst.generalCost = new ArrayList<InsurancePlanPlanGeneralCostComponent>();
1802          for (InsurancePlanPlanGeneralCostComponent i : generalCost)
1803            dst.generalCost.add(i.copy());
1804        };
1805        if (specificCost != null) {
1806          dst.specificCost = new ArrayList<InsurancePlanPlanSpecificCostComponent>();
1807          for (InsurancePlanPlanSpecificCostComponent i : specificCost)
1808            dst.specificCost.add(i.copy());
1809        };
1810      }
1811
1812      @Override
1813      public boolean equalsDeep(Base other_) {
1814        if (!super.equalsDeep(other_))
1815          return false;
1816        if (!(other_ instanceof InsurancePlanPlanComponent))
1817          return false;
1818        InsurancePlanPlanComponent o = (InsurancePlanPlanComponent) other_;
1819        return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(coverageArea, o.coverageArea, true)
1820           && compareDeep(network, o.network, true) && compareDeep(generalCost, o.generalCost, true) && compareDeep(specificCost, o.specificCost, true)
1821          ;
1822      }
1823
1824      @Override
1825      public boolean equalsShallow(Base other_) {
1826        if (!super.equalsShallow(other_))
1827          return false;
1828        if (!(other_ instanceof InsurancePlanPlanComponent))
1829          return false;
1830        InsurancePlanPlanComponent o = (InsurancePlanPlanComponent) other_;
1831        return true;
1832      }
1833
1834      public boolean isEmpty() {
1835        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, type, coverageArea
1836          , network, generalCost, specificCost);
1837      }
1838
1839  public String fhirType() {
1840    return "InsurancePlan.plan";
1841
1842  }
1843
1844  }
1845
1846    @Block()
1847    public static class InsurancePlanPlanGeneralCostComponent extends BackboneElement implements IBaseBackboneElement {
1848        /**
1849         * Type of cost.
1850         */
1851        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1852        @Description(shortDefinition="Type of cost", formalDefinition="Type of cost." )
1853        protected CodeableConcept type;
1854
1855        /**
1856         * Number of participants enrolled in the plan.
1857         */
1858        @Child(name = "groupSize", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1859        @Description(shortDefinition="Number of enrollees", formalDefinition="Number of participants enrolled in the plan." )
1860        protected PositiveIntType groupSize;
1861
1862        /**
1863         * Value of the cost.
1864         */
1865        @Child(name = "cost", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=false)
1866        @Description(shortDefinition="Cost value", formalDefinition="Value of the cost." )
1867        protected Money cost;
1868
1869        /**
1870         * Additional information about the general costs associated with this plan.
1871         */
1872        @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1873        @Description(shortDefinition="Additional cost information", formalDefinition="Additional information about the general costs associated with this plan." )
1874        protected StringType comment;
1875
1876        private static final long serialVersionUID = 1563949866L;
1877
1878    /**
1879     * Constructor
1880     */
1881      public InsurancePlanPlanGeneralCostComponent() {
1882        super();
1883      }
1884
1885        /**
1886         * @return {@link #type} (Type of cost.)
1887         */
1888        public CodeableConcept getType() { 
1889          if (this.type == null)
1890            if (Configuration.errorOnAutoCreate())
1891              throw new Error("Attempt to auto-create InsurancePlanPlanGeneralCostComponent.type");
1892            else if (Configuration.doAutoCreate())
1893              this.type = new CodeableConcept(); // cc
1894          return this.type;
1895        }
1896
1897        public boolean hasType() { 
1898          return this.type != null && !this.type.isEmpty();
1899        }
1900
1901        /**
1902         * @param value {@link #type} (Type of cost.)
1903         */
1904        public InsurancePlanPlanGeneralCostComponent setType(CodeableConcept value) { 
1905          this.type = value;
1906          return this;
1907        }
1908
1909        /**
1910         * @return {@link #groupSize} (Number of participants enrolled in the plan.). This is the underlying object with id, value and extensions. The accessor "getGroupSize" gives direct access to the value
1911         */
1912        public PositiveIntType getGroupSizeElement() { 
1913          if (this.groupSize == null)
1914            if (Configuration.errorOnAutoCreate())
1915              throw new Error("Attempt to auto-create InsurancePlanPlanGeneralCostComponent.groupSize");
1916            else if (Configuration.doAutoCreate())
1917              this.groupSize = new PositiveIntType(); // bb
1918          return this.groupSize;
1919        }
1920
1921        public boolean hasGroupSizeElement() { 
1922          return this.groupSize != null && !this.groupSize.isEmpty();
1923        }
1924
1925        public boolean hasGroupSize() { 
1926          return this.groupSize != null && !this.groupSize.isEmpty();
1927        }
1928
1929        /**
1930         * @param value {@link #groupSize} (Number of participants enrolled in the plan.). This is the underlying object with id, value and extensions. The accessor "getGroupSize" gives direct access to the value
1931         */
1932        public InsurancePlanPlanGeneralCostComponent setGroupSizeElement(PositiveIntType value) { 
1933          this.groupSize = value;
1934          return this;
1935        }
1936
1937        /**
1938         * @return Number of participants enrolled in the plan.
1939         */
1940        public int getGroupSize() { 
1941          return this.groupSize == null || this.groupSize.isEmpty() ? 0 : this.groupSize.getValue();
1942        }
1943
1944        /**
1945         * @param value Number of participants enrolled in the plan.
1946         */
1947        public InsurancePlanPlanGeneralCostComponent setGroupSize(int value) { 
1948            if (this.groupSize == null)
1949              this.groupSize = new PositiveIntType();
1950            this.groupSize.setValue(value);
1951          return this;
1952        }
1953
1954        /**
1955         * @return {@link #cost} (Value of the cost.)
1956         */
1957        public Money getCost() { 
1958          if (this.cost == null)
1959            if (Configuration.errorOnAutoCreate())
1960              throw new Error("Attempt to auto-create InsurancePlanPlanGeneralCostComponent.cost");
1961            else if (Configuration.doAutoCreate())
1962              this.cost = new Money(); // cc
1963          return this.cost;
1964        }
1965
1966        public boolean hasCost() { 
1967          return this.cost != null && !this.cost.isEmpty();
1968        }
1969
1970        /**
1971         * @param value {@link #cost} (Value of the cost.)
1972         */
1973        public InsurancePlanPlanGeneralCostComponent setCost(Money value) { 
1974          this.cost = value;
1975          return this;
1976        }
1977
1978        /**
1979         * @return {@link #comment} (Additional information about the general costs associated with this plan.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
1980         */
1981        public StringType getCommentElement() { 
1982          if (this.comment == null)
1983            if (Configuration.errorOnAutoCreate())
1984              throw new Error("Attempt to auto-create InsurancePlanPlanGeneralCostComponent.comment");
1985            else if (Configuration.doAutoCreate())
1986              this.comment = new StringType(); // bb
1987          return this.comment;
1988        }
1989
1990        public boolean hasCommentElement() { 
1991          return this.comment != null && !this.comment.isEmpty();
1992        }
1993
1994        public boolean hasComment() { 
1995          return this.comment != null && !this.comment.isEmpty();
1996        }
1997
1998        /**
1999         * @param value {@link #comment} (Additional information about the general costs associated with this plan.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
2000         */
2001        public InsurancePlanPlanGeneralCostComponent setCommentElement(StringType value) { 
2002          this.comment = value;
2003          return this;
2004        }
2005
2006        /**
2007         * @return Additional information about the general costs associated with this plan.
2008         */
2009        public String getComment() { 
2010          return this.comment == null ? null : this.comment.getValue();
2011        }
2012
2013        /**
2014         * @param value Additional information about the general costs associated with this plan.
2015         */
2016        public InsurancePlanPlanGeneralCostComponent setComment(String value) { 
2017          if (Utilities.noString(value))
2018            this.comment = null;
2019          else {
2020            if (this.comment == null)
2021              this.comment = new StringType();
2022            this.comment.setValue(value);
2023          }
2024          return this;
2025        }
2026
2027        protected void listChildren(List<Property> children) {
2028          super.listChildren(children);
2029          children.add(new Property("type", "CodeableConcept", "Type of cost.", 0, 1, type));
2030          children.add(new Property("groupSize", "positiveInt", "Number of participants enrolled in the plan.", 0, 1, groupSize));
2031          children.add(new Property("cost", "Money", "Value of the cost.", 0, 1, cost));
2032          children.add(new Property("comment", "string", "Additional information about the general costs associated with this plan.", 0, 1, comment));
2033        }
2034
2035        @Override
2036        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2037          switch (_hash) {
2038          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of cost.", 0, 1, type);
2039          case -1483017440: /*groupSize*/  return new Property("groupSize", "positiveInt", "Number of participants enrolled in the plan.", 0, 1, groupSize);
2040          case 3059661: /*cost*/  return new Property("cost", "Money", "Value of the cost.", 0, 1, cost);
2041          case 950398559: /*comment*/  return new Property("comment", "string", "Additional information about the general costs associated with this plan.", 0, 1, comment);
2042          default: return super.getNamedProperty(_hash, _name, _checkValid);
2043          }
2044
2045        }
2046
2047      @Override
2048      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2049        switch (hash) {
2050        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2051        case -1483017440: /*groupSize*/ return this.groupSize == null ? new Base[0] : new Base[] {this.groupSize}; // PositiveIntType
2052        case 3059661: /*cost*/ return this.cost == null ? new Base[0] : new Base[] {this.cost}; // Money
2053        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
2054        default: return super.getProperty(hash, name, checkValid);
2055        }
2056
2057      }
2058
2059      @Override
2060      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2061        switch (hash) {
2062        case 3575610: // type
2063          this.type = castToCodeableConcept(value); // CodeableConcept
2064          return value;
2065        case -1483017440: // groupSize
2066          this.groupSize = castToPositiveInt(value); // PositiveIntType
2067          return value;
2068        case 3059661: // cost
2069          this.cost = castToMoney(value); // Money
2070          return value;
2071        case 950398559: // comment
2072          this.comment = castToString(value); // StringType
2073          return value;
2074        default: return super.setProperty(hash, name, value);
2075        }
2076
2077      }
2078
2079      @Override
2080      public Base setProperty(String name, Base value) throws FHIRException {
2081        if (name.equals("type")) {
2082          this.type = castToCodeableConcept(value); // CodeableConcept
2083        } else if (name.equals("groupSize")) {
2084          this.groupSize = castToPositiveInt(value); // PositiveIntType
2085        } else if (name.equals("cost")) {
2086          this.cost = castToMoney(value); // Money
2087        } else if (name.equals("comment")) {
2088          this.comment = castToString(value); // StringType
2089        } else
2090          return super.setProperty(name, value);
2091        return value;
2092      }
2093
2094      @Override
2095      public Base makeProperty(int hash, String name) throws FHIRException {
2096        switch (hash) {
2097        case 3575610:  return getType(); 
2098        case -1483017440:  return getGroupSizeElement();
2099        case 3059661:  return getCost(); 
2100        case 950398559:  return getCommentElement();
2101        default: return super.makeProperty(hash, name);
2102        }
2103
2104      }
2105
2106      @Override
2107      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2108        switch (hash) {
2109        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2110        case -1483017440: /*groupSize*/ return new String[] {"positiveInt"};
2111        case 3059661: /*cost*/ return new String[] {"Money"};
2112        case 950398559: /*comment*/ return new String[] {"string"};
2113        default: return super.getTypesForProperty(hash, name);
2114        }
2115
2116      }
2117
2118      @Override
2119      public Base addChild(String name) throws FHIRException {
2120        if (name.equals("type")) {
2121          this.type = new CodeableConcept();
2122          return this.type;
2123        }
2124        else if (name.equals("groupSize")) {
2125          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.groupSize");
2126        }
2127        else if (name.equals("cost")) {
2128          this.cost = new Money();
2129          return this.cost;
2130        }
2131        else if (name.equals("comment")) {
2132          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.comment");
2133        }
2134        else
2135          return super.addChild(name);
2136      }
2137
2138      public InsurancePlanPlanGeneralCostComponent copy() {
2139        InsurancePlanPlanGeneralCostComponent dst = new InsurancePlanPlanGeneralCostComponent();
2140        copyValues(dst);
2141        return dst;
2142      }
2143
2144      public void copyValues(InsurancePlanPlanGeneralCostComponent dst) {
2145        super.copyValues(dst);
2146        dst.type = type == null ? null : type.copy();
2147        dst.groupSize = groupSize == null ? null : groupSize.copy();
2148        dst.cost = cost == null ? null : cost.copy();
2149        dst.comment = comment == null ? null : comment.copy();
2150      }
2151
2152      @Override
2153      public boolean equalsDeep(Base other_) {
2154        if (!super.equalsDeep(other_))
2155          return false;
2156        if (!(other_ instanceof InsurancePlanPlanGeneralCostComponent))
2157          return false;
2158        InsurancePlanPlanGeneralCostComponent o = (InsurancePlanPlanGeneralCostComponent) other_;
2159        return compareDeep(type, o.type, true) && compareDeep(groupSize, o.groupSize, true) && compareDeep(cost, o.cost, true)
2160           && compareDeep(comment, o.comment, true);
2161      }
2162
2163      @Override
2164      public boolean equalsShallow(Base other_) {
2165        if (!super.equalsShallow(other_))
2166          return false;
2167        if (!(other_ instanceof InsurancePlanPlanGeneralCostComponent))
2168          return false;
2169        InsurancePlanPlanGeneralCostComponent o = (InsurancePlanPlanGeneralCostComponent) other_;
2170        return compareValues(groupSize, o.groupSize, true) && compareValues(comment, o.comment, true);
2171      }
2172
2173      public boolean isEmpty() {
2174        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, groupSize, cost, comment
2175          );
2176      }
2177
2178  public String fhirType() {
2179    return "InsurancePlan.plan.generalCost";
2180
2181  }
2182
2183  }
2184
2185    @Block()
2186    public static class InsurancePlanPlanSpecificCostComponent extends BackboneElement implements IBaseBackboneElement {
2187        /**
2188         * General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).
2189         */
2190        @Child(name = "category", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2191        @Description(shortDefinition="General category of benefit", formalDefinition="General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health)." )
2192        protected CodeableConcept category;
2193
2194        /**
2195         * List of the specific benefits under this category of benefit.
2196         */
2197        @Child(name = "benefit", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2198        @Description(shortDefinition="Benefits list", formalDefinition="List of the specific benefits under this category of benefit." )
2199        protected List<PlanBenefitComponent> benefit;
2200
2201        private static final long serialVersionUID = 922585525L;
2202
2203    /**
2204     * Constructor
2205     */
2206      public InsurancePlanPlanSpecificCostComponent() {
2207        super();
2208      }
2209
2210    /**
2211     * Constructor
2212     */
2213      public InsurancePlanPlanSpecificCostComponent(CodeableConcept category) {
2214        super();
2215        this.category = category;
2216      }
2217
2218        /**
2219         * @return {@link #category} (General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).)
2220         */
2221        public CodeableConcept getCategory() { 
2222          if (this.category == null)
2223            if (Configuration.errorOnAutoCreate())
2224              throw new Error("Attempt to auto-create InsurancePlanPlanSpecificCostComponent.category");
2225            else if (Configuration.doAutoCreate())
2226              this.category = new CodeableConcept(); // cc
2227          return this.category;
2228        }
2229
2230        public boolean hasCategory() { 
2231          return this.category != null && !this.category.isEmpty();
2232        }
2233
2234        /**
2235         * @param value {@link #category} (General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).)
2236         */
2237        public InsurancePlanPlanSpecificCostComponent setCategory(CodeableConcept value) { 
2238          this.category = value;
2239          return this;
2240        }
2241
2242        /**
2243         * @return {@link #benefit} (List of the specific benefits under this category of benefit.)
2244         */
2245        public List<PlanBenefitComponent> getBenefit() { 
2246          if (this.benefit == null)
2247            this.benefit = new ArrayList<PlanBenefitComponent>();
2248          return this.benefit;
2249        }
2250
2251        /**
2252         * @return Returns a reference to <code>this</code> for easy method chaining
2253         */
2254        public InsurancePlanPlanSpecificCostComponent setBenefit(List<PlanBenefitComponent> theBenefit) { 
2255          this.benefit = theBenefit;
2256          return this;
2257        }
2258
2259        public boolean hasBenefit() { 
2260          if (this.benefit == null)
2261            return false;
2262          for (PlanBenefitComponent item : this.benefit)
2263            if (!item.isEmpty())
2264              return true;
2265          return false;
2266        }
2267
2268        public PlanBenefitComponent addBenefit() { //3
2269          PlanBenefitComponent t = new PlanBenefitComponent();
2270          if (this.benefit == null)
2271            this.benefit = new ArrayList<PlanBenefitComponent>();
2272          this.benefit.add(t);
2273          return t;
2274        }
2275
2276        public InsurancePlanPlanSpecificCostComponent addBenefit(PlanBenefitComponent t) { //3
2277          if (t == null)
2278            return this;
2279          if (this.benefit == null)
2280            this.benefit = new ArrayList<PlanBenefitComponent>();
2281          this.benefit.add(t);
2282          return this;
2283        }
2284
2285        /**
2286         * @return The first repetition of repeating field {@link #benefit}, creating it if it does not already exist
2287         */
2288        public PlanBenefitComponent getBenefitFirstRep() { 
2289          if (getBenefit().isEmpty()) {
2290            addBenefit();
2291          }
2292          return getBenefit().get(0);
2293        }
2294
2295        protected void listChildren(List<Property> children) {
2296          super.listChildren(children);
2297          children.add(new Property("category", "CodeableConcept", "General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).", 0, 1, category));
2298          children.add(new Property("benefit", "", "List of the specific benefits under this category of benefit.", 0, java.lang.Integer.MAX_VALUE, benefit));
2299        }
2300
2301        @Override
2302        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2303          switch (_hash) {
2304          case 50511102: /*category*/  return new Property("category", "CodeableConcept", "General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).", 0, 1, category);
2305          case -222710633: /*benefit*/  return new Property("benefit", "", "List of the specific benefits under this category of benefit.", 0, java.lang.Integer.MAX_VALUE, benefit);
2306          default: return super.getNamedProperty(_hash, _name, _checkValid);
2307          }
2308
2309        }
2310
2311      @Override
2312      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2313        switch (hash) {
2314        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
2315        case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : this.benefit.toArray(new Base[this.benefit.size()]); // PlanBenefitComponent
2316        default: return super.getProperty(hash, name, checkValid);
2317        }
2318
2319      }
2320
2321      @Override
2322      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2323        switch (hash) {
2324        case 50511102: // category
2325          this.category = castToCodeableConcept(value); // CodeableConcept
2326          return value;
2327        case -222710633: // benefit
2328          this.getBenefit().add((PlanBenefitComponent) value); // PlanBenefitComponent
2329          return value;
2330        default: return super.setProperty(hash, name, value);
2331        }
2332
2333      }
2334
2335      @Override
2336      public Base setProperty(String name, Base value) throws FHIRException {
2337        if (name.equals("category")) {
2338          this.category = castToCodeableConcept(value); // CodeableConcept
2339        } else if (name.equals("benefit")) {
2340          this.getBenefit().add((PlanBenefitComponent) value);
2341        } else
2342          return super.setProperty(name, value);
2343        return value;
2344      }
2345
2346      @Override
2347      public Base makeProperty(int hash, String name) throws FHIRException {
2348        switch (hash) {
2349        case 50511102:  return getCategory(); 
2350        case -222710633:  return addBenefit(); 
2351        default: return super.makeProperty(hash, name);
2352        }
2353
2354      }
2355
2356      @Override
2357      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2358        switch (hash) {
2359        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2360        case -222710633: /*benefit*/ return new String[] {};
2361        default: return super.getTypesForProperty(hash, name);
2362        }
2363
2364      }
2365
2366      @Override
2367      public Base addChild(String name) throws FHIRException {
2368        if (name.equals("category")) {
2369          this.category = new CodeableConcept();
2370          return this.category;
2371        }
2372        else if (name.equals("benefit")) {
2373          return addBenefit();
2374        }
2375        else
2376          return super.addChild(name);
2377      }
2378
2379      public InsurancePlanPlanSpecificCostComponent copy() {
2380        InsurancePlanPlanSpecificCostComponent dst = new InsurancePlanPlanSpecificCostComponent();
2381        copyValues(dst);
2382        return dst;
2383      }
2384
2385      public void copyValues(InsurancePlanPlanSpecificCostComponent dst) {
2386        super.copyValues(dst);
2387        dst.category = category == null ? null : category.copy();
2388        if (benefit != null) {
2389          dst.benefit = new ArrayList<PlanBenefitComponent>();
2390          for (PlanBenefitComponent i : benefit)
2391            dst.benefit.add(i.copy());
2392        };
2393      }
2394
2395      @Override
2396      public boolean equalsDeep(Base other_) {
2397        if (!super.equalsDeep(other_))
2398          return false;
2399        if (!(other_ instanceof InsurancePlanPlanSpecificCostComponent))
2400          return false;
2401        InsurancePlanPlanSpecificCostComponent o = (InsurancePlanPlanSpecificCostComponent) other_;
2402        return compareDeep(category, o.category, true) && compareDeep(benefit, o.benefit, true);
2403      }
2404
2405      @Override
2406      public boolean equalsShallow(Base other_) {
2407        if (!super.equalsShallow(other_))
2408          return false;
2409        if (!(other_ instanceof InsurancePlanPlanSpecificCostComponent))
2410          return false;
2411        InsurancePlanPlanSpecificCostComponent o = (InsurancePlanPlanSpecificCostComponent) other_;
2412        return true;
2413      }
2414
2415      public boolean isEmpty() {
2416        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, benefit);
2417      }
2418
2419  public String fhirType() {
2420    return "InsurancePlan.plan.specificCost";
2421
2422  }
2423
2424  }
2425
2426    @Block()
2427    public static class PlanBenefitComponent extends BackboneElement implements IBaseBackboneElement {
2428        /**
2429         * Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).
2430         */
2431        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2432        @Description(shortDefinition="Type of specific benefit", formalDefinition="Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care)." )
2433        protected CodeableConcept type;
2434
2435        /**
2436         * List of the costs associated with a specific benefit.
2437         */
2438        @Child(name = "cost", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2439        @Description(shortDefinition="List of the costs", formalDefinition="List of the costs associated with a specific benefit." )
2440        protected List<PlanBenefitCostComponent> cost;
2441
2442        private static final long serialVersionUID = 792296200L;
2443
2444    /**
2445     * Constructor
2446     */
2447      public PlanBenefitComponent() {
2448        super();
2449      }
2450
2451    /**
2452     * Constructor
2453     */
2454      public PlanBenefitComponent(CodeableConcept type) {
2455        super();
2456        this.type = type;
2457      }
2458
2459        /**
2460         * @return {@link #type} (Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).)
2461         */
2462        public CodeableConcept getType() { 
2463          if (this.type == null)
2464            if (Configuration.errorOnAutoCreate())
2465              throw new Error("Attempt to auto-create PlanBenefitComponent.type");
2466            else if (Configuration.doAutoCreate())
2467              this.type = new CodeableConcept(); // cc
2468          return this.type;
2469        }
2470
2471        public boolean hasType() { 
2472          return this.type != null && !this.type.isEmpty();
2473        }
2474
2475        /**
2476         * @param value {@link #type} (Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).)
2477         */
2478        public PlanBenefitComponent setType(CodeableConcept value) { 
2479          this.type = value;
2480          return this;
2481        }
2482
2483        /**
2484         * @return {@link #cost} (List of the costs associated with a specific benefit.)
2485         */
2486        public List<PlanBenefitCostComponent> getCost() { 
2487          if (this.cost == null)
2488            this.cost = new ArrayList<PlanBenefitCostComponent>();
2489          return this.cost;
2490        }
2491
2492        /**
2493         * @return Returns a reference to <code>this</code> for easy method chaining
2494         */
2495        public PlanBenefitComponent setCost(List<PlanBenefitCostComponent> theCost) { 
2496          this.cost = theCost;
2497          return this;
2498        }
2499
2500        public boolean hasCost() { 
2501          if (this.cost == null)
2502            return false;
2503          for (PlanBenefitCostComponent item : this.cost)
2504            if (!item.isEmpty())
2505              return true;
2506          return false;
2507        }
2508
2509        public PlanBenefitCostComponent addCost() { //3
2510          PlanBenefitCostComponent t = new PlanBenefitCostComponent();
2511          if (this.cost == null)
2512            this.cost = new ArrayList<PlanBenefitCostComponent>();
2513          this.cost.add(t);
2514          return t;
2515        }
2516
2517        public PlanBenefitComponent addCost(PlanBenefitCostComponent t) { //3
2518          if (t == null)
2519            return this;
2520          if (this.cost == null)
2521            this.cost = new ArrayList<PlanBenefitCostComponent>();
2522          this.cost.add(t);
2523          return this;
2524        }
2525
2526        /**
2527         * @return The first repetition of repeating field {@link #cost}, creating it if it does not already exist
2528         */
2529        public PlanBenefitCostComponent getCostFirstRep() { 
2530          if (getCost().isEmpty()) {
2531            addCost();
2532          }
2533          return getCost().get(0);
2534        }
2535
2536        protected void listChildren(List<Property> children) {
2537          super.listChildren(children);
2538          children.add(new Property("type", "CodeableConcept", "Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).", 0, 1, type));
2539          children.add(new Property("cost", "", "List of the costs associated with a specific benefit.", 0, java.lang.Integer.MAX_VALUE, cost));
2540        }
2541
2542        @Override
2543        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2544          switch (_hash) {
2545          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).", 0, 1, type);
2546          case 3059661: /*cost*/  return new Property("cost", "", "List of the costs associated with a specific benefit.", 0, java.lang.Integer.MAX_VALUE, cost);
2547          default: return super.getNamedProperty(_hash, _name, _checkValid);
2548          }
2549
2550        }
2551
2552      @Override
2553      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2554        switch (hash) {
2555        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2556        case 3059661: /*cost*/ return this.cost == null ? new Base[0] : this.cost.toArray(new Base[this.cost.size()]); // PlanBenefitCostComponent
2557        default: return super.getProperty(hash, name, checkValid);
2558        }
2559
2560      }
2561
2562      @Override
2563      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2564        switch (hash) {
2565        case 3575610: // type
2566          this.type = castToCodeableConcept(value); // CodeableConcept
2567          return value;
2568        case 3059661: // cost
2569          this.getCost().add((PlanBenefitCostComponent) value); // PlanBenefitCostComponent
2570          return value;
2571        default: return super.setProperty(hash, name, value);
2572        }
2573
2574      }
2575
2576      @Override
2577      public Base setProperty(String name, Base value) throws FHIRException {
2578        if (name.equals("type")) {
2579          this.type = castToCodeableConcept(value); // CodeableConcept
2580        } else if (name.equals("cost")) {
2581          this.getCost().add((PlanBenefitCostComponent) value);
2582        } else
2583          return super.setProperty(name, value);
2584        return value;
2585      }
2586
2587      @Override
2588      public Base makeProperty(int hash, String name) throws FHIRException {
2589        switch (hash) {
2590        case 3575610:  return getType(); 
2591        case 3059661:  return addCost(); 
2592        default: return super.makeProperty(hash, name);
2593        }
2594
2595      }
2596
2597      @Override
2598      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2599        switch (hash) {
2600        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2601        case 3059661: /*cost*/ return new String[] {};
2602        default: return super.getTypesForProperty(hash, name);
2603        }
2604
2605      }
2606
2607      @Override
2608      public Base addChild(String name) throws FHIRException {
2609        if (name.equals("type")) {
2610          this.type = new CodeableConcept();
2611          return this.type;
2612        }
2613        else if (name.equals("cost")) {
2614          return addCost();
2615        }
2616        else
2617          return super.addChild(name);
2618      }
2619
2620      public PlanBenefitComponent copy() {
2621        PlanBenefitComponent dst = new PlanBenefitComponent();
2622        copyValues(dst);
2623        return dst;
2624      }
2625
2626      public void copyValues(PlanBenefitComponent dst) {
2627        super.copyValues(dst);
2628        dst.type = type == null ? null : type.copy();
2629        if (cost != null) {
2630          dst.cost = new ArrayList<PlanBenefitCostComponent>();
2631          for (PlanBenefitCostComponent i : cost)
2632            dst.cost.add(i.copy());
2633        };
2634      }
2635
2636      @Override
2637      public boolean equalsDeep(Base other_) {
2638        if (!super.equalsDeep(other_))
2639          return false;
2640        if (!(other_ instanceof PlanBenefitComponent))
2641          return false;
2642        PlanBenefitComponent o = (PlanBenefitComponent) other_;
2643        return compareDeep(type, o.type, true) && compareDeep(cost, o.cost, true);
2644      }
2645
2646      @Override
2647      public boolean equalsShallow(Base other_) {
2648        if (!super.equalsShallow(other_))
2649          return false;
2650        if (!(other_ instanceof PlanBenefitComponent))
2651          return false;
2652        PlanBenefitComponent o = (PlanBenefitComponent) other_;
2653        return true;
2654      }
2655
2656      public boolean isEmpty() {
2657        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, cost);
2658      }
2659
2660  public String fhirType() {
2661    return "InsurancePlan.plan.specificCost.benefit";
2662
2663  }
2664
2665  }
2666
2667    @Block()
2668    public static class PlanBenefitCostComponent extends BackboneElement implements IBaseBackboneElement {
2669        /**
2670         * Type of cost (copay; individual cap; family cap; coinsurance; deductible).
2671         */
2672        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
2673        @Description(shortDefinition="Type of cost", formalDefinition="Type of cost (copay; individual cap; family cap; coinsurance; deductible)." )
2674        protected CodeableConcept type;
2675
2676        /**
2677         * Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).
2678         */
2679        @Child(name = "applicability", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2680        @Description(shortDefinition="in-network | out-of-network | other", formalDefinition="Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other)." )
2681        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/insuranceplan-applicability")
2682        protected CodeableConcept applicability;
2683
2684        /**
2685         * Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).
2686         */
2687        @Child(name = "qualifiers", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2688        @Description(shortDefinition="Additional information about the cost", formalDefinition="Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA)." )
2689        protected List<CodeableConcept> qualifiers;
2690
2691        /**
2692         * The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).
2693         */
2694        @Child(name = "value", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=false)
2695        @Description(shortDefinition="The actual cost value", formalDefinition="The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance)." )
2696        protected Quantity value;
2697
2698        private static final long serialVersionUID = -340688733L;
2699
2700    /**
2701     * Constructor
2702     */
2703      public PlanBenefitCostComponent() {
2704        super();
2705      }
2706
2707    /**
2708     * Constructor
2709     */
2710      public PlanBenefitCostComponent(CodeableConcept type) {
2711        super();
2712        this.type = type;
2713      }
2714
2715        /**
2716         * @return {@link #type} (Type of cost (copay; individual cap; family cap; coinsurance; deductible).)
2717         */
2718        public CodeableConcept getType() { 
2719          if (this.type == null)
2720            if (Configuration.errorOnAutoCreate())
2721              throw new Error("Attempt to auto-create PlanBenefitCostComponent.type");
2722            else if (Configuration.doAutoCreate())
2723              this.type = new CodeableConcept(); // cc
2724          return this.type;
2725        }
2726
2727        public boolean hasType() { 
2728          return this.type != null && !this.type.isEmpty();
2729        }
2730
2731        /**
2732         * @param value {@link #type} (Type of cost (copay; individual cap; family cap; coinsurance; deductible).)
2733         */
2734        public PlanBenefitCostComponent setType(CodeableConcept value) { 
2735          this.type = value;
2736          return this;
2737        }
2738
2739        /**
2740         * @return {@link #applicability} (Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).)
2741         */
2742        public CodeableConcept getApplicability() { 
2743          if (this.applicability == null)
2744            if (Configuration.errorOnAutoCreate())
2745              throw new Error("Attempt to auto-create PlanBenefitCostComponent.applicability");
2746            else if (Configuration.doAutoCreate())
2747              this.applicability = new CodeableConcept(); // cc
2748          return this.applicability;
2749        }
2750
2751        public boolean hasApplicability() { 
2752          return this.applicability != null && !this.applicability.isEmpty();
2753        }
2754
2755        /**
2756         * @param value {@link #applicability} (Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).)
2757         */
2758        public PlanBenefitCostComponent setApplicability(CodeableConcept value) { 
2759          this.applicability = value;
2760          return this;
2761        }
2762
2763        /**
2764         * @return {@link #qualifiers} (Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).)
2765         */
2766        public List<CodeableConcept> getQualifiers() { 
2767          if (this.qualifiers == null)
2768            this.qualifiers = new ArrayList<CodeableConcept>();
2769          return this.qualifiers;
2770        }
2771
2772        /**
2773         * @return Returns a reference to <code>this</code> for easy method chaining
2774         */
2775        public PlanBenefitCostComponent setQualifiers(List<CodeableConcept> theQualifiers) { 
2776          this.qualifiers = theQualifiers;
2777          return this;
2778        }
2779
2780        public boolean hasQualifiers() { 
2781          if (this.qualifiers == null)
2782            return false;
2783          for (CodeableConcept item : this.qualifiers)
2784            if (!item.isEmpty())
2785              return true;
2786          return false;
2787        }
2788
2789        public CodeableConcept addQualifiers() { //3
2790          CodeableConcept t = new CodeableConcept();
2791          if (this.qualifiers == null)
2792            this.qualifiers = new ArrayList<CodeableConcept>();
2793          this.qualifiers.add(t);
2794          return t;
2795        }
2796
2797        public PlanBenefitCostComponent addQualifiers(CodeableConcept t) { //3
2798          if (t == null)
2799            return this;
2800          if (this.qualifiers == null)
2801            this.qualifiers = new ArrayList<CodeableConcept>();
2802          this.qualifiers.add(t);
2803          return this;
2804        }
2805
2806        /**
2807         * @return The first repetition of repeating field {@link #qualifiers}, creating it if it does not already exist
2808         */
2809        public CodeableConcept getQualifiersFirstRep() { 
2810          if (getQualifiers().isEmpty()) {
2811            addQualifiers();
2812          }
2813          return getQualifiers().get(0);
2814        }
2815
2816        /**
2817         * @return {@link #value} (The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).)
2818         */
2819        public Quantity getValue() { 
2820          if (this.value == null)
2821            if (Configuration.errorOnAutoCreate())
2822              throw new Error("Attempt to auto-create PlanBenefitCostComponent.value");
2823            else if (Configuration.doAutoCreate())
2824              this.value = new Quantity(); // cc
2825          return this.value;
2826        }
2827
2828        public boolean hasValue() { 
2829          return this.value != null && !this.value.isEmpty();
2830        }
2831
2832        /**
2833         * @param value {@link #value} (The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).)
2834         */
2835        public PlanBenefitCostComponent setValue(Quantity value) { 
2836          this.value = value;
2837          return this;
2838        }
2839
2840        protected void listChildren(List<Property> children) {
2841          super.listChildren(children);
2842          children.add(new Property("type", "CodeableConcept", "Type of cost (copay; individual cap; family cap; coinsurance; deductible).", 0, 1, type));
2843          children.add(new Property("applicability", "CodeableConcept", "Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).", 0, 1, applicability));
2844          children.add(new Property("qualifiers", "CodeableConcept", "Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).", 0, java.lang.Integer.MAX_VALUE, qualifiers));
2845          children.add(new Property("value", "Quantity", "The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).", 0, 1, value));
2846        }
2847
2848        @Override
2849        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2850          switch (_hash) {
2851          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type of cost (copay; individual cap; family cap; coinsurance; deductible).", 0, 1, type);
2852          case -1526770491: /*applicability*/  return new Property("applicability", "CodeableConcept", "Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).", 0, 1, applicability);
2853          case -31447799: /*qualifiers*/  return new Property("qualifiers", "CodeableConcept", "Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).", 0, java.lang.Integer.MAX_VALUE, qualifiers);
2854          case 111972721: /*value*/  return new Property("value", "Quantity", "The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).", 0, 1, value);
2855          default: return super.getNamedProperty(_hash, _name, _checkValid);
2856          }
2857
2858        }
2859
2860      @Override
2861      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2862        switch (hash) {
2863        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2864        case -1526770491: /*applicability*/ return this.applicability == null ? new Base[0] : new Base[] {this.applicability}; // CodeableConcept
2865        case -31447799: /*qualifiers*/ return this.qualifiers == null ? new Base[0] : this.qualifiers.toArray(new Base[this.qualifiers.size()]); // CodeableConcept
2866        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Quantity
2867        default: return super.getProperty(hash, name, checkValid);
2868        }
2869
2870      }
2871
2872      @Override
2873      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2874        switch (hash) {
2875        case 3575610: // type
2876          this.type = castToCodeableConcept(value); // CodeableConcept
2877          return value;
2878        case -1526770491: // applicability
2879          this.applicability = castToCodeableConcept(value); // CodeableConcept
2880          return value;
2881        case -31447799: // qualifiers
2882          this.getQualifiers().add(castToCodeableConcept(value)); // CodeableConcept
2883          return value;
2884        case 111972721: // value
2885          this.value = castToQuantity(value); // Quantity
2886          return value;
2887        default: return super.setProperty(hash, name, value);
2888        }
2889
2890      }
2891
2892      @Override
2893      public Base setProperty(String name, Base value) throws FHIRException {
2894        if (name.equals("type")) {
2895          this.type = castToCodeableConcept(value); // CodeableConcept
2896        } else if (name.equals("applicability")) {
2897          this.applicability = castToCodeableConcept(value); // CodeableConcept
2898        } else if (name.equals("qualifiers")) {
2899          this.getQualifiers().add(castToCodeableConcept(value));
2900        } else if (name.equals("value")) {
2901          this.value = castToQuantity(value); // Quantity
2902        } else
2903          return super.setProperty(name, value);
2904        return value;
2905      }
2906
2907      @Override
2908      public Base makeProperty(int hash, String name) throws FHIRException {
2909        switch (hash) {
2910        case 3575610:  return getType(); 
2911        case -1526770491:  return getApplicability(); 
2912        case -31447799:  return addQualifiers(); 
2913        case 111972721:  return getValue(); 
2914        default: return super.makeProperty(hash, name);
2915        }
2916
2917      }
2918
2919      @Override
2920      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2921        switch (hash) {
2922        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2923        case -1526770491: /*applicability*/ return new String[] {"CodeableConcept"};
2924        case -31447799: /*qualifiers*/ return new String[] {"CodeableConcept"};
2925        case 111972721: /*value*/ return new String[] {"Quantity"};
2926        default: return super.getTypesForProperty(hash, name);
2927        }
2928
2929      }
2930
2931      @Override
2932      public Base addChild(String name) throws FHIRException {
2933        if (name.equals("type")) {
2934          this.type = new CodeableConcept();
2935          return this.type;
2936        }
2937        else if (name.equals("applicability")) {
2938          this.applicability = new CodeableConcept();
2939          return this.applicability;
2940        }
2941        else if (name.equals("qualifiers")) {
2942          return addQualifiers();
2943        }
2944        else if (name.equals("value")) {
2945          this.value = new Quantity();
2946          return this.value;
2947        }
2948        else
2949          return super.addChild(name);
2950      }
2951
2952      public PlanBenefitCostComponent copy() {
2953        PlanBenefitCostComponent dst = new PlanBenefitCostComponent();
2954        copyValues(dst);
2955        return dst;
2956      }
2957
2958      public void copyValues(PlanBenefitCostComponent dst) {
2959        super.copyValues(dst);
2960        dst.type = type == null ? null : type.copy();
2961        dst.applicability = applicability == null ? null : applicability.copy();
2962        if (qualifiers != null) {
2963          dst.qualifiers = new ArrayList<CodeableConcept>();
2964          for (CodeableConcept i : qualifiers)
2965            dst.qualifiers.add(i.copy());
2966        };
2967        dst.value = value == null ? null : value.copy();
2968      }
2969
2970      @Override
2971      public boolean equalsDeep(Base other_) {
2972        if (!super.equalsDeep(other_))
2973          return false;
2974        if (!(other_ instanceof PlanBenefitCostComponent))
2975          return false;
2976        PlanBenefitCostComponent o = (PlanBenefitCostComponent) other_;
2977        return compareDeep(type, o.type, true) && compareDeep(applicability, o.applicability, true) && compareDeep(qualifiers, o.qualifiers, true)
2978           && compareDeep(value, o.value, true);
2979      }
2980
2981      @Override
2982      public boolean equalsShallow(Base other_) {
2983        if (!super.equalsShallow(other_))
2984          return false;
2985        if (!(other_ instanceof PlanBenefitCostComponent))
2986          return false;
2987        PlanBenefitCostComponent o = (PlanBenefitCostComponent) other_;
2988        return true;
2989      }
2990
2991      public boolean isEmpty() {
2992        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, applicability, qualifiers
2993          , value);
2994      }
2995
2996  public String fhirType() {
2997    return "InsurancePlan.plan.specificCost.benefit.cost";
2998
2999  }
3000
3001  }
3002
3003    /**
3004     * Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.
3005     */
3006    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3007    @Description(shortDefinition="Business Identifier for Product", formalDefinition="Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server." )
3008    protected List<Identifier> identifier;
3009
3010    /**
3011     * The current state of the health insurance product.
3012     */
3013    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
3014    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The current state of the health insurance product." )
3015    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
3016    protected Enumeration<PublicationStatus> status;
3017
3018    /**
3019     * The kind of health insurance product.
3020     */
3021    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3022    @Description(shortDefinition="Kind of product", formalDefinition="The kind of health insurance product." )
3023    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/insuranceplan-type")
3024    protected List<CodeableConcept> type;
3025
3026    /**
3027     * Official name of the health insurance product as designated by the owner.
3028     */
3029    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
3030    @Description(shortDefinition="Official name", formalDefinition="Official name of the health insurance product as designated by the owner." )
3031    protected StringType name;
3032
3033    /**
3034     * A list of alternate names that the product is known as, or was known as in the past.
3035     */
3036    @Child(name = "alias", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3037    @Description(shortDefinition="Alternate names", formalDefinition="A list of alternate names that the product is known as, or was known as in the past." )
3038    protected List<StringType> alias;
3039
3040    /**
3041     * The period of time that the health insurance product is available.
3042     */
3043    @Child(name = "period", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=false)
3044    @Description(shortDefinition="When the product is available", formalDefinition="The period of time that the health insurance product is available." )
3045    protected Period period;
3046
3047    /**
3048     * The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.
3049     */
3050    @Child(name = "ownedBy", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
3051    @Description(shortDefinition="Plan issuer", formalDefinition="The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'." )
3052    protected Reference ownedBy;
3053
3054    /**
3055     * The actual object that is the target of the reference (The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.)
3056     */
3057    protected Organization ownedByTarget;
3058
3059    /**
3060     * An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.
3061     */
3062    @Child(name = "administeredBy", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
3063    @Description(shortDefinition="Product administrator", formalDefinition="An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner." )
3064    protected Reference administeredBy;
3065
3066    /**
3067     * The actual object that is the target of the reference (An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.)
3068     */
3069    protected Organization administeredByTarget;
3070
3071    /**
3072     * The geographic region in which a health insurance product's benefits apply.
3073     */
3074    @Child(name = "coverageArea", type = {Location.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3075    @Description(shortDefinition="Where product applies", formalDefinition="The geographic region in which a health insurance product's benefits apply." )
3076    protected List<Reference> coverageArea;
3077    /**
3078     * The actual objects that are the target of the reference (The geographic region in which a health insurance product's benefits apply.)
3079     */
3080    protected List<Location> coverageAreaTarget;
3081
3082
3083    /**
3084     * The contact for the health insurance product for a certain purpose.
3085     */
3086    @Child(name = "contact", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3087    @Description(shortDefinition="Contact for the product", formalDefinition="The contact for the health insurance product for a certain purpose." )
3088    protected List<InsurancePlanContactComponent> contact;
3089
3090    /**
3091     * The technical endpoints providing access to services operated for the health insurance product.
3092     */
3093    @Child(name = "endpoint", type = {Endpoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3094    @Description(shortDefinition="Technical endpoint", formalDefinition="The technical endpoints providing access to services operated for the health insurance product." )
3095    protected List<Reference> endpoint;
3096    /**
3097     * The actual objects that are the target of the reference (The technical endpoints providing access to services operated for the health insurance product.)
3098     */
3099    protected List<Endpoint> endpointTarget;
3100
3101
3102    /**
3103     * Reference to the network included in the health insurance product.
3104     */
3105    @Child(name = "network", type = {Organization.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3106    @Description(shortDefinition="What networks are Included", formalDefinition="Reference to the network included in the health insurance product." )
3107    protected List<Reference> network;
3108    /**
3109     * The actual objects that are the target of the reference (Reference to the network included in the health insurance product.)
3110     */
3111    protected List<Organization> networkTarget;
3112
3113
3114    /**
3115     * Details about the coverage offered by the insurance product.
3116     */
3117    @Child(name = "coverage", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3118    @Description(shortDefinition="Coverage details", formalDefinition="Details about the coverage offered by the insurance product." )
3119    protected List<InsurancePlanCoverageComponent> coverage;
3120
3121    /**
3122     * Details about an insurance plan.
3123     */
3124    @Child(name = "plan", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3125    @Description(shortDefinition="Plan details", formalDefinition="Details about an insurance plan." )
3126    protected List<InsurancePlanPlanComponent> plan;
3127
3128    private static final long serialVersionUID = -1910594688L;
3129
3130  /**
3131   * Constructor
3132   */
3133    public InsurancePlan() {
3134      super();
3135    }
3136
3137    /**
3138     * @return {@link #identifier} (Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.)
3139     */
3140    public List<Identifier> getIdentifier() { 
3141      if (this.identifier == null)
3142        this.identifier = new ArrayList<Identifier>();
3143      return this.identifier;
3144    }
3145
3146    /**
3147     * @return Returns a reference to <code>this</code> for easy method chaining
3148     */
3149    public InsurancePlan setIdentifier(List<Identifier> theIdentifier) { 
3150      this.identifier = theIdentifier;
3151      return this;
3152    }
3153
3154    public boolean hasIdentifier() { 
3155      if (this.identifier == null)
3156        return false;
3157      for (Identifier item : this.identifier)
3158        if (!item.isEmpty())
3159          return true;
3160      return false;
3161    }
3162
3163    public Identifier addIdentifier() { //3
3164      Identifier t = new Identifier();
3165      if (this.identifier == null)
3166        this.identifier = new ArrayList<Identifier>();
3167      this.identifier.add(t);
3168      return t;
3169    }
3170
3171    public InsurancePlan addIdentifier(Identifier t) { //3
3172      if (t == null)
3173        return this;
3174      if (this.identifier == null)
3175        this.identifier = new ArrayList<Identifier>();
3176      this.identifier.add(t);
3177      return this;
3178    }
3179
3180    /**
3181     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
3182     */
3183    public Identifier getIdentifierFirstRep() { 
3184      if (getIdentifier().isEmpty()) {
3185        addIdentifier();
3186      }
3187      return getIdentifier().get(0);
3188    }
3189
3190    /**
3191     * @return {@link #status} (The current state of the health insurance product.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3192     */
3193    public Enumeration<PublicationStatus> getStatusElement() { 
3194      if (this.status == null)
3195        if (Configuration.errorOnAutoCreate())
3196          throw new Error("Attempt to auto-create InsurancePlan.status");
3197        else if (Configuration.doAutoCreate())
3198          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
3199      return this.status;
3200    }
3201
3202    public boolean hasStatusElement() { 
3203      return this.status != null && !this.status.isEmpty();
3204    }
3205
3206    public boolean hasStatus() { 
3207      return this.status != null && !this.status.isEmpty();
3208    }
3209
3210    /**
3211     * @param value {@link #status} (The current state of the health insurance product.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3212     */
3213    public InsurancePlan setStatusElement(Enumeration<PublicationStatus> value) { 
3214      this.status = value;
3215      return this;
3216    }
3217
3218    /**
3219     * @return The current state of the health insurance product.
3220     */
3221    public PublicationStatus getStatus() { 
3222      return this.status == null ? null : this.status.getValue();
3223    }
3224
3225    /**
3226     * @param value The current state of the health insurance product.
3227     */
3228    public InsurancePlan setStatus(PublicationStatus value) { 
3229      if (value == null)
3230        this.status = null;
3231      else {
3232        if (this.status == null)
3233          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
3234        this.status.setValue(value);
3235      }
3236      return this;
3237    }
3238
3239    /**
3240     * @return {@link #type} (The kind of health insurance product.)
3241     */
3242    public List<CodeableConcept> getType() { 
3243      if (this.type == null)
3244        this.type = new ArrayList<CodeableConcept>();
3245      return this.type;
3246    }
3247
3248    /**
3249     * @return Returns a reference to <code>this</code> for easy method chaining
3250     */
3251    public InsurancePlan setType(List<CodeableConcept> theType) { 
3252      this.type = theType;
3253      return this;
3254    }
3255
3256    public boolean hasType() { 
3257      if (this.type == null)
3258        return false;
3259      for (CodeableConcept item : this.type)
3260        if (!item.isEmpty())
3261          return true;
3262      return false;
3263    }
3264
3265    public CodeableConcept addType() { //3
3266      CodeableConcept t = new CodeableConcept();
3267      if (this.type == null)
3268        this.type = new ArrayList<CodeableConcept>();
3269      this.type.add(t);
3270      return t;
3271    }
3272
3273    public InsurancePlan addType(CodeableConcept t) { //3
3274      if (t == null)
3275        return this;
3276      if (this.type == null)
3277        this.type = new ArrayList<CodeableConcept>();
3278      this.type.add(t);
3279      return this;
3280    }
3281
3282    /**
3283     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist
3284     */
3285    public CodeableConcept getTypeFirstRep() { 
3286      if (getType().isEmpty()) {
3287        addType();
3288      }
3289      return getType().get(0);
3290    }
3291
3292    /**
3293     * @return {@link #name} (Official name of the health insurance product as designated by the owner.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3294     */
3295    public StringType getNameElement() { 
3296      if (this.name == null)
3297        if (Configuration.errorOnAutoCreate())
3298          throw new Error("Attempt to auto-create InsurancePlan.name");
3299        else if (Configuration.doAutoCreate())
3300          this.name = new StringType(); // bb
3301      return this.name;
3302    }
3303
3304    public boolean hasNameElement() { 
3305      return this.name != null && !this.name.isEmpty();
3306    }
3307
3308    public boolean hasName() { 
3309      return this.name != null && !this.name.isEmpty();
3310    }
3311
3312    /**
3313     * @param value {@link #name} (Official name of the health insurance product as designated by the owner.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3314     */
3315    public InsurancePlan setNameElement(StringType value) { 
3316      this.name = value;
3317      return this;
3318    }
3319
3320    /**
3321     * @return Official name of the health insurance product as designated by the owner.
3322     */
3323    public String getName() { 
3324      return this.name == null ? null : this.name.getValue();
3325    }
3326
3327    /**
3328     * @param value Official name of the health insurance product as designated by the owner.
3329     */
3330    public InsurancePlan setName(String value) { 
3331      if (Utilities.noString(value))
3332        this.name = null;
3333      else {
3334        if (this.name == null)
3335          this.name = new StringType();
3336        this.name.setValue(value);
3337      }
3338      return this;
3339    }
3340
3341    /**
3342     * @return {@link #alias} (A list of alternate names that the product is known as, or was known as in the past.)
3343     */
3344    public List<StringType> getAlias() { 
3345      if (this.alias == null)
3346        this.alias = new ArrayList<StringType>();
3347      return this.alias;
3348    }
3349
3350    /**
3351     * @return Returns a reference to <code>this</code> for easy method chaining
3352     */
3353    public InsurancePlan setAlias(List<StringType> theAlias) { 
3354      this.alias = theAlias;
3355      return this;
3356    }
3357
3358    public boolean hasAlias() { 
3359      if (this.alias == null)
3360        return false;
3361      for (StringType item : this.alias)
3362        if (!item.isEmpty())
3363          return true;
3364      return false;
3365    }
3366
3367    /**
3368     * @return {@link #alias} (A list of alternate names that the product is known as, or was known as in the past.)
3369     */
3370    public StringType addAliasElement() {//2 
3371      StringType t = new StringType();
3372      if (this.alias == null)
3373        this.alias = new ArrayList<StringType>();
3374      this.alias.add(t);
3375      return t;
3376    }
3377
3378    /**
3379     * @param value {@link #alias} (A list of alternate names that the product is known as, or was known as in the past.)
3380     */
3381    public InsurancePlan addAlias(String value) { //1
3382      StringType t = new StringType();
3383      t.setValue(value);
3384      if (this.alias == null)
3385        this.alias = new ArrayList<StringType>();
3386      this.alias.add(t);
3387      return this;
3388    }
3389
3390    /**
3391     * @param value {@link #alias} (A list of alternate names that the product is known as, or was known as in the past.)
3392     */
3393    public boolean hasAlias(String value) { 
3394      if (this.alias == null)
3395        return false;
3396      for (StringType v : this.alias)
3397        if (v.getValue().equals(value)) // string
3398          return true;
3399      return false;
3400    }
3401
3402    /**
3403     * @return {@link #period} (The period of time that the health insurance product is available.)
3404     */
3405    public Period getPeriod() { 
3406      if (this.period == null)
3407        if (Configuration.errorOnAutoCreate())
3408          throw new Error("Attempt to auto-create InsurancePlan.period");
3409        else if (Configuration.doAutoCreate())
3410          this.period = new Period(); // cc
3411      return this.period;
3412    }
3413
3414    public boolean hasPeriod() { 
3415      return this.period != null && !this.period.isEmpty();
3416    }
3417
3418    /**
3419     * @param value {@link #period} (The period of time that the health insurance product is available.)
3420     */
3421    public InsurancePlan setPeriod(Period value) { 
3422      this.period = value;
3423      return this;
3424    }
3425
3426    /**
3427     * @return {@link #ownedBy} (The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.)
3428     */
3429    public Reference getOwnedBy() { 
3430      if (this.ownedBy == null)
3431        if (Configuration.errorOnAutoCreate())
3432          throw new Error("Attempt to auto-create InsurancePlan.ownedBy");
3433        else if (Configuration.doAutoCreate())
3434          this.ownedBy = new Reference(); // cc
3435      return this.ownedBy;
3436    }
3437
3438    public boolean hasOwnedBy() { 
3439      return this.ownedBy != null && !this.ownedBy.isEmpty();
3440    }
3441
3442    /**
3443     * @param value {@link #ownedBy} (The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.)
3444     */
3445    public InsurancePlan setOwnedBy(Reference value) { 
3446      this.ownedBy = value;
3447      return this;
3448    }
3449
3450    /**
3451     * @return {@link #ownedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.)
3452     */
3453    public Organization getOwnedByTarget() { 
3454      if (this.ownedByTarget == null)
3455        if (Configuration.errorOnAutoCreate())
3456          throw new Error("Attempt to auto-create InsurancePlan.ownedBy");
3457        else if (Configuration.doAutoCreate())
3458          this.ownedByTarget = new Organization(); // aa
3459      return this.ownedByTarget;
3460    }
3461
3462    /**
3463     * @param value {@link #ownedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.)
3464     */
3465    public InsurancePlan setOwnedByTarget(Organization value) { 
3466      this.ownedByTarget = value;
3467      return this;
3468    }
3469
3470    /**
3471     * @return {@link #administeredBy} (An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.)
3472     */
3473    public Reference getAdministeredBy() { 
3474      if (this.administeredBy == null)
3475        if (Configuration.errorOnAutoCreate())
3476          throw new Error("Attempt to auto-create InsurancePlan.administeredBy");
3477        else if (Configuration.doAutoCreate())
3478          this.administeredBy = new Reference(); // cc
3479      return this.administeredBy;
3480    }
3481
3482    public boolean hasAdministeredBy() { 
3483      return this.administeredBy != null && !this.administeredBy.isEmpty();
3484    }
3485
3486    /**
3487     * @param value {@link #administeredBy} (An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.)
3488     */
3489    public InsurancePlan setAdministeredBy(Reference value) { 
3490      this.administeredBy = value;
3491      return this;
3492    }
3493
3494    /**
3495     * @return {@link #administeredBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.)
3496     */
3497    public Organization getAdministeredByTarget() { 
3498      if (this.administeredByTarget == null)
3499        if (Configuration.errorOnAutoCreate())
3500          throw new Error("Attempt to auto-create InsurancePlan.administeredBy");
3501        else if (Configuration.doAutoCreate())
3502          this.administeredByTarget = new Organization(); // aa
3503      return this.administeredByTarget;
3504    }
3505
3506    /**
3507     * @param value {@link #administeredBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.)
3508     */
3509    public InsurancePlan setAdministeredByTarget(Organization value) { 
3510      this.administeredByTarget = value;
3511      return this;
3512    }
3513
3514    /**
3515     * @return {@link #coverageArea} (The geographic region in which a health insurance product's benefits apply.)
3516     */
3517    public List<Reference> getCoverageArea() { 
3518      if (this.coverageArea == null)
3519        this.coverageArea = new ArrayList<Reference>();
3520      return this.coverageArea;
3521    }
3522
3523    /**
3524     * @return Returns a reference to <code>this</code> for easy method chaining
3525     */
3526    public InsurancePlan setCoverageArea(List<Reference> theCoverageArea) { 
3527      this.coverageArea = theCoverageArea;
3528      return this;
3529    }
3530
3531    public boolean hasCoverageArea() { 
3532      if (this.coverageArea == null)
3533        return false;
3534      for (Reference item : this.coverageArea)
3535        if (!item.isEmpty())
3536          return true;
3537      return false;
3538    }
3539
3540    public Reference addCoverageArea() { //3
3541      Reference t = new Reference();
3542      if (this.coverageArea == null)
3543        this.coverageArea = new ArrayList<Reference>();
3544      this.coverageArea.add(t);
3545      return t;
3546    }
3547
3548    public InsurancePlan addCoverageArea(Reference t) { //3
3549      if (t == null)
3550        return this;
3551      if (this.coverageArea == null)
3552        this.coverageArea = new ArrayList<Reference>();
3553      this.coverageArea.add(t);
3554      return this;
3555    }
3556
3557    /**
3558     * @return The first repetition of repeating field {@link #coverageArea}, creating it if it does not already exist
3559     */
3560    public Reference getCoverageAreaFirstRep() { 
3561      if (getCoverageArea().isEmpty()) {
3562        addCoverageArea();
3563      }
3564      return getCoverageArea().get(0);
3565    }
3566
3567    /**
3568     * @deprecated Use Reference#setResource(IBaseResource) instead
3569     */
3570    @Deprecated
3571    public List<Location> getCoverageAreaTarget() { 
3572      if (this.coverageAreaTarget == null)
3573        this.coverageAreaTarget = new ArrayList<Location>();
3574      return this.coverageAreaTarget;
3575    }
3576
3577    /**
3578     * @deprecated Use Reference#setResource(IBaseResource) instead
3579     */
3580    @Deprecated
3581    public Location addCoverageAreaTarget() { 
3582      Location r = new Location();
3583      if (this.coverageAreaTarget == null)
3584        this.coverageAreaTarget = new ArrayList<Location>();
3585      this.coverageAreaTarget.add(r);
3586      return r;
3587    }
3588
3589    /**
3590     * @return {@link #contact} (The contact for the health insurance product for a certain purpose.)
3591     */
3592    public List<InsurancePlanContactComponent> getContact() { 
3593      if (this.contact == null)
3594        this.contact = new ArrayList<InsurancePlanContactComponent>();
3595      return this.contact;
3596    }
3597
3598    /**
3599     * @return Returns a reference to <code>this</code> for easy method chaining
3600     */
3601    public InsurancePlan setContact(List<InsurancePlanContactComponent> theContact) { 
3602      this.contact = theContact;
3603      return this;
3604    }
3605
3606    public boolean hasContact() { 
3607      if (this.contact == null)
3608        return false;
3609      for (InsurancePlanContactComponent item : this.contact)
3610        if (!item.isEmpty())
3611          return true;
3612      return false;
3613    }
3614
3615    public InsurancePlanContactComponent addContact() { //3
3616      InsurancePlanContactComponent t = new InsurancePlanContactComponent();
3617      if (this.contact == null)
3618        this.contact = new ArrayList<InsurancePlanContactComponent>();
3619      this.contact.add(t);
3620      return t;
3621    }
3622
3623    public InsurancePlan addContact(InsurancePlanContactComponent t) { //3
3624      if (t == null)
3625        return this;
3626      if (this.contact == null)
3627        this.contact = new ArrayList<InsurancePlanContactComponent>();
3628      this.contact.add(t);
3629      return this;
3630    }
3631
3632    /**
3633     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
3634     */
3635    public InsurancePlanContactComponent getContactFirstRep() { 
3636      if (getContact().isEmpty()) {
3637        addContact();
3638      }
3639      return getContact().get(0);
3640    }
3641
3642    /**
3643     * @return {@link #endpoint} (The technical endpoints providing access to services operated for the health insurance product.)
3644     */
3645    public List<Reference> getEndpoint() { 
3646      if (this.endpoint == null)
3647        this.endpoint = new ArrayList<Reference>();
3648      return this.endpoint;
3649    }
3650
3651    /**
3652     * @return Returns a reference to <code>this</code> for easy method chaining
3653     */
3654    public InsurancePlan setEndpoint(List<Reference> theEndpoint) { 
3655      this.endpoint = theEndpoint;
3656      return this;
3657    }
3658
3659    public boolean hasEndpoint() { 
3660      if (this.endpoint == null)
3661        return false;
3662      for (Reference item : this.endpoint)
3663        if (!item.isEmpty())
3664          return true;
3665      return false;
3666    }
3667
3668    public Reference addEndpoint() { //3
3669      Reference t = new Reference();
3670      if (this.endpoint == null)
3671        this.endpoint = new ArrayList<Reference>();
3672      this.endpoint.add(t);
3673      return t;
3674    }
3675
3676    public InsurancePlan addEndpoint(Reference t) { //3
3677      if (t == null)
3678        return this;
3679      if (this.endpoint == null)
3680        this.endpoint = new ArrayList<Reference>();
3681      this.endpoint.add(t);
3682      return this;
3683    }
3684
3685    /**
3686     * @return The first repetition of repeating field {@link #endpoint}, creating it if it does not already exist
3687     */
3688    public Reference getEndpointFirstRep() { 
3689      if (getEndpoint().isEmpty()) {
3690        addEndpoint();
3691      }
3692      return getEndpoint().get(0);
3693    }
3694
3695    /**
3696     * @deprecated Use Reference#setResource(IBaseResource) instead
3697     */
3698    @Deprecated
3699    public List<Endpoint> getEndpointTarget() { 
3700      if (this.endpointTarget == null)
3701        this.endpointTarget = new ArrayList<Endpoint>();
3702      return this.endpointTarget;
3703    }
3704
3705    /**
3706     * @deprecated Use Reference#setResource(IBaseResource) instead
3707     */
3708    @Deprecated
3709    public Endpoint addEndpointTarget() { 
3710      Endpoint r = new Endpoint();
3711      if (this.endpointTarget == null)
3712        this.endpointTarget = new ArrayList<Endpoint>();
3713      this.endpointTarget.add(r);
3714      return r;
3715    }
3716
3717    /**
3718     * @return {@link #network} (Reference to the network included in the health insurance product.)
3719     */
3720    public List<Reference> getNetwork() { 
3721      if (this.network == null)
3722        this.network = new ArrayList<Reference>();
3723      return this.network;
3724    }
3725
3726    /**
3727     * @return Returns a reference to <code>this</code> for easy method chaining
3728     */
3729    public InsurancePlan setNetwork(List<Reference> theNetwork) { 
3730      this.network = theNetwork;
3731      return this;
3732    }
3733
3734    public boolean hasNetwork() { 
3735      if (this.network == null)
3736        return false;
3737      for (Reference item : this.network)
3738        if (!item.isEmpty())
3739          return true;
3740      return false;
3741    }
3742
3743    public Reference addNetwork() { //3
3744      Reference t = new Reference();
3745      if (this.network == null)
3746        this.network = new ArrayList<Reference>();
3747      this.network.add(t);
3748      return t;
3749    }
3750
3751    public InsurancePlan addNetwork(Reference t) { //3
3752      if (t == null)
3753        return this;
3754      if (this.network == null)
3755        this.network = new ArrayList<Reference>();
3756      this.network.add(t);
3757      return this;
3758    }
3759
3760    /**
3761     * @return The first repetition of repeating field {@link #network}, creating it if it does not already exist
3762     */
3763    public Reference getNetworkFirstRep() { 
3764      if (getNetwork().isEmpty()) {
3765        addNetwork();
3766      }
3767      return getNetwork().get(0);
3768    }
3769
3770    /**
3771     * @deprecated Use Reference#setResource(IBaseResource) instead
3772     */
3773    @Deprecated
3774    public List<Organization> getNetworkTarget() { 
3775      if (this.networkTarget == null)
3776        this.networkTarget = new ArrayList<Organization>();
3777      return this.networkTarget;
3778    }
3779
3780    /**
3781     * @deprecated Use Reference#setResource(IBaseResource) instead
3782     */
3783    @Deprecated
3784    public Organization addNetworkTarget() { 
3785      Organization r = new Organization();
3786      if (this.networkTarget == null)
3787        this.networkTarget = new ArrayList<Organization>();
3788      this.networkTarget.add(r);
3789      return r;
3790    }
3791
3792    /**
3793     * @return {@link #coverage} (Details about the coverage offered by the insurance product.)
3794     */
3795    public List<InsurancePlanCoverageComponent> getCoverage() { 
3796      if (this.coverage == null)
3797        this.coverage = new ArrayList<InsurancePlanCoverageComponent>();
3798      return this.coverage;
3799    }
3800
3801    /**
3802     * @return Returns a reference to <code>this</code> for easy method chaining
3803     */
3804    public InsurancePlan setCoverage(List<InsurancePlanCoverageComponent> theCoverage) { 
3805      this.coverage = theCoverage;
3806      return this;
3807    }
3808
3809    public boolean hasCoverage() { 
3810      if (this.coverage == null)
3811        return false;
3812      for (InsurancePlanCoverageComponent item : this.coverage)
3813        if (!item.isEmpty())
3814          return true;
3815      return false;
3816    }
3817
3818    public InsurancePlanCoverageComponent addCoverage() { //3
3819      InsurancePlanCoverageComponent t = new InsurancePlanCoverageComponent();
3820      if (this.coverage == null)
3821        this.coverage = new ArrayList<InsurancePlanCoverageComponent>();
3822      this.coverage.add(t);
3823      return t;
3824    }
3825
3826    public InsurancePlan addCoverage(InsurancePlanCoverageComponent t) { //3
3827      if (t == null)
3828        return this;
3829      if (this.coverage == null)
3830        this.coverage = new ArrayList<InsurancePlanCoverageComponent>();
3831      this.coverage.add(t);
3832      return this;
3833    }
3834
3835    /**
3836     * @return The first repetition of repeating field {@link #coverage}, creating it if it does not already exist
3837     */
3838    public InsurancePlanCoverageComponent getCoverageFirstRep() { 
3839      if (getCoverage().isEmpty()) {
3840        addCoverage();
3841      }
3842      return getCoverage().get(0);
3843    }
3844
3845    /**
3846     * @return {@link #plan} (Details about an insurance plan.)
3847     */
3848    public List<InsurancePlanPlanComponent> getPlan() { 
3849      if (this.plan == null)
3850        this.plan = new ArrayList<InsurancePlanPlanComponent>();
3851      return this.plan;
3852    }
3853
3854    /**
3855     * @return Returns a reference to <code>this</code> for easy method chaining
3856     */
3857    public InsurancePlan setPlan(List<InsurancePlanPlanComponent> thePlan) { 
3858      this.plan = thePlan;
3859      return this;
3860    }
3861
3862    public boolean hasPlan() { 
3863      if (this.plan == null)
3864        return false;
3865      for (InsurancePlanPlanComponent item : this.plan)
3866        if (!item.isEmpty())
3867          return true;
3868      return false;
3869    }
3870
3871    public InsurancePlanPlanComponent addPlan() { //3
3872      InsurancePlanPlanComponent t = new InsurancePlanPlanComponent();
3873      if (this.plan == null)
3874        this.plan = new ArrayList<InsurancePlanPlanComponent>();
3875      this.plan.add(t);
3876      return t;
3877    }
3878
3879    public InsurancePlan addPlan(InsurancePlanPlanComponent t) { //3
3880      if (t == null)
3881        return this;
3882      if (this.plan == null)
3883        this.plan = new ArrayList<InsurancePlanPlanComponent>();
3884      this.plan.add(t);
3885      return this;
3886    }
3887
3888    /**
3889     * @return The first repetition of repeating field {@link #plan}, creating it if it does not already exist
3890     */
3891    public InsurancePlanPlanComponent getPlanFirstRep() { 
3892      if (getPlan().isEmpty()) {
3893        addPlan();
3894      }
3895      return getPlan().get(0);
3896    }
3897
3898      protected void listChildren(List<Property> children) {
3899        super.listChildren(children);
3900        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
3901        children.add(new Property("status", "code", "The current state of the health insurance product.", 0, 1, status));
3902        children.add(new Property("type", "CodeableConcept", "The kind of health insurance product.", 0, java.lang.Integer.MAX_VALUE, type));
3903        children.add(new Property("name", "string", "Official name of the health insurance product as designated by the owner.", 0, 1, name));
3904        children.add(new Property("alias", "string", "A list of alternate names that the product is known as, or was known as in the past.", 0, java.lang.Integer.MAX_VALUE, alias));
3905        children.add(new Property("period", "Period", "The period of time that the health insurance product is available.", 0, 1, period));
3906        children.add(new Property("ownedBy", "Reference(Organization)", "The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.", 0, 1, ownedBy));
3907        children.add(new Property("administeredBy", "Reference(Organization)", "An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.", 0, 1, administeredBy));
3908        children.add(new Property("coverageArea", "Reference(Location)", "The geographic region in which a health insurance product's benefits apply.", 0, java.lang.Integer.MAX_VALUE, coverageArea));
3909        children.add(new Property("contact", "", "The contact for the health insurance product for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact));
3910        children.add(new Property("endpoint", "Reference(Endpoint)", "The technical endpoints providing access to services operated for the health insurance product.", 0, java.lang.Integer.MAX_VALUE, endpoint));
3911        children.add(new Property("network", "Reference(Organization)", "Reference to the network included in the health insurance product.", 0, java.lang.Integer.MAX_VALUE, network));
3912        children.add(new Property("coverage", "", "Details about the coverage offered by the insurance product.", 0, java.lang.Integer.MAX_VALUE, coverage));
3913        children.add(new Property("plan", "", "Details about an insurance plan.", 0, java.lang.Integer.MAX_VALUE, plan));
3914      }
3915
3916      @Override
3917      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3918        switch (_hash) {
3919        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
3920        case -892481550: /*status*/  return new Property("status", "code", "The current state of the health insurance product.", 0, 1, status);
3921        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The kind of health insurance product.", 0, java.lang.Integer.MAX_VALUE, type);
3922        case 3373707: /*name*/  return new Property("name", "string", "Official name of the health insurance product as designated by the owner.", 0, 1, name);
3923        case 92902992: /*alias*/  return new Property("alias", "string", "A list of alternate names that the product is known as, or was known as in the past.", 0, java.lang.Integer.MAX_VALUE, alias);
3924        case -991726143: /*period*/  return new Property("period", "Period", "The period of time that the health insurance product is available.", 0, 1, period);
3925        case -1054743076: /*ownedBy*/  return new Property("ownedBy", "Reference(Organization)", "The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.", 0, 1, ownedBy);
3926        case 898770462: /*administeredBy*/  return new Property("administeredBy", "Reference(Organization)", "An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.", 0, 1, administeredBy);
3927        case -1532328299: /*coverageArea*/  return new Property("coverageArea", "Reference(Location)", "The geographic region in which a health insurance product's benefits apply.", 0, java.lang.Integer.MAX_VALUE, coverageArea);
3928        case 951526432: /*contact*/  return new Property("contact", "", "The contact for the health insurance product for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact);
3929        case 1741102485: /*endpoint*/  return new Property("endpoint", "Reference(Endpoint)", "The technical endpoints providing access to services operated for the health insurance product.", 0, java.lang.Integer.MAX_VALUE, endpoint);
3930        case 1843485230: /*network*/  return new Property("network", "Reference(Organization)", "Reference to the network included in the health insurance product.", 0, java.lang.Integer.MAX_VALUE, network);
3931        case -351767064: /*coverage*/  return new Property("coverage", "", "Details about the coverage offered by the insurance product.", 0, java.lang.Integer.MAX_VALUE, coverage);
3932        case 3443497: /*plan*/  return new Property("plan", "", "Details about an insurance plan.", 0, java.lang.Integer.MAX_VALUE, plan);
3933        default: return super.getNamedProperty(_hash, _name, _checkValid);
3934        }
3935
3936      }
3937
3938      @Override
3939      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3940        switch (hash) {
3941        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3942        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3943        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3944        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3945        case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType
3946        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
3947        case -1054743076: /*ownedBy*/ return this.ownedBy == null ? new Base[0] : new Base[] {this.ownedBy}; // Reference
3948        case 898770462: /*administeredBy*/ return this.administeredBy == null ? new Base[0] : new Base[] {this.administeredBy}; // Reference
3949        case -1532328299: /*coverageArea*/ return this.coverageArea == null ? new Base[0] : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference
3950        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // InsurancePlanContactComponent
3951        case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // Reference
3952        case 1843485230: /*network*/ return this.network == null ? new Base[0] : this.network.toArray(new Base[this.network.size()]); // Reference
3953        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // InsurancePlanCoverageComponent
3954        case 3443497: /*plan*/ return this.plan == null ? new Base[0] : this.plan.toArray(new Base[this.plan.size()]); // InsurancePlanPlanComponent
3955        default: return super.getProperty(hash, name, checkValid);
3956        }
3957
3958      }
3959
3960      @Override
3961      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3962        switch (hash) {
3963        case -1618432855: // identifier
3964          this.getIdentifier().add(castToIdentifier(value)); // Identifier
3965          return value;
3966        case -892481550: // status
3967          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
3968          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3969          return value;
3970        case 3575610: // type
3971          this.getType().add(castToCodeableConcept(value)); // CodeableConcept
3972          return value;
3973        case 3373707: // name
3974          this.name = castToString(value); // StringType
3975          return value;
3976        case 92902992: // alias
3977          this.getAlias().add(castToString(value)); // StringType
3978          return value;
3979        case -991726143: // period
3980          this.period = castToPeriod(value); // Period
3981          return value;
3982        case -1054743076: // ownedBy
3983          this.ownedBy = castToReference(value); // Reference
3984          return value;
3985        case 898770462: // administeredBy
3986          this.administeredBy = castToReference(value); // Reference
3987          return value;
3988        case -1532328299: // coverageArea
3989          this.getCoverageArea().add(castToReference(value)); // Reference
3990          return value;
3991        case 951526432: // contact
3992          this.getContact().add((InsurancePlanContactComponent) value); // InsurancePlanContactComponent
3993          return value;
3994        case 1741102485: // endpoint
3995          this.getEndpoint().add(castToReference(value)); // Reference
3996          return value;
3997        case 1843485230: // network
3998          this.getNetwork().add(castToReference(value)); // Reference
3999          return value;
4000        case -351767064: // coverage
4001          this.getCoverage().add((InsurancePlanCoverageComponent) value); // InsurancePlanCoverageComponent
4002          return value;
4003        case 3443497: // plan
4004          this.getPlan().add((InsurancePlanPlanComponent) value); // InsurancePlanPlanComponent
4005          return value;
4006        default: return super.setProperty(hash, name, value);
4007        }
4008
4009      }
4010
4011      @Override
4012      public Base setProperty(String name, Base value) throws FHIRException {
4013        if (name.equals("identifier")) {
4014          this.getIdentifier().add(castToIdentifier(value));
4015        } else if (name.equals("status")) {
4016          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
4017          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4018        } else if (name.equals("type")) {
4019          this.getType().add(castToCodeableConcept(value));
4020        } else if (name.equals("name")) {
4021          this.name = castToString(value); // StringType
4022        } else if (name.equals("alias")) {
4023          this.getAlias().add(castToString(value));
4024        } else if (name.equals("period")) {
4025          this.period = castToPeriod(value); // Period
4026        } else if (name.equals("ownedBy")) {
4027          this.ownedBy = castToReference(value); // Reference
4028        } else if (name.equals("administeredBy")) {
4029          this.administeredBy = castToReference(value); // Reference
4030        } else if (name.equals("coverageArea")) {
4031          this.getCoverageArea().add(castToReference(value));
4032        } else if (name.equals("contact")) {
4033          this.getContact().add((InsurancePlanContactComponent) value);
4034        } else if (name.equals("endpoint")) {
4035          this.getEndpoint().add(castToReference(value));
4036        } else if (name.equals("network")) {
4037          this.getNetwork().add(castToReference(value));
4038        } else if (name.equals("coverage")) {
4039          this.getCoverage().add((InsurancePlanCoverageComponent) value);
4040        } else if (name.equals("plan")) {
4041          this.getPlan().add((InsurancePlanPlanComponent) value);
4042        } else
4043          return super.setProperty(name, value);
4044        return value;
4045      }
4046
4047      @Override
4048      public Base makeProperty(int hash, String name) throws FHIRException {
4049        switch (hash) {
4050        case -1618432855:  return addIdentifier(); 
4051        case -892481550:  return getStatusElement();
4052        case 3575610:  return addType(); 
4053        case 3373707:  return getNameElement();
4054        case 92902992:  return addAliasElement();
4055        case -991726143:  return getPeriod(); 
4056        case -1054743076:  return getOwnedBy(); 
4057        case 898770462:  return getAdministeredBy(); 
4058        case -1532328299:  return addCoverageArea(); 
4059        case 951526432:  return addContact(); 
4060        case 1741102485:  return addEndpoint(); 
4061        case 1843485230:  return addNetwork(); 
4062        case -351767064:  return addCoverage(); 
4063        case 3443497:  return addPlan(); 
4064        default: return super.makeProperty(hash, name);
4065        }
4066
4067      }
4068
4069      @Override
4070      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4071        switch (hash) {
4072        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4073        case -892481550: /*status*/ return new String[] {"code"};
4074        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4075        case 3373707: /*name*/ return new String[] {"string"};
4076        case 92902992: /*alias*/ return new String[] {"string"};
4077        case -991726143: /*period*/ return new String[] {"Period"};
4078        case -1054743076: /*ownedBy*/ return new String[] {"Reference"};
4079        case 898770462: /*administeredBy*/ return new String[] {"Reference"};
4080        case -1532328299: /*coverageArea*/ return new String[] {"Reference"};
4081        case 951526432: /*contact*/ return new String[] {};
4082        case 1741102485: /*endpoint*/ return new String[] {"Reference"};
4083        case 1843485230: /*network*/ return new String[] {"Reference"};
4084        case -351767064: /*coverage*/ return new String[] {};
4085        case 3443497: /*plan*/ return new String[] {};
4086        default: return super.getTypesForProperty(hash, name);
4087        }
4088
4089      }
4090
4091      @Override
4092      public Base addChild(String name) throws FHIRException {
4093        if (name.equals("identifier")) {
4094          return addIdentifier();
4095        }
4096        else if (name.equals("status")) {
4097          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.status");
4098        }
4099        else if (name.equals("type")) {
4100          return addType();
4101        }
4102        else if (name.equals("name")) {
4103          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.name");
4104        }
4105        else if (name.equals("alias")) {
4106          throw new FHIRException("Cannot call addChild on a primitive type InsurancePlan.alias");
4107        }
4108        else if (name.equals("period")) {
4109          this.period = new Period();
4110          return this.period;
4111        }
4112        else if (name.equals("ownedBy")) {
4113          this.ownedBy = new Reference();
4114          return this.ownedBy;
4115        }
4116        else if (name.equals("administeredBy")) {
4117          this.administeredBy = new Reference();
4118          return this.administeredBy;
4119        }
4120        else if (name.equals("coverageArea")) {
4121          return addCoverageArea();
4122        }
4123        else if (name.equals("contact")) {
4124          return addContact();
4125        }
4126        else if (name.equals("endpoint")) {
4127          return addEndpoint();
4128        }
4129        else if (name.equals("network")) {
4130          return addNetwork();
4131        }
4132        else if (name.equals("coverage")) {
4133          return addCoverage();
4134        }
4135        else if (name.equals("plan")) {
4136          return addPlan();
4137        }
4138        else
4139          return super.addChild(name);
4140      }
4141
4142  public String fhirType() {
4143    return "InsurancePlan";
4144
4145  }
4146
4147      public InsurancePlan copy() {
4148        InsurancePlan dst = new InsurancePlan();
4149        copyValues(dst);
4150        return dst;
4151      }
4152
4153      public void copyValues(InsurancePlan dst) {
4154        super.copyValues(dst);
4155        if (identifier != null) {
4156          dst.identifier = new ArrayList<Identifier>();
4157          for (Identifier i : identifier)
4158            dst.identifier.add(i.copy());
4159        };
4160        dst.status = status == null ? null : status.copy();
4161        if (type != null) {
4162          dst.type = new ArrayList<CodeableConcept>();
4163          for (CodeableConcept i : type)
4164            dst.type.add(i.copy());
4165        };
4166        dst.name = name == null ? null : name.copy();
4167        if (alias != null) {
4168          dst.alias = new ArrayList<StringType>();
4169          for (StringType i : alias)
4170            dst.alias.add(i.copy());
4171        };
4172        dst.period = period == null ? null : period.copy();
4173        dst.ownedBy = ownedBy == null ? null : ownedBy.copy();
4174        dst.administeredBy = administeredBy == null ? null : administeredBy.copy();
4175        if (coverageArea != null) {
4176          dst.coverageArea = new ArrayList<Reference>();
4177          for (Reference i : coverageArea)
4178            dst.coverageArea.add(i.copy());
4179        };
4180        if (contact != null) {
4181          dst.contact = new ArrayList<InsurancePlanContactComponent>();
4182          for (InsurancePlanContactComponent i : contact)
4183            dst.contact.add(i.copy());
4184        };
4185        if (endpoint != null) {
4186          dst.endpoint = new ArrayList<Reference>();
4187          for (Reference i : endpoint)
4188            dst.endpoint.add(i.copy());
4189        };
4190        if (network != null) {
4191          dst.network = new ArrayList<Reference>();
4192          for (Reference i : network)
4193            dst.network.add(i.copy());
4194        };
4195        if (coverage != null) {
4196          dst.coverage = new ArrayList<InsurancePlanCoverageComponent>();
4197          for (InsurancePlanCoverageComponent i : coverage)
4198            dst.coverage.add(i.copy());
4199        };
4200        if (plan != null) {
4201          dst.plan = new ArrayList<InsurancePlanPlanComponent>();
4202          for (InsurancePlanPlanComponent i : plan)
4203            dst.plan.add(i.copy());
4204        };
4205      }
4206
4207      protected InsurancePlan typedCopy() {
4208        return copy();
4209      }
4210
4211      @Override
4212      public boolean equalsDeep(Base other_) {
4213        if (!super.equalsDeep(other_))
4214          return false;
4215        if (!(other_ instanceof InsurancePlan))
4216          return false;
4217        InsurancePlan o = (InsurancePlan) other_;
4218        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true)
4219           && compareDeep(name, o.name, true) && compareDeep(alias, o.alias, true) && compareDeep(period, o.period, true)
4220           && compareDeep(ownedBy, o.ownedBy, true) && compareDeep(administeredBy, o.administeredBy, true)
4221           && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(contact, o.contact, true) && compareDeep(endpoint, o.endpoint, true)
4222           && compareDeep(network, o.network, true) && compareDeep(coverage, o.coverage, true) && compareDeep(plan, o.plan, true)
4223          ;
4224      }
4225
4226      @Override
4227      public boolean equalsShallow(Base other_) {
4228        if (!super.equalsShallow(other_))
4229          return false;
4230        if (!(other_ instanceof InsurancePlan))
4231          return false;
4232        InsurancePlan o = (InsurancePlan) other_;
4233        return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(alias, o.alias, true)
4234          ;
4235      }
4236
4237      public boolean isEmpty() {
4238        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, type
4239          , name, alias, period, ownedBy, administeredBy, coverageArea, contact, endpoint
4240          , network, coverage, plan);
4241      }
4242
4243  @Override
4244  public ResourceType getResourceType() {
4245    return ResourceType.InsurancePlan;
4246   }
4247
4248 /**
4249   * Search parameter: <b>identifier</b>
4250   * <p>
4251   * Description: <b>Any identifier for the organization (not the accreditation issuer's identifier)</b><br>
4252   * Type: <b>token</b><br>
4253   * Path: <b>InsurancePlan.identifier</b><br>
4254   * </p>
4255   */
4256  @SearchParamDefinition(name="identifier", path="InsurancePlan.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" )
4257  public static final String SP_IDENTIFIER = "identifier";
4258 /**
4259   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4260   * <p>
4261   * Description: <b>Any identifier for the organization (not the accreditation issuer's identifier)</b><br>
4262   * Type: <b>token</b><br>
4263   * Path: <b>InsurancePlan.identifier</b><br>
4264   * </p>
4265   */
4266  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4267
4268 /**
4269   * Search parameter: <b>address</b>
4270   * <p>
4271   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text</b><br>
4272   * Type: <b>string</b><br>
4273   * Path: <b>InsurancePlan.contact.address</b><br>
4274   * </p>
4275   */
4276  @SearchParamDefinition(name="address", path="InsurancePlan.contact.address", description="A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text", type="string" )
4277  public static final String SP_ADDRESS = "address";
4278 /**
4279   * <b>Fluent Client</b> search parameter constant for <b>address</b>
4280   * <p>
4281   * Description: <b>A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text</b><br>
4282   * Type: <b>string</b><br>
4283   * Path: <b>InsurancePlan.contact.address</b><br>
4284   * </p>
4285   */
4286  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS);
4287
4288 /**
4289   * Search parameter: <b>address-state</b>
4290   * <p>
4291   * Description: <b>A state specified in an address</b><br>
4292   * Type: <b>string</b><br>
4293   * Path: <b>InsurancePlan.contact.address.state</b><br>
4294   * </p>
4295   */
4296  @SearchParamDefinition(name="address-state", path="InsurancePlan.contact.address.state", description="A state specified in an address", type="string" )
4297  public static final String SP_ADDRESS_STATE = "address-state";
4298 /**
4299   * <b>Fluent Client</b> search parameter constant for <b>address-state</b>
4300   * <p>
4301   * Description: <b>A state specified in an address</b><br>
4302   * Type: <b>string</b><br>
4303   * Path: <b>InsurancePlan.contact.address.state</b><br>
4304   * </p>
4305   */
4306  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE);
4307
4308 /**
4309   * Search parameter: <b>owned-by</b>
4310   * <p>
4311   * Description: <b>An organization of which this organization forms a part</b><br>
4312   * Type: <b>reference</b><br>
4313   * Path: <b>InsurancePlan.ownedBy</b><br>
4314   * </p>
4315   */
4316  @SearchParamDefinition(name="owned-by", path="InsurancePlan.ownedBy", description="An organization of which this organization forms a part", type="reference", target={Organization.class } )
4317  public static final String SP_OWNED_BY = "owned-by";
4318 /**
4319   * <b>Fluent Client</b> search parameter constant for <b>owned-by</b>
4320   * <p>
4321   * Description: <b>An organization of which this organization forms a part</b><br>
4322   * Type: <b>reference</b><br>
4323   * Path: <b>InsurancePlan.ownedBy</b><br>
4324   * </p>
4325   */
4326  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNED_BY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNED_BY);
4327
4328/**
4329   * Constant for fluent queries to be used to add include statements. Specifies
4330   * the path value of "<b>InsurancePlan:owned-by</b>".
4331   */
4332  public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNED_BY = new ca.uhn.fhir.model.api.Include("InsurancePlan:owned-by").toLocked();
4333
4334 /**
4335   * Search parameter: <b>type</b>
4336   * <p>
4337   * Description: <b>A code for the type of organization</b><br>
4338   * Type: <b>token</b><br>
4339   * Path: <b>InsurancePlan.type</b><br>
4340   * </p>
4341   */
4342  @SearchParamDefinition(name="type", path="InsurancePlan.type", description="A code for the type of organization", type="token" )
4343  public static final String SP_TYPE = "type";
4344 /**
4345   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4346   * <p>
4347   * Description: <b>A code for the type of organization</b><br>
4348   * Type: <b>token</b><br>
4349   * Path: <b>InsurancePlan.type</b><br>
4350   * </p>
4351   */
4352  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4353
4354 /**
4355   * Search parameter: <b>address-postalcode</b>
4356   * <p>
4357   * Description: <b>A postal code specified in an address</b><br>
4358   * Type: <b>string</b><br>
4359   * Path: <b>InsurancePlan.contact.address.postalCode</b><br>
4360   * </p>
4361   */
4362  @SearchParamDefinition(name="address-postalcode", path="InsurancePlan.contact.address.postalCode", description="A postal code specified in an address", type="string" )
4363  public static final String SP_ADDRESS_POSTALCODE = "address-postalcode";
4364 /**
4365   * <b>Fluent Client</b> search parameter constant for <b>address-postalcode</b>
4366   * <p>
4367   * Description: <b>A postal code specified in an address</b><br>
4368   * Type: <b>string</b><br>
4369   * Path: <b>InsurancePlan.contact.address.postalCode</b><br>
4370   * </p>
4371   */
4372  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE);
4373
4374 /**
4375   * Search parameter: <b>administered-by</b>
4376   * <p>
4377   * Description: <b>Product administrator</b><br>
4378   * Type: <b>reference</b><br>
4379   * Path: <b>InsurancePlan.administeredBy</b><br>
4380   * </p>
4381   */
4382  @SearchParamDefinition(name="administered-by", path="InsurancePlan.administeredBy", description="Product administrator", type="reference", target={Organization.class } )
4383  public static final String SP_ADMINISTERED_BY = "administered-by";
4384 /**
4385   * <b>Fluent Client</b> search parameter constant for <b>administered-by</b>
4386   * <p>
4387   * Description: <b>Product administrator</b><br>
4388   * Type: <b>reference</b><br>
4389   * Path: <b>InsurancePlan.administeredBy</b><br>
4390   * </p>
4391   */
4392  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ADMINISTERED_BY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ADMINISTERED_BY);
4393
4394/**
4395   * Constant for fluent queries to be used to add include statements. Specifies
4396   * the path value of "<b>InsurancePlan:administered-by</b>".
4397   */
4398  public static final ca.uhn.fhir.model.api.Include INCLUDE_ADMINISTERED_BY = new ca.uhn.fhir.model.api.Include("InsurancePlan:administered-by").toLocked();
4399
4400 /**
4401   * Search parameter: <b>address-country</b>
4402   * <p>
4403   * Description: <b>A country specified in an address</b><br>
4404   * Type: <b>string</b><br>
4405   * Path: <b>InsurancePlan.contact.address.country</b><br>
4406   * </p>
4407   */
4408  @SearchParamDefinition(name="address-country", path="InsurancePlan.contact.address.country", description="A country specified in an address", type="string" )
4409  public static final String SP_ADDRESS_COUNTRY = "address-country";
4410 /**
4411   * <b>Fluent Client</b> search parameter constant for <b>address-country</b>
4412   * <p>
4413   * Description: <b>A country specified in an address</b><br>
4414   * Type: <b>string</b><br>
4415   * Path: <b>InsurancePlan.contact.address.country</b><br>
4416   * </p>
4417   */
4418  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY);
4419
4420 /**
4421   * Search parameter: <b>endpoint</b>
4422   * <p>
4423   * Description: <b>Technical endpoint</b><br>
4424   * Type: <b>reference</b><br>
4425   * Path: <b>InsurancePlan.endpoint</b><br>
4426   * </p>
4427   */
4428  @SearchParamDefinition(name="endpoint", path="InsurancePlan.endpoint", description="Technical endpoint", type="reference", target={Endpoint.class } )
4429  public static final String SP_ENDPOINT = "endpoint";
4430 /**
4431   * <b>Fluent Client</b> search parameter constant for <b>endpoint</b>
4432   * <p>
4433   * Description: <b>Technical endpoint</b><br>
4434   * Type: <b>reference</b><br>
4435   * Path: <b>InsurancePlan.endpoint</b><br>
4436   * </p>
4437   */
4438  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENDPOINT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENDPOINT);
4439
4440/**
4441   * Constant for fluent queries to be used to add include statements. Specifies
4442   * the path value of "<b>InsurancePlan:endpoint</b>".
4443   */
4444  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENDPOINT = new ca.uhn.fhir.model.api.Include("InsurancePlan:endpoint").toLocked();
4445
4446 /**
4447   * Search parameter: <b>phonetic</b>
4448   * <p>
4449   * Description: <b>A portion of the organization's name using some kind of phonetic matching algorithm</b><br>
4450   * Type: <b>string</b><br>
4451   * Path: <b>InsurancePlan.name</b><br>
4452   * </p>
4453   */
4454  @SearchParamDefinition(name="phonetic", path="InsurancePlan.name", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" )
4455  public static final String SP_PHONETIC = "phonetic";
4456 /**
4457   * <b>Fluent Client</b> search parameter constant for <b>phonetic</b>
4458   * <p>
4459   * Description: <b>A portion of the organization's name using some kind of phonetic matching algorithm</b><br>
4460   * Type: <b>string</b><br>
4461   * Path: <b>InsurancePlan.name</b><br>
4462   * </p>
4463   */
4464  public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC);
4465
4466 /**
4467   * Search parameter: <b>name</b>
4468   * <p>
4469   * Description: <b>A portion of the organization's name or alias</b><br>
4470   * Type: <b>string</b><br>
4471   * Path: <b>InsurancePlan.name, InsurancePlan.alias</b><br>
4472   * </p>
4473   */
4474  @SearchParamDefinition(name="name", path="name | alias", description="A portion of the organization's name or alias", type="string" )
4475  public static final String SP_NAME = "name";
4476 /**
4477   * <b>Fluent Client</b> search parameter constant for <b>name</b>
4478   * <p>
4479   * Description: <b>A portion of the organization's name or alias</b><br>
4480   * Type: <b>string</b><br>
4481   * Path: <b>InsurancePlan.name, InsurancePlan.alias</b><br>
4482   * </p>
4483   */
4484  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
4485
4486 /**
4487   * Search parameter: <b>address-use</b>
4488   * <p>
4489   * Description: <b>A use code specified in an address</b><br>
4490   * Type: <b>token</b><br>
4491   * Path: <b>InsurancePlan.contact.address.use</b><br>
4492   * </p>
4493   */
4494  @SearchParamDefinition(name="address-use", path="InsurancePlan.contact.address.use", description="A use code specified in an address", type="token" )
4495  public static final String SP_ADDRESS_USE = "address-use";
4496 /**
4497   * <b>Fluent Client</b> search parameter constant for <b>address-use</b>
4498   * <p>
4499   * Description: <b>A use code specified in an address</b><br>
4500   * Type: <b>token</b><br>
4501   * Path: <b>InsurancePlan.contact.address.use</b><br>
4502   * </p>
4503   */
4504  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE);
4505
4506 /**
4507   * Search parameter: <b>address-city</b>
4508   * <p>
4509   * Description: <b>A city specified in an address</b><br>
4510   * Type: <b>string</b><br>
4511   * Path: <b>InsurancePlan.contact.address.city</b><br>
4512   * </p>
4513   */
4514  @SearchParamDefinition(name="address-city", path="InsurancePlan.contact.address.city", description="A city specified in an address", type="string" )
4515  public static final String SP_ADDRESS_CITY = "address-city";
4516 /**
4517   * <b>Fluent Client</b> search parameter constant for <b>address-city</b>
4518   * <p>
4519   * Description: <b>A city specified in an address</b><br>
4520   * Type: <b>string</b><br>
4521   * Path: <b>InsurancePlan.contact.address.city</b><br>
4522   * </p>
4523   */
4524  public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY);
4525
4526 /**
4527   * Search parameter: <b>status</b>
4528   * <p>
4529   * Description: <b>Is the Organization record active</b><br>
4530   * Type: <b>token</b><br>
4531   * Path: <b>InsurancePlan.status</b><br>
4532   * </p>
4533   */
4534  @SearchParamDefinition(name="status", path="InsurancePlan.status", description="Is the Organization record active", type="token" )
4535  public static final String SP_STATUS = "status";
4536 /**
4537   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4538   * <p>
4539   * Description: <b>Is the Organization record active</b><br>
4540   * Type: <b>token</b><br>
4541   * Path: <b>InsurancePlan.status</b><br>
4542   * </p>
4543   */
4544  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4545
4546
4547}