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