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