001package org.hl7.fhir.dstu2016may.model;
002
003import java.math.BigDecimal;
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
041import org.hl7.fhir.utilities.Utilities;
042
043import ca.uhn.fhir.model.api.annotation.Block;
044import ca.uhn.fhir.model.api.annotation.Child;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.ResourceDef;
047import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
048/**
049 * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.
050 */
051@ResourceDef(name="Claim", profile="http://hl7.org/fhir/Profile/Claim")
052public class Claim extends DomainResource {
053
054    public enum ClaimType {
055        /**
056         * A claim for Institution based, typically in-patient, goods and services.
057         */
058        INSTITUTIONAL, 
059        /**
060         * A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services.
061         */
062        ORAL, 
063        /**
064         * A claim for Pharmacy based goods and services.
065         */
066        PHARMACY, 
067        /**
068         * A claim for Professional, typically out-patient, goods and services.
069         */
070        PROFESSIONAL, 
071        /**
072         * A claim for Vision (Opthamologist, Optometrist and Optician) goods and services.
073         */
074        VISION, 
075        /**
076         * added to help the parsers
077         */
078        NULL;
079        public static ClaimType fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("institutional".equals(codeString))
083          return INSTITUTIONAL;
084        if ("oral".equals(codeString))
085          return ORAL;
086        if ("pharmacy".equals(codeString))
087          return PHARMACY;
088        if ("professional".equals(codeString))
089          return PROFESSIONAL;
090        if ("vision".equals(codeString))
091          return VISION;
092        throw new FHIRException("Unknown ClaimType code '"+codeString+"'");
093        }
094        public String toCode() {
095          switch (this) {
096            case INSTITUTIONAL: return "institutional";
097            case ORAL: return "oral";
098            case PHARMACY: return "pharmacy";
099            case PROFESSIONAL: return "professional";
100            case VISION: return "vision";
101            default: return "?";
102          }
103        }
104        public String getSystem() {
105          switch (this) {
106            case INSTITUTIONAL: return "http://hl7.org/fhir/claim-type-link";
107            case ORAL: return "http://hl7.org/fhir/claim-type-link";
108            case PHARMACY: return "http://hl7.org/fhir/claim-type-link";
109            case PROFESSIONAL: return "http://hl7.org/fhir/claim-type-link";
110            case VISION: return "http://hl7.org/fhir/claim-type-link";
111            default: return "?";
112          }
113        }
114        public String getDefinition() {
115          switch (this) {
116            case INSTITUTIONAL: return "A claim for Institution based, typically in-patient, goods and services.";
117            case ORAL: return "A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services.";
118            case PHARMACY: return "A claim for Pharmacy based goods and services.";
119            case PROFESSIONAL: return "A claim for Professional, typically out-patient, goods and services.";
120            case VISION: return "A claim for Vision (Opthamologist, Optometrist and Optician) goods and services.";
121            default: return "?";
122          }
123        }
124        public String getDisplay() {
125          switch (this) {
126            case INSTITUTIONAL: return "Institutional";
127            case ORAL: return "Oral Health";
128            case PHARMACY: return "Pharmacy";
129            case PROFESSIONAL: return "Professional";
130            case VISION: return "Vision";
131            default: return "?";
132          }
133        }
134    }
135
136  public static class ClaimTypeEnumFactory implements EnumFactory<ClaimType> {
137    public ClaimType fromCode(String codeString) throws IllegalArgumentException {
138      if (codeString == null || "".equals(codeString))
139            if (codeString == null || "".equals(codeString))
140                return null;
141        if ("institutional".equals(codeString))
142          return ClaimType.INSTITUTIONAL;
143        if ("oral".equals(codeString))
144          return ClaimType.ORAL;
145        if ("pharmacy".equals(codeString))
146          return ClaimType.PHARMACY;
147        if ("professional".equals(codeString))
148          return ClaimType.PROFESSIONAL;
149        if ("vision".equals(codeString))
150          return ClaimType.VISION;
151        throw new IllegalArgumentException("Unknown ClaimType code '"+codeString+"'");
152        }
153        public Enumeration<ClaimType> fromType(Base code) throws FHIRException {
154          if (code == null || code.isEmpty())
155            return null;
156          String codeString = ((PrimitiveType) code).asStringValue();
157          if (codeString == null || "".equals(codeString))
158            return null;
159        if ("institutional".equals(codeString))
160          return new Enumeration<ClaimType>(this, ClaimType.INSTITUTIONAL);
161        if ("oral".equals(codeString))
162          return new Enumeration<ClaimType>(this, ClaimType.ORAL);
163        if ("pharmacy".equals(codeString))
164          return new Enumeration<ClaimType>(this, ClaimType.PHARMACY);
165        if ("professional".equals(codeString))
166          return new Enumeration<ClaimType>(this, ClaimType.PROFESSIONAL);
167        if ("vision".equals(codeString))
168          return new Enumeration<ClaimType>(this, ClaimType.VISION);
169        throw new FHIRException("Unknown ClaimType code '"+codeString+"'");
170        }
171    public String toCode(ClaimType code) {
172      if (code == ClaimType.INSTITUTIONAL)
173        return "institutional";
174      if (code == ClaimType.ORAL)
175        return "oral";
176      if (code == ClaimType.PHARMACY)
177        return "pharmacy";
178      if (code == ClaimType.PROFESSIONAL)
179        return "professional";
180      if (code == ClaimType.VISION)
181        return "vision";
182      return "?";
183      }
184    public String toSystem(ClaimType code) {
185      return code.getSystem();
186      }
187    }
188
189    public enum Use {
190        /**
191         * The treatment is complete and this represents a Claim for the services.
192         */
193        COMPLETE, 
194        /**
195         * The treatment is proposed and this represents a Pre-authorization for the services.
196         */
197        PROPOSED, 
198        /**
199         * The treatment is proposed and this represents a Pre-determination for the services.
200         */
201        EXPLORATORY, 
202        /**
203         * A locally defined or otherwise resolved status.
204         */
205        OTHER, 
206        /**
207         * added to help the parsers
208         */
209        NULL;
210        public static Use fromCode(String codeString) throws FHIRException {
211            if (codeString == null || "".equals(codeString))
212                return null;
213        if ("complete".equals(codeString))
214          return COMPLETE;
215        if ("proposed".equals(codeString))
216          return PROPOSED;
217        if ("exploratory".equals(codeString))
218          return EXPLORATORY;
219        if ("other".equals(codeString))
220          return OTHER;
221        throw new FHIRException("Unknown Use code '"+codeString+"'");
222        }
223        public String toCode() {
224          switch (this) {
225            case COMPLETE: return "complete";
226            case PROPOSED: return "proposed";
227            case EXPLORATORY: return "exploratory";
228            case OTHER: return "other";
229            default: return "?";
230          }
231        }
232        public String getSystem() {
233          switch (this) {
234            case COMPLETE: return "http://hl7.org/fhir/claim-use-link";
235            case PROPOSED: return "http://hl7.org/fhir/claim-use-link";
236            case EXPLORATORY: return "http://hl7.org/fhir/claim-use-link";
237            case OTHER: return "http://hl7.org/fhir/claim-use-link";
238            default: return "?";
239          }
240        }
241        public String getDefinition() {
242          switch (this) {
243            case COMPLETE: return "The treatment is complete and this represents a Claim for the services.";
244            case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services.";
245            case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services.";
246            case OTHER: return "A locally defined or otherwise resolved status.";
247            default: return "?";
248          }
249        }
250        public String getDisplay() {
251          switch (this) {
252            case COMPLETE: return "Complete";
253            case PROPOSED: return "Proposed";
254            case EXPLORATORY: return "Exploratory";
255            case OTHER: return "Other";
256            default: return "?";
257          }
258        }
259    }
260
261  public static class UseEnumFactory implements EnumFactory<Use> {
262    public Use fromCode(String codeString) throws IllegalArgumentException {
263      if (codeString == null || "".equals(codeString))
264            if (codeString == null || "".equals(codeString))
265                return null;
266        if ("complete".equals(codeString))
267          return Use.COMPLETE;
268        if ("proposed".equals(codeString))
269          return Use.PROPOSED;
270        if ("exploratory".equals(codeString))
271          return Use.EXPLORATORY;
272        if ("other".equals(codeString))
273          return Use.OTHER;
274        throw new IllegalArgumentException("Unknown Use code '"+codeString+"'");
275        }
276        public Enumeration<Use> fromType(Base code) throws FHIRException {
277          if (code == null || code.isEmpty())
278            return null;
279          String codeString = ((PrimitiveType) code).asStringValue();
280          if (codeString == null || "".equals(codeString))
281            return null;
282        if ("complete".equals(codeString))
283          return new Enumeration<Use>(this, Use.COMPLETE);
284        if ("proposed".equals(codeString))
285          return new Enumeration<Use>(this, Use.PROPOSED);
286        if ("exploratory".equals(codeString))
287          return new Enumeration<Use>(this, Use.EXPLORATORY);
288        if ("other".equals(codeString))
289          return new Enumeration<Use>(this, Use.OTHER);
290        throw new FHIRException("Unknown Use code '"+codeString+"'");
291        }
292    public String toCode(Use code) {
293      if (code == Use.COMPLETE)
294        return "complete";
295      if (code == Use.PROPOSED)
296        return "proposed";
297      if (code == Use.EXPLORATORY)
298        return "exploratory";
299      if (code == Use.OTHER)
300        return "other";
301      return "?";
302      }
303    public String toSystem(Use code) {
304      return code.getSystem();
305      }
306    }
307
308    @Block()
309    public static class RelatedClaimsComponent extends BackboneElement implements IBaseBackboneElement {
310        /**
311         * Other claims which are related to this claim such as prior claim versions or for related services.
312         */
313        @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true)
314        @Description(shortDefinition="Reference to the related claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." )
315        protected Type claim;
316
317        /**
318         * For example prior or umbrella.
319         */
320        @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
321        @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." )
322        protected Coding relationship;
323
324        /**
325         * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .
326         */
327        @Child(name = "reference", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
328        @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." )
329        protected Identifier reference;
330
331        private static final long serialVersionUID = -2033217402L;
332
333    /**
334     * Constructor
335     */
336      public RelatedClaimsComponent() {
337        super();
338      }
339
340        /**
341         * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.)
342         */
343        public Type getClaim() { 
344          return this.claim;
345        }
346
347        /**
348         * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.)
349         */
350        public Identifier getClaimIdentifier() throws FHIRException { 
351          if (!(this.claim instanceof Identifier))
352            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered");
353          return (Identifier) this.claim;
354        }
355
356        public boolean hasClaimIdentifier() { 
357          return this.claim instanceof Identifier;
358        }
359
360        /**
361         * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.)
362         */
363        public Reference getClaimReference() throws FHIRException { 
364          if (!(this.claim instanceof Reference))
365            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered");
366          return (Reference) this.claim;
367        }
368
369        public boolean hasClaimReference() { 
370          return this.claim instanceof Reference;
371        }
372
373        public boolean hasClaim() { 
374          return this.claim != null && !this.claim.isEmpty();
375        }
376
377        /**
378         * @param value {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.)
379         */
380        public RelatedClaimsComponent setClaim(Type value) { 
381          this.claim = value;
382          return this;
383        }
384
385        /**
386         * @return {@link #relationship} (For example prior or umbrella.)
387         */
388        public Coding getRelationship() { 
389          if (this.relationship == null)
390            if (Configuration.errorOnAutoCreate())
391              throw new Error("Attempt to auto-create RelatedClaimsComponent.relationship");
392            else if (Configuration.doAutoCreate())
393              this.relationship = new Coding(); // cc
394          return this.relationship;
395        }
396
397        public boolean hasRelationship() { 
398          return this.relationship != null && !this.relationship.isEmpty();
399        }
400
401        /**
402         * @param value {@link #relationship} (For example prior or umbrella.)
403         */
404        public RelatedClaimsComponent setRelationship(Coding value) { 
405          this.relationship = value;
406          return this;
407        }
408
409        /**
410         * @return {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .)
411         */
412        public Identifier getReference() { 
413          if (this.reference == null)
414            if (Configuration.errorOnAutoCreate())
415              throw new Error("Attempt to auto-create RelatedClaimsComponent.reference");
416            else if (Configuration.doAutoCreate())
417              this.reference = new Identifier(); // cc
418          return this.reference;
419        }
420
421        public boolean hasReference() { 
422          return this.reference != null && !this.reference.isEmpty();
423        }
424
425        /**
426         * @param value {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .)
427         */
428        public RelatedClaimsComponent setReference(Identifier value) { 
429          this.reference = value;
430          return this;
431        }
432
433        protected void listChildren(List<Property> childrenList) {
434          super.listChildren(childrenList);
435          childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim));
436          childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship));
437          childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference));
438        }
439
440      @Override
441      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
442        switch (hash) {
443        case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type
444        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding
445        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier
446        default: return super.getProperty(hash, name, checkValid);
447        }
448
449      }
450
451      @Override
452      public void setProperty(int hash, String name, Base value) throws FHIRException {
453        switch (hash) {
454        case 94742588: // claim
455          this.claim = (Type) value; // Type
456          break;
457        case -261851592: // relationship
458          this.relationship = castToCoding(value); // Coding
459          break;
460        case -925155509: // reference
461          this.reference = castToIdentifier(value); // Identifier
462          break;
463        default: super.setProperty(hash, name, value);
464        }
465
466      }
467
468      @Override
469      public void setProperty(String name, Base value) throws FHIRException {
470        if (name.equals("claim[x]"))
471          this.claim = (Type) value; // Type
472        else if (name.equals("relationship"))
473          this.relationship = castToCoding(value); // Coding
474        else if (name.equals("reference"))
475          this.reference = castToIdentifier(value); // Identifier
476        else
477          super.setProperty(name, value);
478      }
479
480      @Override
481      public Base makeProperty(int hash, String name) throws FHIRException {
482        switch (hash) {
483        case 683016900:  return getClaim(); // Type
484        case -261851592:  return getRelationship(); // Coding
485        case -925155509:  return getReference(); // Identifier
486        default: return super.makeProperty(hash, name);
487        }
488
489      }
490
491      @Override
492      public Base addChild(String name) throws FHIRException {
493        if (name.equals("claimIdentifier")) {
494          this.claim = new Identifier();
495          return this.claim;
496        }
497        else if (name.equals("claimReference")) {
498          this.claim = new Reference();
499          return this.claim;
500        }
501        else if (name.equals("relationship")) {
502          this.relationship = new Coding();
503          return this.relationship;
504        }
505        else if (name.equals("reference")) {
506          this.reference = new Identifier();
507          return this.reference;
508        }
509        else
510          return super.addChild(name);
511      }
512
513      public RelatedClaimsComponent copy() {
514        RelatedClaimsComponent dst = new RelatedClaimsComponent();
515        copyValues(dst);
516        dst.claim = claim == null ? null : claim.copy();
517        dst.relationship = relationship == null ? null : relationship.copy();
518        dst.reference = reference == null ? null : reference.copy();
519        return dst;
520      }
521
522      @Override
523      public boolean equalsDeep(Base other) {
524        if (!super.equalsDeep(other))
525          return false;
526        if (!(other instanceof RelatedClaimsComponent))
527          return false;
528        RelatedClaimsComponent o = (RelatedClaimsComponent) other;
529        return compareDeep(claim, o.claim, true) && compareDeep(relationship, o.relationship, true) && compareDeep(reference, o.reference, true)
530          ;
531      }
532
533      @Override
534      public boolean equalsShallow(Base other) {
535        if (!super.equalsShallow(other))
536          return false;
537        if (!(other instanceof RelatedClaimsComponent))
538          return false;
539        RelatedClaimsComponent o = (RelatedClaimsComponent) other;
540        return true;
541      }
542
543      public boolean isEmpty() {
544        return super.isEmpty() && (claim == null || claim.isEmpty()) && (relationship == null || relationship.isEmpty())
545           && (reference == null || reference.isEmpty());
546      }
547
548  public String fhirType() {
549    return "Claim.related";
550
551  }
552
553  }
554
555    @Block()
556    public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement {
557        /**
558         * Type of Party to be reimbursed: Subscriber, provider, other.
559         */
560        @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
561        @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." )
562        protected Coding type;
563
564        /**
565         * Party to be reimbursed: Subscriber, provider, other.
566         */
567        @Child(name = "party", type = {Identifier.class, Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true)
568        @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." )
569        protected Type party;
570
571        private static final long serialVersionUID = 1304353420L;
572
573    /**
574     * Constructor
575     */
576      public PayeeComponent() {
577        super();
578      }
579
580    /**
581     * Constructor
582     */
583      public PayeeComponent(Coding type) {
584        super();
585        this.type = type;
586      }
587
588        /**
589         * @return {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.)
590         */
591        public Coding getType() { 
592          if (this.type == null)
593            if (Configuration.errorOnAutoCreate())
594              throw new Error("Attempt to auto-create PayeeComponent.type");
595            else if (Configuration.doAutoCreate())
596              this.type = new Coding(); // cc
597          return this.type;
598        }
599
600        public boolean hasType() { 
601          return this.type != null && !this.type.isEmpty();
602        }
603
604        /**
605         * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.)
606         */
607        public PayeeComponent setType(Coding value) { 
608          this.type = value;
609          return this;
610        }
611
612        /**
613         * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.)
614         */
615        public Type getParty() { 
616          return this.party;
617        }
618
619        /**
620         * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.)
621         */
622        public Identifier getPartyIdentifier() throws FHIRException { 
623          if (!(this.party instanceof Identifier))
624            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.party.getClass().getName()+" was encountered");
625          return (Identifier) this.party;
626        }
627
628        public boolean hasPartyIdentifier() { 
629          return this.party instanceof Identifier;
630        }
631
632        /**
633         * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.)
634         */
635        public Reference getPartyReference() throws FHIRException { 
636          if (!(this.party instanceof Reference))
637            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.party.getClass().getName()+" was encountered");
638          return (Reference) this.party;
639        }
640
641        public boolean hasPartyReference() { 
642          return this.party instanceof Reference;
643        }
644
645        public boolean hasParty() { 
646          return this.party != null && !this.party.isEmpty();
647        }
648
649        /**
650         * @param value {@link #party} (Party to be reimbursed: Subscriber, provider, other.)
651         */
652        public PayeeComponent setParty(Type value) { 
653          this.party = value;
654          return this;
655        }
656
657        protected void listChildren(List<Property> childrenList) {
658          super.listChildren(childrenList);
659          childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type));
660          childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party));
661        }
662
663      @Override
664      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
665        switch (hash) {
666        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
667        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type
668        default: return super.getProperty(hash, name, checkValid);
669        }
670
671      }
672
673      @Override
674      public void setProperty(int hash, String name, Base value) throws FHIRException {
675        switch (hash) {
676        case 3575610: // type
677          this.type = castToCoding(value); // Coding
678          break;
679        case 106437350: // party
680          this.party = (Type) value; // Type
681          break;
682        default: super.setProperty(hash, name, value);
683        }
684
685      }
686
687      @Override
688      public void setProperty(String name, Base value) throws FHIRException {
689        if (name.equals("type"))
690          this.type = castToCoding(value); // Coding
691        else if (name.equals("party[x]"))
692          this.party = (Type) value; // Type
693        else
694          super.setProperty(name, value);
695      }
696
697      @Override
698      public Base makeProperty(int hash, String name) throws FHIRException {
699        switch (hash) {
700        case 3575610:  return getType(); // Coding
701        case 1189320666:  return getParty(); // Type
702        default: return super.makeProperty(hash, name);
703        }
704
705      }
706
707      @Override
708      public Base addChild(String name) throws FHIRException {
709        if (name.equals("type")) {
710          this.type = new Coding();
711          return this.type;
712        }
713        else if (name.equals("partyIdentifier")) {
714          this.party = new Identifier();
715          return this.party;
716        }
717        else if (name.equals("partyReference")) {
718          this.party = new Reference();
719          return this.party;
720        }
721        else
722          return super.addChild(name);
723      }
724
725      public PayeeComponent copy() {
726        PayeeComponent dst = new PayeeComponent();
727        copyValues(dst);
728        dst.type = type == null ? null : type.copy();
729        dst.party = party == null ? null : party.copy();
730        return dst;
731      }
732
733      @Override
734      public boolean equalsDeep(Base other) {
735        if (!super.equalsDeep(other))
736          return false;
737        if (!(other instanceof PayeeComponent))
738          return false;
739        PayeeComponent o = (PayeeComponent) other;
740        return compareDeep(type, o.type, true) && compareDeep(party, o.party, true);
741      }
742
743      @Override
744      public boolean equalsShallow(Base other) {
745        if (!super.equalsShallow(other))
746          return false;
747        if (!(other instanceof PayeeComponent))
748          return false;
749        PayeeComponent o = (PayeeComponent) other;
750        return true;
751      }
752
753      public boolean isEmpty() {
754        return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty())
755          ;
756      }
757
758  public String fhirType() {
759    return "Claim.payee";
760
761  }
762
763  }
764
765    @Block()
766    public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement {
767        /**
768         * Sequence of diagnosis which serves to order and provide a link.
769         */
770        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
771        @Description(shortDefinition="Number to covey order of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." )
772        protected PositiveIntType sequence;
773
774        /**
775         * The diagnosis.
776         */
777        @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
778        @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." )
779        protected Coding diagnosis;
780
781        private static final long serialVersionUID = -795010186L;
782
783    /**
784     * Constructor
785     */
786      public DiagnosisComponent() {
787        super();
788      }
789
790    /**
791     * Constructor
792     */
793      public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) {
794        super();
795        this.sequence = sequence;
796        this.diagnosis = diagnosis;
797      }
798
799        /**
800         * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
801         */
802        public PositiveIntType getSequenceElement() { 
803          if (this.sequence == null)
804            if (Configuration.errorOnAutoCreate())
805              throw new Error("Attempt to auto-create DiagnosisComponent.sequence");
806            else if (Configuration.doAutoCreate())
807              this.sequence = new PositiveIntType(); // bb
808          return this.sequence;
809        }
810
811        public boolean hasSequenceElement() { 
812          return this.sequence != null && !this.sequence.isEmpty();
813        }
814
815        public boolean hasSequence() { 
816          return this.sequence != null && !this.sequence.isEmpty();
817        }
818
819        /**
820         * @param value {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
821         */
822        public DiagnosisComponent setSequenceElement(PositiveIntType value) { 
823          this.sequence = value;
824          return this;
825        }
826
827        /**
828         * @return Sequence of diagnosis which serves to order and provide a link.
829         */
830        public int getSequence() { 
831          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
832        }
833
834        /**
835         * @param value Sequence of diagnosis which serves to order and provide a link.
836         */
837        public DiagnosisComponent setSequence(int value) { 
838            if (this.sequence == null)
839              this.sequence = new PositiveIntType();
840            this.sequence.setValue(value);
841          return this;
842        }
843
844        /**
845         * @return {@link #diagnosis} (The diagnosis.)
846         */
847        public Coding getDiagnosis() { 
848          if (this.diagnosis == null)
849            if (Configuration.errorOnAutoCreate())
850              throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis");
851            else if (Configuration.doAutoCreate())
852              this.diagnosis = new Coding(); // cc
853          return this.diagnosis;
854        }
855
856        public boolean hasDiagnosis() { 
857          return this.diagnosis != null && !this.diagnosis.isEmpty();
858        }
859
860        /**
861         * @param value {@link #diagnosis} (The diagnosis.)
862         */
863        public DiagnosisComponent setDiagnosis(Coding value) { 
864          this.diagnosis = value;
865          return this;
866        }
867
868        protected void listChildren(List<Property> childrenList) {
869          super.listChildren(childrenList);
870          childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence));
871          childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
872        }
873
874      @Override
875      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
876        switch (hash) {
877        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
878        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding
879        default: return super.getProperty(hash, name, checkValid);
880        }
881
882      }
883
884      @Override
885      public void setProperty(int hash, String name, Base value) throws FHIRException {
886        switch (hash) {
887        case 1349547969: // sequence
888          this.sequence = castToPositiveInt(value); // PositiveIntType
889          break;
890        case 1196993265: // diagnosis
891          this.diagnosis = castToCoding(value); // Coding
892          break;
893        default: super.setProperty(hash, name, value);
894        }
895
896      }
897
898      @Override
899      public void setProperty(String name, Base value) throws FHIRException {
900        if (name.equals("sequence"))
901          this.sequence = castToPositiveInt(value); // PositiveIntType
902        else if (name.equals("diagnosis"))
903          this.diagnosis = castToCoding(value); // Coding
904        else
905          super.setProperty(name, value);
906      }
907
908      @Override
909      public Base makeProperty(int hash, String name) throws FHIRException {
910        switch (hash) {
911        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
912        case 1196993265:  return getDiagnosis(); // Coding
913        default: return super.makeProperty(hash, name);
914        }
915
916      }
917
918      @Override
919      public Base addChild(String name) throws FHIRException {
920        if (name.equals("sequence")) {
921          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
922        }
923        else if (name.equals("diagnosis")) {
924          this.diagnosis = new Coding();
925          return this.diagnosis;
926        }
927        else
928          return super.addChild(name);
929      }
930
931      public DiagnosisComponent copy() {
932        DiagnosisComponent dst = new DiagnosisComponent();
933        copyValues(dst);
934        dst.sequence = sequence == null ? null : sequence.copy();
935        dst.diagnosis = diagnosis == null ? null : diagnosis.copy();
936        return dst;
937      }
938
939      @Override
940      public boolean equalsDeep(Base other) {
941        if (!super.equalsDeep(other))
942          return false;
943        if (!(other instanceof DiagnosisComponent))
944          return false;
945        DiagnosisComponent o = (DiagnosisComponent) other;
946        return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true);
947      }
948
949      @Override
950      public boolean equalsShallow(Base other) {
951        if (!super.equalsShallow(other))
952          return false;
953        if (!(other instanceof DiagnosisComponent))
954          return false;
955        DiagnosisComponent o = (DiagnosisComponent) other;
956        return compareValues(sequence, o.sequence, true);
957      }
958
959      public boolean isEmpty() {
960        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty())
961          ;
962      }
963
964  public String fhirType() {
965    return "Claim.diagnosis";
966
967  }
968
969  }
970
971    @Block()
972    public static class ProcedureComponent extends BackboneElement implements IBaseBackboneElement {
973        /**
974         * Sequence of procedures which serves to order and provide a link.
975         */
976        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
977        @Description(shortDefinition="Procedure sequence for reference", formalDefinition="Sequence of procedures which serves to order and provide a link." )
978        protected PositiveIntType sequence;
979
980        /**
981         * Date and optionally time the procedure was performed .
982         */
983        @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
984        @Description(shortDefinition="When the procedure was performed", formalDefinition="Date and optionally time the procedure was performed ." )
985        protected DateTimeType date;
986
987        /**
988         * The procedure code.
989         */
990        @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=true)
991        @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." )
992        protected Type procedure;
993
994        private static final long serialVersionUID = 864307347L;
995
996    /**
997     * Constructor
998     */
999      public ProcedureComponent() {
1000        super();
1001      }
1002
1003    /**
1004     * Constructor
1005     */
1006      public ProcedureComponent(PositiveIntType sequence, Type procedure) {
1007        super();
1008        this.sequence = sequence;
1009        this.procedure = procedure;
1010      }
1011
1012        /**
1013         * @return {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1014         */
1015        public PositiveIntType getSequenceElement() { 
1016          if (this.sequence == null)
1017            if (Configuration.errorOnAutoCreate())
1018              throw new Error("Attempt to auto-create ProcedureComponent.sequence");
1019            else if (Configuration.doAutoCreate())
1020              this.sequence = new PositiveIntType(); // bb
1021          return this.sequence;
1022        }
1023
1024        public boolean hasSequenceElement() { 
1025          return this.sequence != null && !this.sequence.isEmpty();
1026        }
1027
1028        public boolean hasSequence() { 
1029          return this.sequence != null && !this.sequence.isEmpty();
1030        }
1031
1032        /**
1033         * @param value {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1034         */
1035        public ProcedureComponent setSequenceElement(PositiveIntType value) { 
1036          this.sequence = value;
1037          return this;
1038        }
1039
1040        /**
1041         * @return Sequence of procedures which serves to order and provide a link.
1042         */
1043        public int getSequence() { 
1044          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
1045        }
1046
1047        /**
1048         * @param value Sequence of procedures which serves to order and provide a link.
1049         */
1050        public ProcedureComponent setSequence(int value) { 
1051            if (this.sequence == null)
1052              this.sequence = new PositiveIntType();
1053            this.sequence.setValue(value);
1054          return this;
1055        }
1056
1057        /**
1058         * @return {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1059         */
1060        public DateTimeType getDateElement() { 
1061          if (this.date == null)
1062            if (Configuration.errorOnAutoCreate())
1063              throw new Error("Attempt to auto-create ProcedureComponent.date");
1064            else if (Configuration.doAutoCreate())
1065              this.date = new DateTimeType(); // bb
1066          return this.date;
1067        }
1068
1069        public boolean hasDateElement() { 
1070          return this.date != null && !this.date.isEmpty();
1071        }
1072
1073        public boolean hasDate() { 
1074          return this.date != null && !this.date.isEmpty();
1075        }
1076
1077        /**
1078         * @param value {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1079         */
1080        public ProcedureComponent setDateElement(DateTimeType value) { 
1081          this.date = value;
1082          return this;
1083        }
1084
1085        /**
1086         * @return Date and optionally time the procedure was performed .
1087         */
1088        public Date getDate() { 
1089          return this.date == null ? null : this.date.getValue();
1090        }
1091
1092        /**
1093         * @param value Date and optionally time the procedure was performed .
1094         */
1095        public ProcedureComponent setDate(Date value) { 
1096          if (value == null)
1097            this.date = null;
1098          else {
1099            if (this.date == null)
1100              this.date = new DateTimeType();
1101            this.date.setValue(value);
1102          }
1103          return this;
1104        }
1105
1106        /**
1107         * @return {@link #procedure} (The procedure code.)
1108         */
1109        public Type getProcedure() { 
1110          return this.procedure;
1111        }
1112
1113        /**
1114         * @return {@link #procedure} (The procedure code.)
1115         */
1116        public Coding getProcedureCoding() throws FHIRException { 
1117          if (!(this.procedure instanceof Coding))
1118            throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered");
1119          return (Coding) this.procedure;
1120        }
1121
1122        public boolean hasProcedureCoding() { 
1123          return this.procedure instanceof Coding;
1124        }
1125
1126        /**
1127         * @return {@link #procedure} (The procedure code.)
1128         */
1129        public Reference getProcedureReference() throws FHIRException { 
1130          if (!(this.procedure instanceof Reference))
1131            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.procedure.getClass().getName()+" was encountered");
1132          return (Reference) this.procedure;
1133        }
1134
1135        public boolean hasProcedureReference() { 
1136          return this.procedure instanceof Reference;
1137        }
1138
1139        public boolean hasProcedure() { 
1140          return this.procedure != null && !this.procedure.isEmpty();
1141        }
1142
1143        /**
1144         * @param value {@link #procedure} (The procedure code.)
1145         */
1146        public ProcedureComponent setProcedure(Type value) { 
1147          this.procedure = value;
1148          return this;
1149        }
1150
1151        protected void listChildren(List<Property> childrenList) {
1152          super.listChildren(childrenList);
1153          childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence));
1154          childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date));
1155          childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure));
1156        }
1157
1158      @Override
1159      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1160        switch (hash) {
1161        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
1162        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1163        case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // Type
1164        default: return super.getProperty(hash, name, checkValid);
1165        }
1166
1167      }
1168
1169      @Override
1170      public void setProperty(int hash, String name, Base value) throws FHIRException {
1171        switch (hash) {
1172        case 1349547969: // sequence
1173          this.sequence = castToPositiveInt(value); // PositiveIntType
1174          break;
1175        case 3076014: // date
1176          this.date = castToDateTime(value); // DateTimeType
1177          break;
1178        case -1095204141: // procedure
1179          this.procedure = (Type) value; // Type
1180          break;
1181        default: super.setProperty(hash, name, value);
1182        }
1183
1184      }
1185
1186      @Override
1187      public void setProperty(String name, Base value) throws FHIRException {
1188        if (name.equals("sequence"))
1189          this.sequence = castToPositiveInt(value); // PositiveIntType
1190        else if (name.equals("date"))
1191          this.date = castToDateTime(value); // DateTimeType
1192        else if (name.equals("procedure[x]"))
1193          this.procedure = (Type) value; // Type
1194        else
1195          super.setProperty(name, value);
1196      }
1197
1198      @Override
1199      public Base makeProperty(int hash, String name) throws FHIRException {
1200        switch (hash) {
1201        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
1202        case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType
1203        case 1640074445:  return getProcedure(); // Type
1204        default: return super.makeProperty(hash, name);
1205        }
1206
1207      }
1208
1209      @Override
1210      public Base addChild(String name) throws FHIRException {
1211        if (name.equals("sequence")) {
1212          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
1213        }
1214        else if (name.equals("date")) {
1215          throw new FHIRException("Cannot call addChild on a primitive type Claim.date");
1216        }
1217        else if (name.equals("procedureCoding")) {
1218          this.procedure = new Coding();
1219          return this.procedure;
1220        }
1221        else if (name.equals("procedureReference")) {
1222          this.procedure = new Reference();
1223          return this.procedure;
1224        }
1225        else
1226          return super.addChild(name);
1227      }
1228
1229      public ProcedureComponent copy() {
1230        ProcedureComponent dst = new ProcedureComponent();
1231        copyValues(dst);
1232        dst.sequence = sequence == null ? null : sequence.copy();
1233        dst.date = date == null ? null : date.copy();
1234        dst.procedure = procedure == null ? null : procedure.copy();
1235        return dst;
1236      }
1237
1238      @Override
1239      public boolean equalsDeep(Base other) {
1240        if (!super.equalsDeep(other))
1241          return false;
1242        if (!(other instanceof ProcedureComponent))
1243          return false;
1244        ProcedureComponent o = (ProcedureComponent) other;
1245        return compareDeep(sequence, o.sequence, true) && compareDeep(date, o.date, true) && compareDeep(procedure, o.procedure, true)
1246          ;
1247      }
1248
1249      @Override
1250      public boolean equalsShallow(Base other) {
1251        if (!super.equalsShallow(other))
1252          return false;
1253        if (!(other instanceof ProcedureComponent))
1254          return false;
1255        ProcedureComponent o = (ProcedureComponent) other;
1256        return compareValues(sequence, o.sequence, true) && compareValues(date, o.date, true);
1257      }
1258
1259      public boolean isEmpty() {
1260        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (date == null || date.isEmpty())
1261           && (procedure == null || procedure.isEmpty());
1262      }
1263
1264  public String fhirType() {
1265    return "Claim.procedure";
1266
1267  }
1268
1269  }
1270
1271    @Block()
1272    public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement {
1273        /**
1274         * A service line item.
1275         */
1276        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
1277        @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." )
1278        protected PositiveIntType sequence;
1279
1280        /**
1281         * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
1282         */
1283        @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true)
1284        @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." )
1285        protected BooleanType focal;
1286
1287        /**
1288         * Reference to the program or plan identification, underwriter or payor.
1289         */
1290        @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true)
1291        @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." )
1292        protected Type coverage;
1293
1294        /**
1295         * The contract number of a business agreement which describes the terms and conditions.
1296         */
1297        @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1298        @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." )
1299        protected StringType businessArrangement;
1300
1301        /**
1302         * A list of references from the Insurer to which these services pertain.
1303         */
1304        @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1305        @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." )
1306        protected List<StringType> preAuthRef;
1307
1308        /**
1309         * The Coverages adjudication details.
1310         */
1311        @Child(name = "claimResponse", type = {ClaimResponse.class}, order=6, min=0, max=1, modifier=false, summary=true)
1312        @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." )
1313        protected Reference claimResponse;
1314
1315        /**
1316         * The actual object that is the target of the reference (The Coverages adjudication details.)
1317         */
1318        protected ClaimResponse claimResponseTarget;
1319
1320        /**
1321         * The style (standard) and version of the original material which was converted into this resource.
1322         */
1323        @Child(name = "originalRuleset", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=true)
1324        @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." )
1325        protected Coding originalRuleset;
1326
1327        private static final long serialVersionUID = 2031704818L;
1328
1329    /**
1330     * Constructor
1331     */
1332      public CoverageComponent() {
1333        super();
1334      }
1335
1336    /**
1337     * Constructor
1338     */
1339      public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) {
1340        super();
1341        this.sequence = sequence;
1342        this.focal = focal;
1343        this.coverage = coverage;
1344      }
1345
1346        /**
1347         * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1348         */
1349        public PositiveIntType getSequenceElement() { 
1350          if (this.sequence == null)
1351            if (Configuration.errorOnAutoCreate())
1352              throw new Error("Attempt to auto-create CoverageComponent.sequence");
1353            else if (Configuration.doAutoCreate())
1354              this.sequence = new PositiveIntType(); // bb
1355          return this.sequence;
1356        }
1357
1358        public boolean hasSequenceElement() { 
1359          return this.sequence != null && !this.sequence.isEmpty();
1360        }
1361
1362        public boolean hasSequence() { 
1363          return this.sequence != null && !this.sequence.isEmpty();
1364        }
1365
1366        /**
1367         * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1368         */
1369        public CoverageComponent setSequenceElement(PositiveIntType value) { 
1370          this.sequence = value;
1371          return this;
1372        }
1373
1374        /**
1375         * @return A service line item.
1376         */
1377        public int getSequence() { 
1378          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
1379        }
1380
1381        /**
1382         * @param value A service line item.
1383         */
1384        public CoverageComponent setSequence(int value) { 
1385            if (this.sequence == null)
1386              this.sequence = new PositiveIntType();
1387            this.sequence.setValue(value);
1388          return this;
1389        }
1390
1391        /**
1392         * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
1393         */
1394        public BooleanType getFocalElement() { 
1395          if (this.focal == null)
1396            if (Configuration.errorOnAutoCreate())
1397              throw new Error("Attempt to auto-create CoverageComponent.focal");
1398            else if (Configuration.doAutoCreate())
1399              this.focal = new BooleanType(); // bb
1400          return this.focal;
1401        }
1402
1403        public boolean hasFocalElement() { 
1404          return this.focal != null && !this.focal.isEmpty();
1405        }
1406
1407        public boolean hasFocal() { 
1408          return this.focal != null && !this.focal.isEmpty();
1409        }
1410
1411        /**
1412         * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value
1413         */
1414        public CoverageComponent setFocalElement(BooleanType value) { 
1415          this.focal = value;
1416          return this;
1417        }
1418
1419        /**
1420         * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
1421         */
1422        public boolean getFocal() { 
1423          return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue();
1424        }
1425
1426        /**
1427         * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.
1428         */
1429        public CoverageComponent setFocal(boolean value) { 
1430            if (this.focal == null)
1431              this.focal = new BooleanType();
1432            this.focal.setValue(value);
1433          return this;
1434        }
1435
1436        /**
1437         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
1438         */
1439        public Type getCoverage() { 
1440          return this.coverage;
1441        }
1442
1443        /**
1444         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
1445         */
1446        public Identifier getCoverageIdentifier() throws FHIRException { 
1447          if (!(this.coverage instanceof Identifier))
1448            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered");
1449          return (Identifier) this.coverage;
1450        }
1451
1452        public boolean hasCoverageIdentifier() { 
1453          return this.coverage instanceof Identifier;
1454        }
1455
1456        /**
1457         * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
1458         */
1459        public Reference getCoverageReference() throws FHIRException { 
1460          if (!(this.coverage instanceof Reference))
1461            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered");
1462          return (Reference) this.coverage;
1463        }
1464
1465        public boolean hasCoverageReference() { 
1466          return this.coverage instanceof Reference;
1467        }
1468
1469        public boolean hasCoverage() { 
1470          return this.coverage != null && !this.coverage.isEmpty();
1471        }
1472
1473        /**
1474         * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
1475         */
1476        public CoverageComponent setCoverage(Type value) { 
1477          this.coverage = value;
1478          return this;
1479        }
1480
1481        /**
1482         * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
1483         */
1484        public StringType getBusinessArrangementElement() { 
1485          if (this.businessArrangement == null)
1486            if (Configuration.errorOnAutoCreate())
1487              throw new Error("Attempt to auto-create CoverageComponent.businessArrangement");
1488            else if (Configuration.doAutoCreate())
1489              this.businessArrangement = new StringType(); // bb
1490          return this.businessArrangement;
1491        }
1492
1493        public boolean hasBusinessArrangementElement() { 
1494          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
1495        }
1496
1497        public boolean hasBusinessArrangement() { 
1498          return this.businessArrangement != null && !this.businessArrangement.isEmpty();
1499        }
1500
1501        /**
1502         * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value
1503         */
1504        public CoverageComponent setBusinessArrangementElement(StringType value) { 
1505          this.businessArrangement = value;
1506          return this;
1507        }
1508
1509        /**
1510         * @return The contract number of a business agreement which describes the terms and conditions.
1511         */
1512        public String getBusinessArrangement() { 
1513          return this.businessArrangement == null ? null : this.businessArrangement.getValue();
1514        }
1515
1516        /**
1517         * @param value The contract number of a business agreement which describes the terms and conditions.
1518         */
1519        public CoverageComponent setBusinessArrangement(String value) { 
1520          if (Utilities.noString(value))
1521            this.businessArrangement = null;
1522          else {
1523            if (this.businessArrangement == null)
1524              this.businessArrangement = new StringType();
1525            this.businessArrangement.setValue(value);
1526          }
1527          return this;
1528        }
1529
1530        /**
1531         * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
1532         */
1533        public List<StringType> getPreAuthRef() { 
1534          if (this.preAuthRef == null)
1535            this.preAuthRef = new ArrayList<StringType>();
1536          return this.preAuthRef;
1537        }
1538
1539        public boolean hasPreAuthRef() { 
1540          if (this.preAuthRef == null)
1541            return false;
1542          for (StringType item : this.preAuthRef)
1543            if (!item.isEmpty())
1544              return true;
1545          return false;
1546        }
1547
1548        /**
1549         * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
1550         */
1551    // syntactic sugar
1552        public StringType addPreAuthRefElement() {//2 
1553          StringType t = new StringType();
1554          if (this.preAuthRef == null)
1555            this.preAuthRef = new ArrayList<StringType>();
1556          this.preAuthRef.add(t);
1557          return t;
1558        }
1559
1560        /**
1561         * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
1562         */
1563        public CoverageComponent addPreAuthRef(String value) { //1
1564          StringType t = new StringType();
1565          t.setValue(value);
1566          if (this.preAuthRef == null)
1567            this.preAuthRef = new ArrayList<StringType>();
1568          this.preAuthRef.add(t);
1569          return this;
1570        }
1571
1572        /**
1573         * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.)
1574         */
1575        public boolean hasPreAuthRef(String value) { 
1576          if (this.preAuthRef == null)
1577            return false;
1578          for (StringType v : this.preAuthRef)
1579            if (v.equals(value)) // string
1580              return true;
1581          return false;
1582        }
1583
1584        /**
1585         * @return {@link #claimResponse} (The Coverages adjudication details.)
1586         */
1587        public Reference getClaimResponse() { 
1588          if (this.claimResponse == null)
1589            if (Configuration.errorOnAutoCreate())
1590              throw new Error("Attempt to auto-create CoverageComponent.claimResponse");
1591            else if (Configuration.doAutoCreate())
1592              this.claimResponse = new Reference(); // cc
1593          return this.claimResponse;
1594        }
1595
1596        public boolean hasClaimResponse() { 
1597          return this.claimResponse != null && !this.claimResponse.isEmpty();
1598        }
1599
1600        /**
1601         * @param value {@link #claimResponse} (The Coverages adjudication details.)
1602         */
1603        public CoverageComponent setClaimResponse(Reference value) { 
1604          this.claimResponse = value;
1605          return this;
1606        }
1607
1608        /**
1609         * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.)
1610         */
1611        public ClaimResponse getClaimResponseTarget() { 
1612          if (this.claimResponseTarget == null)
1613            if (Configuration.errorOnAutoCreate())
1614              throw new Error("Attempt to auto-create CoverageComponent.claimResponse");
1615            else if (Configuration.doAutoCreate())
1616              this.claimResponseTarget = new ClaimResponse(); // aa
1617          return this.claimResponseTarget;
1618        }
1619
1620        /**
1621         * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.)
1622         */
1623        public CoverageComponent setClaimResponseTarget(ClaimResponse value) { 
1624          this.claimResponseTarget = value;
1625          return this;
1626        }
1627
1628        /**
1629         * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
1630         */
1631        public Coding getOriginalRuleset() { 
1632          if (this.originalRuleset == null)
1633            if (Configuration.errorOnAutoCreate())
1634              throw new Error("Attempt to auto-create CoverageComponent.originalRuleset");
1635            else if (Configuration.doAutoCreate())
1636              this.originalRuleset = new Coding(); // cc
1637          return this.originalRuleset;
1638        }
1639
1640        public boolean hasOriginalRuleset() { 
1641          return this.originalRuleset != null && !this.originalRuleset.isEmpty();
1642        }
1643
1644        /**
1645         * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.)
1646         */
1647        public CoverageComponent setOriginalRuleset(Coding value) { 
1648          this.originalRuleset = value;
1649          return this;
1650        }
1651
1652        protected void listChildren(List<Property> childrenList) {
1653          super.listChildren(childrenList);
1654          childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence));
1655          childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal));
1656          childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage));
1657          childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement));
1658          childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef));
1659          childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse));
1660          childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
1661        }
1662
1663      @Override
1664      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1665        switch (hash) {
1666        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
1667        case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType
1668        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type
1669        case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
1670        case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType
1671        case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference
1672        case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding
1673        default: return super.getProperty(hash, name, checkValid);
1674        }
1675
1676      }
1677
1678      @Override
1679      public void setProperty(int hash, String name, Base value) throws FHIRException {
1680        switch (hash) {
1681        case 1349547969: // sequence
1682          this.sequence = castToPositiveInt(value); // PositiveIntType
1683          break;
1684        case 97604197: // focal
1685          this.focal = castToBoolean(value); // BooleanType
1686          break;
1687        case -351767064: // coverage
1688          this.coverage = (Type) value; // Type
1689          break;
1690        case 259920682: // businessArrangement
1691          this.businessArrangement = castToString(value); // StringType
1692          break;
1693        case 522246568: // preAuthRef
1694          this.getPreAuthRef().add(castToString(value)); // StringType
1695          break;
1696        case 689513629: // claimResponse
1697          this.claimResponse = castToReference(value); // Reference
1698          break;
1699        case 1089373397: // originalRuleset
1700          this.originalRuleset = castToCoding(value); // Coding
1701          break;
1702        default: super.setProperty(hash, name, value);
1703        }
1704
1705      }
1706
1707      @Override
1708      public void setProperty(String name, Base value) throws FHIRException {
1709        if (name.equals("sequence"))
1710          this.sequence = castToPositiveInt(value); // PositiveIntType
1711        else if (name.equals("focal"))
1712          this.focal = castToBoolean(value); // BooleanType
1713        else if (name.equals("coverage[x]"))
1714          this.coverage = (Type) value; // Type
1715        else if (name.equals("businessArrangement"))
1716          this.businessArrangement = castToString(value); // StringType
1717        else if (name.equals("preAuthRef"))
1718          this.getPreAuthRef().add(castToString(value));
1719        else if (name.equals("claimResponse"))
1720          this.claimResponse = castToReference(value); // Reference
1721        else if (name.equals("originalRuleset"))
1722          this.originalRuleset = castToCoding(value); // Coding
1723        else
1724          super.setProperty(name, value);
1725      }
1726
1727      @Override
1728      public Base makeProperty(int hash, String name) throws FHIRException {
1729        switch (hash) {
1730        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
1731        case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType
1732        case 227689880:  return getCoverage(); // Type
1733        case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType
1734        case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType
1735        case 689513629:  return getClaimResponse(); // Reference
1736        case 1089373397:  return getOriginalRuleset(); // Coding
1737        default: return super.makeProperty(hash, name);
1738        }
1739
1740      }
1741
1742      @Override
1743      public Base addChild(String name) throws FHIRException {
1744        if (name.equals("sequence")) {
1745          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
1746        }
1747        else if (name.equals("focal")) {
1748          throw new FHIRException("Cannot call addChild on a primitive type Claim.focal");
1749        }
1750        else if (name.equals("coverageIdentifier")) {
1751          this.coverage = new Identifier();
1752          return this.coverage;
1753        }
1754        else if (name.equals("coverageReference")) {
1755          this.coverage = new Reference();
1756          return this.coverage;
1757        }
1758        else if (name.equals("businessArrangement")) {
1759          throw new FHIRException("Cannot call addChild on a primitive type Claim.businessArrangement");
1760        }
1761        else if (name.equals("preAuthRef")) {
1762          throw new FHIRException("Cannot call addChild on a primitive type Claim.preAuthRef");
1763        }
1764        else if (name.equals("claimResponse")) {
1765          this.claimResponse = new Reference();
1766          return this.claimResponse;
1767        }
1768        else if (name.equals("originalRuleset")) {
1769          this.originalRuleset = new Coding();
1770          return this.originalRuleset;
1771        }
1772        else
1773          return super.addChild(name);
1774      }
1775
1776      public CoverageComponent copy() {
1777        CoverageComponent dst = new CoverageComponent();
1778        copyValues(dst);
1779        dst.sequence = sequence == null ? null : sequence.copy();
1780        dst.focal = focal == null ? null : focal.copy();
1781        dst.coverage = coverage == null ? null : coverage.copy();
1782        dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
1783        if (preAuthRef != null) {
1784          dst.preAuthRef = new ArrayList<StringType>();
1785          for (StringType i : preAuthRef)
1786            dst.preAuthRef.add(i.copy());
1787        };
1788        dst.claimResponse = claimResponse == null ? null : claimResponse.copy();
1789        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
1790        return dst;
1791      }
1792
1793      @Override
1794      public boolean equalsDeep(Base other) {
1795        if (!super.equalsDeep(other))
1796          return false;
1797        if (!(other instanceof CoverageComponent))
1798          return false;
1799        CoverageComponent o = (CoverageComponent) other;
1800        return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true)
1801           && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true)
1802           && compareDeep(claimResponse, o.claimResponse, true) && compareDeep(originalRuleset, o.originalRuleset, true)
1803          ;
1804      }
1805
1806      @Override
1807      public boolean equalsShallow(Base other) {
1808        if (!super.equalsShallow(other))
1809          return false;
1810        if (!(other instanceof CoverageComponent))
1811          return false;
1812        CoverageComponent o = (CoverageComponent) other;
1813        return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true)
1814           && compareValues(preAuthRef, o.preAuthRef, true);
1815      }
1816
1817      public boolean isEmpty() {
1818        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty())
1819           && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty())
1820           && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty())
1821           && (originalRuleset == null || originalRuleset.isEmpty());
1822      }
1823
1824  public String fhirType() {
1825    return "Claim.coverage";
1826
1827  }
1828
1829  }
1830
1831    @Block()
1832    public static class OnsetComponent extends BackboneElement implements IBaseBackboneElement {
1833        /**
1834         * The start or start and end dates for the treatable condition.
1835         */
1836        @Child(name = "time", type = {DateType.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true)
1837        @Description(shortDefinition="Illness, injury or treatable condition date", formalDefinition="The start or start and end dates for the treatable condition." )
1838        protected Type time;
1839
1840        /**
1841         * Onset typifications eg. Start of pregnancy, start of illnes, etc.
1842         */
1843        @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
1844        @Description(shortDefinition="Onset of what", formalDefinition="Onset typifications eg. Start of pregnancy, start of illnes, etc." )
1845        protected Coding type;
1846
1847        private static final long serialVersionUID = -560173231L;
1848
1849    /**
1850     * Constructor
1851     */
1852      public OnsetComponent() {
1853        super();
1854      }
1855
1856        /**
1857         * @return {@link #time} (The start or start and end dates for the treatable condition.)
1858         */
1859        public Type getTime() { 
1860          return this.time;
1861        }
1862
1863        /**
1864         * @return {@link #time} (The start or start and end dates for the treatable condition.)
1865         */
1866        public DateType getTimeDateType() throws FHIRException { 
1867          if (!(this.time instanceof DateType))
1868            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.time.getClass().getName()+" was encountered");
1869          return (DateType) this.time;
1870        }
1871
1872        public boolean hasTimeDateType() { 
1873          return this.time instanceof DateType;
1874        }
1875
1876        /**
1877         * @return {@link #time} (The start or start and end dates for the treatable condition.)
1878         */
1879        public Period getTimePeriod() throws FHIRException { 
1880          if (!(this.time instanceof Period))
1881            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.time.getClass().getName()+" was encountered");
1882          return (Period) this.time;
1883        }
1884
1885        public boolean hasTimePeriod() { 
1886          return this.time instanceof Period;
1887        }
1888
1889        public boolean hasTime() { 
1890          return this.time != null && !this.time.isEmpty();
1891        }
1892
1893        /**
1894         * @param value {@link #time} (The start or start and end dates for the treatable condition.)
1895         */
1896        public OnsetComponent setTime(Type value) { 
1897          this.time = value;
1898          return this;
1899        }
1900
1901        /**
1902         * @return {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.)
1903         */
1904        public Coding getType() { 
1905          if (this.type == null)
1906            if (Configuration.errorOnAutoCreate())
1907              throw new Error("Attempt to auto-create OnsetComponent.type");
1908            else if (Configuration.doAutoCreate())
1909              this.type = new Coding(); // cc
1910          return this.type;
1911        }
1912
1913        public boolean hasType() { 
1914          return this.type != null && !this.type.isEmpty();
1915        }
1916
1917        /**
1918         * @param value {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.)
1919         */
1920        public OnsetComponent setType(Coding value) { 
1921          this.type = value;
1922          return this;
1923        }
1924
1925        protected void listChildren(List<Property> childrenList) {
1926          super.listChildren(childrenList);
1927          childrenList.add(new Property("time[x]", "date|Period", "The start or start and end dates for the treatable condition.", 0, java.lang.Integer.MAX_VALUE, time));
1928          childrenList.add(new Property("type", "Coding", "Onset typifications eg. Start of pregnancy, start of illnes, etc.", 0, java.lang.Integer.MAX_VALUE, type));
1929        }
1930
1931      @Override
1932      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1933        switch (hash) {
1934        case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // Type
1935        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
1936        default: return super.getProperty(hash, name, checkValid);
1937        }
1938
1939      }
1940
1941      @Override
1942      public void setProperty(int hash, String name, Base value) throws FHIRException {
1943        switch (hash) {
1944        case 3560141: // time
1945          this.time = (Type) value; // Type
1946          break;
1947        case 3575610: // type
1948          this.type = castToCoding(value); // Coding
1949          break;
1950        default: super.setProperty(hash, name, value);
1951        }
1952
1953      }
1954
1955      @Override
1956      public void setProperty(String name, Base value) throws FHIRException {
1957        if (name.equals("time[x]"))
1958          this.time = (Type) value; // Type
1959        else if (name.equals("type"))
1960          this.type = castToCoding(value); // Coding
1961        else
1962          super.setProperty(name, value);
1963      }
1964
1965      @Override
1966      public Base makeProperty(int hash, String name) throws FHIRException {
1967        switch (hash) {
1968        case -1313930605:  return getTime(); // Type
1969        case 3575610:  return getType(); // Coding
1970        default: return super.makeProperty(hash, name);
1971        }
1972
1973      }
1974
1975      @Override
1976      public Base addChild(String name) throws FHIRException {
1977        if (name.equals("timeDate")) {
1978          this.time = new DateType();
1979          return this.time;
1980        }
1981        else if (name.equals("timePeriod")) {
1982          this.time = new Period();
1983          return this.time;
1984        }
1985        else if (name.equals("type")) {
1986          this.type = new Coding();
1987          return this.type;
1988        }
1989        else
1990          return super.addChild(name);
1991      }
1992
1993      public OnsetComponent copy() {
1994        OnsetComponent dst = new OnsetComponent();
1995        copyValues(dst);
1996        dst.time = time == null ? null : time.copy();
1997        dst.type = type == null ? null : type.copy();
1998        return dst;
1999      }
2000
2001      @Override
2002      public boolean equalsDeep(Base other) {
2003        if (!super.equalsDeep(other))
2004          return false;
2005        if (!(other instanceof OnsetComponent))
2006          return false;
2007        OnsetComponent o = (OnsetComponent) other;
2008        return compareDeep(time, o.time, true) && compareDeep(type, o.type, true);
2009      }
2010
2011      @Override
2012      public boolean equalsShallow(Base other) {
2013        if (!super.equalsShallow(other))
2014          return false;
2015        if (!(other instanceof OnsetComponent))
2016          return false;
2017        OnsetComponent o = (OnsetComponent) other;
2018        return true;
2019      }
2020
2021      public boolean isEmpty() {
2022        return super.isEmpty() && (time == null || time.isEmpty()) && (type == null || type.isEmpty())
2023          ;
2024      }
2025
2026  public String fhirType() {
2027    return "Claim.onset";
2028
2029  }
2030
2031  }
2032
2033    @Block()
2034    public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement {
2035        /**
2036         * A service line number.
2037         */
2038        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
2039        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
2040        protected PositiveIntType sequence;
2041
2042        /**
2043         * The type of product or service.
2044         */
2045        @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
2046        @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." )
2047        protected Coding type;
2048
2049        /**
2050         * The practitioner who is responsible for the services rendered to the patient.
2051         */
2052        @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true)
2053        @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." )
2054        protected Type provider;
2055
2056        /**
2057         * The practitioner who is supervising the work of the servicing provider(s).
2058         */
2059        @Child(name = "supervisor", type = {Identifier.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true)
2060        @Description(shortDefinition="Supervising Practitioner", formalDefinition="The practitioner who is supervising the work of the servicing provider(s)." )
2061        protected Type supervisor;
2062
2063        /**
2064         * The qualification which is applicable for this service.
2065         */
2066        @Child(name = "providerQualification", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true)
2067        @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." )
2068        protected Coding providerQualification;
2069
2070        /**
2071         * Diagnosis applicable for this service or product line.
2072         */
2073        @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2074        @Description(shortDefinition="Applicable diagnoses", formalDefinition="Diagnosis applicable for this service or product line." )
2075        protected List<PositiveIntType> diagnosisLinkId;
2076
2077        /**
2078         * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.
2079         */
2080        @Child(name = "service", type = {Coding.class}, order=7, min=1, max=1, modifier=false, summary=true)
2081        @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." )
2082        protected Coding service;
2083
2084        /**
2085         * Unusual circumstances which may influence adjudication.
2086         */
2087        @Child(name = "serviceModifier", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2088        @Description(shortDefinition="Service/Product modifiers", formalDefinition="Unusual circumstances which may influence adjudication." )
2089        protected List<Coding> serviceModifier;
2090
2091        /**
2092         * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.
2093         */
2094        @Child(name = "modifier", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2095        @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." )
2096        protected List<Coding> modifier;
2097
2098        /**
2099         * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.
2100         */
2101        @Child(name = "programCode", type = {Coding.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2102        @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." )
2103        protected List<Coding> programCode;
2104
2105        /**
2106         * The date or dates when the enclosed suite of services were performed or completed.
2107         */
2108        @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=true)
2109        @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." )
2110        protected Type serviced;
2111
2112        /**
2113         * Where the service was provided.
2114         */
2115        @Child(name = "place", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true)
2116        @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." )
2117        protected Coding place;
2118
2119        /**
2120         * The number of repetitions of a service or product.
2121         */
2122        @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=true)
2123        @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." )
2124        protected SimpleQuantity quantity;
2125
2126        /**
2127         * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.
2128         */
2129        @Child(name = "unitPrice", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true)
2130        @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." )
2131        protected Money unitPrice;
2132
2133        /**
2134         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2135         */
2136        @Child(name = "factor", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=true)
2137        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
2138        protected DecimalType factor;
2139
2140        /**
2141         * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
2142         */
2143        @Child(name = "points", type = {DecimalType.class}, order=16, min=0, max=1, modifier=false, summary=true)
2144        @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." )
2145        protected DecimalType points;
2146
2147        /**
2148         * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
2149         */
2150        @Child(name = "net", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true)
2151        @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." )
2152        protected Money net;
2153
2154        /**
2155         * List of Unique Device Identifiers associated with this line item.
2156         */
2157        @Child(name = "udi", type = {Device.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2158        @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." )
2159        protected List<Reference> udi;
2160        /**
2161         * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.)
2162         */
2163        protected List<Device> udiTarget;
2164
2165
2166        /**
2167         * Physical service site on the patient (limb, tooth, etc).
2168         */
2169        @Child(name = "bodySite", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=true)
2170        @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." )
2171        protected Coding bodySite;
2172
2173        /**
2174         * A region or surface of the site, eg. limb region or tooth surface(s).
2175         */
2176        @Child(name = "subSite", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2177        @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." )
2178        protected List<Coding> subSite;
2179
2180        /**
2181         * Second tier of goods and services.
2182         */
2183        @Child(name = "detail", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2184        @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." )
2185        protected List<DetailComponent> detail;
2186
2187        /**
2188         * The materials and placement date of prior fixed prosthesis.
2189         */
2190        @Child(name = "prosthesis", type = {}, order=22, min=0, max=1, modifier=false, summary=true)
2191        @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." )
2192        protected ProsthesisComponent prosthesis;
2193
2194        private static final long serialVersionUID = 1007480127L;
2195
2196    /**
2197     * Constructor
2198     */
2199      public ItemsComponent() {
2200        super();
2201      }
2202
2203    /**
2204     * Constructor
2205     */
2206      public ItemsComponent(PositiveIntType sequence, Coding type, Coding service) {
2207        super();
2208        this.sequence = sequence;
2209        this.type = type;
2210        this.service = service;
2211      }
2212
2213        /**
2214         * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
2215         */
2216        public PositiveIntType getSequenceElement() { 
2217          if (this.sequence == null)
2218            if (Configuration.errorOnAutoCreate())
2219              throw new Error("Attempt to auto-create ItemsComponent.sequence");
2220            else if (Configuration.doAutoCreate())
2221              this.sequence = new PositiveIntType(); // bb
2222          return this.sequence;
2223        }
2224
2225        public boolean hasSequenceElement() { 
2226          return this.sequence != null && !this.sequence.isEmpty();
2227        }
2228
2229        public boolean hasSequence() { 
2230          return this.sequence != null && !this.sequence.isEmpty();
2231        }
2232
2233        /**
2234         * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
2235         */
2236        public ItemsComponent setSequenceElement(PositiveIntType value) { 
2237          this.sequence = value;
2238          return this;
2239        }
2240
2241        /**
2242         * @return A service line number.
2243         */
2244        public int getSequence() { 
2245          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
2246        }
2247
2248        /**
2249         * @param value A service line number.
2250         */
2251        public ItemsComponent setSequence(int value) { 
2252            if (this.sequence == null)
2253              this.sequence = new PositiveIntType();
2254            this.sequence.setValue(value);
2255          return this;
2256        }
2257
2258        /**
2259         * @return {@link #type} (The type of product or service.)
2260         */
2261        public Coding getType() { 
2262          if (this.type == null)
2263            if (Configuration.errorOnAutoCreate())
2264              throw new Error("Attempt to auto-create ItemsComponent.type");
2265            else if (Configuration.doAutoCreate())
2266              this.type = new Coding(); // cc
2267          return this.type;
2268        }
2269
2270        public boolean hasType() { 
2271          return this.type != null && !this.type.isEmpty();
2272        }
2273
2274        /**
2275         * @param value {@link #type} (The type of product or service.)
2276         */
2277        public ItemsComponent setType(Coding value) { 
2278          this.type = value;
2279          return this;
2280        }
2281
2282        /**
2283         * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
2284         */
2285        public Type getProvider() { 
2286          return this.provider;
2287        }
2288
2289        /**
2290         * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
2291         */
2292        public Identifier getProviderIdentifier() throws FHIRException { 
2293          if (!(this.provider instanceof Identifier))
2294            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered");
2295          return (Identifier) this.provider;
2296        }
2297
2298        public boolean hasProviderIdentifier() { 
2299          return this.provider instanceof Identifier;
2300        }
2301
2302        /**
2303         * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
2304         */
2305        public Reference getProviderReference() throws FHIRException { 
2306          if (!(this.provider instanceof Reference))
2307            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered");
2308          return (Reference) this.provider;
2309        }
2310
2311        public boolean hasProviderReference() { 
2312          return this.provider instanceof Reference;
2313        }
2314
2315        public boolean hasProvider() { 
2316          return this.provider != null && !this.provider.isEmpty();
2317        }
2318
2319        /**
2320         * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.)
2321         */
2322        public ItemsComponent setProvider(Type value) { 
2323          this.provider = value;
2324          return this;
2325        }
2326
2327        /**
2328         * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).)
2329         */
2330        public Type getSupervisor() { 
2331          return this.supervisor;
2332        }
2333
2334        /**
2335         * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).)
2336         */
2337        public Identifier getSupervisorIdentifier() throws FHIRException { 
2338          if (!(this.supervisor instanceof Identifier))
2339            throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.supervisor.getClass().getName()+" was encountered");
2340          return (Identifier) this.supervisor;
2341        }
2342
2343        public boolean hasSupervisorIdentifier() { 
2344          return this.supervisor instanceof Identifier;
2345        }
2346
2347        /**
2348         * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).)
2349         */
2350        public Reference getSupervisorReference() throws FHIRException { 
2351          if (!(this.supervisor instanceof Reference))
2352            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.supervisor.getClass().getName()+" was encountered");
2353          return (Reference) this.supervisor;
2354        }
2355
2356        public boolean hasSupervisorReference() { 
2357          return this.supervisor instanceof Reference;
2358        }
2359
2360        public boolean hasSupervisor() { 
2361          return this.supervisor != null && !this.supervisor.isEmpty();
2362        }
2363
2364        /**
2365         * @param value {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).)
2366         */
2367        public ItemsComponent setSupervisor(Type value) { 
2368          this.supervisor = value;
2369          return this;
2370        }
2371
2372        /**
2373         * @return {@link #providerQualification} (The qualification which is applicable for this service.)
2374         */
2375        public Coding getProviderQualification() { 
2376          if (this.providerQualification == null)
2377            if (Configuration.errorOnAutoCreate())
2378              throw new Error("Attempt to auto-create ItemsComponent.providerQualification");
2379            else if (Configuration.doAutoCreate())
2380              this.providerQualification = new Coding(); // cc
2381          return this.providerQualification;
2382        }
2383
2384        public boolean hasProviderQualification() { 
2385          return this.providerQualification != null && !this.providerQualification.isEmpty();
2386        }
2387
2388        /**
2389         * @param value {@link #providerQualification} (The qualification which is applicable for this service.)
2390         */
2391        public ItemsComponent setProviderQualification(Coding value) { 
2392          this.providerQualification = value;
2393          return this;
2394        }
2395
2396        /**
2397         * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
2398         */
2399        public List<PositiveIntType> getDiagnosisLinkId() { 
2400          if (this.diagnosisLinkId == null)
2401            this.diagnosisLinkId = new ArrayList<PositiveIntType>();
2402          return this.diagnosisLinkId;
2403        }
2404
2405        public boolean hasDiagnosisLinkId() { 
2406          if (this.diagnosisLinkId == null)
2407            return false;
2408          for (PositiveIntType item : this.diagnosisLinkId)
2409            if (!item.isEmpty())
2410              return true;
2411          return false;
2412        }
2413
2414        /**
2415         * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
2416         */
2417    // syntactic sugar
2418        public PositiveIntType addDiagnosisLinkIdElement() {//2 
2419          PositiveIntType t = new PositiveIntType();
2420          if (this.diagnosisLinkId == null)
2421            this.diagnosisLinkId = new ArrayList<PositiveIntType>();
2422          this.diagnosisLinkId.add(t);
2423          return t;
2424        }
2425
2426        /**
2427         * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
2428         */
2429        public ItemsComponent addDiagnosisLinkId(int value) { //1
2430          PositiveIntType t = new PositiveIntType();
2431          t.setValue(value);
2432          if (this.diagnosisLinkId == null)
2433            this.diagnosisLinkId = new ArrayList<PositiveIntType>();
2434          this.diagnosisLinkId.add(t);
2435          return this;
2436        }
2437
2438        /**
2439         * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.)
2440         */
2441        public boolean hasDiagnosisLinkId(int value) { 
2442          if (this.diagnosisLinkId == null)
2443            return false;
2444          for (PositiveIntType v : this.diagnosisLinkId)
2445            if (v.equals(value)) // positiveInt
2446              return true;
2447          return false;
2448        }
2449
2450        /**
2451         * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.)
2452         */
2453        public Coding getService() { 
2454          if (this.service == null)
2455            if (Configuration.errorOnAutoCreate())
2456              throw new Error("Attempt to auto-create ItemsComponent.service");
2457            else if (Configuration.doAutoCreate())
2458              this.service = new Coding(); // cc
2459          return this.service;
2460        }
2461
2462        public boolean hasService() { 
2463          return this.service != null && !this.service.isEmpty();
2464        }
2465
2466        /**
2467         * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.)
2468         */
2469        public ItemsComponent setService(Coding value) { 
2470          this.service = value;
2471          return this;
2472        }
2473
2474        /**
2475         * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.)
2476         */
2477        public List<Coding> getServiceModifier() { 
2478          if (this.serviceModifier == null)
2479            this.serviceModifier = new ArrayList<Coding>();
2480          return this.serviceModifier;
2481        }
2482
2483        public boolean hasServiceModifier() { 
2484          if (this.serviceModifier == null)
2485            return false;
2486          for (Coding item : this.serviceModifier)
2487            if (!item.isEmpty())
2488              return true;
2489          return false;
2490        }
2491
2492        /**
2493         * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.)
2494         */
2495    // syntactic sugar
2496        public Coding addServiceModifier() { //3
2497          Coding t = new Coding();
2498          if (this.serviceModifier == null)
2499            this.serviceModifier = new ArrayList<Coding>();
2500          this.serviceModifier.add(t);
2501          return t;
2502        }
2503
2504    // syntactic sugar
2505        public ItemsComponent addServiceModifier(Coding t) { //3
2506          if (t == null)
2507            return this;
2508          if (this.serviceModifier == null)
2509            this.serviceModifier = new ArrayList<Coding>();
2510          this.serviceModifier.add(t);
2511          return this;
2512        }
2513
2514        /**
2515         * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.)
2516         */
2517        public List<Coding> getModifier() { 
2518          if (this.modifier == null)
2519            this.modifier = new ArrayList<Coding>();
2520          return this.modifier;
2521        }
2522
2523        public boolean hasModifier() { 
2524          if (this.modifier == null)
2525            return false;
2526          for (Coding item : this.modifier)
2527            if (!item.isEmpty())
2528              return true;
2529          return false;
2530        }
2531
2532        /**
2533         * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.)
2534         */
2535    // syntactic sugar
2536        public Coding addModifier() { //3
2537          Coding t = new Coding();
2538          if (this.modifier == null)
2539            this.modifier = new ArrayList<Coding>();
2540          this.modifier.add(t);
2541          return t;
2542        }
2543
2544    // syntactic sugar
2545        public ItemsComponent addModifier(Coding t) { //3
2546          if (t == null)
2547            return this;
2548          if (this.modifier == null)
2549            this.modifier = new ArrayList<Coding>();
2550          this.modifier.add(t);
2551          return this;
2552        }
2553
2554        /**
2555         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
2556         */
2557        public List<Coding> getProgramCode() { 
2558          if (this.programCode == null)
2559            this.programCode = new ArrayList<Coding>();
2560          return this.programCode;
2561        }
2562
2563        public boolean hasProgramCode() { 
2564          if (this.programCode == null)
2565            return false;
2566          for (Coding item : this.programCode)
2567            if (!item.isEmpty())
2568              return true;
2569          return false;
2570        }
2571
2572        /**
2573         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
2574         */
2575    // syntactic sugar
2576        public Coding addProgramCode() { //3
2577          Coding t = new Coding();
2578          if (this.programCode == null)
2579            this.programCode = new ArrayList<Coding>();
2580          this.programCode.add(t);
2581          return t;
2582        }
2583
2584    // syntactic sugar
2585        public ItemsComponent addProgramCode(Coding t) { //3
2586          if (t == null)
2587            return this;
2588          if (this.programCode == null)
2589            this.programCode = new ArrayList<Coding>();
2590          this.programCode.add(t);
2591          return this;
2592        }
2593
2594        /**
2595         * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2596         */
2597        public Type getServiced() { 
2598          return this.serviced;
2599        }
2600
2601        /**
2602         * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2603         */
2604        public DateType getServicedDateType() throws FHIRException { 
2605          if (!(this.serviced instanceof DateType))
2606            throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered");
2607          return (DateType) this.serviced;
2608        }
2609
2610        public boolean hasServicedDateType() { 
2611          return this.serviced instanceof DateType;
2612        }
2613
2614        /**
2615         * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2616         */
2617        public Period getServicedPeriod() throws FHIRException { 
2618          if (!(this.serviced instanceof Period))
2619            throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered");
2620          return (Period) this.serviced;
2621        }
2622
2623        public boolean hasServicedPeriod() { 
2624          return this.serviced instanceof Period;
2625        }
2626
2627        public boolean hasServiced() { 
2628          return this.serviced != null && !this.serviced.isEmpty();
2629        }
2630
2631        /**
2632         * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.)
2633         */
2634        public ItemsComponent setServiced(Type value) { 
2635          this.serviced = value;
2636          return this;
2637        }
2638
2639        /**
2640         * @return {@link #place} (Where the service was provided.)
2641         */
2642        public Coding getPlace() { 
2643          if (this.place == null)
2644            if (Configuration.errorOnAutoCreate())
2645              throw new Error("Attempt to auto-create ItemsComponent.place");
2646            else if (Configuration.doAutoCreate())
2647              this.place = new Coding(); // cc
2648          return this.place;
2649        }
2650
2651        public boolean hasPlace() { 
2652          return this.place != null && !this.place.isEmpty();
2653        }
2654
2655        /**
2656         * @param value {@link #place} (Where the service was provided.)
2657         */
2658        public ItemsComponent setPlace(Coding value) { 
2659          this.place = value;
2660          return this;
2661        }
2662
2663        /**
2664         * @return {@link #quantity} (The number of repetitions of a service or product.)
2665         */
2666        public SimpleQuantity getQuantity() { 
2667          if (this.quantity == null)
2668            if (Configuration.errorOnAutoCreate())
2669              throw new Error("Attempt to auto-create ItemsComponent.quantity");
2670            else if (Configuration.doAutoCreate())
2671              this.quantity = new SimpleQuantity(); // cc
2672          return this.quantity;
2673        }
2674
2675        public boolean hasQuantity() { 
2676          return this.quantity != null && !this.quantity.isEmpty();
2677        }
2678
2679        /**
2680         * @param value {@link #quantity} (The number of repetitions of a service or product.)
2681         */
2682        public ItemsComponent setQuantity(SimpleQuantity value) { 
2683          this.quantity = value;
2684          return this;
2685        }
2686
2687        /**
2688         * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.)
2689         */
2690        public Money getUnitPrice() { 
2691          if (this.unitPrice == null)
2692            if (Configuration.errorOnAutoCreate())
2693              throw new Error("Attempt to auto-create ItemsComponent.unitPrice");
2694            else if (Configuration.doAutoCreate())
2695              this.unitPrice = new Money(); // cc
2696          return this.unitPrice;
2697        }
2698
2699        public boolean hasUnitPrice() { 
2700          return this.unitPrice != null && !this.unitPrice.isEmpty();
2701        }
2702
2703        /**
2704         * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.)
2705         */
2706        public ItemsComponent setUnitPrice(Money value) { 
2707          this.unitPrice = value;
2708          return this;
2709        }
2710
2711        /**
2712         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
2713         */
2714        public DecimalType getFactorElement() { 
2715          if (this.factor == null)
2716            if (Configuration.errorOnAutoCreate())
2717              throw new Error("Attempt to auto-create ItemsComponent.factor");
2718            else if (Configuration.doAutoCreate())
2719              this.factor = new DecimalType(); // bb
2720          return this.factor;
2721        }
2722
2723        public boolean hasFactorElement() { 
2724          return this.factor != null && !this.factor.isEmpty();
2725        }
2726
2727        public boolean hasFactor() { 
2728          return this.factor != null && !this.factor.isEmpty();
2729        }
2730
2731        /**
2732         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
2733         */
2734        public ItemsComponent setFactorElement(DecimalType value) { 
2735          this.factor = value;
2736          return this;
2737        }
2738
2739        /**
2740         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2741         */
2742        public BigDecimal getFactor() { 
2743          return this.factor == null ? null : this.factor.getValue();
2744        }
2745
2746        /**
2747         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2748         */
2749        public ItemsComponent setFactor(BigDecimal value) { 
2750          if (value == null)
2751            this.factor = null;
2752          else {
2753            if (this.factor == null)
2754              this.factor = new DecimalType();
2755            this.factor.setValue(value);
2756          }
2757          return this;
2758        }
2759
2760        /**
2761         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2762         */
2763        public ItemsComponent setFactor(long value) { 
2764              this.factor = new DecimalType();
2765            this.factor.setValue(value);
2766          return this;
2767        }
2768
2769        /**
2770         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
2771         */
2772        public ItemsComponent setFactor(double value) { 
2773              this.factor = new DecimalType();
2774            this.factor.setValue(value);
2775          return this;
2776        }
2777
2778        /**
2779         * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
2780         */
2781        public DecimalType getPointsElement() { 
2782          if (this.points == null)
2783            if (Configuration.errorOnAutoCreate())
2784              throw new Error("Attempt to auto-create ItemsComponent.points");
2785            else if (Configuration.doAutoCreate())
2786              this.points = new DecimalType(); // bb
2787          return this.points;
2788        }
2789
2790        public boolean hasPointsElement() { 
2791          return this.points != null && !this.points.isEmpty();
2792        }
2793
2794        public boolean hasPoints() { 
2795          return this.points != null && !this.points.isEmpty();
2796        }
2797
2798        /**
2799         * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
2800         */
2801        public ItemsComponent setPointsElement(DecimalType value) { 
2802          this.points = value;
2803          return this;
2804        }
2805
2806        /**
2807         * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
2808         */
2809        public BigDecimal getPoints() { 
2810          return this.points == null ? null : this.points.getValue();
2811        }
2812
2813        /**
2814         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
2815         */
2816        public ItemsComponent setPoints(BigDecimal value) { 
2817          if (value == null)
2818            this.points = null;
2819          else {
2820            if (this.points == null)
2821              this.points = new DecimalType();
2822            this.points.setValue(value);
2823          }
2824          return this;
2825        }
2826
2827        /**
2828         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
2829         */
2830        public ItemsComponent setPoints(long value) { 
2831              this.points = new DecimalType();
2832            this.points.setValue(value);
2833          return this;
2834        }
2835
2836        /**
2837         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
2838         */
2839        public ItemsComponent setPoints(double value) { 
2840              this.points = new DecimalType();
2841            this.points.setValue(value);
2842          return this;
2843        }
2844
2845        /**
2846         * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
2847         */
2848        public Money getNet() { 
2849          if (this.net == null)
2850            if (Configuration.errorOnAutoCreate())
2851              throw new Error("Attempt to auto-create ItemsComponent.net");
2852            else if (Configuration.doAutoCreate())
2853              this.net = new Money(); // cc
2854          return this.net;
2855        }
2856
2857        public boolean hasNet() { 
2858          return this.net != null && !this.net.isEmpty();
2859        }
2860
2861        /**
2862         * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
2863         */
2864        public ItemsComponent setNet(Money value) { 
2865          this.net = value;
2866          return this;
2867        }
2868
2869        /**
2870         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
2871         */
2872        public List<Reference> getUdi() { 
2873          if (this.udi == null)
2874            this.udi = new ArrayList<Reference>();
2875          return this.udi;
2876        }
2877
2878        public boolean hasUdi() { 
2879          if (this.udi == null)
2880            return false;
2881          for (Reference item : this.udi)
2882            if (!item.isEmpty())
2883              return true;
2884          return false;
2885        }
2886
2887        /**
2888         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
2889         */
2890    // syntactic sugar
2891        public Reference addUdi() { //3
2892          Reference t = new Reference();
2893          if (this.udi == null)
2894            this.udi = new ArrayList<Reference>();
2895          this.udi.add(t);
2896          return t;
2897        }
2898
2899    // syntactic sugar
2900        public ItemsComponent addUdi(Reference t) { //3
2901          if (t == null)
2902            return this;
2903          if (this.udi == null)
2904            this.udi = new ArrayList<Reference>();
2905          this.udi.add(t);
2906          return this;
2907        }
2908
2909        /**
2910         * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
2911         */
2912        public List<Device> getUdiTarget() { 
2913          if (this.udiTarget == null)
2914            this.udiTarget = new ArrayList<Device>();
2915          return this.udiTarget;
2916        }
2917
2918    // syntactic sugar
2919        /**
2920         * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
2921         */
2922        public Device addUdiTarget() { 
2923          Device r = new Device();
2924          if (this.udiTarget == null)
2925            this.udiTarget = new ArrayList<Device>();
2926          this.udiTarget.add(r);
2927          return r;
2928        }
2929
2930        /**
2931         * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).)
2932         */
2933        public Coding getBodySite() { 
2934          if (this.bodySite == null)
2935            if (Configuration.errorOnAutoCreate())
2936              throw new Error("Attempt to auto-create ItemsComponent.bodySite");
2937            else if (Configuration.doAutoCreate())
2938              this.bodySite = new Coding(); // cc
2939          return this.bodySite;
2940        }
2941
2942        public boolean hasBodySite() { 
2943          return this.bodySite != null && !this.bodySite.isEmpty();
2944        }
2945
2946        /**
2947         * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).)
2948         */
2949        public ItemsComponent setBodySite(Coding value) { 
2950          this.bodySite = value;
2951          return this;
2952        }
2953
2954        /**
2955         * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).)
2956         */
2957        public List<Coding> getSubSite() { 
2958          if (this.subSite == null)
2959            this.subSite = new ArrayList<Coding>();
2960          return this.subSite;
2961        }
2962
2963        public boolean hasSubSite() { 
2964          if (this.subSite == null)
2965            return false;
2966          for (Coding item : this.subSite)
2967            if (!item.isEmpty())
2968              return true;
2969          return false;
2970        }
2971
2972        /**
2973         * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).)
2974         */
2975    // syntactic sugar
2976        public Coding addSubSite() { //3
2977          Coding t = new Coding();
2978          if (this.subSite == null)
2979            this.subSite = new ArrayList<Coding>();
2980          this.subSite.add(t);
2981          return t;
2982        }
2983
2984    // syntactic sugar
2985        public ItemsComponent addSubSite(Coding t) { //3
2986          if (t == null)
2987            return this;
2988          if (this.subSite == null)
2989            this.subSite = new ArrayList<Coding>();
2990          this.subSite.add(t);
2991          return this;
2992        }
2993
2994        /**
2995         * @return {@link #detail} (Second tier of goods and services.)
2996         */
2997        public List<DetailComponent> getDetail() { 
2998          if (this.detail == null)
2999            this.detail = new ArrayList<DetailComponent>();
3000          return this.detail;
3001        }
3002
3003        public boolean hasDetail() { 
3004          if (this.detail == null)
3005            return false;
3006          for (DetailComponent item : this.detail)
3007            if (!item.isEmpty())
3008              return true;
3009          return false;
3010        }
3011
3012        /**
3013         * @return {@link #detail} (Second tier of goods and services.)
3014         */
3015    // syntactic sugar
3016        public DetailComponent addDetail() { //3
3017          DetailComponent t = new DetailComponent();
3018          if (this.detail == null)
3019            this.detail = new ArrayList<DetailComponent>();
3020          this.detail.add(t);
3021          return t;
3022        }
3023
3024    // syntactic sugar
3025        public ItemsComponent addDetail(DetailComponent t) { //3
3026          if (t == null)
3027            return this;
3028          if (this.detail == null)
3029            this.detail = new ArrayList<DetailComponent>();
3030          this.detail.add(t);
3031          return this;
3032        }
3033
3034        /**
3035         * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.)
3036         */
3037        public ProsthesisComponent getProsthesis() { 
3038          if (this.prosthesis == null)
3039            if (Configuration.errorOnAutoCreate())
3040              throw new Error("Attempt to auto-create ItemsComponent.prosthesis");
3041            else if (Configuration.doAutoCreate())
3042              this.prosthesis = new ProsthesisComponent(); // cc
3043          return this.prosthesis;
3044        }
3045
3046        public boolean hasProsthesis() { 
3047          return this.prosthesis != null && !this.prosthesis.isEmpty();
3048        }
3049
3050        /**
3051         * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.)
3052         */
3053        public ItemsComponent setProsthesis(ProsthesisComponent value) { 
3054          this.prosthesis = value;
3055          return this;
3056        }
3057
3058        protected void listChildren(List<Property> childrenList) {
3059          super.listChildren(childrenList);
3060          childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence));
3061          childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type));
3062          childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider));
3063          childrenList.add(new Property("supervisor[x]", "Identifier|Reference(Practitioner)", "The practitioner who is supervising the work of the servicing provider(s).", 0, java.lang.Integer.MAX_VALUE, supervisor));
3064          childrenList.add(new Property("providerQualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, providerQualification));
3065          childrenList.add(new Property("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId));
3066          childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service));
3067          childrenList.add(new Property("serviceModifier", "Coding", "Unusual circumstances which may influence adjudication.", 0, java.lang.Integer.MAX_VALUE, serviceModifier));
3068          childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier));
3069          childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode));
3070          childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced));
3071          childrenList.add(new Property("place", "Coding", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, place));
3072          childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity));
3073          childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice));
3074          childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor));
3075          childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points));
3076          childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net));
3077          childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi));
3078          childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite));
3079          childrenList.add(new Property("subSite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite));
3080          childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail));
3081          childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis));
3082        }
3083
3084      @Override
3085      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3086        switch (hash) {
3087        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
3088        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
3089        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type
3090        case -1697229976: /*supervisor*/ return this.supervisor == null ? new Base[0] : new Base[] {this.supervisor}; // Type
3091        case -1240156290: /*providerQualification*/ return this.providerQualification == null ? new Base[0] : new Base[] {this.providerQualification}; // Coding
3092        case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType
3093        case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding
3094        case 615164076: /*serviceModifier*/ return this.serviceModifier == null ? new Base[0] : this.serviceModifier.toArray(new Base[this.serviceModifier.size()]); // Coding
3095        case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding
3096        case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding
3097        case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type
3098        case 106748167: /*place*/ return this.place == null ? new Base[0] : new Base[] {this.place}; // Coding
3099        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
3100        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
3101        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
3102        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
3103        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
3104        case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference
3105        case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding
3106        case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding
3107        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent
3108        case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent
3109        default: return super.getProperty(hash, name, checkValid);
3110        }
3111
3112      }
3113
3114      @Override
3115      public void setProperty(int hash, String name, Base value) throws FHIRException {
3116        switch (hash) {
3117        case 1349547969: // sequence
3118          this.sequence = castToPositiveInt(value); // PositiveIntType
3119          break;
3120        case 3575610: // type
3121          this.type = castToCoding(value); // Coding
3122          break;
3123        case -987494927: // provider
3124          this.provider = (Type) value; // Type
3125          break;
3126        case -1697229976: // supervisor
3127          this.supervisor = (Type) value; // Type
3128          break;
3129        case -1240156290: // providerQualification
3130          this.providerQualification = castToCoding(value); // Coding
3131          break;
3132        case -1659207418: // diagnosisLinkId
3133          this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType
3134          break;
3135        case 1984153269: // service
3136          this.service = castToCoding(value); // Coding
3137          break;
3138        case 615164076: // serviceModifier
3139          this.getServiceModifier().add(castToCoding(value)); // Coding
3140          break;
3141        case -615513385: // modifier
3142          this.getModifier().add(castToCoding(value)); // Coding
3143          break;
3144        case 1010065041: // programCode
3145          this.getProgramCode().add(castToCoding(value)); // Coding
3146          break;
3147        case 1379209295: // serviced
3148          this.serviced = (Type) value; // Type
3149          break;
3150        case 106748167: // place
3151          this.place = castToCoding(value); // Coding
3152          break;
3153        case -1285004149: // quantity
3154          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
3155          break;
3156        case -486196699: // unitPrice
3157          this.unitPrice = castToMoney(value); // Money
3158          break;
3159        case -1282148017: // factor
3160          this.factor = castToDecimal(value); // DecimalType
3161          break;
3162        case -982754077: // points
3163          this.points = castToDecimal(value); // DecimalType
3164          break;
3165        case 108957: // net
3166          this.net = castToMoney(value); // Money
3167          break;
3168        case 115642: // udi
3169          this.getUdi().add(castToReference(value)); // Reference
3170          break;
3171        case 1702620169: // bodySite
3172          this.bodySite = castToCoding(value); // Coding
3173          break;
3174        case -1868566105: // subSite
3175          this.getSubSite().add(castToCoding(value)); // Coding
3176          break;
3177        case -1335224239: // detail
3178          this.getDetail().add((DetailComponent) value); // DetailComponent
3179          break;
3180        case -2138744398: // prosthesis
3181          this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent
3182          break;
3183        default: super.setProperty(hash, name, value);
3184        }
3185
3186      }
3187
3188      @Override
3189      public void setProperty(String name, Base value) throws FHIRException {
3190        if (name.equals("sequence"))
3191          this.sequence = castToPositiveInt(value); // PositiveIntType
3192        else if (name.equals("type"))
3193          this.type = castToCoding(value); // Coding
3194        else if (name.equals("provider[x]"))
3195          this.provider = (Type) value; // Type
3196        else if (name.equals("supervisor[x]"))
3197          this.supervisor = (Type) value; // Type
3198        else if (name.equals("providerQualification"))
3199          this.providerQualification = castToCoding(value); // Coding
3200        else if (name.equals("diagnosisLinkId"))
3201          this.getDiagnosisLinkId().add(castToPositiveInt(value));
3202        else if (name.equals("service"))
3203          this.service = castToCoding(value); // Coding
3204        else if (name.equals("serviceModifier"))
3205          this.getServiceModifier().add(castToCoding(value));
3206        else if (name.equals("modifier"))
3207          this.getModifier().add(castToCoding(value));
3208        else if (name.equals("programCode"))
3209          this.getProgramCode().add(castToCoding(value));
3210        else if (name.equals("serviced[x]"))
3211          this.serviced = (Type) value; // Type
3212        else if (name.equals("place"))
3213          this.place = castToCoding(value); // Coding
3214        else if (name.equals("quantity"))
3215          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
3216        else if (name.equals("unitPrice"))
3217          this.unitPrice = castToMoney(value); // Money
3218        else if (name.equals("factor"))
3219          this.factor = castToDecimal(value); // DecimalType
3220        else if (name.equals("points"))
3221          this.points = castToDecimal(value); // DecimalType
3222        else if (name.equals("net"))
3223          this.net = castToMoney(value); // Money
3224        else if (name.equals("udi"))
3225          this.getUdi().add(castToReference(value));
3226        else if (name.equals("bodySite"))
3227          this.bodySite = castToCoding(value); // Coding
3228        else if (name.equals("subSite"))
3229          this.getSubSite().add(castToCoding(value));
3230        else if (name.equals("detail"))
3231          this.getDetail().add((DetailComponent) value);
3232        else if (name.equals("prosthesis"))
3233          this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent
3234        else
3235          super.setProperty(name, value);
3236      }
3237
3238      @Override
3239      public Base makeProperty(int hash, String name) throws FHIRException {
3240        switch (hash) {
3241        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
3242        case 3575610:  return getType(); // Coding
3243        case 2064698607:  return getProvider(); // Type
3244        case -1823115240:  return getSupervisor(); // Type
3245        case -1240156290:  return getProviderQualification(); // Coding
3246        case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType
3247        case 1984153269:  return getService(); // Coding
3248        case 615164076:  return addServiceModifier(); // Coding
3249        case -615513385:  return addModifier(); // Coding
3250        case 1010065041:  return addProgramCode(); // Coding
3251        case -1927922223:  return getServiced(); // Type
3252        case 106748167:  return getPlace(); // Coding
3253        case -1285004149:  return getQuantity(); // SimpleQuantity
3254        case -486196699:  return getUnitPrice(); // Money
3255        case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType
3256        case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType
3257        case 108957:  return getNet(); // Money
3258        case 115642:  return addUdi(); // Reference
3259        case 1702620169:  return getBodySite(); // Coding
3260        case -1868566105:  return addSubSite(); // Coding
3261        case -1335224239:  return addDetail(); // DetailComponent
3262        case -2138744398:  return getProsthesis(); // ProsthesisComponent
3263        default: return super.makeProperty(hash, name);
3264        }
3265
3266      }
3267
3268      @Override
3269      public Base addChild(String name) throws FHIRException {
3270        if (name.equals("sequence")) {
3271          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
3272        }
3273        else if (name.equals("type")) {
3274          this.type = new Coding();
3275          return this.type;
3276        }
3277        else if (name.equals("providerIdentifier")) {
3278          this.provider = new Identifier();
3279          return this.provider;
3280        }
3281        else if (name.equals("providerReference")) {
3282          this.provider = new Reference();
3283          return this.provider;
3284        }
3285        else if (name.equals("supervisorIdentifier")) {
3286          this.supervisor = new Identifier();
3287          return this.supervisor;
3288        }
3289        else if (name.equals("supervisorReference")) {
3290          this.supervisor = new Reference();
3291          return this.supervisor;
3292        }
3293        else if (name.equals("providerQualification")) {
3294          this.providerQualification = new Coding();
3295          return this.providerQualification;
3296        }
3297        else if (name.equals("diagnosisLinkId")) {
3298          throw new FHIRException("Cannot call addChild on a primitive type Claim.diagnosisLinkId");
3299        }
3300        else if (name.equals("service")) {
3301          this.service = new Coding();
3302          return this.service;
3303        }
3304        else if (name.equals("serviceModifier")) {
3305          return addServiceModifier();
3306        }
3307        else if (name.equals("modifier")) {
3308          return addModifier();
3309        }
3310        else if (name.equals("programCode")) {
3311          return addProgramCode();
3312        }
3313        else if (name.equals("servicedDate")) {
3314          this.serviced = new DateType();
3315          return this.serviced;
3316        }
3317        else if (name.equals("servicedPeriod")) {
3318          this.serviced = new Period();
3319          return this.serviced;
3320        }
3321        else if (name.equals("place")) {
3322          this.place = new Coding();
3323          return this.place;
3324        }
3325        else if (name.equals("quantity")) {
3326          this.quantity = new SimpleQuantity();
3327          return this.quantity;
3328        }
3329        else if (name.equals("unitPrice")) {
3330          this.unitPrice = new Money();
3331          return this.unitPrice;
3332        }
3333        else if (name.equals("factor")) {
3334          throw new FHIRException("Cannot call addChild on a primitive type Claim.factor");
3335        }
3336        else if (name.equals("points")) {
3337          throw new FHIRException("Cannot call addChild on a primitive type Claim.points");
3338        }
3339        else if (name.equals("net")) {
3340          this.net = new Money();
3341          return this.net;
3342        }
3343        else if (name.equals("udi")) {
3344          return addUdi();
3345        }
3346        else if (name.equals("bodySite")) {
3347          this.bodySite = new Coding();
3348          return this.bodySite;
3349        }
3350        else if (name.equals("subSite")) {
3351          return addSubSite();
3352        }
3353        else if (name.equals("detail")) {
3354          return addDetail();
3355        }
3356        else if (name.equals("prosthesis")) {
3357          this.prosthesis = new ProsthesisComponent();
3358          return this.prosthesis;
3359        }
3360        else
3361          return super.addChild(name);
3362      }
3363
3364      public ItemsComponent copy() {
3365        ItemsComponent dst = new ItemsComponent();
3366        copyValues(dst);
3367        dst.sequence = sequence == null ? null : sequence.copy();
3368        dst.type = type == null ? null : type.copy();
3369        dst.provider = provider == null ? null : provider.copy();
3370        dst.supervisor = supervisor == null ? null : supervisor.copy();
3371        dst.providerQualification = providerQualification == null ? null : providerQualification.copy();
3372        if (diagnosisLinkId != null) {
3373          dst.diagnosisLinkId = new ArrayList<PositiveIntType>();
3374          for (PositiveIntType i : diagnosisLinkId)
3375            dst.diagnosisLinkId.add(i.copy());
3376        };
3377        dst.service = service == null ? null : service.copy();
3378        if (serviceModifier != null) {
3379          dst.serviceModifier = new ArrayList<Coding>();
3380          for (Coding i : serviceModifier)
3381            dst.serviceModifier.add(i.copy());
3382        };
3383        if (modifier != null) {
3384          dst.modifier = new ArrayList<Coding>();
3385          for (Coding i : modifier)
3386            dst.modifier.add(i.copy());
3387        };
3388        if (programCode != null) {
3389          dst.programCode = new ArrayList<Coding>();
3390          for (Coding i : programCode)
3391            dst.programCode.add(i.copy());
3392        };
3393        dst.serviced = serviced == null ? null : serviced.copy();
3394        dst.place = place == null ? null : place.copy();
3395        dst.quantity = quantity == null ? null : quantity.copy();
3396        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
3397        dst.factor = factor == null ? null : factor.copy();
3398        dst.points = points == null ? null : points.copy();
3399        dst.net = net == null ? null : net.copy();
3400        if (udi != null) {
3401          dst.udi = new ArrayList<Reference>();
3402          for (Reference i : udi)
3403            dst.udi.add(i.copy());
3404        };
3405        dst.bodySite = bodySite == null ? null : bodySite.copy();
3406        if (subSite != null) {
3407          dst.subSite = new ArrayList<Coding>();
3408          for (Coding i : subSite)
3409            dst.subSite.add(i.copy());
3410        };
3411        if (detail != null) {
3412          dst.detail = new ArrayList<DetailComponent>();
3413          for (DetailComponent i : detail)
3414            dst.detail.add(i.copy());
3415        };
3416        dst.prosthesis = prosthesis == null ? null : prosthesis.copy();
3417        return dst;
3418      }
3419
3420      @Override
3421      public boolean equalsDeep(Base other) {
3422        if (!super.equalsDeep(other))
3423          return false;
3424        if (!(other instanceof ItemsComponent))
3425          return false;
3426        ItemsComponent o = (ItemsComponent) other;
3427        return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true)
3428           && compareDeep(supervisor, o.supervisor, true) && compareDeep(providerQualification, o.providerQualification, true)
3429           && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true)
3430           && compareDeep(serviceModifier, o.serviceModifier, true) && compareDeep(modifier, o.modifier, true)
3431           && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(place, o.place, true)
3432           && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true)
3433           && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true)
3434           && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) && compareDeep(detail, o.detail, true)
3435           && compareDeep(prosthesis, o.prosthesis, true);
3436      }
3437
3438      @Override
3439      public boolean equalsShallow(Base other) {
3440        if (!super.equalsShallow(other))
3441          return false;
3442        if (!(other instanceof ItemsComponent))
3443          return false;
3444        ItemsComponent o = (ItemsComponent) other;
3445        return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true)
3446           && compareValues(factor, o.factor, true) && compareValues(points, o.points, true);
3447      }
3448
3449      public boolean isEmpty() {
3450        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty())
3451           && (provider == null || provider.isEmpty()) && (supervisor == null || supervisor.isEmpty())
3452           && (providerQualification == null || providerQualification.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty())
3453           && (service == null || service.isEmpty()) && (serviceModifier == null || serviceModifier.isEmpty())
3454           && (modifier == null || modifier.isEmpty()) && (programCode == null || programCode.isEmpty())
3455           && (serviced == null || serviced.isEmpty()) && (place == null || place.isEmpty()) && (quantity == null || quantity.isEmpty())
3456           && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty())
3457           && (net == null || net.isEmpty()) && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty())
3458           && (subSite == null || subSite.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty())
3459          ;
3460      }
3461
3462  public String fhirType() {
3463    return "Claim.item";
3464
3465  }
3466
3467  }
3468
3469    @Block()
3470    public static class DetailComponent extends BackboneElement implements IBaseBackboneElement {
3471        /**
3472         * A service line number.
3473         */
3474        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
3475        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
3476        protected PositiveIntType sequence;
3477
3478        /**
3479         * The type of product or service.
3480         */
3481        @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
3482        @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." )
3483        protected Coding type;
3484
3485        /**
3486         * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.
3487         */
3488        @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true)
3489        @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." )
3490        protected Coding service;
3491
3492        /**
3493         * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.
3494         */
3495        @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3496        @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." )
3497        protected List<Coding> programCode;
3498
3499        /**
3500         * The number of repetitions of a service or product.
3501         */
3502        @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
3503        @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." )
3504        protected SimpleQuantity quantity;
3505
3506        /**
3507         * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.
3508         */
3509        @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true)
3510        @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." )
3511        protected Money unitPrice;
3512
3513        /**
3514         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3515         */
3516        @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
3517        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
3518        protected DecimalType factor;
3519
3520        /**
3521         * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
3522         */
3523        @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true)
3524        @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." )
3525        protected DecimalType points;
3526
3527        /**
3528         * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
3529         */
3530        @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true)
3531        @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." )
3532        protected Money net;
3533
3534        /**
3535         * List of Unique Device Identifiers associated with this line item.
3536         */
3537        @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3538        @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." )
3539        protected List<Reference> udi;
3540        /**
3541         * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.)
3542         */
3543        protected List<Device> udiTarget;
3544
3545
3546        /**
3547         * Third tier of goods and services.
3548         */
3549        @Child(name = "subDetail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
3550        @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." )
3551        protected List<SubDetailComponent> subDetail;
3552
3553        private static final long serialVersionUID = -1099698352L;
3554
3555    /**
3556     * Constructor
3557     */
3558      public DetailComponent() {
3559        super();
3560      }
3561
3562    /**
3563     * Constructor
3564     */
3565      public DetailComponent(PositiveIntType sequence, Coding type, Coding service) {
3566        super();
3567        this.sequence = sequence;
3568        this.type = type;
3569        this.service = service;
3570      }
3571
3572        /**
3573         * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
3574         */
3575        public PositiveIntType getSequenceElement() { 
3576          if (this.sequence == null)
3577            if (Configuration.errorOnAutoCreate())
3578              throw new Error("Attempt to auto-create DetailComponent.sequence");
3579            else if (Configuration.doAutoCreate())
3580              this.sequence = new PositiveIntType(); // bb
3581          return this.sequence;
3582        }
3583
3584        public boolean hasSequenceElement() { 
3585          return this.sequence != null && !this.sequence.isEmpty();
3586        }
3587
3588        public boolean hasSequence() { 
3589          return this.sequence != null && !this.sequence.isEmpty();
3590        }
3591
3592        /**
3593         * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
3594         */
3595        public DetailComponent setSequenceElement(PositiveIntType value) { 
3596          this.sequence = value;
3597          return this;
3598        }
3599
3600        /**
3601         * @return A service line number.
3602         */
3603        public int getSequence() { 
3604          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
3605        }
3606
3607        /**
3608         * @param value A service line number.
3609         */
3610        public DetailComponent setSequence(int value) { 
3611            if (this.sequence == null)
3612              this.sequence = new PositiveIntType();
3613            this.sequence.setValue(value);
3614          return this;
3615        }
3616
3617        /**
3618         * @return {@link #type} (The type of product or service.)
3619         */
3620        public Coding getType() { 
3621          if (this.type == null)
3622            if (Configuration.errorOnAutoCreate())
3623              throw new Error("Attempt to auto-create DetailComponent.type");
3624            else if (Configuration.doAutoCreate())
3625              this.type = new Coding(); // cc
3626          return this.type;
3627        }
3628
3629        public boolean hasType() { 
3630          return this.type != null && !this.type.isEmpty();
3631        }
3632
3633        /**
3634         * @param value {@link #type} (The type of product or service.)
3635         */
3636        public DetailComponent setType(Coding value) { 
3637          this.type = value;
3638          return this;
3639        }
3640
3641        /**
3642         * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.)
3643         */
3644        public Coding getService() { 
3645          if (this.service == null)
3646            if (Configuration.errorOnAutoCreate())
3647              throw new Error("Attempt to auto-create DetailComponent.service");
3648            else if (Configuration.doAutoCreate())
3649              this.service = new Coding(); // cc
3650          return this.service;
3651        }
3652
3653        public boolean hasService() { 
3654          return this.service != null && !this.service.isEmpty();
3655        }
3656
3657        /**
3658         * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.)
3659         */
3660        public DetailComponent setService(Coding value) { 
3661          this.service = value;
3662          return this;
3663        }
3664
3665        /**
3666         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
3667         */
3668        public List<Coding> getProgramCode() { 
3669          if (this.programCode == null)
3670            this.programCode = new ArrayList<Coding>();
3671          return this.programCode;
3672        }
3673
3674        public boolean hasProgramCode() { 
3675          if (this.programCode == null)
3676            return false;
3677          for (Coding item : this.programCode)
3678            if (!item.isEmpty())
3679              return true;
3680          return false;
3681        }
3682
3683        /**
3684         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
3685         */
3686    // syntactic sugar
3687        public Coding addProgramCode() { //3
3688          Coding t = new Coding();
3689          if (this.programCode == null)
3690            this.programCode = new ArrayList<Coding>();
3691          this.programCode.add(t);
3692          return t;
3693        }
3694
3695    // syntactic sugar
3696        public DetailComponent addProgramCode(Coding t) { //3
3697          if (t == null)
3698            return this;
3699          if (this.programCode == null)
3700            this.programCode = new ArrayList<Coding>();
3701          this.programCode.add(t);
3702          return this;
3703        }
3704
3705        /**
3706         * @return {@link #quantity} (The number of repetitions of a service or product.)
3707         */
3708        public SimpleQuantity getQuantity() { 
3709          if (this.quantity == null)
3710            if (Configuration.errorOnAutoCreate())
3711              throw new Error("Attempt to auto-create DetailComponent.quantity");
3712            else if (Configuration.doAutoCreate())
3713              this.quantity = new SimpleQuantity(); // cc
3714          return this.quantity;
3715        }
3716
3717        public boolean hasQuantity() { 
3718          return this.quantity != null && !this.quantity.isEmpty();
3719        }
3720
3721        /**
3722         * @param value {@link #quantity} (The number of repetitions of a service or product.)
3723         */
3724        public DetailComponent setQuantity(SimpleQuantity value) { 
3725          this.quantity = value;
3726          return this;
3727        }
3728
3729        /**
3730         * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.)
3731         */
3732        public Money getUnitPrice() { 
3733          if (this.unitPrice == null)
3734            if (Configuration.errorOnAutoCreate())
3735              throw new Error("Attempt to auto-create DetailComponent.unitPrice");
3736            else if (Configuration.doAutoCreate())
3737              this.unitPrice = new Money(); // cc
3738          return this.unitPrice;
3739        }
3740
3741        public boolean hasUnitPrice() { 
3742          return this.unitPrice != null && !this.unitPrice.isEmpty();
3743        }
3744
3745        /**
3746         * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.)
3747         */
3748        public DetailComponent setUnitPrice(Money value) { 
3749          this.unitPrice = value;
3750          return this;
3751        }
3752
3753        /**
3754         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
3755         */
3756        public DecimalType getFactorElement() { 
3757          if (this.factor == null)
3758            if (Configuration.errorOnAutoCreate())
3759              throw new Error("Attempt to auto-create DetailComponent.factor");
3760            else if (Configuration.doAutoCreate())
3761              this.factor = new DecimalType(); // bb
3762          return this.factor;
3763        }
3764
3765        public boolean hasFactorElement() { 
3766          return this.factor != null && !this.factor.isEmpty();
3767        }
3768
3769        public boolean hasFactor() { 
3770          return this.factor != null && !this.factor.isEmpty();
3771        }
3772
3773        /**
3774         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
3775         */
3776        public DetailComponent setFactorElement(DecimalType value) { 
3777          this.factor = value;
3778          return this;
3779        }
3780
3781        /**
3782         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3783         */
3784        public BigDecimal getFactor() { 
3785          return this.factor == null ? null : this.factor.getValue();
3786        }
3787
3788        /**
3789         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3790         */
3791        public DetailComponent setFactor(BigDecimal value) { 
3792          if (value == null)
3793            this.factor = null;
3794          else {
3795            if (this.factor == null)
3796              this.factor = new DecimalType();
3797            this.factor.setValue(value);
3798          }
3799          return this;
3800        }
3801
3802        /**
3803         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3804         */
3805        public DetailComponent setFactor(long value) { 
3806              this.factor = new DecimalType();
3807            this.factor.setValue(value);
3808          return this;
3809        }
3810
3811        /**
3812         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
3813         */
3814        public DetailComponent setFactor(double value) { 
3815              this.factor = new DecimalType();
3816            this.factor.setValue(value);
3817          return this;
3818        }
3819
3820        /**
3821         * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
3822         */
3823        public DecimalType getPointsElement() { 
3824          if (this.points == null)
3825            if (Configuration.errorOnAutoCreate())
3826              throw new Error("Attempt to auto-create DetailComponent.points");
3827            else if (Configuration.doAutoCreate())
3828              this.points = new DecimalType(); // bb
3829          return this.points;
3830        }
3831
3832        public boolean hasPointsElement() { 
3833          return this.points != null && !this.points.isEmpty();
3834        }
3835
3836        public boolean hasPoints() { 
3837          return this.points != null && !this.points.isEmpty();
3838        }
3839
3840        /**
3841         * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
3842         */
3843        public DetailComponent setPointsElement(DecimalType value) { 
3844          this.points = value;
3845          return this;
3846        }
3847
3848        /**
3849         * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
3850         */
3851        public BigDecimal getPoints() { 
3852          return this.points == null ? null : this.points.getValue();
3853        }
3854
3855        /**
3856         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
3857         */
3858        public DetailComponent setPoints(BigDecimal value) { 
3859          if (value == null)
3860            this.points = null;
3861          else {
3862            if (this.points == null)
3863              this.points = new DecimalType();
3864            this.points.setValue(value);
3865          }
3866          return this;
3867        }
3868
3869        /**
3870         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
3871         */
3872        public DetailComponent setPoints(long value) { 
3873              this.points = new DecimalType();
3874            this.points.setValue(value);
3875          return this;
3876        }
3877
3878        /**
3879         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
3880         */
3881        public DetailComponent setPoints(double value) { 
3882              this.points = new DecimalType();
3883            this.points.setValue(value);
3884          return this;
3885        }
3886
3887        /**
3888         * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
3889         */
3890        public Money getNet() { 
3891          if (this.net == null)
3892            if (Configuration.errorOnAutoCreate())
3893              throw new Error("Attempt to auto-create DetailComponent.net");
3894            else if (Configuration.doAutoCreate())
3895              this.net = new Money(); // cc
3896          return this.net;
3897        }
3898
3899        public boolean hasNet() { 
3900          return this.net != null && !this.net.isEmpty();
3901        }
3902
3903        /**
3904         * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
3905         */
3906        public DetailComponent setNet(Money value) { 
3907          this.net = value;
3908          return this;
3909        }
3910
3911        /**
3912         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
3913         */
3914        public List<Reference> getUdi() { 
3915          if (this.udi == null)
3916            this.udi = new ArrayList<Reference>();
3917          return this.udi;
3918        }
3919
3920        public boolean hasUdi() { 
3921          if (this.udi == null)
3922            return false;
3923          for (Reference item : this.udi)
3924            if (!item.isEmpty())
3925              return true;
3926          return false;
3927        }
3928
3929        /**
3930         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
3931         */
3932    // syntactic sugar
3933        public Reference addUdi() { //3
3934          Reference t = new Reference();
3935          if (this.udi == null)
3936            this.udi = new ArrayList<Reference>();
3937          this.udi.add(t);
3938          return t;
3939        }
3940
3941    // syntactic sugar
3942        public DetailComponent addUdi(Reference t) { //3
3943          if (t == null)
3944            return this;
3945          if (this.udi == null)
3946            this.udi = new ArrayList<Reference>();
3947          this.udi.add(t);
3948          return this;
3949        }
3950
3951        /**
3952         * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
3953         */
3954        public List<Device> getUdiTarget() { 
3955          if (this.udiTarget == null)
3956            this.udiTarget = new ArrayList<Device>();
3957          return this.udiTarget;
3958        }
3959
3960    // syntactic sugar
3961        /**
3962         * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
3963         */
3964        public Device addUdiTarget() { 
3965          Device r = new Device();
3966          if (this.udiTarget == null)
3967            this.udiTarget = new ArrayList<Device>();
3968          this.udiTarget.add(r);
3969          return r;
3970        }
3971
3972        /**
3973         * @return {@link #subDetail} (Third tier of goods and services.)
3974         */
3975        public List<SubDetailComponent> getSubDetail() { 
3976          if (this.subDetail == null)
3977            this.subDetail = new ArrayList<SubDetailComponent>();
3978          return this.subDetail;
3979        }
3980
3981        public boolean hasSubDetail() { 
3982          if (this.subDetail == null)
3983            return false;
3984          for (SubDetailComponent item : this.subDetail)
3985            if (!item.isEmpty())
3986              return true;
3987          return false;
3988        }
3989
3990        /**
3991         * @return {@link #subDetail} (Third tier of goods and services.)
3992         */
3993    // syntactic sugar
3994        public SubDetailComponent addSubDetail() { //3
3995          SubDetailComponent t = new SubDetailComponent();
3996          if (this.subDetail == null)
3997            this.subDetail = new ArrayList<SubDetailComponent>();
3998          this.subDetail.add(t);
3999          return t;
4000        }
4001
4002    // syntactic sugar
4003        public DetailComponent addSubDetail(SubDetailComponent t) { //3
4004          if (t == null)
4005            return this;
4006          if (this.subDetail == null)
4007            this.subDetail = new ArrayList<SubDetailComponent>();
4008          this.subDetail.add(t);
4009          return this;
4010        }
4011
4012        protected void listChildren(List<Property> childrenList) {
4013          super.listChildren(childrenList);
4014          childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence));
4015          childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type));
4016          childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service));
4017          childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode));
4018          childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity));
4019          childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice));
4020          childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor));
4021          childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points));
4022          childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net));
4023          childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi));
4024          childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail));
4025        }
4026
4027      @Override
4028      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4029        switch (hash) {
4030        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
4031        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
4032        case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding
4033        case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding
4034        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
4035        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
4036        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
4037        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
4038        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
4039        case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference
4040        case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent
4041        default: return super.getProperty(hash, name, checkValid);
4042        }
4043
4044      }
4045
4046      @Override
4047      public void setProperty(int hash, String name, Base value) throws FHIRException {
4048        switch (hash) {
4049        case 1349547969: // sequence
4050          this.sequence = castToPositiveInt(value); // PositiveIntType
4051          break;
4052        case 3575610: // type
4053          this.type = castToCoding(value); // Coding
4054          break;
4055        case 1984153269: // service
4056          this.service = castToCoding(value); // Coding
4057          break;
4058        case 1010065041: // programCode
4059          this.getProgramCode().add(castToCoding(value)); // Coding
4060          break;
4061        case -1285004149: // quantity
4062          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
4063          break;
4064        case -486196699: // unitPrice
4065          this.unitPrice = castToMoney(value); // Money
4066          break;
4067        case -1282148017: // factor
4068          this.factor = castToDecimal(value); // DecimalType
4069          break;
4070        case -982754077: // points
4071          this.points = castToDecimal(value); // DecimalType
4072          break;
4073        case 108957: // net
4074          this.net = castToMoney(value); // Money
4075          break;
4076        case 115642: // udi
4077          this.getUdi().add(castToReference(value)); // Reference
4078          break;
4079        case -828829007: // subDetail
4080          this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent
4081          break;
4082        default: super.setProperty(hash, name, value);
4083        }
4084
4085      }
4086
4087      @Override
4088      public void setProperty(String name, Base value) throws FHIRException {
4089        if (name.equals("sequence"))
4090          this.sequence = castToPositiveInt(value); // PositiveIntType
4091        else if (name.equals("type"))
4092          this.type = castToCoding(value); // Coding
4093        else if (name.equals("service"))
4094          this.service = castToCoding(value); // Coding
4095        else if (name.equals("programCode"))
4096          this.getProgramCode().add(castToCoding(value));
4097        else if (name.equals("quantity"))
4098          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
4099        else if (name.equals("unitPrice"))
4100          this.unitPrice = castToMoney(value); // Money
4101        else if (name.equals("factor"))
4102          this.factor = castToDecimal(value); // DecimalType
4103        else if (name.equals("points"))
4104          this.points = castToDecimal(value); // DecimalType
4105        else if (name.equals("net"))
4106          this.net = castToMoney(value); // Money
4107        else if (name.equals("udi"))
4108          this.getUdi().add(castToReference(value));
4109        else if (name.equals("subDetail"))
4110          this.getSubDetail().add((SubDetailComponent) value);
4111        else
4112          super.setProperty(name, value);
4113      }
4114
4115      @Override
4116      public Base makeProperty(int hash, String name) throws FHIRException {
4117        switch (hash) {
4118        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
4119        case 3575610:  return getType(); // Coding
4120        case 1984153269:  return getService(); // Coding
4121        case 1010065041:  return addProgramCode(); // Coding
4122        case -1285004149:  return getQuantity(); // SimpleQuantity
4123        case -486196699:  return getUnitPrice(); // Money
4124        case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType
4125        case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType
4126        case 108957:  return getNet(); // Money
4127        case 115642:  return addUdi(); // Reference
4128        case -828829007:  return addSubDetail(); // SubDetailComponent
4129        default: return super.makeProperty(hash, name);
4130        }
4131
4132      }
4133
4134      @Override
4135      public Base addChild(String name) throws FHIRException {
4136        if (name.equals("sequence")) {
4137          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
4138        }
4139        else if (name.equals("type")) {
4140          this.type = new Coding();
4141          return this.type;
4142        }
4143        else if (name.equals("service")) {
4144          this.service = new Coding();
4145          return this.service;
4146        }
4147        else if (name.equals("programCode")) {
4148          return addProgramCode();
4149        }
4150        else if (name.equals("quantity")) {
4151          this.quantity = new SimpleQuantity();
4152          return this.quantity;
4153        }
4154        else if (name.equals("unitPrice")) {
4155          this.unitPrice = new Money();
4156          return this.unitPrice;
4157        }
4158        else if (name.equals("factor")) {
4159          throw new FHIRException("Cannot call addChild on a primitive type Claim.factor");
4160        }
4161        else if (name.equals("points")) {
4162          throw new FHIRException("Cannot call addChild on a primitive type Claim.points");
4163        }
4164        else if (name.equals("net")) {
4165          this.net = new Money();
4166          return this.net;
4167        }
4168        else if (name.equals("udi")) {
4169          return addUdi();
4170        }
4171        else if (name.equals("subDetail")) {
4172          return addSubDetail();
4173        }
4174        else
4175          return super.addChild(name);
4176      }
4177
4178      public DetailComponent copy() {
4179        DetailComponent dst = new DetailComponent();
4180        copyValues(dst);
4181        dst.sequence = sequence == null ? null : sequence.copy();
4182        dst.type = type == null ? null : type.copy();
4183        dst.service = service == null ? null : service.copy();
4184        if (programCode != null) {
4185          dst.programCode = new ArrayList<Coding>();
4186          for (Coding i : programCode)
4187            dst.programCode.add(i.copy());
4188        };
4189        dst.quantity = quantity == null ? null : quantity.copy();
4190        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
4191        dst.factor = factor == null ? null : factor.copy();
4192        dst.points = points == null ? null : points.copy();
4193        dst.net = net == null ? null : net.copy();
4194        if (udi != null) {
4195          dst.udi = new ArrayList<Reference>();
4196          for (Reference i : udi)
4197            dst.udi.add(i.copy());
4198        };
4199        if (subDetail != null) {
4200          dst.subDetail = new ArrayList<SubDetailComponent>();
4201          for (SubDetailComponent i : subDetail)
4202            dst.subDetail.add(i.copy());
4203        };
4204        return dst;
4205      }
4206
4207      @Override
4208      public boolean equalsDeep(Base other) {
4209        if (!super.equalsDeep(other))
4210          return false;
4211        if (!(other instanceof DetailComponent))
4212          return false;
4213        DetailComponent o = (DetailComponent) other;
4214        return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true)
4215           && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true)
4216           && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true)
4217           && compareDeep(udi, o.udi, true) && compareDeep(subDetail, o.subDetail, true);
4218      }
4219
4220      @Override
4221      public boolean equalsShallow(Base other) {
4222        if (!super.equalsShallow(other))
4223          return false;
4224        if (!(other instanceof DetailComponent))
4225          return false;
4226        DetailComponent o = (DetailComponent) other;
4227        return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true)
4228          ;
4229      }
4230
4231      public boolean isEmpty() {
4232        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty())
4233           && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty())
4234           && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty())
4235           && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty())
4236           && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty());
4237      }
4238
4239  public String fhirType() {
4240    return "Claim.item.detail";
4241
4242  }
4243
4244  }
4245
4246    @Block()
4247    public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement {
4248        /**
4249         * A service line number.
4250         */
4251        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true)
4252        @Description(shortDefinition="Service instance", formalDefinition="A service line number." )
4253        protected PositiveIntType sequence;
4254
4255        /**
4256         * The type of product or service.
4257         */
4258        @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true)
4259        @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." )
4260        protected Coding type;
4261
4262        /**
4263         * The fee for an addittional service or product or charge.
4264         */
4265        @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true)
4266        @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." )
4267        protected Coding service;
4268
4269        /**
4270         * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.
4271         */
4272        @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4273        @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." )
4274        protected List<Coding> programCode;
4275
4276        /**
4277         * The number of repetitions of a service or product.
4278         */
4279        @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true)
4280        @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." )
4281        protected SimpleQuantity quantity;
4282
4283        /**
4284         * The fee for an addittional service or product or charge.
4285         */
4286        @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true)
4287        @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional service or product or charge." )
4288        protected Money unitPrice;
4289
4290        /**
4291         * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4292         */
4293        @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true)
4294        @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." )
4295        protected DecimalType factor;
4296
4297        /**
4298         * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
4299         */
4300        @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true)
4301        @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." )
4302        protected DecimalType points;
4303
4304        /**
4305         * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.
4306         */
4307        @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true)
4308        @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." )
4309        protected Money net;
4310
4311        /**
4312         * List of Unique Device Identifiers associated with this line item.
4313         */
4314        @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
4315        @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." )
4316        protected List<Reference> udi;
4317        /**
4318         * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.)
4319         */
4320        protected List<Device> udiTarget;
4321
4322
4323        private static final long serialVersionUID = 846630321L;
4324
4325    /**
4326     * Constructor
4327     */
4328      public SubDetailComponent() {
4329        super();
4330      }
4331
4332    /**
4333     * Constructor
4334     */
4335      public SubDetailComponent(PositiveIntType sequence, Coding type, Coding service) {
4336        super();
4337        this.sequence = sequence;
4338        this.type = type;
4339        this.service = service;
4340      }
4341
4342        /**
4343         * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
4344         */
4345        public PositiveIntType getSequenceElement() { 
4346          if (this.sequence == null)
4347            if (Configuration.errorOnAutoCreate())
4348              throw new Error("Attempt to auto-create SubDetailComponent.sequence");
4349            else if (Configuration.doAutoCreate())
4350              this.sequence = new PositiveIntType(); // bb
4351          return this.sequence;
4352        }
4353
4354        public boolean hasSequenceElement() { 
4355          return this.sequence != null && !this.sequence.isEmpty();
4356        }
4357
4358        public boolean hasSequence() { 
4359          return this.sequence != null && !this.sequence.isEmpty();
4360        }
4361
4362        /**
4363         * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
4364         */
4365        public SubDetailComponent setSequenceElement(PositiveIntType value) { 
4366          this.sequence = value;
4367          return this;
4368        }
4369
4370        /**
4371         * @return A service line number.
4372         */
4373        public int getSequence() { 
4374          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
4375        }
4376
4377        /**
4378         * @param value A service line number.
4379         */
4380        public SubDetailComponent setSequence(int value) { 
4381            if (this.sequence == null)
4382              this.sequence = new PositiveIntType();
4383            this.sequence.setValue(value);
4384          return this;
4385        }
4386
4387        /**
4388         * @return {@link #type} (The type of product or service.)
4389         */
4390        public Coding getType() { 
4391          if (this.type == null)
4392            if (Configuration.errorOnAutoCreate())
4393              throw new Error("Attempt to auto-create SubDetailComponent.type");
4394            else if (Configuration.doAutoCreate())
4395              this.type = new Coding(); // cc
4396          return this.type;
4397        }
4398
4399        public boolean hasType() { 
4400          return this.type != null && !this.type.isEmpty();
4401        }
4402
4403        /**
4404         * @param value {@link #type} (The type of product or service.)
4405         */
4406        public SubDetailComponent setType(Coding value) { 
4407          this.type = value;
4408          return this;
4409        }
4410
4411        /**
4412         * @return {@link #service} (The fee for an addittional service or product or charge.)
4413         */
4414        public Coding getService() { 
4415          if (this.service == null)
4416            if (Configuration.errorOnAutoCreate())
4417              throw new Error("Attempt to auto-create SubDetailComponent.service");
4418            else if (Configuration.doAutoCreate())
4419              this.service = new Coding(); // cc
4420          return this.service;
4421        }
4422
4423        public boolean hasService() { 
4424          return this.service != null && !this.service.isEmpty();
4425        }
4426
4427        /**
4428         * @param value {@link #service} (The fee for an addittional service or product or charge.)
4429         */
4430        public SubDetailComponent setService(Coding value) { 
4431          this.service = value;
4432          return this;
4433        }
4434
4435        /**
4436         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
4437         */
4438        public List<Coding> getProgramCode() { 
4439          if (this.programCode == null)
4440            this.programCode = new ArrayList<Coding>();
4441          return this.programCode;
4442        }
4443
4444        public boolean hasProgramCode() { 
4445          if (this.programCode == null)
4446            return false;
4447          for (Coding item : this.programCode)
4448            if (!item.isEmpty())
4449              return true;
4450          return false;
4451        }
4452
4453        /**
4454         * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.)
4455         */
4456    // syntactic sugar
4457        public Coding addProgramCode() { //3
4458          Coding t = new Coding();
4459          if (this.programCode == null)
4460            this.programCode = new ArrayList<Coding>();
4461          this.programCode.add(t);
4462          return t;
4463        }
4464
4465    // syntactic sugar
4466        public SubDetailComponent addProgramCode(Coding t) { //3
4467          if (t == null)
4468            return this;
4469          if (this.programCode == null)
4470            this.programCode = new ArrayList<Coding>();
4471          this.programCode.add(t);
4472          return this;
4473        }
4474
4475        /**
4476         * @return {@link #quantity} (The number of repetitions of a service or product.)
4477         */
4478        public SimpleQuantity getQuantity() { 
4479          if (this.quantity == null)
4480            if (Configuration.errorOnAutoCreate())
4481              throw new Error("Attempt to auto-create SubDetailComponent.quantity");
4482            else if (Configuration.doAutoCreate())
4483              this.quantity = new SimpleQuantity(); // cc
4484          return this.quantity;
4485        }
4486
4487        public boolean hasQuantity() { 
4488          return this.quantity != null && !this.quantity.isEmpty();
4489        }
4490
4491        /**
4492         * @param value {@link #quantity} (The number of repetitions of a service or product.)
4493         */
4494        public SubDetailComponent setQuantity(SimpleQuantity value) { 
4495          this.quantity = value;
4496          return this;
4497        }
4498
4499        /**
4500         * @return {@link #unitPrice} (The fee for an addittional service or product or charge.)
4501         */
4502        public Money getUnitPrice() { 
4503          if (this.unitPrice == null)
4504            if (Configuration.errorOnAutoCreate())
4505              throw new Error("Attempt to auto-create SubDetailComponent.unitPrice");
4506            else if (Configuration.doAutoCreate())
4507              this.unitPrice = new Money(); // cc
4508          return this.unitPrice;
4509        }
4510
4511        public boolean hasUnitPrice() { 
4512          return this.unitPrice != null && !this.unitPrice.isEmpty();
4513        }
4514
4515        /**
4516         * @param value {@link #unitPrice} (The fee for an addittional service or product or charge.)
4517         */
4518        public SubDetailComponent setUnitPrice(Money value) { 
4519          this.unitPrice = value;
4520          return this;
4521        }
4522
4523        /**
4524         * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
4525         */
4526        public DecimalType getFactorElement() { 
4527          if (this.factor == null)
4528            if (Configuration.errorOnAutoCreate())
4529              throw new Error("Attempt to auto-create SubDetailComponent.factor");
4530            else if (Configuration.doAutoCreate())
4531              this.factor = new DecimalType(); // bb
4532          return this.factor;
4533        }
4534
4535        public boolean hasFactorElement() { 
4536          return this.factor != null && !this.factor.isEmpty();
4537        }
4538
4539        public boolean hasFactor() { 
4540          return this.factor != null && !this.factor.isEmpty();
4541        }
4542
4543        /**
4544         * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value
4545         */
4546        public SubDetailComponent setFactorElement(DecimalType value) { 
4547          this.factor = value;
4548          return this;
4549        }
4550
4551        /**
4552         * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4553         */
4554        public BigDecimal getFactor() { 
4555          return this.factor == null ? null : this.factor.getValue();
4556        }
4557
4558        /**
4559         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4560         */
4561        public SubDetailComponent setFactor(BigDecimal value) { 
4562          if (value == null)
4563            this.factor = null;
4564          else {
4565            if (this.factor == null)
4566              this.factor = new DecimalType();
4567            this.factor.setValue(value);
4568          }
4569          return this;
4570        }
4571
4572        /**
4573         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4574         */
4575        public SubDetailComponent setFactor(long value) { 
4576              this.factor = new DecimalType();
4577            this.factor.setValue(value);
4578          return this;
4579        }
4580
4581        /**
4582         * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.
4583         */
4584        public SubDetailComponent setFactor(double value) { 
4585              this.factor = new DecimalType();
4586            this.factor.setValue(value);
4587          return this;
4588        }
4589
4590        /**
4591         * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
4592         */
4593        public DecimalType getPointsElement() { 
4594          if (this.points == null)
4595            if (Configuration.errorOnAutoCreate())
4596              throw new Error("Attempt to auto-create SubDetailComponent.points");
4597            else if (Configuration.doAutoCreate())
4598              this.points = new DecimalType(); // bb
4599          return this.points;
4600        }
4601
4602        public boolean hasPointsElement() { 
4603          return this.points != null && !this.points.isEmpty();
4604        }
4605
4606        public boolean hasPoints() { 
4607          return this.points != null && !this.points.isEmpty();
4608        }
4609
4610        /**
4611         * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value
4612         */
4613        public SubDetailComponent setPointsElement(DecimalType value) { 
4614          this.points = value;
4615          return this;
4616        }
4617
4618        /**
4619         * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
4620         */
4621        public BigDecimal getPoints() { 
4622          return this.points == null ? null : this.points.getValue();
4623        }
4624
4625        /**
4626         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
4627         */
4628        public SubDetailComponent setPoints(BigDecimal value) { 
4629          if (value == null)
4630            this.points = null;
4631          else {
4632            if (this.points == null)
4633              this.points = new DecimalType();
4634            this.points.setValue(value);
4635          }
4636          return this;
4637        }
4638
4639        /**
4640         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
4641         */
4642        public SubDetailComponent setPoints(long value) { 
4643              this.points = new DecimalType();
4644            this.points.setValue(value);
4645          return this;
4646        }
4647
4648        /**
4649         * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.
4650         */
4651        public SubDetailComponent setPoints(double value) { 
4652              this.points = new DecimalType();
4653            this.points.setValue(value);
4654          return this;
4655        }
4656
4657        /**
4658         * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
4659         */
4660        public Money getNet() { 
4661          if (this.net == null)
4662            if (Configuration.errorOnAutoCreate())
4663              throw new Error("Attempt to auto-create SubDetailComponent.net");
4664            else if (Configuration.doAutoCreate())
4665              this.net = new Money(); // cc
4666          return this.net;
4667        }
4668
4669        public boolean hasNet() { 
4670          return this.net != null && !this.net.isEmpty();
4671        }
4672
4673        /**
4674         * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.)
4675         */
4676        public SubDetailComponent setNet(Money value) { 
4677          this.net = value;
4678          return this;
4679        }
4680
4681        /**
4682         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
4683         */
4684        public List<Reference> getUdi() { 
4685          if (this.udi == null)
4686            this.udi = new ArrayList<Reference>();
4687          return this.udi;
4688        }
4689
4690        public boolean hasUdi() { 
4691          if (this.udi == null)
4692            return false;
4693          for (Reference item : this.udi)
4694            if (!item.isEmpty())
4695              return true;
4696          return false;
4697        }
4698
4699        /**
4700         * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.)
4701         */
4702    // syntactic sugar
4703        public Reference addUdi() { //3
4704          Reference t = new Reference();
4705          if (this.udi == null)
4706            this.udi = new ArrayList<Reference>();
4707          this.udi.add(t);
4708          return t;
4709        }
4710
4711    // syntactic sugar
4712        public SubDetailComponent addUdi(Reference t) { //3
4713          if (t == null)
4714            return this;
4715          if (this.udi == null)
4716            this.udi = new ArrayList<Reference>();
4717          this.udi.add(t);
4718          return this;
4719        }
4720
4721        /**
4722         * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
4723         */
4724        public List<Device> getUdiTarget() { 
4725          if (this.udiTarget == null)
4726            this.udiTarget = new ArrayList<Device>();
4727          return this.udiTarget;
4728        }
4729
4730    // syntactic sugar
4731        /**
4732         * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.)
4733         */
4734        public Device addUdiTarget() { 
4735          Device r = new Device();
4736          if (this.udiTarget == null)
4737            this.udiTarget = new ArrayList<Device>();
4738          this.udiTarget.add(r);
4739          return r;
4740        }
4741
4742        protected void listChildren(List<Property> childrenList) {
4743          super.listChildren(childrenList);
4744          childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence));
4745          childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type));
4746          childrenList.add(new Property("service", "Coding", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service));
4747          childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode));
4748          childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity));
4749          childrenList.add(new Property("unitPrice", "Money", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice));
4750          childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor));
4751          childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points));
4752          childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net));
4753          childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi));
4754        }
4755
4756      @Override
4757      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4758        switch (hash) {
4759        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
4760        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
4761        case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding
4762        case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding
4763        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity
4764        case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money
4765        case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType
4766        case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType
4767        case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money
4768        case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference
4769        default: return super.getProperty(hash, name, checkValid);
4770        }
4771
4772      }
4773
4774      @Override
4775      public void setProperty(int hash, String name, Base value) throws FHIRException {
4776        switch (hash) {
4777        case 1349547969: // sequence
4778          this.sequence = castToPositiveInt(value); // PositiveIntType
4779          break;
4780        case 3575610: // type
4781          this.type = castToCoding(value); // Coding
4782          break;
4783        case 1984153269: // service
4784          this.service = castToCoding(value); // Coding
4785          break;
4786        case 1010065041: // programCode
4787          this.getProgramCode().add(castToCoding(value)); // Coding
4788          break;
4789        case -1285004149: // quantity
4790          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
4791          break;
4792        case -486196699: // unitPrice
4793          this.unitPrice = castToMoney(value); // Money
4794          break;
4795        case -1282148017: // factor
4796          this.factor = castToDecimal(value); // DecimalType
4797          break;
4798        case -982754077: // points
4799          this.points = castToDecimal(value); // DecimalType
4800          break;
4801        case 108957: // net
4802          this.net = castToMoney(value); // Money
4803          break;
4804        case 115642: // udi
4805          this.getUdi().add(castToReference(value)); // Reference
4806          break;
4807        default: super.setProperty(hash, name, value);
4808        }
4809
4810      }
4811
4812      @Override
4813      public void setProperty(String name, Base value) throws FHIRException {
4814        if (name.equals("sequence"))
4815          this.sequence = castToPositiveInt(value); // PositiveIntType
4816        else if (name.equals("type"))
4817          this.type = castToCoding(value); // Coding
4818        else if (name.equals("service"))
4819          this.service = castToCoding(value); // Coding
4820        else if (name.equals("programCode"))
4821          this.getProgramCode().add(castToCoding(value));
4822        else if (name.equals("quantity"))
4823          this.quantity = castToSimpleQuantity(value); // SimpleQuantity
4824        else if (name.equals("unitPrice"))
4825          this.unitPrice = castToMoney(value); // Money
4826        else if (name.equals("factor"))
4827          this.factor = castToDecimal(value); // DecimalType
4828        else if (name.equals("points"))
4829          this.points = castToDecimal(value); // DecimalType
4830        else if (name.equals("net"))
4831          this.net = castToMoney(value); // Money
4832        else if (name.equals("udi"))
4833          this.getUdi().add(castToReference(value));
4834        else
4835          super.setProperty(name, value);
4836      }
4837
4838      @Override
4839      public Base makeProperty(int hash, String name) throws FHIRException {
4840        switch (hash) {
4841        case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType
4842        case 3575610:  return getType(); // Coding
4843        case 1984153269:  return getService(); // Coding
4844        case 1010065041:  return addProgramCode(); // Coding
4845        case -1285004149:  return getQuantity(); // SimpleQuantity
4846        case -486196699:  return getUnitPrice(); // Money
4847        case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType
4848        case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType
4849        case 108957:  return getNet(); // Money
4850        case 115642:  return addUdi(); // Reference
4851        default: return super.makeProperty(hash, name);
4852        }
4853
4854      }
4855
4856      @Override
4857      public Base addChild(String name) throws FHIRException {
4858        if (name.equals("sequence")) {
4859          throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence");
4860        }
4861        else if (name.equals("type")) {
4862          this.type = new Coding();
4863          return this.type;
4864        }
4865        else if (name.equals("service")) {
4866          this.service = new Coding();
4867          return this.service;
4868        }
4869        else if (name.equals("programCode")) {
4870          return addProgramCode();
4871        }
4872        else if (name.equals("quantity")) {
4873          this.quantity = new SimpleQuantity();
4874          return this.quantity;
4875        }
4876        else if (name.equals("unitPrice")) {
4877          this.unitPrice = new Money();
4878          return this.unitPrice;
4879        }
4880        else if (name.equals("factor")) {
4881          throw new FHIRException("Cannot call addChild on a primitive type Claim.factor");
4882        }
4883        else if (name.equals("points")) {
4884          throw new FHIRException("Cannot call addChild on a primitive type Claim.points");
4885        }
4886        else if (name.equals("net")) {
4887          this.net = new Money();
4888          return this.net;
4889        }
4890        else if (name.equals("udi")) {
4891          return addUdi();
4892        }
4893        else
4894          return super.addChild(name);
4895      }
4896
4897      public SubDetailComponent copy() {
4898        SubDetailComponent dst = new SubDetailComponent();
4899        copyValues(dst);
4900        dst.sequence = sequence == null ? null : sequence.copy();
4901        dst.type = type == null ? null : type.copy();
4902        dst.service = service == null ? null : service.copy();
4903        if (programCode != null) {
4904          dst.programCode = new ArrayList<Coding>();
4905          for (Coding i : programCode)
4906            dst.programCode.add(i.copy());
4907        };
4908        dst.quantity = quantity == null ? null : quantity.copy();
4909        dst.unitPrice = unitPrice == null ? null : unitPrice.copy();
4910        dst.factor = factor == null ? null : factor.copy();
4911        dst.points = points == null ? null : points.copy();
4912        dst.net = net == null ? null : net.copy();
4913        if (udi != null) {
4914          dst.udi = new ArrayList<Reference>();
4915          for (Reference i : udi)
4916            dst.udi.add(i.copy());
4917        };
4918        return dst;
4919      }
4920
4921      @Override
4922      public boolean equalsDeep(Base other) {
4923        if (!super.equalsDeep(other))
4924          return false;
4925        if (!(other instanceof SubDetailComponent))
4926          return false;
4927        SubDetailComponent o = (SubDetailComponent) other;
4928        return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true)
4929           && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true)
4930           && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true)
4931           && compareDeep(udi, o.udi, true);
4932      }
4933
4934      @Override
4935      public boolean equalsShallow(Base other) {
4936        if (!super.equalsShallow(other))
4937          return false;
4938        if (!(other instanceof SubDetailComponent))
4939          return false;
4940        SubDetailComponent o = (SubDetailComponent) other;
4941        return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true)
4942          ;
4943      }
4944
4945      public boolean isEmpty() {
4946        return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty())
4947           && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty())
4948           && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty())
4949           && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty())
4950           && (udi == null || udi.isEmpty());
4951      }
4952
4953  public String fhirType() {
4954    return "Claim.item.detail.subDetail";
4955
4956  }
4957
4958  }
4959
4960    @Block()
4961    public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement {
4962        /**
4963         * Indicates whether this is the initial placement of a fixed prosthesis.
4964         */
4965        @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
4966        @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." )
4967        protected BooleanType initial;
4968
4969        /**
4970         * Date of the initial placement.
4971         */
4972        @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=true)
4973        @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." )
4974        protected DateType priorDate;
4975
4976        /**
4977         * Material of the prior denture or bridge prosthesis. (Oral).
4978         */
4979        @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true)
4980        @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." )
4981        protected Coding priorMaterial;
4982
4983        private static final long serialVersionUID = 1739349641L;
4984
4985    /**
4986     * Constructor
4987     */
4988      public ProsthesisComponent() {
4989        super();
4990      }
4991
4992        /**
4993         * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value
4994         */
4995        public BooleanType getInitialElement() { 
4996          if (this.initial == null)
4997            if (Configuration.errorOnAutoCreate())
4998              throw new Error("Attempt to auto-create ProsthesisComponent.initial");
4999            else if (Configuration.doAutoCreate())
5000              this.initial = new BooleanType(); // bb
5001          return this.initial;
5002        }
5003
5004        public boolean hasInitialElement() { 
5005          return this.initial != null && !this.initial.isEmpty();
5006        }
5007
5008        public boolean hasInitial() { 
5009          return this.initial != null && !this.initial.isEmpty();
5010        }
5011
5012        /**
5013         * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value
5014         */
5015        public ProsthesisComponent setInitialElement(BooleanType value) { 
5016          this.initial = value;
5017          return this;
5018        }
5019
5020        /**
5021         * @return Indicates whether this is the initial placement of a fixed prosthesis.
5022         */
5023        public boolean getInitial() { 
5024          return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue();
5025        }
5026
5027        /**
5028         * @param value Indicates whether this is the initial placement of a fixed prosthesis.
5029         */
5030        public ProsthesisComponent setInitial(boolean value) { 
5031            if (this.initial == null)
5032              this.initial = new BooleanType();
5033            this.initial.setValue(value);
5034          return this;
5035        }
5036
5037        /**
5038         * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value
5039         */
5040        public DateType getPriorDateElement() { 
5041          if (this.priorDate == null)
5042            if (Configuration.errorOnAutoCreate())
5043              throw new Error("Attempt to auto-create ProsthesisComponent.priorDate");
5044            else if (Configuration.doAutoCreate())
5045              this.priorDate = new DateType(); // bb
5046          return this.priorDate;
5047        }
5048
5049        public boolean hasPriorDateElement() { 
5050          return this.priorDate != null && !this.priorDate.isEmpty();
5051        }
5052
5053        public boolean hasPriorDate() { 
5054          return this.priorDate != null && !this.priorDate.isEmpty();
5055        }
5056
5057        /**
5058         * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value
5059         */
5060        public ProsthesisComponent setPriorDateElement(DateType value) { 
5061          this.priorDate = value;
5062          return this;
5063        }
5064
5065        /**
5066         * @return Date of the initial placement.
5067         */
5068        public Date getPriorDate() { 
5069          return this.priorDate == null ? null : this.priorDate.getValue();
5070        }
5071
5072        /**
5073         * @param value Date of the initial placement.
5074         */
5075        public ProsthesisComponent setPriorDate(Date value) { 
5076          if (value == null)
5077            this.priorDate = null;
5078          else {
5079            if (this.priorDate == null)
5080              this.priorDate = new DateType();
5081            this.priorDate.setValue(value);
5082          }
5083          return this;
5084        }
5085
5086        /**
5087         * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).)
5088         */
5089        public Coding getPriorMaterial() { 
5090          if (this.priorMaterial == null)
5091            if (Configuration.errorOnAutoCreate())
5092              throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial");
5093            else if (Configuration.doAutoCreate())
5094              this.priorMaterial = new Coding(); // cc
5095          return this.priorMaterial;
5096        }
5097
5098        public boolean hasPriorMaterial() { 
5099          return this.priorMaterial != null && !this.priorMaterial.isEmpty();
5100        }
5101
5102        /**
5103         * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).)
5104         */
5105        public ProsthesisComponent setPriorMaterial(Coding value) { 
5106          this.priorMaterial = value;
5107          return this;
5108        }
5109
5110        protected void listChildren(List<Property> childrenList) {
5111          super.listChildren(childrenList);
5112          childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial));
5113          childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate));
5114          childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial));
5115        }
5116
5117      @Override
5118      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5119        switch (hash) {
5120        case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType
5121        case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType
5122        case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding
5123        default: return super.getProperty(hash, name, checkValid);
5124        }
5125
5126      }
5127
5128      @Override
5129      public void setProperty(int hash, String name, Base value) throws FHIRException {
5130        switch (hash) {
5131        case 1948342084: // initial
5132          this.initial = castToBoolean(value); // BooleanType
5133          break;
5134        case -1770675816: // priorDate
5135          this.priorDate = castToDate(value); // DateType
5136          break;
5137        case -532999663: // priorMaterial
5138          this.priorMaterial = castToCoding(value); // Coding
5139          break;
5140        default: super.setProperty(hash, name, value);
5141        }
5142
5143      }
5144
5145      @Override
5146      public void setProperty(String name, Base value) throws FHIRException {
5147        if (name.equals("initial"))
5148          this.initial = castToBoolean(value); // BooleanType
5149        else if (name.equals("priorDate"))
5150          this.priorDate = castToDate(value); // DateType
5151        else if (name.equals("priorMaterial"))
5152          this.priorMaterial = castToCoding(value); // Coding
5153        else
5154          super.setProperty(name, value);
5155      }
5156
5157      @Override
5158      public Base makeProperty(int hash, String name) throws FHIRException {
5159        switch (hash) {
5160        case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType
5161        case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType
5162        case -532999663:  return getPriorMaterial(); // Coding
5163        default: return super.makeProperty(hash, name);
5164        }
5165
5166      }
5167
5168      @Override
5169      public Base addChild(String name) throws FHIRException {
5170        if (name.equals("initial")) {
5171          throw new FHIRException("Cannot call addChild on a primitive type Claim.initial");
5172        }
5173        else if (name.equals("priorDate")) {
5174          throw new FHIRException("Cannot call addChild on a primitive type Claim.priorDate");
5175        }
5176        else if (name.equals("priorMaterial")) {
5177          this.priorMaterial = new Coding();
5178          return this.priorMaterial;
5179        }
5180        else
5181          return super.addChild(name);
5182      }
5183
5184      public ProsthesisComponent copy() {
5185        ProsthesisComponent dst = new ProsthesisComponent();
5186        copyValues(dst);
5187        dst.initial = initial == null ? null : initial.copy();
5188        dst.priorDate = priorDate == null ? null : priorDate.copy();
5189        dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy();
5190        return dst;
5191      }
5192
5193      @Override
5194      public boolean equalsDeep(Base other) {
5195        if (!super.equalsDeep(other))
5196          return false;
5197        if (!(other instanceof ProsthesisComponent))
5198          return false;
5199        ProsthesisComponent o = (ProsthesisComponent) other;
5200        return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true)
5201          ;
5202      }
5203
5204      @Override
5205      public boolean equalsShallow(Base other) {
5206        if (!super.equalsShallow(other))
5207          return false;
5208        if (!(other instanceof ProsthesisComponent))
5209          return false;
5210        ProsthesisComponent o = (ProsthesisComponent) other;
5211        return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true);
5212      }
5213
5214      public boolean isEmpty() {
5215        return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty())
5216           && (priorMaterial == null || priorMaterial.isEmpty());
5217      }
5218
5219  public String fhirType() {
5220    return "Claim.item.prosthesis";
5221
5222  }
5223
5224  }
5225
5226    @Block()
5227    public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement {
5228        /**
5229         * The code identifying which tooth is missing.
5230         */
5231        @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true)
5232        @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." )
5233        protected Coding tooth;
5234
5235        /**
5236         * Missing reason may be: E-extraction, O-other.
5237         */
5238        @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true)
5239        @Description(shortDefinition="Indicates whether it was extracted or other reason", formalDefinition="Missing reason may be: E-extraction, O-other." )
5240        protected Coding reason;
5241
5242        /**
5243         * The date of the extraction either known from records or patient reported estimate.
5244         */
5245        @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true)
5246        @Description(shortDefinition="Date tooth was extracted if known", formalDefinition="The date of the extraction either known from records or patient reported estimate." )
5247        protected DateType extractionDate;
5248
5249        private static final long serialVersionUID = 352913313L;
5250
5251    /**
5252     * Constructor
5253     */
5254      public MissingTeethComponent() {
5255        super();
5256      }
5257
5258    /**
5259     * Constructor
5260     */
5261      public MissingTeethComponent(Coding tooth) {
5262        super();
5263        this.tooth = tooth;
5264      }
5265
5266        /**
5267         * @return {@link #tooth} (The code identifying which tooth is missing.)
5268         */
5269        public Coding getTooth() { 
5270          if (this.tooth == null)
5271            if (Configuration.errorOnAutoCreate())
5272              throw new Error("Attempt to auto-create MissingTeethComponent.tooth");
5273            else if (Configuration.doAutoCreate())
5274              this.tooth = new Coding(); // cc
5275          return this.tooth;
5276        }
5277
5278        public boolean hasTooth() { 
5279          return this.tooth != null && !this.tooth.isEmpty();
5280        }
5281
5282        /**
5283         * @param value {@link #tooth} (The code identifying which tooth is missing.)
5284         */
5285        public MissingTeethComponent setTooth(Coding value) { 
5286          this.tooth = value;
5287          return this;
5288        }
5289
5290        /**
5291         * @return {@link #reason} (Missing reason may be: E-extraction, O-other.)
5292         */
5293        public Coding getReason() { 
5294          if (this.reason == null)
5295            if (Configuration.errorOnAutoCreate())
5296              throw new Error("Attempt to auto-create MissingTeethComponent.reason");
5297            else if (Configuration.doAutoCreate())
5298              this.reason = new Coding(); // cc
5299          return this.reason;
5300        }
5301
5302        public boolean hasReason() { 
5303          return this.reason != null && !this.reason.isEmpty();
5304        }
5305
5306        /**
5307         * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.)
5308         */
5309        public MissingTeethComponent setReason(Coding value) { 
5310          this.reason = value;
5311          return this;
5312        }
5313
5314        /**
5315         * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value
5316         */
5317        public DateType getExtractionDateElement() { 
5318          if (this.extractionDate == null)
5319            if (Configuration.errorOnAutoCreate())
5320              throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate");
5321            else if (Configuration.doAutoCreate())
5322              this.extractionDate = new DateType(); // bb
5323          return this.extractionDate;
5324        }
5325
5326        public boolean hasExtractionDateElement() { 
5327          return this.extractionDate != null && !this.extractionDate.isEmpty();
5328        }
5329
5330        public boolean hasExtractionDate() { 
5331          return this.extractionDate != null && !this.extractionDate.isEmpty();
5332        }
5333
5334        /**
5335         * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value
5336         */
5337        public MissingTeethComponent setExtractionDateElement(DateType value) { 
5338          this.extractionDate = value;
5339          return this;
5340        }
5341
5342        /**
5343         * @return The date of the extraction either known from records or patient reported estimate.
5344         */
5345        public Date getExtractionDate() { 
5346          return this.extractionDate == null ? null : this.extractionDate.getValue();
5347        }
5348
5349        /**
5350         * @param value The date of the extraction either known from records or patient reported estimate.
5351         */
5352        public MissingTeethComponent setExtractionDate(Date value) { 
5353          if (value == null)
5354            this.extractionDate = null;
5355          else {
5356            if (this.extractionDate == null)
5357              this.extractionDate = new DateType();
5358            this.extractionDate.setValue(value);
5359          }
5360          return this;
5361        }
5362
5363        protected void listChildren(List<Property> childrenList) {
5364          super.listChildren(childrenList);
5365          childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth));
5366          childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason));
5367          childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate));
5368        }
5369
5370      @Override
5371      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5372        switch (hash) {
5373        case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding
5374        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding
5375        case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType
5376        default: return super.getProperty(hash, name, checkValid);
5377        }
5378
5379      }
5380
5381      @Override
5382      public void setProperty(int hash, String name, Base value) throws FHIRException {
5383        switch (hash) {
5384        case 110545608: // tooth
5385          this.tooth = castToCoding(value); // Coding
5386          break;
5387        case -934964668: // reason
5388          this.reason = castToCoding(value); // Coding
5389          break;
5390        case 580646965: // extractionDate
5391          this.extractionDate = castToDate(value); // DateType
5392          break;
5393        default: super.setProperty(hash, name, value);
5394        }
5395
5396      }
5397
5398      @Override
5399      public void setProperty(String name, Base value) throws FHIRException {
5400        if (name.equals("tooth"))
5401          this.tooth = castToCoding(value); // Coding
5402        else if (name.equals("reason"))
5403          this.reason = castToCoding(value); // Coding
5404        else if (name.equals("extractionDate"))
5405          this.extractionDate = castToDate(value); // DateType
5406        else
5407          super.setProperty(name, value);
5408      }
5409
5410      @Override
5411      public Base makeProperty(int hash, String name) throws FHIRException {
5412        switch (hash) {
5413        case 110545608:  return getTooth(); // Coding
5414        case -934964668:  return getReason(); // Coding
5415        case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType
5416        default: return super.makeProperty(hash, name);
5417        }
5418
5419      }
5420
5421      @Override
5422      public Base addChild(String name) throws FHIRException {
5423        if (name.equals("tooth")) {
5424          this.tooth = new Coding();
5425          return this.tooth;
5426        }
5427        else if (name.equals("reason")) {
5428          this.reason = new Coding();
5429          return this.reason;
5430        }
5431        else if (name.equals("extractionDate")) {
5432          throw new FHIRException("Cannot call addChild on a primitive type Claim.extractionDate");
5433        }
5434        else
5435          return super.addChild(name);
5436      }
5437
5438      public MissingTeethComponent copy() {
5439        MissingTeethComponent dst = new MissingTeethComponent();
5440        copyValues(dst);
5441        dst.tooth = tooth == null ? null : tooth.copy();
5442        dst.reason = reason == null ? null : reason.copy();
5443        dst.extractionDate = extractionDate == null ? null : extractionDate.copy();
5444        return dst;
5445      }
5446
5447      @Override
5448      public boolean equalsDeep(Base other) {
5449        if (!super.equalsDeep(other))
5450          return false;
5451        if (!(other instanceof MissingTeethComponent))
5452          return false;
5453        MissingTeethComponent o = (MissingTeethComponent) other;
5454        return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true)
5455          ;
5456      }
5457
5458      @Override
5459      public boolean equalsShallow(Base other) {
5460        if (!super.equalsShallow(other))
5461          return false;
5462        if (!(other instanceof MissingTeethComponent))
5463          return false;
5464        MissingTeethComponent o = (MissingTeethComponent) other;
5465        return compareValues(extractionDate, o.extractionDate, true);
5466      }
5467
5468      public boolean isEmpty() {
5469        return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty())
5470           && (extractionDate == null || extractionDate.isEmpty());
5471      }
5472
5473  public String fhirType() {
5474    return "Claim.missingTeeth";
5475
5476  }
5477
5478  }
5479
5480    /**
5481     * The category of claim.
5482     */
5483    @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true)
5484    @Description(shortDefinition="institutional | oral | pharmacy | professional | vision", formalDefinition="The category of claim." )
5485    protected Enumeration<ClaimType> type;
5486
5487    /**
5488     * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.
5489     */
5490    @Child(name = "subType", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5491    @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." )
5492    protected List<Coding> subType;
5493
5494    /**
5495     * The business identifier for the instance: claim number, pre-determination or pre-authorization number.
5496     */
5497    @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5498    @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: claim number, pre-determination or pre-authorization number." )
5499    protected List<Identifier> identifier;
5500
5501    /**
5502     * The version of the specification on which this instance relies.
5503     */
5504    @Child(name = "ruleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true)
5505    @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." )
5506    protected Coding ruleset;
5507
5508    /**
5509     * The version of the specification from which the original instance was created.
5510     */
5511    @Child(name = "originalRuleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true)
5512    @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." )
5513    protected Coding originalRuleset;
5514
5515    /**
5516     * The date when the enclosed suite of services were performed or completed.
5517     */
5518    @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
5519    @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." )
5520    protected DateTimeType created;
5521
5522    /**
5523     * The billable period for which charges are being submitted.
5524     */
5525    @Child(name = "billablePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true)
5526    @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." )
5527    protected Period billablePeriod;
5528
5529    /**
5530     * Insurer Identifier, typical BIN number (6 digit).
5531     */
5532    @Child(name = "target", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true)
5533    @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." )
5534    protected Type target;
5535
5536    /**
5537     * The provider which is responsible for the bill, claim pre-determination, pre-authorization.
5538     */
5539    @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true)
5540    @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." )
5541    protected Type provider;
5542
5543    /**
5544     * The organization which is responsible for the bill, claim pre-determination, pre-authorization.
5545     */
5546    @Child(name = "organization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true)
5547    @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." )
5548    protected Type organization;
5549
5550    /**
5551     * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).
5552     */
5553    @Child(name = "use", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=true)
5554    @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." )
5555    protected Enumeration<Use> use;
5556
5557    /**
5558     * Immediate (STAT), best effort (NORMAL), deferred (DEFER).
5559     */
5560    @Child(name = "priority", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=true)
5561    @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." )
5562    protected Coding priority;
5563
5564    /**
5565     * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.
5566     */
5567    @Child(name = "fundsReserve", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true)
5568    @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." )
5569    protected Coding fundsReserve;
5570
5571    /**
5572     * Person who created the invoice/claim/pre-determination or pre-authorization.
5573     */
5574    @Child(name = "enterer", type = {Identifier.class, Practitioner.class}, order=13, min=0, max=1, modifier=false, summary=true)
5575    @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." )
5576    protected Type enterer;
5577
5578    /**
5579     * Facility where the services were provided.
5580     */
5581    @Child(name = "facility", type = {Identifier.class, Location.class}, order=14, min=0, max=1, modifier=false, summary=true)
5582    @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." )
5583    protected Type facility;
5584
5585    /**
5586     * Other claims which are related to this claim such as prior claim versions or for related services.
5587     */
5588    @Child(name = "related", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5589    @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." )
5590    protected List<RelatedClaimsComponent> related;
5591
5592    /**
5593     * Prescription to support the dispensing of Pharmacy or Vision products.
5594     */
5595    @Child(name = "prescription", type = {Identifier.class, MedicationOrder.class, VisionPrescription.class}, order=16, min=0, max=1, modifier=false, summary=true)
5596    @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." )
5597    protected Type prescription;
5598
5599    /**
5600     * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.
5601     */
5602    @Child(name = "originalPrescription", type = {Identifier.class, MedicationOrder.class}, order=17, min=0, max=1, modifier=false, summary=true)
5603    @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." )
5604    protected Type originalPrescription;
5605
5606    /**
5607     * The party to be reimbursed for the services.
5608     */
5609    @Child(name = "payee", type = {}, order=18, min=0, max=1, modifier=false, summary=true)
5610    @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="The party to be reimbursed for the services." )
5611    protected PayeeComponent payee;
5612
5613    /**
5614     * The referral resource which lists the date, practitioner, reason and other supporting information.
5615     */
5616    @Child(name = "referral", type = {Identifier.class, ReferralRequest.class}, order=19, min=0, max=1, modifier=false, summary=true)
5617    @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." )
5618    protected Type referral;
5619
5620    /**
5621     * **Insert definition of Occurrence codes.
5622     */
5623    @Child(name = "occurrenceCode", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5624    @Description(shortDefinition="Occurrence Codes", formalDefinition="**Insert definition of Occurrence codes." )
5625    protected List<Coding> occurrenceCode;
5626
5627    /**
5628     * **Insert definition of Occurrence Span codes.
5629     */
5630    @Child(name = "occurenceSpanCode", type = {Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5631    @Description(shortDefinition="Occurrence Span Codes", formalDefinition="**Insert definition of Occurrence Span codes." )
5632    protected List<Coding> occurenceSpanCode;
5633
5634    /**
5635     * **Insert definition of Value codes.
5636     */
5637    @Child(name = "valueCode", type = {Coding.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5638    @Description(shortDefinition="Value Codes", formalDefinition="**Insert definition of Value codes." )
5639    protected List<Coding> valueCode;
5640
5641    /**
5642     * Ordered list of patient diagnosis for which care is sought.
5643     */
5644    @Child(name = "diagnosis", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5645    @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." )
5646    protected List<DiagnosisComponent> diagnosis;
5647
5648    /**
5649     * Ordered list of patient procedures performed to support the adjudication.
5650     */
5651    @Child(name = "procedure", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5652    @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." )
5653    protected List<ProcedureComponent> procedure;
5654
5655    /**
5656     * List of special conditions relating to the setting, treatment or patient  for which care is sought which may influence the adjudication.
5657     */
5658    @Child(name = "specialCondition", type = {Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5659    @Description(shortDefinition="List of special Conditions", formalDefinition="List of special conditions relating to the setting, treatment or patient  for which care is sought which may influence the adjudication." )
5660    protected List<Coding> specialCondition;
5661
5662    /**
5663     * Patient Resource.
5664     */
5665    @Child(name = "patient", type = {Identifier.class, Patient.class}, order=26, min=1, max=1, modifier=false, summary=true)
5666    @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." )
5667    protected Type patient;
5668
5669    /**
5670     * Financial instrument by which payment information for health care.
5671     */
5672    @Child(name = "coverage", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5673    @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." )
5674    protected List<CoverageComponent> coverage;
5675
5676    /**
5677     * Date of an accident which these services are addressing.
5678     */
5679    @Child(name = "accidentDate", type = {DateType.class}, order=28, min=0, max=1, modifier=false, summary=true)
5680    @Description(shortDefinition="When the accident occurred", formalDefinition="Date of an accident which these services are addressing." )
5681    protected DateType accidentDate;
5682
5683    /**
5684     * Type of accident: work, auto, etc.
5685     */
5686    @Child(name = "accidentType", type = {Coding.class}, order=29, min=0, max=1, modifier=false, summary=true)
5687    @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." )
5688    protected Coding accidentType;
5689
5690    /**
5691     * Accident Place.
5692     */
5693    @Child(name = "accidentLocation", type = {Address.class, Location.class}, order=30, min=0, max=1, modifier=false, summary=true)
5694    @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." )
5695    protected Type accidentLocation;
5696
5697    /**
5698     * A list of intervention and exception codes which may influence the adjudication of the claim.
5699     */
5700    @Child(name = "interventionException", type = {Coding.class}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5701    @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." )
5702    protected List<Coding> interventionException;
5703
5704    /**
5705     * Period, start and last dates of aspects of the Condition or related services.
5706     */
5707    @Child(name = "onset", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5708    @Description(shortDefinition="Condition related Onset related dates and codes", formalDefinition="Period, start and last dates of aspects of the Condition or related services." )
5709    protected List<OnsetComponent> onset;
5710
5711    /**
5712     * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).
5713     */
5714    @Child(name = "employmentImpacted", type = {Period.class}, order=33, min=0, max=1, modifier=false, summary=true)
5715    @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." )
5716    protected Period employmentImpacted;
5717
5718    /**
5719     * The start and optional end dates of when the patient was confined to a treatment center.
5720     */
5721    @Child(name = "hospitalization", type = {Period.class}, order=34, min=0, max=1, modifier=false, summary=true)
5722    @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." )
5723    protected Period hospitalization;
5724
5725    /**
5726     * First tier of goods and services.
5727     */
5728    @Child(name = "item", type = {}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5729    @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." )
5730    protected List<ItemsComponent> item;
5731
5732    /**
5733     * The total value of the claim.
5734     */
5735    @Child(name = "total", type = {Money.class}, order=36, min=0, max=1, modifier=false, summary=true)
5736    @Description(shortDefinition="Total claim cost", formalDefinition="The total value of the claim." )
5737    protected Money total;
5738
5739    /**
5740     * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.
5741     */
5742    @Child(name = "additionalMaterial", type = {Coding.class}, order=37, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5743    @Description(shortDefinition="Additional supporting materials and documents", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." )
5744    protected List<Coding> additionalMaterial;
5745
5746    /**
5747     * A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons.
5748     */
5749    @Child(name = "missingTeeth", type = {}, order=38, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5750    @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons." )
5751    protected List<MissingTeethComponent> missingTeeth;
5752
5753    private static final long serialVersionUID = 1478562254L;
5754
5755  /**
5756   * Constructor
5757   */
5758    public Claim() {
5759      super();
5760    }
5761
5762  /**
5763   * Constructor
5764   */
5765    public Claim(Enumeration<ClaimType> type, Type patient) {
5766      super();
5767      this.type = type;
5768      this.patient = patient;
5769    }
5770
5771    /**
5772     * @return {@link #type} (The category of claim.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5773     */
5774    public Enumeration<ClaimType> getTypeElement() { 
5775      if (this.type == null)
5776        if (Configuration.errorOnAutoCreate())
5777          throw new Error("Attempt to auto-create Claim.type");
5778        else if (Configuration.doAutoCreate())
5779          this.type = new Enumeration<ClaimType>(new ClaimTypeEnumFactory()); // bb
5780      return this.type;
5781    }
5782
5783    public boolean hasTypeElement() { 
5784      return this.type != null && !this.type.isEmpty();
5785    }
5786
5787    public boolean hasType() { 
5788      return this.type != null && !this.type.isEmpty();
5789    }
5790
5791    /**
5792     * @param value {@link #type} (The category of claim.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
5793     */
5794    public Claim setTypeElement(Enumeration<ClaimType> value) { 
5795      this.type = value;
5796      return this;
5797    }
5798
5799    /**
5800     * @return The category of claim.
5801     */
5802    public ClaimType getType() { 
5803      return this.type == null ? null : this.type.getValue();
5804    }
5805
5806    /**
5807     * @param value The category of claim.
5808     */
5809    public Claim setType(ClaimType value) { 
5810        if (this.type == null)
5811          this.type = new Enumeration<ClaimType>(new ClaimTypeEnumFactory());
5812        this.type.setValue(value);
5813      return this;
5814    }
5815
5816    /**
5817     * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.)
5818     */
5819    public List<Coding> getSubType() { 
5820      if (this.subType == null)
5821        this.subType = new ArrayList<Coding>();
5822      return this.subType;
5823    }
5824
5825    public boolean hasSubType() { 
5826      if (this.subType == null)
5827        return false;
5828      for (Coding item : this.subType)
5829        if (!item.isEmpty())
5830          return true;
5831      return false;
5832    }
5833
5834    /**
5835     * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.)
5836     */
5837    // syntactic sugar
5838    public Coding addSubType() { //3
5839      Coding t = new Coding();
5840      if (this.subType == null)
5841        this.subType = new ArrayList<Coding>();
5842      this.subType.add(t);
5843      return t;
5844    }
5845
5846    // syntactic sugar
5847    public Claim addSubType(Coding t) { //3
5848      if (t == null)
5849        return this;
5850      if (this.subType == null)
5851        this.subType = new ArrayList<Coding>();
5852      this.subType.add(t);
5853      return this;
5854    }
5855
5856    /**
5857     * @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.)
5858     */
5859    public List<Identifier> getIdentifier() { 
5860      if (this.identifier == null)
5861        this.identifier = new ArrayList<Identifier>();
5862      return this.identifier;
5863    }
5864
5865    public boolean hasIdentifier() { 
5866      if (this.identifier == null)
5867        return false;
5868      for (Identifier item : this.identifier)
5869        if (!item.isEmpty())
5870          return true;
5871      return false;
5872    }
5873
5874    /**
5875     * @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.)
5876     */
5877    // syntactic sugar
5878    public Identifier addIdentifier() { //3
5879      Identifier t = new Identifier();
5880      if (this.identifier == null)
5881        this.identifier = new ArrayList<Identifier>();
5882      this.identifier.add(t);
5883      return t;
5884    }
5885
5886    // syntactic sugar
5887    public Claim addIdentifier(Identifier t) { //3
5888      if (t == null)
5889        return this;
5890      if (this.identifier == null)
5891        this.identifier = new ArrayList<Identifier>();
5892      this.identifier.add(t);
5893      return this;
5894    }
5895
5896    /**
5897     * @return {@link #ruleset} (The version of the specification on which this instance relies.)
5898     */
5899    public Coding getRuleset() { 
5900      if (this.ruleset == null)
5901        if (Configuration.errorOnAutoCreate())
5902          throw new Error("Attempt to auto-create Claim.ruleset");
5903        else if (Configuration.doAutoCreate())
5904          this.ruleset = new Coding(); // cc
5905      return this.ruleset;
5906    }
5907
5908    public boolean hasRuleset() { 
5909      return this.ruleset != null && !this.ruleset.isEmpty();
5910    }
5911
5912    /**
5913     * @param value {@link #ruleset} (The version of the specification on which this instance relies.)
5914     */
5915    public Claim setRuleset(Coding value) { 
5916      this.ruleset = value;
5917      return this;
5918    }
5919
5920    /**
5921     * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.)
5922     */
5923    public Coding getOriginalRuleset() { 
5924      if (this.originalRuleset == null)
5925        if (Configuration.errorOnAutoCreate())
5926          throw new Error("Attempt to auto-create Claim.originalRuleset");
5927        else if (Configuration.doAutoCreate())
5928          this.originalRuleset = new Coding(); // cc
5929      return this.originalRuleset;
5930    }
5931
5932    public boolean hasOriginalRuleset() { 
5933      return this.originalRuleset != null && !this.originalRuleset.isEmpty();
5934    }
5935
5936    /**
5937     * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.)
5938     */
5939    public Claim setOriginalRuleset(Coding value) { 
5940      this.originalRuleset = value;
5941      return this;
5942    }
5943
5944    /**
5945     * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
5946     */
5947    public DateTimeType getCreatedElement() { 
5948      if (this.created == null)
5949        if (Configuration.errorOnAutoCreate())
5950          throw new Error("Attempt to auto-create Claim.created");
5951        else if (Configuration.doAutoCreate())
5952          this.created = new DateTimeType(); // bb
5953      return this.created;
5954    }
5955
5956    public boolean hasCreatedElement() { 
5957      return this.created != null && !this.created.isEmpty();
5958    }
5959
5960    public boolean hasCreated() { 
5961      return this.created != null && !this.created.isEmpty();
5962    }
5963
5964    /**
5965     * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value
5966     */
5967    public Claim setCreatedElement(DateTimeType value) { 
5968      this.created = value;
5969      return this;
5970    }
5971
5972    /**
5973     * @return The date when the enclosed suite of services were performed or completed.
5974     */
5975    public Date getCreated() { 
5976      return this.created == null ? null : this.created.getValue();
5977    }
5978
5979    /**
5980     * @param value The date when the enclosed suite of services were performed or completed.
5981     */
5982    public Claim setCreated(Date value) { 
5983      if (value == null)
5984        this.created = null;
5985      else {
5986        if (this.created == null)
5987          this.created = new DateTimeType();
5988        this.created.setValue(value);
5989      }
5990      return this;
5991    }
5992
5993    /**
5994     * @return {@link #billablePeriod} (The billable period for which charges are being submitted.)
5995     */
5996    public Period getBillablePeriod() { 
5997      if (this.billablePeriod == null)
5998        if (Configuration.errorOnAutoCreate())
5999          throw new Error("Attempt to auto-create Claim.billablePeriod");
6000        else if (Configuration.doAutoCreate())
6001          this.billablePeriod = new Period(); // cc
6002      return this.billablePeriod;
6003    }
6004
6005    public boolean hasBillablePeriod() { 
6006      return this.billablePeriod != null && !this.billablePeriod.isEmpty();
6007    }
6008
6009    /**
6010     * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.)
6011     */
6012    public Claim setBillablePeriod(Period value) { 
6013      this.billablePeriod = value;
6014      return this;
6015    }
6016
6017    /**
6018     * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).)
6019     */
6020    public Type getTarget() { 
6021      return this.target;
6022    }
6023
6024    /**
6025     * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).)
6026     */
6027    public Identifier getTargetIdentifier() throws FHIRException { 
6028      if (!(this.target instanceof Identifier))
6029        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered");
6030      return (Identifier) this.target;
6031    }
6032
6033    public boolean hasTargetIdentifier() { 
6034      return this.target instanceof Identifier;
6035    }
6036
6037    /**
6038     * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).)
6039     */
6040    public Reference getTargetReference() throws FHIRException { 
6041      if (!(this.target instanceof Reference))
6042        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered");
6043      return (Reference) this.target;
6044    }
6045
6046    public boolean hasTargetReference() { 
6047      return this.target instanceof Reference;
6048    }
6049
6050    public boolean hasTarget() { 
6051      return this.target != null && !this.target.isEmpty();
6052    }
6053
6054    /**
6055     * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).)
6056     */
6057    public Claim setTarget(Type value) { 
6058      this.target = value;
6059      return this;
6060    }
6061
6062    /**
6063     * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.)
6064     */
6065    public Type getProvider() { 
6066      return this.provider;
6067    }
6068
6069    /**
6070     * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.)
6071     */
6072    public Identifier getProviderIdentifier() throws FHIRException { 
6073      if (!(this.provider instanceof Identifier))
6074        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered");
6075      return (Identifier) this.provider;
6076    }
6077
6078    public boolean hasProviderIdentifier() { 
6079      return this.provider instanceof Identifier;
6080    }
6081
6082    /**
6083     * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.)
6084     */
6085    public Reference getProviderReference() throws FHIRException { 
6086      if (!(this.provider instanceof Reference))
6087        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered");
6088      return (Reference) this.provider;
6089    }
6090
6091    public boolean hasProviderReference() { 
6092      return this.provider instanceof Reference;
6093    }
6094
6095    public boolean hasProvider() { 
6096      return this.provider != null && !this.provider.isEmpty();
6097    }
6098
6099    /**
6100     * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.)
6101     */
6102    public Claim setProvider(Type value) { 
6103      this.provider = value;
6104      return this;
6105    }
6106
6107    /**
6108     * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.)
6109     */
6110    public Type getOrganization() { 
6111      return this.organization;
6112    }
6113
6114    /**
6115     * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.)
6116     */
6117    public Identifier getOrganizationIdentifier() throws FHIRException { 
6118      if (!(this.organization instanceof Identifier))
6119        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered");
6120      return (Identifier) this.organization;
6121    }
6122
6123    public boolean hasOrganizationIdentifier() { 
6124      return this.organization instanceof Identifier;
6125    }
6126
6127    /**
6128     * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.)
6129     */
6130    public Reference getOrganizationReference() throws FHIRException { 
6131      if (!(this.organization instanceof Reference))
6132        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered");
6133      return (Reference) this.organization;
6134    }
6135
6136    public boolean hasOrganizationReference() { 
6137      return this.organization instanceof Reference;
6138    }
6139
6140    public boolean hasOrganization() { 
6141      return this.organization != null && !this.organization.isEmpty();
6142    }
6143
6144    /**
6145     * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.)
6146     */
6147    public Claim setOrganization(Type value) { 
6148      this.organization = value;
6149      return this;
6150    }
6151
6152    /**
6153     * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
6154     */
6155    public Enumeration<Use> getUseElement() { 
6156      if (this.use == null)
6157        if (Configuration.errorOnAutoCreate())
6158          throw new Error("Attempt to auto-create Claim.use");
6159        else if (Configuration.doAutoCreate())
6160          this.use = new Enumeration<Use>(new UseEnumFactory()); // bb
6161      return this.use;
6162    }
6163
6164    public boolean hasUseElement() { 
6165      return this.use != null && !this.use.isEmpty();
6166    }
6167
6168    public boolean hasUse() { 
6169      return this.use != null && !this.use.isEmpty();
6170    }
6171
6172    /**
6173     * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value
6174     */
6175    public Claim setUseElement(Enumeration<Use> value) { 
6176      this.use = value;
6177      return this;
6178    }
6179
6180    /**
6181     * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).
6182     */
6183    public Use getUse() { 
6184      return this.use == null ? null : this.use.getValue();
6185    }
6186
6187    /**
6188     * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).
6189     */
6190    public Claim setUse(Use value) { 
6191      if (value == null)
6192        this.use = null;
6193      else {
6194        if (this.use == null)
6195          this.use = new Enumeration<Use>(new UseEnumFactory());
6196        this.use.setValue(value);
6197      }
6198      return this;
6199    }
6200
6201    /**
6202     * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).)
6203     */
6204    public Coding getPriority() { 
6205      if (this.priority == null)
6206        if (Configuration.errorOnAutoCreate())
6207          throw new Error("Attempt to auto-create Claim.priority");
6208        else if (Configuration.doAutoCreate())
6209          this.priority = new Coding(); // cc
6210      return this.priority;
6211    }
6212
6213    public boolean hasPriority() { 
6214      return this.priority != null && !this.priority.isEmpty();
6215    }
6216
6217    /**
6218     * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).)
6219     */
6220    public Claim setPriority(Coding value) { 
6221      this.priority = value;
6222      return this;
6223    }
6224
6225    /**
6226     * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.)
6227     */
6228    public Coding getFundsReserve() { 
6229      if (this.fundsReserve == null)
6230        if (Configuration.errorOnAutoCreate())
6231          throw new Error("Attempt to auto-create Claim.fundsReserve");
6232        else if (Configuration.doAutoCreate())
6233          this.fundsReserve = new Coding(); // cc
6234      return this.fundsReserve;
6235    }
6236
6237    public boolean hasFundsReserve() { 
6238      return this.fundsReserve != null && !this.fundsReserve.isEmpty();
6239    }
6240
6241    /**
6242     * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.)
6243     */
6244    public Claim setFundsReserve(Coding value) { 
6245      this.fundsReserve = value;
6246      return this;
6247    }
6248
6249    /**
6250     * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
6251     */
6252    public Type getEnterer() { 
6253      return this.enterer;
6254    }
6255
6256    /**
6257     * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
6258     */
6259    public Identifier getEntererIdentifier() throws FHIRException { 
6260      if (!(this.enterer instanceof Identifier))
6261        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.enterer.getClass().getName()+" was encountered");
6262      return (Identifier) this.enterer;
6263    }
6264
6265    public boolean hasEntererIdentifier() { 
6266      return this.enterer instanceof Identifier;
6267    }
6268
6269    /**
6270     * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
6271     */
6272    public Reference getEntererReference() throws FHIRException { 
6273      if (!(this.enterer instanceof Reference))
6274        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.enterer.getClass().getName()+" was encountered");
6275      return (Reference) this.enterer;
6276    }
6277
6278    public boolean hasEntererReference() { 
6279      return this.enterer instanceof Reference;
6280    }
6281
6282    public boolean hasEnterer() { 
6283      return this.enterer != null && !this.enterer.isEmpty();
6284    }
6285
6286    /**
6287     * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.)
6288     */
6289    public Claim setEnterer(Type value) { 
6290      this.enterer = value;
6291      return this;
6292    }
6293
6294    /**
6295     * @return {@link #facility} (Facility where the services were provided.)
6296     */
6297    public Type getFacility() { 
6298      return this.facility;
6299    }
6300
6301    /**
6302     * @return {@link #facility} (Facility where the services were provided.)
6303     */
6304    public Identifier getFacilityIdentifier() throws FHIRException { 
6305      if (!(this.facility instanceof Identifier))
6306        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered");
6307      return (Identifier) this.facility;
6308    }
6309
6310    public boolean hasFacilityIdentifier() { 
6311      return this.facility instanceof Identifier;
6312    }
6313
6314    /**
6315     * @return {@link #facility} (Facility where the services were provided.)
6316     */
6317    public Reference getFacilityReference() throws FHIRException { 
6318      if (!(this.facility instanceof Reference))
6319        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered");
6320      return (Reference) this.facility;
6321    }
6322
6323    public boolean hasFacilityReference() { 
6324      return this.facility instanceof Reference;
6325    }
6326
6327    public boolean hasFacility() { 
6328      return this.facility != null && !this.facility.isEmpty();
6329    }
6330
6331    /**
6332     * @param value {@link #facility} (Facility where the services were provided.)
6333     */
6334    public Claim setFacility(Type value) { 
6335      this.facility = value;
6336      return this;
6337    }
6338
6339    /**
6340     * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.)
6341     */
6342    public List<RelatedClaimsComponent> getRelated() { 
6343      if (this.related == null)
6344        this.related = new ArrayList<RelatedClaimsComponent>();
6345      return this.related;
6346    }
6347
6348    public boolean hasRelated() { 
6349      if (this.related == null)
6350        return false;
6351      for (RelatedClaimsComponent item : this.related)
6352        if (!item.isEmpty())
6353          return true;
6354      return false;
6355    }
6356
6357    /**
6358     * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.)
6359     */
6360    // syntactic sugar
6361    public RelatedClaimsComponent addRelated() { //3
6362      RelatedClaimsComponent t = new RelatedClaimsComponent();
6363      if (this.related == null)
6364        this.related = new ArrayList<RelatedClaimsComponent>();
6365      this.related.add(t);
6366      return t;
6367    }
6368
6369    // syntactic sugar
6370    public Claim addRelated(RelatedClaimsComponent t) { //3
6371      if (t == null)
6372        return this;
6373      if (this.related == null)
6374        this.related = new ArrayList<RelatedClaimsComponent>();
6375      this.related.add(t);
6376      return this;
6377    }
6378
6379    /**
6380     * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.)
6381     */
6382    public Type getPrescription() { 
6383      return this.prescription;
6384    }
6385
6386    /**
6387     * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.)
6388     */
6389    public Identifier getPrescriptionIdentifier() throws FHIRException { 
6390      if (!(this.prescription instanceof Identifier))
6391        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.prescription.getClass().getName()+" was encountered");
6392      return (Identifier) this.prescription;
6393    }
6394
6395    public boolean hasPrescriptionIdentifier() { 
6396      return this.prescription instanceof Identifier;
6397    }
6398
6399    /**
6400     * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.)
6401     */
6402    public Reference getPrescriptionReference() throws FHIRException { 
6403      if (!(this.prescription instanceof Reference))
6404        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.prescription.getClass().getName()+" was encountered");
6405      return (Reference) this.prescription;
6406    }
6407
6408    public boolean hasPrescriptionReference() { 
6409      return this.prescription instanceof Reference;
6410    }
6411
6412    public boolean hasPrescription() { 
6413      return this.prescription != null && !this.prescription.isEmpty();
6414    }
6415
6416    /**
6417     * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.)
6418     */
6419    public Claim setPrescription(Type value) { 
6420      this.prescription = value;
6421      return this;
6422    }
6423
6424    /**
6425     * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.)
6426     */
6427    public Type getOriginalPrescription() { 
6428      return this.originalPrescription;
6429    }
6430
6431    /**
6432     * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.)
6433     */
6434    public Identifier getOriginalPrescriptionIdentifier() throws FHIRException { 
6435      if (!(this.originalPrescription instanceof Identifier))
6436        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.originalPrescription.getClass().getName()+" was encountered");
6437      return (Identifier) this.originalPrescription;
6438    }
6439
6440    public boolean hasOriginalPrescriptionIdentifier() { 
6441      return this.originalPrescription instanceof Identifier;
6442    }
6443
6444    /**
6445     * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.)
6446     */
6447    public Reference getOriginalPrescriptionReference() throws FHIRException { 
6448      if (!(this.originalPrescription instanceof Reference))
6449        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.originalPrescription.getClass().getName()+" was encountered");
6450      return (Reference) this.originalPrescription;
6451    }
6452
6453    public boolean hasOriginalPrescriptionReference() { 
6454      return this.originalPrescription instanceof Reference;
6455    }
6456
6457    public boolean hasOriginalPrescription() { 
6458      return this.originalPrescription != null && !this.originalPrescription.isEmpty();
6459    }
6460
6461    /**
6462     * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.)
6463     */
6464    public Claim setOriginalPrescription(Type value) { 
6465      this.originalPrescription = value;
6466      return this;
6467    }
6468
6469    /**
6470     * @return {@link #payee} (The party to be reimbursed for the services.)
6471     */
6472    public PayeeComponent getPayee() { 
6473      if (this.payee == null)
6474        if (Configuration.errorOnAutoCreate())
6475          throw new Error("Attempt to auto-create Claim.payee");
6476        else if (Configuration.doAutoCreate())
6477          this.payee = new PayeeComponent(); // cc
6478      return this.payee;
6479    }
6480
6481    public boolean hasPayee() { 
6482      return this.payee != null && !this.payee.isEmpty();
6483    }
6484
6485    /**
6486     * @param value {@link #payee} (The party to be reimbursed for the services.)
6487     */
6488    public Claim setPayee(PayeeComponent value) { 
6489      this.payee = value;
6490      return this;
6491    }
6492
6493    /**
6494     * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.)
6495     */
6496    public Type getReferral() { 
6497      return this.referral;
6498    }
6499
6500    /**
6501     * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.)
6502     */
6503    public Identifier getReferralIdentifier() throws FHIRException { 
6504      if (!(this.referral instanceof Identifier))
6505        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.referral.getClass().getName()+" was encountered");
6506      return (Identifier) this.referral;
6507    }
6508
6509    public boolean hasReferralIdentifier() { 
6510      return this.referral instanceof Identifier;
6511    }
6512
6513    /**
6514     * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.)
6515     */
6516    public Reference getReferralReference() throws FHIRException { 
6517      if (!(this.referral instanceof Reference))
6518        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.referral.getClass().getName()+" was encountered");
6519      return (Reference) this.referral;
6520    }
6521
6522    public boolean hasReferralReference() { 
6523      return this.referral instanceof Reference;
6524    }
6525
6526    public boolean hasReferral() { 
6527      return this.referral != null && !this.referral.isEmpty();
6528    }
6529
6530    /**
6531     * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.)
6532     */
6533    public Claim setReferral(Type value) { 
6534      this.referral = value;
6535      return this;
6536    }
6537
6538    /**
6539     * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.)
6540     */
6541    public List<Coding> getOccurrenceCode() { 
6542      if (this.occurrenceCode == null)
6543        this.occurrenceCode = new ArrayList<Coding>();
6544      return this.occurrenceCode;
6545    }
6546
6547    public boolean hasOccurrenceCode() { 
6548      if (this.occurrenceCode == null)
6549        return false;
6550      for (Coding item : this.occurrenceCode)
6551        if (!item.isEmpty())
6552          return true;
6553      return false;
6554    }
6555
6556    /**
6557     * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.)
6558     */
6559    // syntactic sugar
6560    public Coding addOccurrenceCode() { //3
6561      Coding t = new Coding();
6562      if (this.occurrenceCode == null)
6563        this.occurrenceCode = new ArrayList<Coding>();
6564      this.occurrenceCode.add(t);
6565      return t;
6566    }
6567
6568    // syntactic sugar
6569    public Claim addOccurrenceCode(Coding t) { //3
6570      if (t == null)
6571        return this;
6572      if (this.occurrenceCode == null)
6573        this.occurrenceCode = new ArrayList<Coding>();
6574      this.occurrenceCode.add(t);
6575      return this;
6576    }
6577
6578    /**
6579     * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.)
6580     */
6581    public List<Coding> getOccurenceSpanCode() { 
6582      if (this.occurenceSpanCode == null)
6583        this.occurenceSpanCode = new ArrayList<Coding>();
6584      return this.occurenceSpanCode;
6585    }
6586
6587    public boolean hasOccurenceSpanCode() { 
6588      if (this.occurenceSpanCode == null)
6589        return false;
6590      for (Coding item : this.occurenceSpanCode)
6591        if (!item.isEmpty())
6592          return true;
6593      return false;
6594    }
6595
6596    /**
6597     * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.)
6598     */
6599    // syntactic sugar
6600    public Coding addOccurenceSpanCode() { //3
6601      Coding t = new Coding();
6602      if (this.occurenceSpanCode == null)
6603        this.occurenceSpanCode = new ArrayList<Coding>();
6604      this.occurenceSpanCode.add(t);
6605      return t;
6606    }
6607
6608    // syntactic sugar
6609    public Claim addOccurenceSpanCode(Coding t) { //3
6610      if (t == null)
6611        return this;
6612      if (this.occurenceSpanCode == null)
6613        this.occurenceSpanCode = new ArrayList<Coding>();
6614      this.occurenceSpanCode.add(t);
6615      return this;
6616    }
6617
6618    /**
6619     * @return {@link #valueCode} (**Insert definition of Value codes.)
6620     */
6621    public List<Coding> getValueCode() { 
6622      if (this.valueCode == null)
6623        this.valueCode = new ArrayList<Coding>();
6624      return this.valueCode;
6625    }
6626
6627    public boolean hasValueCode() { 
6628      if (this.valueCode == null)
6629        return false;
6630      for (Coding item : this.valueCode)
6631        if (!item.isEmpty())
6632          return true;
6633      return false;
6634    }
6635
6636    /**
6637     * @return {@link #valueCode} (**Insert definition of Value codes.)
6638     */
6639    // syntactic sugar
6640    public Coding addValueCode() { //3
6641      Coding t = new Coding();
6642      if (this.valueCode == null)
6643        this.valueCode = new ArrayList<Coding>();
6644      this.valueCode.add(t);
6645      return t;
6646    }
6647
6648    // syntactic sugar
6649    public Claim addValueCode(Coding t) { //3
6650      if (t == null)
6651        return this;
6652      if (this.valueCode == null)
6653        this.valueCode = new ArrayList<Coding>();
6654      this.valueCode.add(t);
6655      return this;
6656    }
6657
6658    /**
6659     * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.)
6660     */
6661    public List<DiagnosisComponent> getDiagnosis() { 
6662      if (this.diagnosis == null)
6663        this.diagnosis = new ArrayList<DiagnosisComponent>();
6664      return this.diagnosis;
6665    }
6666
6667    public boolean hasDiagnosis() { 
6668      if (this.diagnosis == null)
6669        return false;
6670      for (DiagnosisComponent item : this.diagnosis)
6671        if (!item.isEmpty())
6672          return true;
6673      return false;
6674    }
6675
6676    /**
6677     * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.)
6678     */
6679    // syntactic sugar
6680    public DiagnosisComponent addDiagnosis() { //3
6681      DiagnosisComponent t = new DiagnosisComponent();
6682      if (this.diagnosis == null)
6683        this.diagnosis = new ArrayList<DiagnosisComponent>();
6684      this.diagnosis.add(t);
6685      return t;
6686    }
6687
6688    // syntactic sugar
6689    public Claim addDiagnosis(DiagnosisComponent t) { //3
6690      if (t == null)
6691        return this;
6692      if (this.diagnosis == null)
6693        this.diagnosis = new ArrayList<DiagnosisComponent>();
6694      this.diagnosis.add(t);
6695      return this;
6696    }
6697
6698    /**
6699     * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.)
6700     */
6701    public List<ProcedureComponent> getProcedure() { 
6702      if (this.procedure == null)
6703        this.procedure = new ArrayList<ProcedureComponent>();
6704      return this.procedure;
6705    }
6706
6707    public boolean hasProcedure() { 
6708      if (this.procedure == null)
6709        return false;
6710      for (ProcedureComponent item : this.procedure)
6711        if (!item.isEmpty())
6712          return true;
6713      return false;
6714    }
6715
6716    /**
6717     * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.)
6718     */
6719    // syntactic sugar
6720    public ProcedureComponent addProcedure() { //3
6721      ProcedureComponent t = new ProcedureComponent();
6722      if (this.procedure == null)
6723        this.procedure = new ArrayList<ProcedureComponent>();
6724      this.procedure.add(t);
6725      return t;
6726    }
6727
6728    // syntactic sugar
6729    public Claim addProcedure(ProcedureComponent t) { //3
6730      if (t == null)
6731        return this;
6732      if (this.procedure == null)
6733        this.procedure = new ArrayList<ProcedureComponent>();
6734      this.procedure.add(t);
6735      return this;
6736    }
6737
6738    /**
6739     * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient  for which care is sought which may influence the adjudication.)
6740     */
6741    public List<Coding> getSpecialCondition() { 
6742      if (this.specialCondition == null)
6743        this.specialCondition = new ArrayList<Coding>();
6744      return this.specialCondition;
6745    }
6746
6747    public boolean hasSpecialCondition() { 
6748      if (this.specialCondition == null)
6749        return false;
6750      for (Coding item : this.specialCondition)
6751        if (!item.isEmpty())
6752          return true;
6753      return false;
6754    }
6755
6756    /**
6757     * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient  for which care is sought which may influence the adjudication.)
6758     */
6759    // syntactic sugar
6760    public Coding addSpecialCondition() { //3
6761      Coding t = new Coding();
6762      if (this.specialCondition == null)
6763        this.specialCondition = new ArrayList<Coding>();
6764      this.specialCondition.add(t);
6765      return t;
6766    }
6767
6768    // syntactic sugar
6769    public Claim addSpecialCondition(Coding t) { //3
6770      if (t == null)
6771        return this;
6772      if (this.specialCondition == null)
6773        this.specialCondition = new ArrayList<Coding>();
6774      this.specialCondition.add(t);
6775      return this;
6776    }
6777
6778    /**
6779     * @return {@link #patient} (Patient Resource.)
6780     */
6781    public Type getPatient() { 
6782      return this.patient;
6783    }
6784
6785    /**
6786     * @return {@link #patient} (Patient Resource.)
6787     */
6788    public Identifier getPatientIdentifier() throws FHIRException { 
6789      if (!(this.patient instanceof Identifier))
6790        throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered");
6791      return (Identifier) this.patient;
6792    }
6793
6794    public boolean hasPatientIdentifier() { 
6795      return this.patient instanceof Identifier;
6796    }
6797
6798    /**
6799     * @return {@link #patient} (Patient Resource.)
6800     */
6801    public Reference getPatientReference() throws FHIRException { 
6802      if (!(this.patient instanceof Reference))
6803        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered");
6804      return (Reference) this.patient;
6805    }
6806
6807    public boolean hasPatientReference() { 
6808      return this.patient instanceof Reference;
6809    }
6810
6811    public boolean hasPatient() { 
6812      return this.patient != null && !this.patient.isEmpty();
6813    }
6814
6815    /**
6816     * @param value {@link #patient} (Patient Resource.)
6817     */
6818    public Claim setPatient(Type value) { 
6819      this.patient = value;
6820      return this;
6821    }
6822
6823    /**
6824     * @return {@link #coverage} (Financial instrument by which payment information for health care.)
6825     */
6826    public List<CoverageComponent> getCoverage() { 
6827      if (this.coverage == null)
6828        this.coverage = new ArrayList<CoverageComponent>();
6829      return this.coverage;
6830    }
6831
6832    public boolean hasCoverage() { 
6833      if (this.coverage == null)
6834        return false;
6835      for (CoverageComponent item : this.coverage)
6836        if (!item.isEmpty())
6837          return true;
6838      return false;
6839    }
6840
6841    /**
6842     * @return {@link #coverage} (Financial instrument by which payment information for health care.)
6843     */
6844    // syntactic sugar
6845    public CoverageComponent addCoverage() { //3
6846      CoverageComponent t = new CoverageComponent();
6847      if (this.coverage == null)
6848        this.coverage = new ArrayList<CoverageComponent>();
6849      this.coverage.add(t);
6850      return t;
6851    }
6852
6853    // syntactic sugar
6854    public Claim addCoverage(CoverageComponent t) { //3
6855      if (t == null)
6856        return this;
6857      if (this.coverage == null)
6858        this.coverage = new ArrayList<CoverageComponent>();
6859      this.coverage.add(t);
6860      return this;
6861    }
6862
6863    /**
6864     * @return {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value
6865     */
6866    public DateType getAccidentDateElement() { 
6867      if (this.accidentDate == null)
6868        if (Configuration.errorOnAutoCreate())
6869          throw new Error("Attempt to auto-create Claim.accidentDate");
6870        else if (Configuration.doAutoCreate())
6871          this.accidentDate = new DateType(); // bb
6872      return this.accidentDate;
6873    }
6874
6875    public boolean hasAccidentDateElement() { 
6876      return this.accidentDate != null && !this.accidentDate.isEmpty();
6877    }
6878
6879    public boolean hasAccidentDate() { 
6880      return this.accidentDate != null && !this.accidentDate.isEmpty();
6881    }
6882
6883    /**
6884     * @param value {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value
6885     */
6886    public Claim setAccidentDateElement(DateType value) { 
6887      this.accidentDate = value;
6888      return this;
6889    }
6890
6891    /**
6892     * @return Date of an accident which these services are addressing.
6893     */
6894    public Date getAccidentDate() { 
6895      return this.accidentDate == null ? null : this.accidentDate.getValue();
6896    }
6897
6898    /**
6899     * @param value Date of an accident which these services are addressing.
6900     */
6901    public Claim setAccidentDate(Date value) { 
6902      if (value == null)
6903        this.accidentDate = null;
6904      else {
6905        if (this.accidentDate == null)
6906          this.accidentDate = new DateType();
6907        this.accidentDate.setValue(value);
6908      }
6909      return this;
6910    }
6911
6912    /**
6913     * @return {@link #accidentType} (Type of accident: work, auto, etc.)
6914     */
6915    public Coding getAccidentType() { 
6916      if (this.accidentType == null)
6917        if (Configuration.errorOnAutoCreate())
6918          throw new Error("Attempt to auto-create Claim.accidentType");
6919        else if (Configuration.doAutoCreate())
6920          this.accidentType = new Coding(); // cc
6921      return this.accidentType;
6922    }
6923
6924    public boolean hasAccidentType() { 
6925      return this.accidentType != null && !this.accidentType.isEmpty();
6926    }
6927
6928    /**
6929     * @param value {@link #accidentType} (Type of accident: work, auto, etc.)
6930     */
6931    public Claim setAccidentType(Coding value) { 
6932      this.accidentType = value;
6933      return this;
6934    }
6935
6936    /**
6937     * @return {@link #accidentLocation} (Accident Place.)
6938     */
6939    public Type getAccidentLocation() { 
6940      return this.accidentLocation;
6941    }
6942
6943    /**
6944     * @return {@link #accidentLocation} (Accident Place.)
6945     */
6946    public Address getAccidentLocationAddress() throws FHIRException { 
6947      if (!(this.accidentLocation instanceof Address))
6948        throw new FHIRException("Type mismatch: the type Address was expected, but "+this.accidentLocation.getClass().getName()+" was encountered");
6949      return (Address) this.accidentLocation;
6950    }
6951
6952    public boolean hasAccidentLocationAddress() { 
6953      return this.accidentLocation instanceof Address;
6954    }
6955
6956    /**
6957     * @return {@link #accidentLocation} (Accident Place.)
6958     */
6959    public Reference getAccidentLocationReference() throws FHIRException { 
6960      if (!(this.accidentLocation instanceof Reference))
6961        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.accidentLocation.getClass().getName()+" was encountered");
6962      return (Reference) this.accidentLocation;
6963    }
6964
6965    public boolean hasAccidentLocationReference() { 
6966      return this.accidentLocation instanceof Reference;
6967    }
6968
6969    public boolean hasAccidentLocation() { 
6970      return this.accidentLocation != null && !this.accidentLocation.isEmpty();
6971    }
6972
6973    /**
6974     * @param value {@link #accidentLocation} (Accident Place.)
6975     */
6976    public Claim setAccidentLocation(Type value) { 
6977      this.accidentLocation = value;
6978      return this;
6979    }
6980
6981    /**
6982     * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.)
6983     */
6984    public List<Coding> getInterventionException() { 
6985      if (this.interventionException == null)
6986        this.interventionException = new ArrayList<Coding>();
6987      return this.interventionException;
6988    }
6989
6990    public boolean hasInterventionException() { 
6991      if (this.interventionException == null)
6992        return false;
6993      for (Coding item : this.interventionException)
6994        if (!item.isEmpty())
6995          return true;
6996      return false;
6997    }
6998
6999    /**
7000     * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.)
7001     */
7002    // syntactic sugar
7003    public Coding addInterventionException() { //3
7004      Coding t = new Coding();
7005      if (this.interventionException == null)
7006        this.interventionException = new ArrayList<Coding>();
7007      this.interventionException.add(t);
7008      return t;
7009    }
7010
7011    // syntactic sugar
7012    public Claim addInterventionException(Coding t) { //3
7013      if (t == null)
7014        return this;
7015      if (this.interventionException == null)
7016        this.interventionException = new ArrayList<Coding>();
7017      this.interventionException.add(t);
7018      return this;
7019    }
7020
7021    /**
7022     * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.)
7023     */
7024    public List<OnsetComponent> getOnset() { 
7025      if (this.onset == null)
7026        this.onset = new ArrayList<OnsetComponent>();
7027      return this.onset;
7028    }
7029
7030    public boolean hasOnset() { 
7031      if (this.onset == null)
7032        return false;
7033      for (OnsetComponent item : this.onset)
7034        if (!item.isEmpty())
7035          return true;
7036      return false;
7037    }
7038
7039    /**
7040     * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.)
7041     */
7042    // syntactic sugar
7043    public OnsetComponent addOnset() { //3
7044      OnsetComponent t = new OnsetComponent();
7045      if (this.onset == null)
7046        this.onset = new ArrayList<OnsetComponent>();
7047      this.onset.add(t);
7048      return t;
7049    }
7050
7051    // syntactic sugar
7052    public Claim addOnset(OnsetComponent t) { //3
7053      if (t == null)
7054        return this;
7055      if (this.onset == null)
7056        this.onset = new ArrayList<OnsetComponent>();
7057      this.onset.add(t);
7058      return this;
7059    }
7060
7061    /**
7062     * @return {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).)
7063     */
7064    public Period getEmploymentImpacted() { 
7065      if (this.employmentImpacted == null)
7066        if (Configuration.errorOnAutoCreate())
7067          throw new Error("Attempt to auto-create Claim.employmentImpacted");
7068        else if (Configuration.doAutoCreate())
7069          this.employmentImpacted = new Period(); // cc
7070      return this.employmentImpacted;
7071    }
7072
7073    public boolean hasEmploymentImpacted() { 
7074      return this.employmentImpacted != null && !this.employmentImpacted.isEmpty();
7075    }
7076
7077    /**
7078     * @param value {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).)
7079     */
7080    public Claim setEmploymentImpacted(Period value) { 
7081      this.employmentImpacted = value;
7082      return this;
7083    }
7084
7085    /**
7086     * @return {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.)
7087     */
7088    public Period getHospitalization() { 
7089      if (this.hospitalization == null)
7090        if (Configuration.errorOnAutoCreate())
7091          throw new Error("Attempt to auto-create Claim.hospitalization");
7092        else if (Configuration.doAutoCreate())
7093          this.hospitalization = new Period(); // cc
7094      return this.hospitalization;
7095    }
7096
7097    public boolean hasHospitalization() { 
7098      return this.hospitalization != null && !this.hospitalization.isEmpty();
7099    }
7100
7101    /**
7102     * @param value {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.)
7103     */
7104    public Claim setHospitalization(Period value) { 
7105      this.hospitalization = value;
7106      return this;
7107    }
7108
7109    /**
7110     * @return {@link #item} (First tier of goods and services.)
7111     */
7112    public List<ItemsComponent> getItem() { 
7113      if (this.item == null)
7114        this.item = new ArrayList<ItemsComponent>();
7115      return this.item;
7116    }
7117
7118    public boolean hasItem() { 
7119      if (this.item == null)
7120        return false;
7121      for (ItemsComponent item : this.item)
7122        if (!item.isEmpty())
7123          return true;
7124      return false;
7125    }
7126
7127    /**
7128     * @return {@link #item} (First tier of goods and services.)
7129     */
7130    // syntactic sugar
7131    public ItemsComponent addItem() { //3
7132      ItemsComponent t = new ItemsComponent();
7133      if (this.item == null)
7134        this.item = new ArrayList<ItemsComponent>();
7135      this.item.add(t);
7136      return t;
7137    }
7138
7139    // syntactic sugar
7140    public Claim addItem(ItemsComponent t) { //3
7141      if (t == null)
7142        return this;
7143      if (this.item == null)
7144        this.item = new ArrayList<ItemsComponent>();
7145      this.item.add(t);
7146      return this;
7147    }
7148
7149    /**
7150     * @return {@link #total} (The total value of the claim.)
7151     */
7152    public Money getTotal() { 
7153      if (this.total == null)
7154        if (Configuration.errorOnAutoCreate())
7155          throw new Error("Attempt to auto-create Claim.total");
7156        else if (Configuration.doAutoCreate())
7157          this.total = new Money(); // cc
7158      return this.total;
7159    }
7160
7161    public boolean hasTotal() { 
7162      return this.total != null && !this.total.isEmpty();
7163    }
7164
7165    /**
7166     * @param value {@link #total} (The total value of the claim.)
7167     */
7168    public Claim setTotal(Money value) { 
7169      this.total = value;
7170      return this;
7171    }
7172
7173    /**
7174     * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.)
7175     */
7176    public List<Coding> getAdditionalMaterial() { 
7177      if (this.additionalMaterial == null)
7178        this.additionalMaterial = new ArrayList<Coding>();
7179      return this.additionalMaterial;
7180    }
7181
7182    public boolean hasAdditionalMaterial() { 
7183      if (this.additionalMaterial == null)
7184        return false;
7185      for (Coding item : this.additionalMaterial)
7186        if (!item.isEmpty())
7187          return true;
7188      return false;
7189    }
7190
7191    /**
7192     * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.)
7193     */
7194    // syntactic sugar
7195    public Coding addAdditionalMaterial() { //3
7196      Coding t = new Coding();
7197      if (this.additionalMaterial == null)
7198        this.additionalMaterial = new ArrayList<Coding>();
7199      this.additionalMaterial.add(t);
7200      return t;
7201    }
7202
7203    // syntactic sugar
7204    public Claim addAdditionalMaterial(Coding t) { //3
7205      if (t == null)
7206        return this;
7207      if (this.additionalMaterial == null)
7208        this.additionalMaterial = new ArrayList<Coding>();
7209      this.additionalMaterial.add(t);
7210      return this;
7211    }
7212
7213    /**
7214     * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons.)
7215     */
7216    public List<MissingTeethComponent> getMissingTeeth() { 
7217      if (this.missingTeeth == null)
7218        this.missingTeeth = new ArrayList<MissingTeethComponent>();
7219      return this.missingTeeth;
7220    }
7221
7222    public boolean hasMissingTeeth() { 
7223      if (this.missingTeeth == null)
7224        return false;
7225      for (MissingTeethComponent item : this.missingTeeth)
7226        if (!item.isEmpty())
7227          return true;
7228      return false;
7229    }
7230
7231    /**
7232     * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons.)
7233     */
7234    // syntactic sugar
7235    public MissingTeethComponent addMissingTeeth() { //3
7236      MissingTeethComponent t = new MissingTeethComponent();
7237      if (this.missingTeeth == null)
7238        this.missingTeeth = new ArrayList<MissingTeethComponent>();
7239      this.missingTeeth.add(t);
7240      return t;
7241    }
7242
7243    // syntactic sugar
7244    public Claim addMissingTeeth(MissingTeethComponent t) { //3
7245      if (t == null)
7246        return this;
7247      if (this.missingTeeth == null)
7248        this.missingTeeth = new ArrayList<MissingTeethComponent>();
7249      this.missingTeeth.add(t);
7250      return this;
7251    }
7252
7253      protected void listChildren(List<Property> childrenList) {
7254        super.listChildren(childrenList);
7255        childrenList.add(new Property("type", "code", "The category of claim.", 0, java.lang.Integer.MAX_VALUE, type));
7256        childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType));
7257        childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier));
7258        childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset));
7259        childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset));
7260        childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created));
7261        childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod));
7262        childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target));
7263        childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider));
7264        childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization));
7265        childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use));
7266        childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority));
7267        childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve));
7268        childrenList.add(new Property("enterer[x]", "Identifier|Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer));
7269        childrenList.add(new Property("facility[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility));
7270        childrenList.add(new Property("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related));
7271        childrenList.add(new Property("prescription[x]", "Identifier|Reference(MedicationOrder|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription));
7272        childrenList.add(new Property("originalPrescription[x]", "Identifier|Reference(MedicationOrder)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription));
7273        childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee));
7274        childrenList.add(new Property("referral[x]", "Identifier|Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral));
7275        childrenList.add(new Property("occurrenceCode", "Coding", "**Insert definition of Occurrence codes.", 0, java.lang.Integer.MAX_VALUE, occurrenceCode));
7276        childrenList.add(new Property("occurenceSpanCode", "Coding", "**Insert definition of Occurrence Span codes.", 0, java.lang.Integer.MAX_VALUE, occurenceSpanCode));
7277        childrenList.add(new Property("valueCode", "Coding", "**Insert definition of Value codes.", 0, java.lang.Integer.MAX_VALUE, valueCode));
7278        childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
7279        childrenList.add(new Property("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure));
7280        childrenList.add(new Property("specialCondition", "Coding", "List of special conditions relating to the setting, treatment or patient  for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, specialCondition));
7281        childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient));
7282        childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage));
7283        childrenList.add(new Property("accidentDate", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accidentDate));
7284        childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType));
7285        childrenList.add(new Property("accidentLocation[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, accidentLocation));
7286        childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException));
7287        childrenList.add(new Property("onset", "", "Period, start and last dates of aspects of the Condition or related services.", 0, java.lang.Integer.MAX_VALUE, onset));
7288        childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted));
7289        childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization));
7290        childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item));
7291        childrenList.add(new Property("total", "Money", "The total value of the claim.", 0, java.lang.Integer.MAX_VALUE, total));
7292        childrenList.add(new Property("additionalMaterial", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterial));
7293        childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously  extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth));
7294      }
7295
7296      @Override
7297      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7298        switch (hash) {
7299        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<ClaimType>
7300        case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding
7301        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
7302        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding
7303        case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding
7304        case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType
7305        case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period
7306        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type
7307        case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type
7308        case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type
7309        case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration<Use>
7310        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding
7311        case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // Coding
7312        case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Type
7313        case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type
7314        case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimsComponent
7315        case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Type
7316        case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Type
7317        case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent
7318        case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Type
7319        case 1721744222: /*occurrenceCode*/ return this.occurrenceCode == null ? new Base[0] : this.occurrenceCode.toArray(new Base[this.occurrenceCode.size()]); // Coding
7320        case -556690898: /*occurenceSpanCode*/ return this.occurenceSpanCode == null ? new Base[0] : this.occurenceSpanCode.toArray(new Base[this.occurenceSpanCode.size()]); // Coding
7321        case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // Coding
7322        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent
7323        case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent
7324        case -481489822: /*specialCondition*/ return this.specialCondition == null ? new Base[0] : this.specialCondition.toArray(new Base[this.specialCondition.size()]); // Coding
7325        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type
7326        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent
7327        case -63170979: /*accidentDate*/ return this.accidentDate == null ? new Base[0] : new Base[] {this.accidentDate}; // DateType
7328        case -62671383: /*accidentType*/ return this.accidentType == null ? new Base[0] : new Base[] {this.accidentType}; // Coding
7329        case -1074014492: /*accidentLocation*/ return this.accidentLocation == null ? new Base[0] : new Base[] {this.accidentLocation}; // Type
7330        case 1753076536: /*interventionException*/ return this.interventionException == null ? new Base[0] : this.interventionException.toArray(new Base[this.interventionException.size()]); // Coding
7331        case 105901603: /*onset*/ return this.onset == null ? new Base[0] : this.onset.toArray(new Base[this.onset.size()]); // OnsetComponent
7332        case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period
7333        case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period
7334        case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent
7335        case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money
7336        case -1534875026: /*additionalMaterial*/ return this.additionalMaterial == null ? new Base[0] : this.additionalMaterial.toArray(new Base[this.additionalMaterial.size()]); // Coding
7337        case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent
7338        default: return super.getProperty(hash, name, checkValid);
7339        }
7340
7341      }
7342
7343      @Override
7344      public void setProperty(int hash, String name, Base value) throws FHIRException {
7345        switch (hash) {
7346        case 3575610: // type
7347          this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration<ClaimType>
7348          break;
7349        case -1868521062: // subType
7350          this.getSubType().add(castToCoding(value)); // Coding
7351          break;
7352        case -1618432855: // identifier
7353          this.getIdentifier().add(castToIdentifier(value)); // Identifier
7354          break;
7355        case 1548678118: // ruleset
7356          this.ruleset = castToCoding(value); // Coding
7357          break;
7358        case 1089373397: // originalRuleset
7359          this.originalRuleset = castToCoding(value); // Coding
7360          break;
7361        case 1028554472: // created
7362          this.created = castToDateTime(value); // DateTimeType
7363          break;
7364        case -332066046: // billablePeriod
7365          this.billablePeriod = castToPeriod(value); // Period
7366          break;
7367        case -880905839: // target
7368          this.target = (Type) value; // Type
7369          break;
7370        case -987494927: // provider
7371          this.provider = (Type) value; // Type
7372          break;
7373        case 1178922291: // organization
7374          this.organization = (Type) value; // Type
7375          break;
7376        case 116103: // use
7377          this.use = new UseEnumFactory().fromType(value); // Enumeration<Use>
7378          break;
7379        case -1165461084: // priority
7380          this.priority = castToCoding(value); // Coding
7381          break;
7382        case 1314609806: // fundsReserve
7383          this.fundsReserve = castToCoding(value); // Coding
7384          break;
7385        case -1591951995: // enterer
7386          this.enterer = (Type) value; // Type
7387          break;
7388        case 501116579: // facility
7389          this.facility = (Type) value; // Type
7390          break;
7391        case 1090493483: // related
7392          this.getRelated().add((RelatedClaimsComponent) value); // RelatedClaimsComponent
7393          break;
7394        case 460301338: // prescription
7395          this.prescription = (Type) value; // Type
7396          break;
7397        case -1814015861: // originalPrescription
7398          this.originalPrescription = (Type) value; // Type
7399          break;
7400        case 106443592: // payee
7401          this.payee = (PayeeComponent) value; // PayeeComponent
7402          break;
7403        case -722568291: // referral
7404          this.referral = (Type) value; // Type
7405          break;
7406        case 1721744222: // occurrenceCode
7407          this.getOccurrenceCode().add(castToCoding(value)); // Coding
7408          break;
7409        case -556690898: // occurenceSpanCode
7410          this.getOccurenceSpanCode().add(castToCoding(value)); // Coding
7411          break;
7412        case -766209282: // valueCode
7413          this.getValueCode().add(castToCoding(value)); // Coding
7414          break;
7415        case 1196993265: // diagnosis
7416          this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent
7417          break;
7418        case -1095204141: // procedure
7419          this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent
7420          break;
7421        case -481489822: // specialCondition
7422          this.getSpecialCondition().add(castToCoding(value)); // Coding
7423          break;
7424        case -791418107: // patient
7425          this.patient = (Type) value; // Type
7426          break;
7427        case -351767064: // coverage
7428          this.getCoverage().add((CoverageComponent) value); // CoverageComponent
7429          break;
7430        case -63170979: // accidentDate
7431          this.accidentDate = castToDate(value); // DateType
7432          break;
7433        case -62671383: // accidentType
7434          this.accidentType = castToCoding(value); // Coding
7435          break;
7436        case -1074014492: // accidentLocation
7437          this.accidentLocation = (Type) value; // Type
7438          break;
7439        case 1753076536: // interventionException
7440          this.getInterventionException().add(castToCoding(value)); // Coding
7441          break;
7442        case 105901603: // onset
7443          this.getOnset().add((OnsetComponent) value); // OnsetComponent
7444          break;
7445        case 1051487345: // employmentImpacted
7446          this.employmentImpacted = castToPeriod(value); // Period
7447          break;
7448        case 1057894634: // hospitalization
7449          this.hospitalization = castToPeriod(value); // Period
7450          break;
7451        case 3242771: // item
7452          this.getItem().add((ItemsComponent) value); // ItemsComponent
7453          break;
7454        case 110549828: // total
7455          this.total = castToMoney(value); // Money
7456          break;
7457        case -1534875026: // additionalMaterial
7458          this.getAdditionalMaterial().add(castToCoding(value)); // Coding
7459          break;
7460        case -1157130302: // missingTeeth
7461          this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent
7462          break;
7463        default: super.setProperty(hash, name, value);
7464        }
7465
7466      }
7467
7468      @Override
7469      public void setProperty(String name, Base value) throws FHIRException {
7470        if (name.equals("type"))
7471          this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration<ClaimType>
7472        else if (name.equals("subType"))
7473          this.getSubType().add(castToCoding(value));
7474        else if (name.equals("identifier"))
7475          this.getIdentifier().add(castToIdentifier(value));
7476        else if (name.equals("ruleset"))
7477          this.ruleset = castToCoding(value); // Coding
7478        else if (name.equals("originalRuleset"))
7479          this.originalRuleset = castToCoding(value); // Coding
7480        else if (name.equals("created"))
7481          this.created = castToDateTime(value); // DateTimeType
7482        else if (name.equals("billablePeriod"))
7483          this.billablePeriod = castToPeriod(value); // Period
7484        else if (name.equals("target[x]"))
7485          this.target = (Type) value; // Type
7486        else if (name.equals("provider[x]"))
7487          this.provider = (Type) value; // Type
7488        else if (name.equals("organization[x]"))
7489          this.organization = (Type) value; // Type
7490        else if (name.equals("use"))
7491          this.use = new UseEnumFactory().fromType(value); // Enumeration<Use>
7492        else if (name.equals("priority"))
7493          this.priority = castToCoding(value); // Coding
7494        else if (name.equals("fundsReserve"))
7495          this.fundsReserve = castToCoding(value); // Coding
7496        else if (name.equals("enterer[x]"))
7497          this.enterer = (Type) value; // Type
7498        else if (name.equals("facility[x]"))
7499          this.facility = (Type) value; // Type
7500        else if (name.equals("related"))
7501          this.getRelated().add((RelatedClaimsComponent) value);
7502        else if (name.equals("prescription[x]"))
7503          this.prescription = (Type) value; // Type
7504        else if (name.equals("originalPrescription[x]"))
7505          this.originalPrescription = (Type) value; // Type
7506        else if (name.equals("payee"))
7507          this.payee = (PayeeComponent) value; // PayeeComponent
7508        else if (name.equals("referral[x]"))
7509          this.referral = (Type) value; // Type
7510        else if (name.equals("occurrenceCode"))
7511          this.getOccurrenceCode().add(castToCoding(value));
7512        else if (name.equals("occurenceSpanCode"))
7513          this.getOccurenceSpanCode().add(castToCoding(value));
7514        else if (name.equals("valueCode"))
7515          this.getValueCode().add(castToCoding(value));
7516        else if (name.equals("diagnosis"))
7517          this.getDiagnosis().add((DiagnosisComponent) value);
7518        else if (name.equals("procedure"))
7519          this.getProcedure().add((ProcedureComponent) value);
7520        else if (name.equals("specialCondition"))
7521          this.getSpecialCondition().add(castToCoding(value));
7522        else if (name.equals("patient[x]"))
7523          this.patient = (Type) value; // Type
7524        else if (name.equals("coverage"))
7525          this.getCoverage().add((CoverageComponent) value);
7526        else if (name.equals("accidentDate"))
7527          this.accidentDate = castToDate(value); // DateType
7528        else if (name.equals("accidentType"))
7529          this.accidentType = castToCoding(value); // Coding
7530        else if (name.equals("accidentLocation[x]"))
7531          this.accidentLocation = (Type) value; // Type
7532        else if (name.equals("interventionException"))
7533          this.getInterventionException().add(castToCoding(value));
7534        else if (name.equals("onset"))
7535          this.getOnset().add((OnsetComponent) value);
7536        else if (name.equals("employmentImpacted"))
7537          this.employmentImpacted = castToPeriod(value); // Period
7538        else if (name.equals("hospitalization"))
7539          this.hospitalization = castToPeriod(value); // Period
7540        else if (name.equals("item"))
7541          this.getItem().add((ItemsComponent) value);
7542        else if (name.equals("total"))
7543          this.total = castToMoney(value); // Money
7544        else if (name.equals("additionalMaterial"))
7545          this.getAdditionalMaterial().add(castToCoding(value));
7546        else if (name.equals("missingTeeth"))
7547          this.getMissingTeeth().add((MissingTeethComponent) value);
7548        else
7549          super.setProperty(name, value);
7550      }
7551
7552      @Override
7553      public Base makeProperty(int hash, String name) throws FHIRException {
7554        switch (hash) {
7555        case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration<ClaimType>
7556        case -1868521062:  return addSubType(); // Coding
7557        case -1618432855:  return addIdentifier(); // Identifier
7558        case 1548678118:  return getRuleset(); // Coding
7559        case 1089373397:  return getOriginalRuleset(); // Coding
7560        case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType
7561        case -332066046:  return getBillablePeriod(); // Period
7562        case -815579825:  return getTarget(); // Type
7563        case 2064698607:  return getProvider(); // Type
7564        case 1326483053:  return getOrganization(); // Type
7565        case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration<Use>
7566        case -1165461084:  return getPriority(); // Coding
7567        case 1314609806:  return getFundsReserve(); // Coding
7568        case -812909349:  return getEnterer(); // Type
7569        case -542224643:  return getFacility(); // Type
7570        case 1090493483:  return addRelated(); // RelatedClaimsComponent
7571        case -993324506:  return getPrescription(); // Type
7572        case -2067905515:  return getOriginalPrescription(); // Type
7573        case 106443592:  return getPayee(); // PayeeComponent
7574        case 344221635:  return getReferral(); // Type
7575        case 1721744222:  return addOccurrenceCode(); // Coding
7576        case -556690898:  return addOccurenceSpanCode(); // Coding
7577        case -766209282:  return addValueCode(); // Coding
7578        case 1196993265:  return addDiagnosis(); // DiagnosisComponent
7579        case -1095204141:  return addProcedure(); // ProcedureComponent
7580        case -481489822:  return addSpecialCondition(); // Coding
7581        case -2061246629:  return getPatient(); // Type
7582        case -351767064:  return addCoverage(); // CoverageComponent
7583        case -63170979: throw new FHIRException("Cannot make property accidentDate as it is not a complex type"); // DateType
7584        case -62671383:  return getAccidentType(); // Coding
7585        case 1540715292:  return getAccidentLocation(); // Type
7586        case 1753076536:  return addInterventionException(); // Coding
7587        case 105901603:  return addOnset(); // OnsetComponent
7588        case 1051487345:  return getEmploymentImpacted(); // Period
7589        case 1057894634:  return getHospitalization(); // Period
7590        case 3242771:  return addItem(); // ItemsComponent
7591        case 110549828:  return getTotal(); // Money
7592        case -1534875026:  return addAdditionalMaterial(); // Coding
7593        case -1157130302:  return addMissingTeeth(); // MissingTeethComponent
7594        default: return super.makeProperty(hash, name);
7595        }
7596
7597      }
7598
7599      @Override
7600      public Base addChild(String name) throws FHIRException {
7601        if (name.equals("type")) {
7602          throw new FHIRException("Cannot call addChild on a primitive type Claim.type");
7603        }
7604        else if (name.equals("subType")) {
7605          return addSubType();
7606        }
7607        else if (name.equals("identifier")) {
7608          return addIdentifier();
7609        }
7610        else if (name.equals("ruleset")) {
7611          this.ruleset = new Coding();
7612          return this.ruleset;
7613        }
7614        else if (name.equals("originalRuleset")) {
7615          this.originalRuleset = new Coding();
7616          return this.originalRuleset;
7617        }
7618        else if (name.equals("created")) {
7619          throw new FHIRException("Cannot call addChild on a primitive type Claim.created");
7620        }
7621        else if (name.equals("billablePeriod")) {
7622          this.billablePeriod = new Period();
7623          return this.billablePeriod;
7624        }
7625        else if (name.equals("targetIdentifier")) {
7626          this.target = new Identifier();
7627          return this.target;
7628        }
7629        else if (name.equals("targetReference")) {
7630          this.target = new Reference();
7631          return this.target;
7632        }
7633        else if (name.equals("providerIdentifier")) {
7634          this.provider = new Identifier();
7635          return this.provider;
7636        }
7637        else if (name.equals("providerReference")) {
7638          this.provider = new Reference();
7639          return this.provider;
7640        }
7641        else if (name.equals("organizationIdentifier")) {
7642          this.organization = new Identifier();
7643          return this.organization;
7644        }
7645        else if (name.equals("organizationReference")) {
7646          this.organization = new Reference();
7647          return this.organization;
7648        }
7649        else if (name.equals("use")) {
7650          throw new FHIRException("Cannot call addChild on a primitive type Claim.use");
7651        }
7652        else if (name.equals("priority")) {
7653          this.priority = new Coding();
7654          return this.priority;
7655        }
7656        else if (name.equals("fundsReserve")) {
7657          this.fundsReserve = new Coding();
7658          return this.fundsReserve;
7659        }
7660        else if (name.equals("entererIdentifier")) {
7661          this.enterer = new Identifier();
7662          return this.enterer;
7663        }
7664        else if (name.equals("entererReference")) {
7665          this.enterer = new Reference();
7666          return this.enterer;
7667        }
7668        else if (name.equals("facilityIdentifier")) {
7669          this.facility = new Identifier();
7670          return this.facility;
7671        }
7672        else if (name.equals("facilityReference")) {
7673          this.facility = new Reference();
7674          return this.facility;
7675        }
7676        else if (name.equals("related")) {
7677          return addRelated();
7678        }
7679        else if (name.equals("prescriptionIdentifier")) {
7680          this.prescription = new Identifier();
7681          return this.prescription;
7682        }
7683        else if (name.equals("prescriptionReference")) {
7684          this.prescription = new Reference();
7685          return this.prescription;
7686        }
7687        else if (name.equals("originalPrescriptionIdentifier")) {
7688          this.originalPrescription = new Identifier();
7689          return this.originalPrescription;
7690        }
7691        else if (name.equals("originalPrescriptionReference")) {
7692          this.originalPrescription = new Reference();
7693          return this.originalPrescription;
7694        }
7695        else if (name.equals("payee")) {
7696          this.payee = new PayeeComponent();
7697          return this.payee;
7698        }
7699        else if (name.equals("referralIdentifier")) {
7700          this.referral = new Identifier();
7701          return this.referral;
7702        }
7703        else if (name.equals("referralReference")) {
7704          this.referral = new Reference();
7705          return this.referral;
7706        }
7707        else if (name.equals("occurrenceCode")) {
7708          return addOccurrenceCode();
7709        }
7710        else if (name.equals("occurenceSpanCode")) {
7711          return addOccurenceSpanCode();
7712        }
7713        else if (name.equals("valueCode")) {
7714          return addValueCode();
7715        }
7716        else if (name.equals("diagnosis")) {
7717          return addDiagnosis();
7718        }
7719        else if (name.equals("procedure")) {
7720          return addProcedure();
7721        }
7722        else if (name.equals("specialCondition")) {
7723          return addSpecialCondition();
7724        }
7725        else if (name.equals("patientIdentifier")) {
7726          this.patient = new Identifier();
7727          return this.patient;
7728        }
7729        else if (name.equals("patientReference")) {
7730          this.patient = new Reference();
7731          return this.patient;
7732        }
7733        else if (name.equals("coverage")) {
7734          return addCoverage();
7735        }
7736        else if (name.equals("accidentDate")) {
7737          throw new FHIRException("Cannot call addChild on a primitive type Claim.accidentDate");
7738        }
7739        else if (name.equals("accidentType")) {
7740          this.accidentType = new Coding();
7741          return this.accidentType;
7742        }
7743        else if (name.equals("accidentLocationAddress")) {
7744          this.accidentLocation = new Address();
7745          return this.accidentLocation;
7746        }
7747        else if (name.equals("accidentLocationReference")) {
7748          this.accidentLocation = new Reference();
7749          return this.accidentLocation;
7750        }
7751        else if (name.equals("interventionException")) {
7752          return addInterventionException();
7753        }
7754        else if (name.equals("onset")) {
7755          return addOnset();
7756        }
7757        else if (name.equals("employmentImpacted")) {
7758          this.employmentImpacted = new Period();
7759          return this.employmentImpacted;
7760        }
7761        else if (name.equals("hospitalization")) {
7762          this.hospitalization = new Period();
7763          return this.hospitalization;
7764        }
7765        else if (name.equals("item")) {
7766          return addItem();
7767        }
7768        else if (name.equals("total")) {
7769          this.total = new Money();
7770          return this.total;
7771        }
7772        else if (name.equals("additionalMaterial")) {
7773          return addAdditionalMaterial();
7774        }
7775        else if (name.equals("missingTeeth")) {
7776          return addMissingTeeth();
7777        }
7778        else
7779          return super.addChild(name);
7780      }
7781
7782  public String fhirType() {
7783    return "Claim";
7784
7785  }
7786
7787      public Claim copy() {
7788        Claim dst = new Claim();
7789        copyValues(dst);
7790        dst.type = type == null ? null : type.copy();
7791        if (subType != null) {
7792          dst.subType = new ArrayList<Coding>();
7793          for (Coding i : subType)
7794            dst.subType.add(i.copy());
7795        };
7796        if (identifier != null) {
7797          dst.identifier = new ArrayList<Identifier>();
7798          for (Identifier i : identifier)
7799            dst.identifier.add(i.copy());
7800        };
7801        dst.ruleset = ruleset == null ? null : ruleset.copy();
7802        dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy();
7803        dst.created = created == null ? null : created.copy();
7804        dst.billablePeriod = billablePeriod == null ? null : billablePeriod.copy();
7805        dst.target = target == null ? null : target.copy();
7806        dst.provider = provider == null ? null : provider.copy();
7807        dst.organization = organization == null ? null : organization.copy();
7808        dst.use = use == null ? null : use.copy();
7809        dst.priority = priority == null ? null : priority.copy();
7810        dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy();
7811        dst.enterer = enterer == null ? null : enterer.copy();
7812        dst.facility = facility == null ? null : facility.copy();
7813        if (related != null) {
7814          dst.related = new ArrayList<RelatedClaimsComponent>();
7815          for (RelatedClaimsComponent i : related)
7816            dst.related.add(i.copy());
7817        };
7818        dst.prescription = prescription == null ? null : prescription.copy();
7819        dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy();
7820        dst.payee = payee == null ? null : payee.copy();
7821        dst.referral = referral == null ? null : referral.copy();
7822        if (occurrenceCode != null) {
7823          dst.occurrenceCode = new ArrayList<Coding>();
7824          for (Coding i : occurrenceCode)
7825            dst.occurrenceCode.add(i.copy());
7826        };
7827        if (occurenceSpanCode != null) {
7828          dst.occurenceSpanCode = new ArrayList<Coding>();
7829          for (Coding i : occurenceSpanCode)
7830            dst.occurenceSpanCode.add(i.copy());
7831        };
7832        if (valueCode != null) {
7833          dst.valueCode = new ArrayList<Coding>();
7834          for (Coding i : valueCode)
7835            dst.valueCode.add(i.copy());
7836        };
7837        if (diagnosis != null) {
7838          dst.diagnosis = new ArrayList<DiagnosisComponent>();
7839          for (DiagnosisComponent i : diagnosis)
7840            dst.diagnosis.add(i.copy());
7841        };
7842        if (procedure != null) {
7843          dst.procedure = new ArrayList<ProcedureComponent>();
7844          for (ProcedureComponent i : procedure)
7845            dst.procedure.add(i.copy());
7846        };
7847        if (specialCondition != null) {
7848          dst.specialCondition = new ArrayList<Coding>();
7849          for (Coding i : specialCondition)
7850            dst.specialCondition.add(i.copy());
7851        };
7852        dst.patient = patient == null ? null : patient.copy();
7853        if (coverage != null) {
7854          dst.coverage = new ArrayList<CoverageComponent>();
7855          for (CoverageComponent i : coverage)
7856            dst.coverage.add(i.copy());
7857        };
7858        dst.accidentDate = accidentDate == null ? null : accidentDate.copy();
7859        dst.accidentType = accidentType == null ? null : accidentType.copy();
7860        dst.accidentLocation = accidentLocation == null ? null : accidentLocation.copy();
7861        if (interventionException != null) {
7862          dst.interventionException = new ArrayList<Coding>();
7863          for (Coding i : interventionException)
7864            dst.interventionException.add(i.copy());
7865        };
7866        if (onset != null) {
7867          dst.onset = new ArrayList<OnsetComponent>();
7868          for (OnsetComponent i : onset)
7869            dst.onset.add(i.copy());
7870        };
7871        dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy();
7872        dst.hospitalization = hospitalization == null ? null : hospitalization.copy();
7873        if (item != null) {
7874          dst.item = new ArrayList<ItemsComponent>();
7875          for (ItemsComponent i : item)
7876            dst.item.add(i.copy());
7877        };
7878        dst.total = total == null ? null : total.copy();
7879        if (additionalMaterial != null) {
7880          dst.additionalMaterial = new ArrayList<Coding>();
7881          for (Coding i : additionalMaterial)
7882            dst.additionalMaterial.add(i.copy());
7883        };
7884        if (missingTeeth != null) {
7885          dst.missingTeeth = new ArrayList<MissingTeethComponent>();
7886          for (MissingTeethComponent i : missingTeeth)
7887            dst.missingTeeth.add(i.copy());
7888        };
7889        return dst;
7890      }
7891
7892      protected Claim typedCopy() {
7893        return copy();
7894      }
7895
7896      @Override
7897      public boolean equalsDeep(Base other) {
7898        if (!super.equalsDeep(other))
7899          return false;
7900        if (!(other instanceof Claim))
7901          return false;
7902        Claim o = (Claim) other;
7903        return compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(identifier, o.identifier, true)
7904           && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true)
7905           && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true)
7906           && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true)
7907           && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true)
7908           && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true)
7909           && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true)
7910           && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(occurrenceCode, o.occurrenceCode, true)
7911           && compareDeep(occurenceSpanCode, o.occurenceSpanCode, true) && compareDeep(valueCode, o.valueCode, true)
7912           && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(specialCondition, o.specialCondition, true)
7913           && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(accidentDate, o.accidentDate, true)
7914           && compareDeep(accidentType, o.accidentType, true) && compareDeep(accidentLocation, o.accidentLocation, true)
7915           && compareDeep(interventionException, o.interventionException, true) && compareDeep(onset, o.onset, true)
7916           && compareDeep(employmentImpacted, o.employmentImpacted, true) && compareDeep(hospitalization, o.hospitalization, true)
7917           && compareDeep(item, o.item, true) && compareDeep(total, o.total, true) && compareDeep(additionalMaterial, o.additionalMaterial, true)
7918           && compareDeep(missingTeeth, o.missingTeeth, true);
7919      }
7920
7921      @Override
7922      public boolean equalsShallow(Base other) {
7923        if (!super.equalsShallow(other))
7924          return false;
7925        if (!(other instanceof Claim))
7926          return false;
7927        Claim o = (Claim) other;
7928        return compareValues(type, o.type, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true)
7929           && compareValues(accidentDate, o.accidentDate, true);
7930      }
7931
7932      public boolean isEmpty() {
7933        return super.isEmpty() && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty())
7934           && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty())
7935           && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty())
7936           && (billablePeriod == null || billablePeriod.isEmpty()) && (target == null || target.isEmpty())
7937           && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty())
7938           && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty())
7939           && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (related == null || related.isEmpty())
7940           && (prescription == null || prescription.isEmpty()) && (originalPrescription == null || originalPrescription.isEmpty())
7941           && (payee == null || payee.isEmpty()) && (referral == null || referral.isEmpty()) && (occurrenceCode == null || occurrenceCode.isEmpty())
7942           && (occurenceSpanCode == null || occurenceSpanCode.isEmpty()) && (valueCode == null || valueCode.isEmpty())
7943           && (diagnosis == null || diagnosis.isEmpty()) && (procedure == null || procedure.isEmpty())
7944           && (specialCondition == null || specialCondition.isEmpty()) && (patient == null || patient.isEmpty())
7945           && (coverage == null || coverage.isEmpty()) && (accidentDate == null || accidentDate.isEmpty())
7946           && (accidentType == null || accidentType.isEmpty()) && (accidentLocation == null || accidentLocation.isEmpty())
7947           && (interventionException == null || interventionException.isEmpty()) && (onset == null || onset.isEmpty())
7948           && (employmentImpacted == null || employmentImpacted.isEmpty()) && (hospitalization == null || hospitalization.isEmpty())
7949           && (item == null || item.isEmpty()) && (total == null || total.isEmpty()) && (additionalMaterial == null || additionalMaterial.isEmpty())
7950           && (missingTeeth == null || missingTeeth.isEmpty());
7951      }
7952
7953  @Override
7954  public ResourceType getResourceType() {
7955    return ResourceType.Claim;
7956   }
7957
7958 /**
7959   * Search parameter: <b>patientidentifier</b>
7960   * <p>
7961   * Description: <b>Patient receiving the services</b><br>
7962   * Type: <b>token</b><br>
7963   * Path: <b>Claim.patientIdentifier</b><br>
7964   * </p>
7965   */
7966  @SearchParamDefinition(name="patientidentifier", path="Claim.patient.as(Identifier)", description="Patient receiving the services", type="token" )
7967  public static final String SP_PATIENTIDENTIFIER = "patientidentifier";
7968 /**
7969   * <b>Fluent Client</b> search parameter constant for <b>patientidentifier</b>
7970   * <p>
7971   * Description: <b>Patient receiving the services</b><br>
7972   * Type: <b>token</b><br>
7973   * Path: <b>Claim.patientIdentifier</b><br>
7974   * </p>
7975   */
7976  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER);
7977
7978 /**
7979   * Search parameter: <b>targetreference</b>
7980   * <p>
7981   * Description: <b>The target payor/insurer for the Claim</b><br>
7982   * Type: <b>reference</b><br>
7983   * Path: <b>Claim.targetReference</b><br>
7984   * </p>
7985   */
7986  @SearchParamDefinition(name="targetreference", path="Claim.target.as(Reference)", description="The target payor/insurer for the Claim", type="reference" )
7987  public static final String SP_TARGETREFERENCE = "targetreference";
7988 /**
7989   * <b>Fluent Client</b> search parameter constant for <b>targetreference</b>
7990   * <p>
7991   * Description: <b>The target payor/insurer for the Claim</b><br>
7992   * Type: <b>reference</b><br>
7993   * Path: <b>Claim.targetReference</b><br>
7994   * </p>
7995   */
7996  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGETREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGETREFERENCE);
7997
7998/**
7999   * Constant for fluent queries to be used to add include statements. Specifies
8000   * the path value of "<b>Claim:targetreference</b>".
8001   */
8002  public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGETREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:targetreference").toLocked();
8003
8004 /**
8005   * Search parameter: <b>facilityidentifier</b>
8006   * <p>
8007   * Description: <b>Facility responsible for the goods and services</b><br>
8008   * Type: <b>token</b><br>
8009   * Path: <b>Claim.facilityIdentifier</b><br>
8010   * </p>
8011   */
8012  @SearchParamDefinition(name="facilityidentifier", path="Claim.facility.as(Identifier)", description="Facility responsible for the goods and services", type="token" )
8013  public static final String SP_FACILITYIDENTIFIER = "facilityidentifier";
8014 /**
8015   * <b>Fluent Client</b> search parameter constant for <b>facilityidentifier</b>
8016   * <p>
8017   * Description: <b>Facility responsible for the goods and services</b><br>
8018   * Type: <b>token</b><br>
8019   * Path: <b>Claim.facilityIdentifier</b><br>
8020   * </p>
8021   */
8022  public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER);
8023
8024 /**
8025   * Search parameter: <b>facilityreference</b>
8026   * <p>
8027   * Description: <b>Facility responsible for the goods and services</b><br>
8028   * Type: <b>reference</b><br>
8029   * Path: <b>Claim.facilityReference</b><br>
8030   * </p>
8031   */
8032  @SearchParamDefinition(name="facilityreference", path="Claim.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" )
8033  public static final String SP_FACILITYREFERENCE = "facilityreference";
8034 /**
8035   * <b>Fluent Client</b> search parameter constant for <b>facilityreference</b>
8036   * <p>
8037   * Description: <b>Facility responsible for the goods and services</b><br>
8038   * Type: <b>reference</b><br>
8039   * Path: <b>Claim.facilityReference</b><br>
8040   * </p>
8041   */
8042  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE);
8043
8044/**
8045   * Constant for fluent queries to be used to add include statements. Specifies
8046   * the path value of "<b>Claim:facilityreference</b>".
8047   */
8048  public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:facilityreference").toLocked();
8049
8050 /**
8051   * Search parameter: <b>use</b>
8052   * <p>
8053   * Description: <b>The kind of financial resource</b><br>
8054   * Type: <b>token</b><br>
8055   * Path: <b>Claim.use</b><br>
8056   * </p>
8057   */
8058  @SearchParamDefinition(name="use", path="Claim.use", description="The kind of financial resource", type="token" )
8059  public static final String SP_USE = "use";
8060 /**
8061   * <b>Fluent Client</b> search parameter constant for <b>use</b>
8062   * <p>
8063   * Description: <b>The kind of financial resource</b><br>
8064   * Type: <b>token</b><br>
8065   * Path: <b>Claim.use</b><br>
8066   * </p>
8067   */
8068  public static final ca.uhn.fhir.rest.gclient.TokenClientParam USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USE);
8069
8070 /**
8071   * Search parameter: <b>providerreference</b>
8072   * <p>
8073   * Description: <b>Provider responsible for the Claim</b><br>
8074   * Type: <b>reference</b><br>
8075   * Path: <b>Claim.providerReference</b><br>
8076   * </p>
8077   */
8078  @SearchParamDefinition(name="providerreference", path="Claim.provider.as(Reference)", description="Provider responsible for the Claim", type="reference" )
8079  public static final String SP_PROVIDERREFERENCE = "providerreference";
8080 /**
8081   * <b>Fluent Client</b> search parameter constant for <b>providerreference</b>
8082   * <p>
8083   * Description: <b>Provider responsible for the Claim</b><br>
8084   * Type: <b>reference</b><br>
8085   * Path: <b>Claim.providerReference</b><br>
8086   * </p>
8087   */
8088  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE);
8089
8090/**
8091   * Constant for fluent queries to be used to add include statements. Specifies
8092   * the path value of "<b>Claim:providerreference</b>".
8093   */
8094  public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:providerreference").toLocked();
8095
8096 /**
8097   * Search parameter: <b>organizationidentifier</b>
8098   * <p>
8099   * Description: <b>The reference to the providing organization</b><br>
8100   * Type: <b>token</b><br>
8101   * Path: <b>Claim.organizationIdentifier</b><br>
8102   * </p>
8103   */
8104  @SearchParamDefinition(name="organizationidentifier", path="Claim.organization.as(Identifier)", description="The reference to the providing organization", type="token" )
8105  public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier";
8106 /**
8107   * <b>Fluent Client</b> search parameter constant for <b>organizationidentifier</b>
8108   * <p>
8109   * Description: <b>The reference to the providing organization</b><br>
8110   * Type: <b>token</b><br>
8111   * Path: <b>Claim.organizationIdentifier</b><br>
8112   * </p>
8113   */
8114  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER);
8115
8116 /**
8117   * Search parameter: <b>patientreference</b>
8118   * <p>
8119   * Description: <b>Patient receiving the services</b><br>
8120   * Type: <b>reference</b><br>
8121   * Path: <b>Claim.patientReference</b><br>
8122   * </p>
8123   */
8124  @SearchParamDefinition(name="patientreference", path="Claim.patient.as(Reference)", description="Patient receiving the services", type="reference" )
8125  public static final String SP_PATIENTREFERENCE = "patientreference";
8126 /**
8127   * <b>Fluent Client</b> search parameter constant for <b>patientreference</b>
8128   * <p>
8129   * Description: <b>Patient receiving the services</b><br>
8130   * Type: <b>reference</b><br>
8131   * Path: <b>Claim.patientReference</b><br>
8132   * </p>
8133   */
8134  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE);
8135
8136/**
8137   * Constant for fluent queries to be used to add include statements. Specifies
8138   * the path value of "<b>Claim:patientreference</b>".
8139   */
8140  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:patientreference").toLocked();
8141
8142 /**
8143   * Search parameter: <b>created</b>
8144   * <p>
8145   * Description: <b>The creation date for the Claim</b><br>
8146   * Type: <b>date</b><br>
8147   * Path: <b>Claim.created</b><br>
8148   * </p>
8149   */
8150  @SearchParamDefinition(name="created", path="Claim.created", description="The creation date for the Claim", type="date" )
8151  public static final String SP_CREATED = "created";
8152 /**
8153   * <b>Fluent Client</b> search parameter constant for <b>created</b>
8154   * <p>
8155   * Description: <b>The creation date for the Claim</b><br>
8156   * Type: <b>date</b><br>
8157   * Path: <b>Claim.created</b><br>
8158   * </p>
8159   */
8160  public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED);
8161
8162 /**
8163   * Search parameter: <b>priority</b>
8164   * <p>
8165   * Description: <b>Processing priority requested</b><br>
8166   * Type: <b>token</b><br>
8167   * Path: <b>Claim.priority</b><br>
8168   * </p>
8169   */
8170  @SearchParamDefinition(name="priority", path="Claim.priority", description="Processing priority requested", type="token" )
8171  public static final String SP_PRIORITY = "priority";
8172 /**
8173   * <b>Fluent Client</b> search parameter constant for <b>priority</b>
8174   * <p>
8175   * Description: <b>Processing priority requested</b><br>
8176   * Type: <b>token</b><br>
8177   * Path: <b>Claim.priority</b><br>
8178   * </p>
8179   */
8180  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY);
8181
8182 /**
8183   * Search parameter: <b>targetidentifier</b>
8184   * <p>
8185   * Description: <b>The target payor/insurer for the Claim</b><br>
8186   * Type: <b>token</b><br>
8187   * Path: <b>Claim.targetIdentifier</b><br>
8188   * </p>
8189   */
8190  @SearchParamDefinition(name="targetidentifier", path="Claim.target.as(Identifier)", description="The target payor/insurer for the Claim", type="token" )
8191  public static final String SP_TARGETIDENTIFIER = "targetidentifier";
8192 /**
8193   * <b>Fluent Client</b> search parameter constant for <b>targetidentifier</b>
8194   * <p>
8195   * Description: <b>The target payor/insurer for the Claim</b><br>
8196   * Type: <b>token</b><br>
8197   * Path: <b>Claim.targetIdentifier</b><br>
8198   * </p>
8199   */
8200  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGETIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGETIDENTIFIER);
8201
8202 /**
8203   * Search parameter: <b>organizationreference</b>
8204   * <p>
8205   * Description: <b>The reference to the providing organization</b><br>
8206   * Type: <b>reference</b><br>
8207   * Path: <b>Claim.organizationReference</b><br>
8208   * </p>
8209   */
8210  @SearchParamDefinition(name="organizationreference", path="Claim.organization.as(Reference)", description="The reference to the providing organization", type="reference" )
8211  public static final String SP_ORGANIZATIONREFERENCE = "organizationreference";
8212 /**
8213   * <b>Fluent Client</b> search parameter constant for <b>organizationreference</b>
8214   * <p>
8215   * Description: <b>The reference to the providing organization</b><br>
8216   * Type: <b>reference</b><br>
8217   * Path: <b>Claim.organizationReference</b><br>
8218   * </p>
8219   */
8220  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE);
8221
8222/**
8223   * Constant for fluent queries to be used to add include statements. Specifies
8224   * the path value of "<b>Claim:organizationreference</b>".
8225   */
8226  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:organizationreference").toLocked();
8227
8228 /**
8229   * Search parameter: <b>identifier</b>
8230   * <p>
8231   * Description: <b>The primary identifier of the financial resource</b><br>
8232   * Type: <b>token</b><br>
8233   * Path: <b>Claim.identifier</b><br>
8234   * </p>
8235   */
8236  @SearchParamDefinition(name="identifier", path="Claim.identifier", description="The primary identifier of the financial resource", type="token" )
8237  public static final String SP_IDENTIFIER = "identifier";
8238 /**
8239   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
8240   * <p>
8241   * Description: <b>The primary identifier of the financial resource</b><br>
8242   * Type: <b>token</b><br>
8243   * Path: <b>Claim.identifier</b><br>
8244   * </p>
8245   */
8246  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
8247
8248 /**
8249   * Search parameter: <b>provideridentifier</b>
8250   * <p>
8251   * Description: <b>Provider responsible for the Claim</b><br>
8252   * Type: <b>token</b><br>
8253   * Path: <b>Claim.providerIdentifier</b><br>
8254   * </p>
8255   */
8256  @SearchParamDefinition(name="provideridentifier", path="Claim.provider.as(Identifier)", description="Provider responsible for the Claim", type="token" )
8257  public static final String SP_PROVIDERIDENTIFIER = "provideridentifier";
8258 /**
8259   * <b>Fluent Client</b> search parameter constant for <b>provideridentifier</b>
8260   * <p>
8261   * Description: <b>Provider responsible for the Claim</b><br>
8262   * Type: <b>token</b><br>
8263   * Path: <b>Claim.providerIdentifier</b><br>
8264   * </p>
8265   */
8266  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER);
8267
8268
8269}
8270