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