001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.
052 */
053@ResourceDef(name="Account", profile="http://hl7.org/fhir/StructureDefinition/Account")
054public class Account extends DomainResource {
055
056    public enum AccountStatus {
057        /**
058         * This account is active and may be used.
059         */
060        ACTIVE, 
061        /**
062         * This account is inactive and should not be used to track financial information.
063         */
064        INACTIVE, 
065        /**
066         * This instance should not have been part of this patient's medical record.
067         */
068        ENTEREDINERROR, 
069        /**
070         * This account is on hold.
071         */
072        ONHOLD, 
073        /**
074         * The account status is unknown.
075         */
076        UNKNOWN, 
077        /**
078         * added to help the parsers with the generic types
079         */
080        NULL;
081        public static AccountStatus fromCode(String codeString) throws FHIRException {
082            if (codeString == null || "".equals(codeString))
083                return null;
084        if ("active".equals(codeString))
085          return ACTIVE;
086        if ("inactive".equals(codeString))
087          return INACTIVE;
088        if ("entered-in-error".equals(codeString))
089          return ENTEREDINERROR;
090        if ("on-hold".equals(codeString))
091          return ONHOLD;
092        if ("unknown".equals(codeString))
093          return UNKNOWN;
094        if (Configuration.isAcceptInvalidEnums())
095          return null;
096        else
097          throw new FHIRException("Unknown AccountStatus code '"+codeString+"'");
098        }
099        public String toCode() {
100          switch (this) {
101            case ACTIVE: return "active";
102            case INACTIVE: return "inactive";
103            case ENTEREDINERROR: return "entered-in-error";
104            case ONHOLD: return "on-hold";
105            case UNKNOWN: return "unknown";
106            case NULL: return null;
107            default: return "?";
108          }
109        }
110        public String getSystem() {
111          switch (this) {
112            case ACTIVE: return "http://hl7.org/fhir/account-status";
113            case INACTIVE: return "http://hl7.org/fhir/account-status";
114            case ENTEREDINERROR: return "http://hl7.org/fhir/account-status";
115            case ONHOLD: return "http://hl7.org/fhir/account-status";
116            case UNKNOWN: return "http://hl7.org/fhir/account-status";
117            case NULL: return null;
118            default: return "?";
119          }
120        }
121        public String getDefinition() {
122          switch (this) {
123            case ACTIVE: return "This account is active and may be used.";
124            case INACTIVE: return "This account is inactive and should not be used to track financial information.";
125            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
126            case ONHOLD: return "This account is on hold.";
127            case UNKNOWN: return "The account status is unknown.";
128            case NULL: return null;
129            default: return "?";
130          }
131        }
132        public String getDisplay() {
133          switch (this) {
134            case ACTIVE: return "Active";
135            case INACTIVE: return "Inactive";
136            case ENTEREDINERROR: return "Entered in error";
137            case ONHOLD: return "On Hold";
138            case UNKNOWN: return "Unknown";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143    }
144
145  public static class AccountStatusEnumFactory implements EnumFactory<AccountStatus> {
146    public AccountStatus fromCode(String codeString) throws IllegalArgumentException {
147      if (codeString == null || "".equals(codeString))
148            if (codeString == null || "".equals(codeString))
149                return null;
150        if ("active".equals(codeString))
151          return AccountStatus.ACTIVE;
152        if ("inactive".equals(codeString))
153          return AccountStatus.INACTIVE;
154        if ("entered-in-error".equals(codeString))
155          return AccountStatus.ENTEREDINERROR;
156        if ("on-hold".equals(codeString))
157          return AccountStatus.ONHOLD;
158        if ("unknown".equals(codeString))
159          return AccountStatus.UNKNOWN;
160        throw new IllegalArgumentException("Unknown AccountStatus code '"+codeString+"'");
161        }
162        public Enumeration<AccountStatus> fromType(PrimitiveType<?> code) throws FHIRException {
163          if (code == null)
164            return null;
165          if (code.isEmpty())
166            return new Enumeration<AccountStatus>(this, AccountStatus.NULL, code);
167          String codeString = ((PrimitiveType) code).asStringValue();
168          if (codeString == null || "".equals(codeString))
169            return new Enumeration<AccountStatus>(this, AccountStatus.NULL, code);
170        if ("active".equals(codeString))
171          return new Enumeration<AccountStatus>(this, AccountStatus.ACTIVE, code);
172        if ("inactive".equals(codeString))
173          return new Enumeration<AccountStatus>(this, AccountStatus.INACTIVE, code);
174        if ("entered-in-error".equals(codeString))
175          return new Enumeration<AccountStatus>(this, AccountStatus.ENTEREDINERROR, code);
176        if ("on-hold".equals(codeString))
177          return new Enumeration<AccountStatus>(this, AccountStatus.ONHOLD, code);
178        if ("unknown".equals(codeString))
179          return new Enumeration<AccountStatus>(this, AccountStatus.UNKNOWN, code);
180        throw new FHIRException("Unknown AccountStatus code '"+codeString+"'");
181        }
182    public String toCode(AccountStatus code) {
183      if (code == AccountStatus.ACTIVE)
184        return "active";
185      if (code == AccountStatus.INACTIVE)
186        return "inactive";
187      if (code == AccountStatus.ENTEREDINERROR)
188        return "entered-in-error";
189      if (code == AccountStatus.ONHOLD)
190        return "on-hold";
191      if (code == AccountStatus.UNKNOWN)
192        return "unknown";
193      return "?";
194      }
195    public String toSystem(AccountStatus code) {
196      return code.getSystem();
197      }
198    }
199
200    @Block()
201    public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement {
202        /**
203         * The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).
204
205A coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.
206         */
207        @Child(name = "coverage", type = {Coverage.class}, order=1, min=1, max=1, modifier=false, summary=true)
208        @Description(shortDefinition="The party(s), such as insurances, that may contribute to the payment of this account", formalDefinition="The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).\n\nA coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing." )
209        protected Reference coverage;
210
211        /**
212         * The priority of the coverage in the context of this account.
213         */
214        @Child(name = "priority", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=true)
215        @Description(shortDefinition="The priority of the coverage in the context of this account", formalDefinition="The priority of the coverage in the context of this account." )
216        protected PositiveIntType priority;
217
218        private static final long serialVersionUID = 1695665065L;
219
220    /**
221     * Constructor
222     */
223      public CoverageComponent() {
224        super();
225      }
226
227    /**
228     * Constructor
229     */
230      public CoverageComponent(Reference coverage) {
231        super();
232        this.setCoverage(coverage);
233      }
234
235        /**
236         * @return {@link #coverage} (The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).
237
238A coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.)
239         */
240        public Reference getCoverage() { 
241          if (this.coverage == null)
242            if (Configuration.errorOnAutoCreate())
243              throw new Error("Attempt to auto-create CoverageComponent.coverage");
244            else if (Configuration.doAutoCreate())
245              this.coverage = new Reference(); // cc
246          return this.coverage;
247        }
248
249        public boolean hasCoverage() { 
250          return this.coverage != null && !this.coverage.isEmpty();
251        }
252
253        /**
254         * @param value {@link #coverage} (The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).
255
256A coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.)
257         */
258        public CoverageComponent setCoverage(Reference value) { 
259          this.coverage = value;
260          return this;
261        }
262
263        /**
264         * @return {@link #priority} (The priority of the coverage in the context of this account.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
265         */
266        public PositiveIntType getPriorityElement() { 
267          if (this.priority == null)
268            if (Configuration.errorOnAutoCreate())
269              throw new Error("Attempt to auto-create CoverageComponent.priority");
270            else if (Configuration.doAutoCreate())
271              this.priority = new PositiveIntType(); // bb
272          return this.priority;
273        }
274
275        public boolean hasPriorityElement() { 
276          return this.priority != null && !this.priority.isEmpty();
277        }
278
279        public boolean hasPriority() { 
280          return this.priority != null && !this.priority.isEmpty();
281        }
282
283        /**
284         * @param value {@link #priority} (The priority of the coverage in the context of this account.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value
285         */
286        public CoverageComponent setPriorityElement(PositiveIntType value) { 
287          this.priority = value;
288          return this;
289        }
290
291        /**
292         * @return The priority of the coverage in the context of this account.
293         */
294        public int getPriority() { 
295          return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue();
296        }
297
298        /**
299         * @param value The priority of the coverage in the context of this account.
300         */
301        public CoverageComponent setPriority(int value) { 
302            if (this.priority == null)
303              this.priority = new PositiveIntType();
304            this.priority.setValue(value);
305          return this;
306        }
307
308        protected void listChildren(List<Property> children) {
309          super.listChildren(children);
310          children.add(new Property("coverage", "Reference(Coverage)", "The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).\n\nA coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.", 0, 1, coverage));
311          children.add(new Property("priority", "positiveInt", "The priority of the coverage in the context of this account.", 0, 1, priority));
312        }
313
314        @Override
315        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
316          switch (_hash) {
317          case -351767064: /*coverage*/  return new Property("coverage", "Reference(Coverage)", "The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).\n\nA coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.", 0, 1, coverage);
318          case -1165461084: /*priority*/  return new Property("priority", "positiveInt", "The priority of the coverage in the context of this account.", 0, 1, priority);
319          default: return super.getNamedProperty(_hash, _name, _checkValid);
320          }
321
322        }
323
324      @Override
325      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
326        switch (hash) {
327        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
328        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // PositiveIntType
329        default: return super.getProperty(hash, name, checkValid);
330        }
331
332      }
333
334      @Override
335      public Base setProperty(int hash, String name, Base value) throws FHIRException {
336        switch (hash) {
337        case -351767064: // coverage
338          this.coverage = TypeConvertor.castToReference(value); // Reference
339          return value;
340        case -1165461084: // priority
341          this.priority = TypeConvertor.castToPositiveInt(value); // PositiveIntType
342          return value;
343        default: return super.setProperty(hash, name, value);
344        }
345
346      }
347
348      @Override
349      public Base setProperty(String name, Base value) throws FHIRException {
350        if (name.equals("coverage")) {
351          this.coverage = TypeConvertor.castToReference(value); // Reference
352        } else if (name.equals("priority")) {
353          this.priority = TypeConvertor.castToPositiveInt(value); // PositiveIntType
354        } else
355          return super.setProperty(name, value);
356        return value;
357      }
358
359      @Override
360      public Base makeProperty(int hash, String name) throws FHIRException {
361        switch (hash) {
362        case -351767064:  return getCoverage();
363        case -1165461084:  return getPriorityElement();
364        default: return super.makeProperty(hash, name);
365        }
366
367      }
368
369      @Override
370      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
371        switch (hash) {
372        case -351767064: /*coverage*/ return new String[] {"Reference"};
373        case -1165461084: /*priority*/ return new String[] {"positiveInt"};
374        default: return super.getTypesForProperty(hash, name);
375        }
376
377      }
378
379      @Override
380      public Base addChild(String name) throws FHIRException {
381        if (name.equals("coverage")) {
382          this.coverage = new Reference();
383          return this.coverage;
384        }
385        else if (name.equals("priority")) {
386          throw new FHIRException("Cannot call addChild on a singleton property Account.coverage.priority");
387        }
388        else
389          return super.addChild(name);
390      }
391
392      public CoverageComponent copy() {
393        CoverageComponent dst = new CoverageComponent();
394        copyValues(dst);
395        return dst;
396      }
397
398      public void copyValues(CoverageComponent dst) {
399        super.copyValues(dst);
400        dst.coverage = coverage == null ? null : coverage.copy();
401        dst.priority = priority == null ? null : priority.copy();
402      }
403
404      @Override
405      public boolean equalsDeep(Base other_) {
406        if (!super.equalsDeep(other_))
407          return false;
408        if (!(other_ instanceof CoverageComponent))
409          return false;
410        CoverageComponent o = (CoverageComponent) other_;
411        return compareDeep(coverage, o.coverage, true) && compareDeep(priority, o.priority, true);
412      }
413
414      @Override
415      public boolean equalsShallow(Base other_) {
416        if (!super.equalsShallow(other_))
417          return false;
418        if (!(other_ instanceof CoverageComponent))
419          return false;
420        CoverageComponent o = (CoverageComponent) other_;
421        return compareValues(priority, o.priority, true);
422      }
423
424      public boolean isEmpty() {
425        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(coverage, priority);
426      }
427
428  public String fhirType() {
429    return "Account.coverage";
430
431  }
432
433  }
434
435    @Block()
436    public static class GuarantorComponent extends BackboneElement implements IBaseBackboneElement {
437        /**
438         * The entity who is responsible.
439         */
440        @Child(name = "party", type = {Patient.class, RelatedPerson.class, Organization.class}, order=1, min=1, max=1, modifier=false, summary=false)
441        @Description(shortDefinition="Responsible entity", formalDefinition="The entity who is responsible." )
442        protected Reference party;
443
444        /**
445         * A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.
446         */
447        @Child(name = "onHold", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
448        @Description(shortDefinition="Credit or other hold applied", formalDefinition="A guarantor may be placed on credit hold or otherwise have their role temporarily suspended." )
449        protected BooleanType onHold;
450
451        /**
452         * The timeframe during which the guarantor accepts responsibility for the account.
453         */
454        @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
455        @Description(shortDefinition="Guarantee account during", formalDefinition="The timeframe during which the guarantor accepts responsibility for the account." )
456        protected Period period;
457
458        private static final long serialVersionUID = -523056773L;
459
460    /**
461     * Constructor
462     */
463      public GuarantorComponent() {
464        super();
465      }
466
467    /**
468     * Constructor
469     */
470      public GuarantorComponent(Reference party) {
471        super();
472        this.setParty(party);
473      }
474
475        /**
476         * @return {@link #party} (The entity who is responsible.)
477         */
478        public Reference getParty() { 
479          if (this.party == null)
480            if (Configuration.errorOnAutoCreate())
481              throw new Error("Attempt to auto-create GuarantorComponent.party");
482            else if (Configuration.doAutoCreate())
483              this.party = new Reference(); // cc
484          return this.party;
485        }
486
487        public boolean hasParty() { 
488          return this.party != null && !this.party.isEmpty();
489        }
490
491        /**
492         * @param value {@link #party} (The entity who is responsible.)
493         */
494        public GuarantorComponent setParty(Reference value) { 
495          this.party = value;
496          return this;
497        }
498
499        /**
500         * @return {@link #onHold} (A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.). This is the underlying object with id, value and extensions. The accessor "getOnHold" gives direct access to the value
501         */
502        public BooleanType getOnHoldElement() { 
503          if (this.onHold == null)
504            if (Configuration.errorOnAutoCreate())
505              throw new Error("Attempt to auto-create GuarantorComponent.onHold");
506            else if (Configuration.doAutoCreate())
507              this.onHold = new BooleanType(); // bb
508          return this.onHold;
509        }
510
511        public boolean hasOnHoldElement() { 
512          return this.onHold != null && !this.onHold.isEmpty();
513        }
514
515        public boolean hasOnHold() { 
516          return this.onHold != null && !this.onHold.isEmpty();
517        }
518
519        /**
520         * @param value {@link #onHold} (A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.). This is the underlying object with id, value and extensions. The accessor "getOnHold" gives direct access to the value
521         */
522        public GuarantorComponent setOnHoldElement(BooleanType value) { 
523          this.onHold = value;
524          return this;
525        }
526
527        /**
528         * @return A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.
529         */
530        public boolean getOnHold() { 
531          return this.onHold == null || this.onHold.isEmpty() ? false : this.onHold.getValue();
532        }
533
534        /**
535         * @param value A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.
536         */
537        public GuarantorComponent setOnHold(boolean value) { 
538            if (this.onHold == null)
539              this.onHold = new BooleanType();
540            this.onHold.setValue(value);
541          return this;
542        }
543
544        /**
545         * @return {@link #period} (The timeframe during which the guarantor accepts responsibility for the account.)
546         */
547        public Period getPeriod() { 
548          if (this.period == null)
549            if (Configuration.errorOnAutoCreate())
550              throw new Error("Attempt to auto-create GuarantorComponent.period");
551            else if (Configuration.doAutoCreate())
552              this.period = new Period(); // cc
553          return this.period;
554        }
555
556        public boolean hasPeriod() { 
557          return this.period != null && !this.period.isEmpty();
558        }
559
560        /**
561         * @param value {@link #period} (The timeframe during which the guarantor accepts responsibility for the account.)
562         */
563        public GuarantorComponent setPeriod(Period value) { 
564          this.period = value;
565          return this;
566        }
567
568        protected void listChildren(List<Property> children) {
569          super.listChildren(children);
570          children.add(new Property("party", "Reference(Patient|RelatedPerson|Organization)", "The entity who is responsible.", 0, 1, party));
571          children.add(new Property("onHold", "boolean", "A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.", 0, 1, onHold));
572          children.add(new Property("period", "Period", "The timeframe during which the guarantor accepts responsibility for the account.", 0, 1, period));
573        }
574
575        @Override
576        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
577          switch (_hash) {
578          case 106437350: /*party*/  return new Property("party", "Reference(Patient|RelatedPerson|Organization)", "The entity who is responsible.", 0, 1, party);
579          case -1013289154: /*onHold*/  return new Property("onHold", "boolean", "A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.", 0, 1, onHold);
580          case -991726143: /*period*/  return new Property("period", "Period", "The timeframe during which the guarantor accepts responsibility for the account.", 0, 1, period);
581          default: return super.getNamedProperty(_hash, _name, _checkValid);
582          }
583
584        }
585
586      @Override
587      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
588        switch (hash) {
589        case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference
590        case -1013289154: /*onHold*/ return this.onHold == null ? new Base[0] : new Base[] {this.onHold}; // BooleanType
591        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
592        default: return super.getProperty(hash, name, checkValid);
593        }
594
595      }
596
597      @Override
598      public Base setProperty(int hash, String name, Base value) throws FHIRException {
599        switch (hash) {
600        case 106437350: // party
601          this.party = TypeConvertor.castToReference(value); // Reference
602          return value;
603        case -1013289154: // onHold
604          this.onHold = TypeConvertor.castToBoolean(value); // BooleanType
605          return value;
606        case -991726143: // period
607          this.period = TypeConvertor.castToPeriod(value); // Period
608          return value;
609        default: return super.setProperty(hash, name, value);
610        }
611
612      }
613
614      @Override
615      public Base setProperty(String name, Base value) throws FHIRException {
616        if (name.equals("party")) {
617          this.party = TypeConvertor.castToReference(value); // Reference
618        } else if (name.equals("onHold")) {
619          this.onHold = TypeConvertor.castToBoolean(value); // BooleanType
620        } else if (name.equals("period")) {
621          this.period = TypeConvertor.castToPeriod(value); // Period
622        } else
623          return super.setProperty(name, value);
624        return value;
625      }
626
627      @Override
628      public Base makeProperty(int hash, String name) throws FHIRException {
629        switch (hash) {
630        case 106437350:  return getParty();
631        case -1013289154:  return getOnHoldElement();
632        case -991726143:  return getPeriod();
633        default: return super.makeProperty(hash, name);
634        }
635
636      }
637
638      @Override
639      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
640        switch (hash) {
641        case 106437350: /*party*/ return new String[] {"Reference"};
642        case -1013289154: /*onHold*/ return new String[] {"boolean"};
643        case -991726143: /*period*/ return new String[] {"Period"};
644        default: return super.getTypesForProperty(hash, name);
645        }
646
647      }
648
649      @Override
650      public Base addChild(String name) throws FHIRException {
651        if (name.equals("party")) {
652          this.party = new Reference();
653          return this.party;
654        }
655        else if (name.equals("onHold")) {
656          throw new FHIRException("Cannot call addChild on a singleton property Account.guarantor.onHold");
657        }
658        else if (name.equals("period")) {
659          this.period = new Period();
660          return this.period;
661        }
662        else
663          return super.addChild(name);
664      }
665
666      public GuarantorComponent copy() {
667        GuarantorComponent dst = new GuarantorComponent();
668        copyValues(dst);
669        return dst;
670      }
671
672      public void copyValues(GuarantorComponent dst) {
673        super.copyValues(dst);
674        dst.party = party == null ? null : party.copy();
675        dst.onHold = onHold == null ? null : onHold.copy();
676        dst.period = period == null ? null : period.copy();
677      }
678
679      @Override
680      public boolean equalsDeep(Base other_) {
681        if (!super.equalsDeep(other_))
682          return false;
683        if (!(other_ instanceof GuarantorComponent))
684          return false;
685        GuarantorComponent o = (GuarantorComponent) other_;
686        return compareDeep(party, o.party, true) && compareDeep(onHold, o.onHold, true) && compareDeep(period, o.period, true)
687          ;
688      }
689
690      @Override
691      public boolean equalsShallow(Base other_) {
692        if (!super.equalsShallow(other_))
693          return false;
694        if (!(other_ instanceof GuarantorComponent))
695          return false;
696        GuarantorComponent o = (GuarantorComponent) other_;
697        return compareValues(onHold, o.onHold, true);
698      }
699
700      public boolean isEmpty() {
701        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(party, onHold, period);
702      }
703
704  public String fhirType() {
705    return "Account.guarantor";
706
707  }
708
709  }
710
711    @Block()
712    public static class AccountDiagnosisComponent extends BackboneElement implements IBaseBackboneElement {
713        /**
714         * Ranking of the diagnosis (for each type).
715         */
716        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
717        @Description(shortDefinition="Ranking of the diagnosis (for each type)", formalDefinition="Ranking of the diagnosis (for each type)." )
718        protected PositiveIntType sequence;
719
720        /**
721         * The diagnosis relevant to the account.
722         */
723        @Child(name = "condition", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
724        @Description(shortDefinition="The diagnosis relevant to the account", formalDefinition="The diagnosis relevant to the account." )
725        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
726        protected CodeableReference condition;
727
728        /**
729         * Ranking of the diagnosis (for each type).
730         */
731        @Child(name = "dateOfDiagnosis", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
732        @Description(shortDefinition="Date of the diagnosis (when coded diagnosis)", formalDefinition="Ranking of the diagnosis (for each type)." )
733        protected DateTimeType dateOfDiagnosis;
734
735        /**
736         * Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?).
737         */
738        @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
739        @Description(shortDefinition="Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?)", formalDefinition="Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?)." )
740        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-diagnosis-use")
741        protected List<CodeableConcept> type;
742
743        /**
744         * Was the Diagnosis present on Admission in the related Encounter.
745         */
746        @Child(name = "onAdmission", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false)
747        @Description(shortDefinition="Diagnosis present on Admission", formalDefinition="Was the Diagnosis present on Admission in the related Encounter." )
748        protected BooleanType onAdmission;
749
750        /**
751         * The package code can be used to group diagnoses that may be priced or delivered as a single product. Such as DRGs.
752         */
753        @Child(name = "packageCode", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
754        @Description(shortDefinition="Package Code specific for billing", formalDefinition="The package code can be used to group diagnoses that may be priced or delivered as a single product. Such as DRGs." )
755        protected List<CodeableConcept> packageCode;
756
757        private static final long serialVersionUID = 57125500L;
758
759    /**
760     * Constructor
761     */
762      public AccountDiagnosisComponent() {
763        super();
764      }
765
766    /**
767     * Constructor
768     */
769      public AccountDiagnosisComponent(CodeableReference condition) {
770        super();
771        this.setCondition(condition);
772      }
773
774        /**
775         * @return {@link #sequence} (Ranking of the diagnosis (for each type).). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
776         */
777        public PositiveIntType getSequenceElement() { 
778          if (this.sequence == null)
779            if (Configuration.errorOnAutoCreate())
780              throw new Error("Attempt to auto-create AccountDiagnosisComponent.sequence");
781            else if (Configuration.doAutoCreate())
782              this.sequence = new PositiveIntType(); // bb
783          return this.sequence;
784        }
785
786        public boolean hasSequenceElement() { 
787          return this.sequence != null && !this.sequence.isEmpty();
788        }
789
790        public boolean hasSequence() { 
791          return this.sequence != null && !this.sequence.isEmpty();
792        }
793
794        /**
795         * @param value {@link #sequence} (Ranking of the diagnosis (for each type).). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
796         */
797        public AccountDiagnosisComponent setSequenceElement(PositiveIntType value) { 
798          this.sequence = value;
799          return this;
800        }
801
802        /**
803         * @return Ranking of the diagnosis (for each type).
804         */
805        public int getSequence() { 
806          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
807        }
808
809        /**
810         * @param value Ranking of the diagnosis (for each type).
811         */
812        public AccountDiagnosisComponent setSequence(int value) { 
813            if (this.sequence == null)
814              this.sequence = new PositiveIntType();
815            this.sequence.setValue(value);
816          return this;
817        }
818
819        /**
820         * @return {@link #condition} (The diagnosis relevant to the account.)
821         */
822        public CodeableReference getCondition() { 
823          if (this.condition == null)
824            if (Configuration.errorOnAutoCreate())
825              throw new Error("Attempt to auto-create AccountDiagnosisComponent.condition");
826            else if (Configuration.doAutoCreate())
827              this.condition = new CodeableReference(); // cc
828          return this.condition;
829        }
830
831        public boolean hasCondition() { 
832          return this.condition != null && !this.condition.isEmpty();
833        }
834
835        /**
836         * @param value {@link #condition} (The diagnosis relevant to the account.)
837         */
838        public AccountDiagnosisComponent setCondition(CodeableReference value) { 
839          this.condition = value;
840          return this;
841        }
842
843        /**
844         * @return {@link #dateOfDiagnosis} (Ranking of the diagnosis (for each type).). This is the underlying object with id, value and extensions. The accessor "getDateOfDiagnosis" gives direct access to the value
845         */
846        public DateTimeType getDateOfDiagnosisElement() { 
847          if (this.dateOfDiagnosis == null)
848            if (Configuration.errorOnAutoCreate())
849              throw new Error("Attempt to auto-create AccountDiagnosisComponent.dateOfDiagnosis");
850            else if (Configuration.doAutoCreate())
851              this.dateOfDiagnosis = new DateTimeType(); // bb
852          return this.dateOfDiagnosis;
853        }
854
855        public boolean hasDateOfDiagnosisElement() { 
856          return this.dateOfDiagnosis != null && !this.dateOfDiagnosis.isEmpty();
857        }
858
859        public boolean hasDateOfDiagnosis() { 
860          return this.dateOfDiagnosis != null && !this.dateOfDiagnosis.isEmpty();
861        }
862
863        /**
864         * @param value {@link #dateOfDiagnosis} (Ranking of the diagnosis (for each type).). This is the underlying object with id, value and extensions. The accessor "getDateOfDiagnosis" gives direct access to the value
865         */
866        public AccountDiagnosisComponent setDateOfDiagnosisElement(DateTimeType value) { 
867          this.dateOfDiagnosis = value;
868          return this;
869        }
870
871        /**
872         * @return Ranking of the diagnosis (for each type).
873         */
874        public Date getDateOfDiagnosis() { 
875          return this.dateOfDiagnosis == null ? null : this.dateOfDiagnosis.getValue();
876        }
877
878        /**
879         * @param value Ranking of the diagnosis (for each type).
880         */
881        public AccountDiagnosisComponent setDateOfDiagnosis(Date value) { 
882          if (value == null)
883            this.dateOfDiagnosis = null;
884          else {
885            if (this.dateOfDiagnosis == null)
886              this.dateOfDiagnosis = new DateTimeType();
887            this.dateOfDiagnosis.setValue(value);
888          }
889          return this;
890        }
891
892        /**
893         * @return {@link #type} (Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?).)
894         */
895        public List<CodeableConcept> getType() { 
896          if (this.type == null)
897            this.type = new ArrayList<CodeableConcept>();
898          return this.type;
899        }
900
901        /**
902         * @return Returns a reference to <code>this</code> for easy method chaining
903         */
904        public AccountDiagnosisComponent setType(List<CodeableConcept> theType) { 
905          this.type = theType;
906          return this;
907        }
908
909        public boolean hasType() { 
910          if (this.type == null)
911            return false;
912          for (CodeableConcept item : this.type)
913            if (!item.isEmpty())
914              return true;
915          return false;
916        }
917
918        public CodeableConcept addType() { //3
919          CodeableConcept t = new CodeableConcept();
920          if (this.type == null)
921            this.type = new ArrayList<CodeableConcept>();
922          this.type.add(t);
923          return t;
924        }
925
926        public AccountDiagnosisComponent addType(CodeableConcept t) { //3
927          if (t == null)
928            return this;
929          if (this.type == null)
930            this.type = new ArrayList<CodeableConcept>();
931          this.type.add(t);
932          return this;
933        }
934
935        /**
936         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
937         */
938        public CodeableConcept getTypeFirstRep() { 
939          if (getType().isEmpty()) {
940            addType();
941          }
942          return getType().get(0);
943        }
944
945        /**
946         * @return {@link #onAdmission} (Was the Diagnosis present on Admission in the related Encounter.). This is the underlying object with id, value and extensions. The accessor "getOnAdmission" gives direct access to the value
947         */
948        public BooleanType getOnAdmissionElement() { 
949          if (this.onAdmission == null)
950            if (Configuration.errorOnAutoCreate())
951              throw new Error("Attempt to auto-create AccountDiagnosisComponent.onAdmission");
952            else if (Configuration.doAutoCreate())
953              this.onAdmission = new BooleanType(); // bb
954          return this.onAdmission;
955        }
956
957        public boolean hasOnAdmissionElement() { 
958          return this.onAdmission != null && !this.onAdmission.isEmpty();
959        }
960
961        public boolean hasOnAdmission() { 
962          return this.onAdmission != null && !this.onAdmission.isEmpty();
963        }
964
965        /**
966         * @param value {@link #onAdmission} (Was the Diagnosis present on Admission in the related Encounter.). This is the underlying object with id, value and extensions. The accessor "getOnAdmission" gives direct access to the value
967         */
968        public AccountDiagnosisComponent setOnAdmissionElement(BooleanType value) { 
969          this.onAdmission = value;
970          return this;
971        }
972
973        /**
974         * @return Was the Diagnosis present on Admission in the related Encounter.
975         */
976        public boolean getOnAdmission() { 
977          return this.onAdmission == null || this.onAdmission.isEmpty() ? false : this.onAdmission.getValue();
978        }
979
980        /**
981         * @param value Was the Diagnosis present on Admission in the related Encounter.
982         */
983        public AccountDiagnosisComponent setOnAdmission(boolean value) { 
984            if (this.onAdmission == null)
985              this.onAdmission = new BooleanType();
986            this.onAdmission.setValue(value);
987          return this;
988        }
989
990        /**
991         * @return {@link #packageCode} (The package code can be used to group diagnoses that may be priced or delivered as a single product. Such as DRGs.)
992         */
993        public List<CodeableConcept> getPackageCode() { 
994          if (this.packageCode == null)
995            this.packageCode = new ArrayList<CodeableConcept>();
996          return this.packageCode;
997        }
998
999        /**
1000         * @return Returns a reference to <code>this</code> for easy method chaining
1001         */
1002        public AccountDiagnosisComponent setPackageCode(List<CodeableConcept> thePackageCode) { 
1003          this.packageCode = thePackageCode;
1004          return this;
1005        }
1006
1007        public boolean hasPackageCode() { 
1008          if (this.packageCode == null)
1009            return false;
1010          for (CodeableConcept item : this.packageCode)
1011            if (!item.isEmpty())
1012              return true;
1013          return false;
1014        }
1015
1016        public CodeableConcept addPackageCode() { //3
1017          CodeableConcept t = new CodeableConcept();
1018          if (this.packageCode == null)
1019            this.packageCode = new ArrayList<CodeableConcept>();
1020          this.packageCode.add(t);
1021          return t;
1022        }
1023
1024        public AccountDiagnosisComponent addPackageCode(CodeableConcept t) { //3
1025          if (t == null)
1026            return this;
1027          if (this.packageCode == null)
1028            this.packageCode = new ArrayList<CodeableConcept>();
1029          this.packageCode.add(t);
1030          return this;
1031        }
1032
1033        /**
1034         * @return The first repetition of repeating field {@link #packageCode}, creating it if it does not already exist {3}
1035         */
1036        public CodeableConcept getPackageCodeFirstRep() { 
1037          if (getPackageCode().isEmpty()) {
1038            addPackageCode();
1039          }
1040          return getPackageCode().get(0);
1041        }
1042
1043        protected void listChildren(List<Property> children) {
1044          super.listChildren(children);
1045          children.add(new Property("sequence", "positiveInt", "Ranking of the diagnosis (for each type).", 0, 1, sequence));
1046          children.add(new Property("condition", "CodeableReference(Condition)", "The diagnosis relevant to the account.", 0, 1, condition));
1047          children.add(new Property("dateOfDiagnosis", "dateTime", "Ranking of the diagnosis (for each type).", 0, 1, dateOfDiagnosis));
1048          children.add(new Property("type", "CodeableConcept", "Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?).", 0, java.lang.Integer.MAX_VALUE, type));
1049          children.add(new Property("onAdmission", "boolean", "Was the Diagnosis present on Admission in the related Encounter.", 0, 1, onAdmission));
1050          children.add(new Property("packageCode", "CodeableConcept", "The package code can be used to group diagnoses that may be priced or delivered as a single product. Such as DRGs.", 0, java.lang.Integer.MAX_VALUE, packageCode));
1051        }
1052
1053        @Override
1054        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1055          switch (_hash) {
1056          case 1349547969: /*sequence*/  return new Property("sequence", "positiveInt", "Ranking of the diagnosis (for each type).", 0, 1, sequence);
1057          case -861311717: /*condition*/  return new Property("condition", "CodeableReference(Condition)", "The diagnosis relevant to the account.", 0, 1, condition);
1058          case -774562228: /*dateOfDiagnosis*/  return new Property("dateOfDiagnosis", "dateTime", "Ranking of the diagnosis (for each type).", 0, 1, dateOfDiagnosis);
1059          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge ?).", 0, java.lang.Integer.MAX_VALUE, type);
1060          case -3386134: /*onAdmission*/  return new Property("onAdmission", "boolean", "Was the Diagnosis present on Admission in the related Encounter.", 0, 1, onAdmission);
1061          case 908444499: /*packageCode*/  return new Property("packageCode", "CodeableConcept", "The package code can be used to group diagnoses that may be priced or delivered as a single product. Such as DRGs.", 0, java.lang.Integer.MAX_VALUE, packageCode);
1062          default: return super.getNamedProperty(_hash, _name, _checkValid);
1063          }
1064
1065        }
1066
1067      @Override
1068      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1069        switch (hash) {
1070        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
1071        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // CodeableReference
1072        case -774562228: /*dateOfDiagnosis*/ return this.dateOfDiagnosis == null ? new Base[0] : new Base[] {this.dateOfDiagnosis}; // DateTimeType
1073        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1074        case -3386134: /*onAdmission*/ return this.onAdmission == null ? new Base[0] : new Base[] {this.onAdmission}; // BooleanType
1075        case 908444499: /*packageCode*/ return this.packageCode == null ? new Base[0] : this.packageCode.toArray(new Base[this.packageCode.size()]); // CodeableConcept
1076        default: return super.getProperty(hash, name, checkValid);
1077        }
1078
1079      }
1080
1081      @Override
1082      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1083        switch (hash) {
1084        case 1349547969: // sequence
1085          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1086          return value;
1087        case -861311717: // condition
1088          this.condition = TypeConvertor.castToCodeableReference(value); // CodeableReference
1089          return value;
1090        case -774562228: // dateOfDiagnosis
1091          this.dateOfDiagnosis = TypeConvertor.castToDateTime(value); // DateTimeType
1092          return value;
1093        case 3575610: // type
1094          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1095          return value;
1096        case -3386134: // onAdmission
1097          this.onAdmission = TypeConvertor.castToBoolean(value); // BooleanType
1098          return value;
1099        case 908444499: // packageCode
1100          this.getPackageCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1101          return value;
1102        default: return super.setProperty(hash, name, value);
1103        }
1104
1105      }
1106
1107      @Override
1108      public Base setProperty(String name, Base value) throws FHIRException {
1109        if (name.equals("sequence")) {
1110          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1111        } else if (name.equals("condition")) {
1112          this.condition = TypeConvertor.castToCodeableReference(value); // CodeableReference
1113        } else if (name.equals("dateOfDiagnosis")) {
1114          this.dateOfDiagnosis = TypeConvertor.castToDateTime(value); // DateTimeType
1115        } else if (name.equals("type")) {
1116          this.getType().add(TypeConvertor.castToCodeableConcept(value));
1117        } else if (name.equals("onAdmission")) {
1118          this.onAdmission = TypeConvertor.castToBoolean(value); // BooleanType
1119        } else if (name.equals("packageCode")) {
1120          this.getPackageCode().add(TypeConvertor.castToCodeableConcept(value));
1121        } else
1122          return super.setProperty(name, value);
1123        return value;
1124      }
1125
1126      @Override
1127      public Base makeProperty(int hash, String name) throws FHIRException {
1128        switch (hash) {
1129        case 1349547969:  return getSequenceElement();
1130        case -861311717:  return getCondition();
1131        case -774562228:  return getDateOfDiagnosisElement();
1132        case 3575610:  return addType(); 
1133        case -3386134:  return getOnAdmissionElement();
1134        case 908444499:  return addPackageCode(); 
1135        default: return super.makeProperty(hash, name);
1136        }
1137
1138      }
1139
1140      @Override
1141      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1142        switch (hash) {
1143        case 1349547969: /*sequence*/ return new String[] {"positiveInt"};
1144        case -861311717: /*condition*/ return new String[] {"CodeableReference"};
1145        case -774562228: /*dateOfDiagnosis*/ return new String[] {"dateTime"};
1146        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1147        case -3386134: /*onAdmission*/ return new String[] {"boolean"};
1148        case 908444499: /*packageCode*/ return new String[] {"CodeableConcept"};
1149        default: return super.getTypesForProperty(hash, name);
1150        }
1151
1152      }
1153
1154      @Override
1155      public Base addChild(String name) throws FHIRException {
1156        if (name.equals("sequence")) {
1157          throw new FHIRException("Cannot call addChild on a singleton property Account.diagnosis.sequence");
1158        }
1159        else if (name.equals("condition")) {
1160          this.condition = new CodeableReference();
1161          return this.condition;
1162        }
1163        else if (name.equals("dateOfDiagnosis")) {
1164          throw new FHIRException("Cannot call addChild on a singleton property Account.diagnosis.dateOfDiagnosis");
1165        }
1166        else if (name.equals("type")) {
1167          return addType();
1168        }
1169        else if (name.equals("onAdmission")) {
1170          throw new FHIRException("Cannot call addChild on a singleton property Account.diagnosis.onAdmission");
1171        }
1172        else if (name.equals("packageCode")) {
1173          return addPackageCode();
1174        }
1175        else
1176          return super.addChild(name);
1177      }
1178
1179      public AccountDiagnosisComponent copy() {
1180        AccountDiagnosisComponent dst = new AccountDiagnosisComponent();
1181        copyValues(dst);
1182        return dst;
1183      }
1184
1185      public void copyValues(AccountDiagnosisComponent dst) {
1186        super.copyValues(dst);
1187        dst.sequence = sequence == null ? null : sequence.copy();
1188        dst.condition = condition == null ? null : condition.copy();
1189        dst.dateOfDiagnosis = dateOfDiagnosis == null ? null : dateOfDiagnosis.copy();
1190        if (type != null) {
1191          dst.type = new ArrayList<CodeableConcept>();
1192          for (CodeableConcept i : type)
1193            dst.type.add(i.copy());
1194        };
1195        dst.onAdmission = onAdmission == null ? null : onAdmission.copy();
1196        if (packageCode != null) {
1197          dst.packageCode = new ArrayList<CodeableConcept>();
1198          for (CodeableConcept i : packageCode)
1199            dst.packageCode.add(i.copy());
1200        };
1201      }
1202
1203      @Override
1204      public boolean equalsDeep(Base other_) {
1205        if (!super.equalsDeep(other_))
1206          return false;
1207        if (!(other_ instanceof AccountDiagnosisComponent))
1208          return false;
1209        AccountDiagnosisComponent o = (AccountDiagnosisComponent) other_;
1210        return compareDeep(sequence, o.sequence, true) && compareDeep(condition, o.condition, true) && compareDeep(dateOfDiagnosis, o.dateOfDiagnosis, true)
1211           && compareDeep(type, o.type, true) && compareDeep(onAdmission, o.onAdmission, true) && compareDeep(packageCode, o.packageCode, true)
1212          ;
1213      }
1214
1215      @Override
1216      public boolean equalsShallow(Base other_) {
1217        if (!super.equalsShallow(other_))
1218          return false;
1219        if (!(other_ instanceof AccountDiagnosisComponent))
1220          return false;
1221        AccountDiagnosisComponent o = (AccountDiagnosisComponent) other_;
1222        return compareValues(sequence, o.sequence, true) && compareValues(dateOfDiagnosis, o.dateOfDiagnosis, true)
1223           && compareValues(onAdmission, o.onAdmission, true);
1224      }
1225
1226      public boolean isEmpty() {
1227        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, condition, dateOfDiagnosis
1228          , type, onAdmission, packageCode);
1229      }
1230
1231  public String fhirType() {
1232    return "Account.diagnosis";
1233
1234  }
1235
1236  }
1237
1238    @Block()
1239    public static class AccountProcedureComponent extends BackboneElement implements IBaseBackboneElement {
1240        /**
1241         * Ranking of the procedure (for each type).
1242         */
1243        @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1244        @Description(shortDefinition="Ranking of the procedure (for each type)", formalDefinition="Ranking of the procedure (for each type)." )
1245        protected PositiveIntType sequence;
1246
1247        /**
1248         * The procedure relevant to the account.
1249         */
1250        @Child(name = "code", type = {CodeableReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
1251        @Description(shortDefinition="The procedure relevant to the account", formalDefinition="The procedure relevant to the account." )
1252        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/procedure-code")
1253        protected CodeableReference code;
1254
1255        /**
1256         * Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.
1257         */
1258        @Child(name = "dateOfService", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1259        @Description(shortDefinition="Date of the procedure (when coded procedure)", formalDefinition="Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used." )
1260        protected DateTimeType dateOfService;
1261
1262        /**
1263         * How this procedure value should be used in charging the account.
1264         */
1265        @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1266        @Description(shortDefinition="How this procedure value should be used in charging the account", formalDefinition="How this procedure value should be used in charging the account." )
1267        protected List<CodeableConcept> type;
1268
1269        /**
1270         * The package code can be used to group procedures that may be priced or delivered as a single product. Such as DRGs.
1271         */
1272        @Child(name = "packageCode", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1273        @Description(shortDefinition="Package Code specific for billing", formalDefinition="The package code can be used to group procedures that may be priced or delivered as a single product. Such as DRGs." )
1274        protected List<CodeableConcept> packageCode;
1275
1276        /**
1277         * Any devices that were associated with the procedure relevant to the account.
1278         */
1279        @Child(name = "device", type = {Device.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1280        @Description(shortDefinition="Any devices that were associated with the procedure", formalDefinition="Any devices that were associated with the procedure relevant to the account." )
1281        protected List<Reference> device;
1282
1283        private static final long serialVersionUID = -797201673L;
1284
1285    /**
1286     * Constructor
1287     */
1288      public AccountProcedureComponent() {
1289        super();
1290      }
1291
1292    /**
1293     * Constructor
1294     */
1295      public AccountProcedureComponent(CodeableReference code) {
1296        super();
1297        this.setCode(code);
1298      }
1299
1300        /**
1301         * @return {@link #sequence} (Ranking of the procedure (for each type).). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1302         */
1303        public PositiveIntType getSequenceElement() { 
1304          if (this.sequence == null)
1305            if (Configuration.errorOnAutoCreate())
1306              throw new Error("Attempt to auto-create AccountProcedureComponent.sequence");
1307            else if (Configuration.doAutoCreate())
1308              this.sequence = new PositiveIntType(); // bb
1309          return this.sequence;
1310        }
1311
1312        public boolean hasSequenceElement() { 
1313          return this.sequence != null && !this.sequence.isEmpty();
1314        }
1315
1316        public boolean hasSequence() { 
1317          return this.sequence != null && !this.sequence.isEmpty();
1318        }
1319
1320        /**
1321         * @param value {@link #sequence} (Ranking of the procedure (for each type).). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value
1322         */
1323        public AccountProcedureComponent setSequenceElement(PositiveIntType value) { 
1324          this.sequence = value;
1325          return this;
1326        }
1327
1328        /**
1329         * @return Ranking of the procedure (for each type).
1330         */
1331        public int getSequence() { 
1332          return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue();
1333        }
1334
1335        /**
1336         * @param value Ranking of the procedure (for each type).
1337         */
1338        public AccountProcedureComponent setSequence(int value) { 
1339            if (this.sequence == null)
1340              this.sequence = new PositiveIntType();
1341            this.sequence.setValue(value);
1342          return this;
1343        }
1344
1345        /**
1346         * @return {@link #code} (The procedure relevant to the account.)
1347         */
1348        public CodeableReference getCode() { 
1349          if (this.code == null)
1350            if (Configuration.errorOnAutoCreate())
1351              throw new Error("Attempt to auto-create AccountProcedureComponent.code");
1352            else if (Configuration.doAutoCreate())
1353              this.code = new CodeableReference(); // cc
1354          return this.code;
1355        }
1356
1357        public boolean hasCode() { 
1358          return this.code != null && !this.code.isEmpty();
1359        }
1360
1361        /**
1362         * @param value {@link #code} (The procedure relevant to the account.)
1363         */
1364        public AccountProcedureComponent setCode(CodeableReference value) { 
1365          this.code = value;
1366          return this;
1367        }
1368
1369        /**
1370         * @return {@link #dateOfService} (Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.). This is the underlying object with id, value and extensions. The accessor "getDateOfService" gives direct access to the value
1371         */
1372        public DateTimeType getDateOfServiceElement() { 
1373          if (this.dateOfService == null)
1374            if (Configuration.errorOnAutoCreate())
1375              throw new Error("Attempt to auto-create AccountProcedureComponent.dateOfService");
1376            else if (Configuration.doAutoCreate())
1377              this.dateOfService = new DateTimeType(); // bb
1378          return this.dateOfService;
1379        }
1380
1381        public boolean hasDateOfServiceElement() { 
1382          return this.dateOfService != null && !this.dateOfService.isEmpty();
1383        }
1384
1385        public boolean hasDateOfService() { 
1386          return this.dateOfService != null && !this.dateOfService.isEmpty();
1387        }
1388
1389        /**
1390         * @param value {@link #dateOfService} (Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.). This is the underlying object with id, value and extensions. The accessor "getDateOfService" gives direct access to the value
1391         */
1392        public AccountProcedureComponent setDateOfServiceElement(DateTimeType value) { 
1393          this.dateOfService = value;
1394          return this;
1395        }
1396
1397        /**
1398         * @return Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.
1399         */
1400        public Date getDateOfService() { 
1401          return this.dateOfService == null ? null : this.dateOfService.getValue();
1402        }
1403
1404        /**
1405         * @param value Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.
1406         */
1407        public AccountProcedureComponent setDateOfService(Date value) { 
1408          if (value == null)
1409            this.dateOfService = null;
1410          else {
1411            if (this.dateOfService == null)
1412              this.dateOfService = new DateTimeType();
1413            this.dateOfService.setValue(value);
1414          }
1415          return this;
1416        }
1417
1418        /**
1419         * @return {@link #type} (How this procedure value should be used in charging the account.)
1420         */
1421        public List<CodeableConcept> getType() { 
1422          if (this.type == null)
1423            this.type = new ArrayList<CodeableConcept>();
1424          return this.type;
1425        }
1426
1427        /**
1428         * @return Returns a reference to <code>this</code> for easy method chaining
1429         */
1430        public AccountProcedureComponent setType(List<CodeableConcept> theType) { 
1431          this.type = theType;
1432          return this;
1433        }
1434
1435        public boolean hasType() { 
1436          if (this.type == null)
1437            return false;
1438          for (CodeableConcept item : this.type)
1439            if (!item.isEmpty())
1440              return true;
1441          return false;
1442        }
1443
1444        public CodeableConcept addType() { //3
1445          CodeableConcept t = new CodeableConcept();
1446          if (this.type == null)
1447            this.type = new ArrayList<CodeableConcept>();
1448          this.type.add(t);
1449          return t;
1450        }
1451
1452        public AccountProcedureComponent addType(CodeableConcept t) { //3
1453          if (t == null)
1454            return this;
1455          if (this.type == null)
1456            this.type = new ArrayList<CodeableConcept>();
1457          this.type.add(t);
1458          return this;
1459        }
1460
1461        /**
1462         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
1463         */
1464        public CodeableConcept getTypeFirstRep() { 
1465          if (getType().isEmpty()) {
1466            addType();
1467          }
1468          return getType().get(0);
1469        }
1470
1471        /**
1472         * @return {@link #packageCode} (The package code can be used to group procedures that may be priced or delivered as a single product. Such as DRGs.)
1473         */
1474        public List<CodeableConcept> getPackageCode() { 
1475          if (this.packageCode == null)
1476            this.packageCode = new ArrayList<CodeableConcept>();
1477          return this.packageCode;
1478        }
1479
1480        /**
1481         * @return Returns a reference to <code>this</code> for easy method chaining
1482         */
1483        public AccountProcedureComponent setPackageCode(List<CodeableConcept> thePackageCode) { 
1484          this.packageCode = thePackageCode;
1485          return this;
1486        }
1487
1488        public boolean hasPackageCode() { 
1489          if (this.packageCode == null)
1490            return false;
1491          for (CodeableConcept item : this.packageCode)
1492            if (!item.isEmpty())
1493              return true;
1494          return false;
1495        }
1496
1497        public CodeableConcept addPackageCode() { //3
1498          CodeableConcept t = new CodeableConcept();
1499          if (this.packageCode == null)
1500            this.packageCode = new ArrayList<CodeableConcept>();
1501          this.packageCode.add(t);
1502          return t;
1503        }
1504
1505        public AccountProcedureComponent addPackageCode(CodeableConcept t) { //3
1506          if (t == null)
1507            return this;
1508          if (this.packageCode == null)
1509            this.packageCode = new ArrayList<CodeableConcept>();
1510          this.packageCode.add(t);
1511          return this;
1512        }
1513
1514        /**
1515         * @return The first repetition of repeating field {@link #packageCode}, creating it if it does not already exist {3}
1516         */
1517        public CodeableConcept getPackageCodeFirstRep() { 
1518          if (getPackageCode().isEmpty()) {
1519            addPackageCode();
1520          }
1521          return getPackageCode().get(0);
1522        }
1523
1524        /**
1525         * @return {@link #device} (Any devices that were associated with the procedure relevant to the account.)
1526         */
1527        public List<Reference> getDevice() { 
1528          if (this.device == null)
1529            this.device = new ArrayList<Reference>();
1530          return this.device;
1531        }
1532
1533        /**
1534         * @return Returns a reference to <code>this</code> for easy method chaining
1535         */
1536        public AccountProcedureComponent setDevice(List<Reference> theDevice) { 
1537          this.device = theDevice;
1538          return this;
1539        }
1540
1541        public boolean hasDevice() { 
1542          if (this.device == null)
1543            return false;
1544          for (Reference item : this.device)
1545            if (!item.isEmpty())
1546              return true;
1547          return false;
1548        }
1549
1550        public Reference addDevice() { //3
1551          Reference t = new Reference();
1552          if (this.device == null)
1553            this.device = new ArrayList<Reference>();
1554          this.device.add(t);
1555          return t;
1556        }
1557
1558        public AccountProcedureComponent addDevice(Reference t) { //3
1559          if (t == null)
1560            return this;
1561          if (this.device == null)
1562            this.device = new ArrayList<Reference>();
1563          this.device.add(t);
1564          return this;
1565        }
1566
1567        /**
1568         * @return The first repetition of repeating field {@link #device}, creating it if it does not already exist {3}
1569         */
1570        public Reference getDeviceFirstRep() { 
1571          if (getDevice().isEmpty()) {
1572            addDevice();
1573          }
1574          return getDevice().get(0);
1575        }
1576
1577        protected void listChildren(List<Property> children) {
1578          super.listChildren(children);
1579          children.add(new Property("sequence", "positiveInt", "Ranking of the procedure (for each type).", 0, 1, sequence));
1580          children.add(new Property("code", "CodeableReference(Procedure)", "The procedure relevant to the account.", 0, 1, code));
1581          children.add(new Property("dateOfService", "dateTime", "Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.", 0, 1, dateOfService));
1582          children.add(new Property("type", "CodeableConcept", "How this procedure value should be used in charging the account.", 0, java.lang.Integer.MAX_VALUE, type));
1583          children.add(new Property("packageCode", "CodeableConcept", "The package code can be used to group procedures that may be priced or delivered as a single product. Such as DRGs.", 0, java.lang.Integer.MAX_VALUE, packageCode));
1584          children.add(new Property("device", "Reference(Device)", "Any devices that were associated with the procedure relevant to the account.", 0, java.lang.Integer.MAX_VALUE, device));
1585        }
1586
1587        @Override
1588        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1589          switch (_hash) {
1590          case 1349547969: /*sequence*/  return new Property("sequence", "positiveInt", "Ranking of the procedure (for each type).", 0, 1, sequence);
1591          case 3059181: /*code*/  return new Property("code", "CodeableReference(Procedure)", "The procedure relevant to the account.", 0, 1, code);
1592          case -328510256: /*dateOfService*/  return new Property("dateOfService", "dateTime", "Date of the procedure when using a coded procedure. If using a reference to a procedure, then the date on the procedure should be used.", 0, 1, dateOfService);
1593          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "How this procedure value should be used in charging the account.", 0, java.lang.Integer.MAX_VALUE, type);
1594          case 908444499: /*packageCode*/  return new Property("packageCode", "CodeableConcept", "The package code can be used to group procedures that may be priced or delivered as a single product. Such as DRGs.", 0, java.lang.Integer.MAX_VALUE, packageCode);
1595          case -1335157162: /*device*/  return new Property("device", "Reference(Device)", "Any devices that were associated with the procedure relevant to the account.", 0, java.lang.Integer.MAX_VALUE, device);
1596          default: return super.getNamedProperty(_hash, _name, _checkValid);
1597          }
1598
1599        }
1600
1601      @Override
1602      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1603        switch (hash) {
1604        case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
1605        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableReference
1606        case -328510256: /*dateOfService*/ return this.dateOfService == null ? new Base[0] : new Base[] {this.dateOfService}; // DateTimeType
1607        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1608        case 908444499: /*packageCode*/ return this.packageCode == null ? new Base[0] : this.packageCode.toArray(new Base[this.packageCode.size()]); // CodeableConcept
1609        case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference
1610        default: return super.getProperty(hash, name, checkValid);
1611        }
1612
1613      }
1614
1615      @Override
1616      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1617        switch (hash) {
1618        case 1349547969: // sequence
1619          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1620          return value;
1621        case 3059181: // code
1622          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
1623          return value;
1624        case -328510256: // dateOfService
1625          this.dateOfService = TypeConvertor.castToDateTime(value); // DateTimeType
1626          return value;
1627        case 3575610: // type
1628          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1629          return value;
1630        case 908444499: // packageCode
1631          this.getPackageCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1632          return value;
1633        case -1335157162: // device
1634          this.getDevice().add(TypeConvertor.castToReference(value)); // Reference
1635          return value;
1636        default: return super.setProperty(hash, name, value);
1637        }
1638
1639      }
1640
1641      @Override
1642      public Base setProperty(String name, Base value) throws FHIRException {
1643        if (name.equals("sequence")) {
1644          this.sequence = TypeConvertor.castToPositiveInt(value); // PositiveIntType
1645        } else if (name.equals("code")) {
1646          this.code = TypeConvertor.castToCodeableReference(value); // CodeableReference
1647        } else if (name.equals("dateOfService")) {
1648          this.dateOfService = TypeConvertor.castToDateTime(value); // DateTimeType
1649        } else if (name.equals("type")) {
1650          this.getType().add(TypeConvertor.castToCodeableConcept(value));
1651        } else if (name.equals("packageCode")) {
1652          this.getPackageCode().add(TypeConvertor.castToCodeableConcept(value));
1653        } else if (name.equals("device")) {
1654          this.getDevice().add(TypeConvertor.castToReference(value));
1655        } else
1656          return super.setProperty(name, value);
1657        return value;
1658      }
1659
1660      @Override
1661      public Base makeProperty(int hash, String name) throws FHIRException {
1662        switch (hash) {
1663        case 1349547969:  return getSequenceElement();
1664        case 3059181:  return getCode();
1665        case -328510256:  return getDateOfServiceElement();
1666        case 3575610:  return addType(); 
1667        case 908444499:  return addPackageCode(); 
1668        case -1335157162:  return addDevice(); 
1669        default: return super.makeProperty(hash, name);
1670        }
1671
1672      }
1673
1674      @Override
1675      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1676        switch (hash) {
1677        case 1349547969: /*sequence*/ return new String[] {"positiveInt"};
1678        case 3059181: /*code*/ return new String[] {"CodeableReference"};
1679        case -328510256: /*dateOfService*/ return new String[] {"dateTime"};
1680        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1681        case 908444499: /*packageCode*/ return new String[] {"CodeableConcept"};
1682        case -1335157162: /*device*/ return new String[] {"Reference"};
1683        default: return super.getTypesForProperty(hash, name);
1684        }
1685
1686      }
1687
1688      @Override
1689      public Base addChild(String name) throws FHIRException {
1690        if (name.equals("sequence")) {
1691          throw new FHIRException("Cannot call addChild on a singleton property Account.procedure.sequence");
1692        }
1693        else if (name.equals("code")) {
1694          this.code = new CodeableReference();
1695          return this.code;
1696        }
1697        else if (name.equals("dateOfService")) {
1698          throw new FHIRException("Cannot call addChild on a singleton property Account.procedure.dateOfService");
1699        }
1700        else if (name.equals("type")) {
1701          return addType();
1702        }
1703        else if (name.equals("packageCode")) {
1704          return addPackageCode();
1705        }
1706        else if (name.equals("device")) {
1707          return addDevice();
1708        }
1709        else
1710          return super.addChild(name);
1711      }
1712
1713      public AccountProcedureComponent copy() {
1714        AccountProcedureComponent dst = new AccountProcedureComponent();
1715        copyValues(dst);
1716        return dst;
1717      }
1718
1719      public void copyValues(AccountProcedureComponent dst) {
1720        super.copyValues(dst);
1721        dst.sequence = sequence == null ? null : sequence.copy();
1722        dst.code = code == null ? null : code.copy();
1723        dst.dateOfService = dateOfService == null ? null : dateOfService.copy();
1724        if (type != null) {
1725          dst.type = new ArrayList<CodeableConcept>();
1726          for (CodeableConcept i : type)
1727            dst.type.add(i.copy());
1728        };
1729        if (packageCode != null) {
1730          dst.packageCode = new ArrayList<CodeableConcept>();
1731          for (CodeableConcept i : packageCode)
1732            dst.packageCode.add(i.copy());
1733        };
1734        if (device != null) {
1735          dst.device = new ArrayList<Reference>();
1736          for (Reference i : device)
1737            dst.device.add(i.copy());
1738        };
1739      }
1740
1741      @Override
1742      public boolean equalsDeep(Base other_) {
1743        if (!super.equalsDeep(other_))
1744          return false;
1745        if (!(other_ instanceof AccountProcedureComponent))
1746          return false;
1747        AccountProcedureComponent o = (AccountProcedureComponent) other_;
1748        return compareDeep(sequence, o.sequence, true) && compareDeep(code, o.code, true) && compareDeep(dateOfService, o.dateOfService, true)
1749           && compareDeep(type, o.type, true) && compareDeep(packageCode, o.packageCode, true) && compareDeep(device, o.device, true)
1750          ;
1751      }
1752
1753      @Override
1754      public boolean equalsShallow(Base other_) {
1755        if (!super.equalsShallow(other_))
1756          return false;
1757        if (!(other_ instanceof AccountProcedureComponent))
1758          return false;
1759        AccountProcedureComponent o = (AccountProcedureComponent) other_;
1760        return compareValues(sequence, o.sequence, true) && compareValues(dateOfService, o.dateOfService, true)
1761          ;
1762      }
1763
1764      public boolean isEmpty() {
1765        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, code, dateOfService
1766          , type, packageCode, device);
1767      }
1768
1769  public String fhirType() {
1770    return "Account.procedure";
1771
1772  }
1773
1774  }
1775
1776    @Block()
1777    public static class AccountRelatedAccountComponent extends BackboneElement implements IBaseBackboneElement {
1778        /**
1779         * Relationship of the associated Account.
1780         */
1781        @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1782        @Description(shortDefinition="Relationship of the associated Account", formalDefinition="Relationship of the associated Account." )
1783        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-relationship")
1784        protected CodeableConcept relationship;
1785
1786        /**
1787         * Reference to an associated Account.
1788         */
1789        @Child(name = "account", type = {Account.class}, order=2, min=1, max=1, modifier=false, summary=false)
1790        @Description(shortDefinition="Reference to an associated Account", formalDefinition="Reference to an associated Account." )
1791        protected Reference account;
1792
1793        private static final long serialVersionUID = 1586291361L;
1794
1795    /**
1796     * Constructor
1797     */
1798      public AccountRelatedAccountComponent() {
1799        super();
1800      }
1801
1802    /**
1803     * Constructor
1804     */
1805      public AccountRelatedAccountComponent(Reference account) {
1806        super();
1807        this.setAccount(account);
1808      }
1809
1810        /**
1811         * @return {@link #relationship} (Relationship of the associated Account.)
1812         */
1813        public CodeableConcept getRelationship() { 
1814          if (this.relationship == null)
1815            if (Configuration.errorOnAutoCreate())
1816              throw new Error("Attempt to auto-create AccountRelatedAccountComponent.relationship");
1817            else if (Configuration.doAutoCreate())
1818              this.relationship = new CodeableConcept(); // cc
1819          return this.relationship;
1820        }
1821
1822        public boolean hasRelationship() { 
1823          return this.relationship != null && !this.relationship.isEmpty();
1824        }
1825
1826        /**
1827         * @param value {@link #relationship} (Relationship of the associated Account.)
1828         */
1829        public AccountRelatedAccountComponent setRelationship(CodeableConcept value) { 
1830          this.relationship = value;
1831          return this;
1832        }
1833
1834        /**
1835         * @return {@link #account} (Reference to an associated Account.)
1836         */
1837        public Reference getAccount() { 
1838          if (this.account == null)
1839            if (Configuration.errorOnAutoCreate())
1840              throw new Error("Attempt to auto-create AccountRelatedAccountComponent.account");
1841            else if (Configuration.doAutoCreate())
1842              this.account = new Reference(); // cc
1843          return this.account;
1844        }
1845
1846        public boolean hasAccount() { 
1847          return this.account != null && !this.account.isEmpty();
1848        }
1849
1850        /**
1851         * @param value {@link #account} (Reference to an associated Account.)
1852         */
1853        public AccountRelatedAccountComponent setAccount(Reference value) { 
1854          this.account = value;
1855          return this;
1856        }
1857
1858        protected void listChildren(List<Property> children) {
1859          super.listChildren(children);
1860          children.add(new Property("relationship", "CodeableConcept", "Relationship of the associated Account.", 0, 1, relationship));
1861          children.add(new Property("account", "Reference(Account)", "Reference to an associated Account.", 0, 1, account));
1862        }
1863
1864        @Override
1865        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1866          switch (_hash) {
1867          case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "Relationship of the associated Account.", 0, 1, relationship);
1868          case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "Reference to an associated Account.", 0, 1, account);
1869          default: return super.getNamedProperty(_hash, _name, _checkValid);
1870          }
1871
1872        }
1873
1874      @Override
1875      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1876        switch (hash) {
1877        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
1878        case -1177318867: /*account*/ return this.account == null ? new Base[0] : new Base[] {this.account}; // Reference
1879        default: return super.getProperty(hash, name, checkValid);
1880        }
1881
1882      }
1883
1884      @Override
1885      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1886        switch (hash) {
1887        case -261851592: // relationship
1888          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1889          return value;
1890        case -1177318867: // account
1891          this.account = TypeConvertor.castToReference(value); // Reference
1892          return value;
1893        default: return super.setProperty(hash, name, value);
1894        }
1895
1896      }
1897
1898      @Override
1899      public Base setProperty(String name, Base value) throws FHIRException {
1900        if (name.equals("relationship")) {
1901          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1902        } else if (name.equals("account")) {
1903          this.account = TypeConvertor.castToReference(value); // Reference
1904        } else
1905          return super.setProperty(name, value);
1906        return value;
1907      }
1908
1909      @Override
1910      public Base makeProperty(int hash, String name) throws FHIRException {
1911        switch (hash) {
1912        case -261851592:  return getRelationship();
1913        case -1177318867:  return getAccount();
1914        default: return super.makeProperty(hash, name);
1915        }
1916
1917      }
1918
1919      @Override
1920      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1921        switch (hash) {
1922        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
1923        case -1177318867: /*account*/ return new String[] {"Reference"};
1924        default: return super.getTypesForProperty(hash, name);
1925        }
1926
1927      }
1928
1929      @Override
1930      public Base addChild(String name) throws FHIRException {
1931        if (name.equals("relationship")) {
1932          this.relationship = new CodeableConcept();
1933          return this.relationship;
1934        }
1935        else if (name.equals("account")) {
1936          this.account = new Reference();
1937          return this.account;
1938        }
1939        else
1940          return super.addChild(name);
1941      }
1942
1943      public AccountRelatedAccountComponent copy() {
1944        AccountRelatedAccountComponent dst = new AccountRelatedAccountComponent();
1945        copyValues(dst);
1946        return dst;
1947      }
1948
1949      public void copyValues(AccountRelatedAccountComponent dst) {
1950        super.copyValues(dst);
1951        dst.relationship = relationship == null ? null : relationship.copy();
1952        dst.account = account == null ? null : account.copy();
1953      }
1954
1955      @Override
1956      public boolean equalsDeep(Base other_) {
1957        if (!super.equalsDeep(other_))
1958          return false;
1959        if (!(other_ instanceof AccountRelatedAccountComponent))
1960          return false;
1961        AccountRelatedAccountComponent o = (AccountRelatedAccountComponent) other_;
1962        return compareDeep(relationship, o.relationship, true) && compareDeep(account, o.account, true)
1963          ;
1964      }
1965
1966      @Override
1967      public boolean equalsShallow(Base other_) {
1968        if (!super.equalsShallow(other_))
1969          return false;
1970        if (!(other_ instanceof AccountRelatedAccountComponent))
1971          return false;
1972        AccountRelatedAccountComponent o = (AccountRelatedAccountComponent) other_;
1973        return true;
1974      }
1975
1976      public boolean isEmpty() {
1977        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationship, account);
1978      }
1979
1980  public String fhirType() {
1981    return "Account.relatedAccount";
1982
1983  }
1984
1985  }
1986
1987    @Block()
1988    public static class AccountBalanceComponent extends BackboneElement implements IBaseBackboneElement {
1989        /**
1990         * Who is expected to pay this part of the balance.
1991         */
1992        @Child(name = "aggregate", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
1993        @Description(shortDefinition="Who is expected to pay this part of the balance", formalDefinition="Who is expected to pay this part of the balance." )
1994        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-aggregate")
1995        protected CodeableConcept aggregate;
1996
1997        /**
1998         * The term of the account balances - The balance value is the amount that was outstanding for this age.
1999         */
2000        @Child(name = "term", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
2001        @Description(shortDefinition="current | 30 | 60 | 90 | 120", formalDefinition="The term of the account balances - The balance value is the amount that was outstanding for this age." )
2002        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-balance-term")
2003        protected CodeableConcept term;
2004
2005        /**
2006         * The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).
2007         */
2008        @Child(name = "estimate", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2009        @Description(shortDefinition="Estimated balance", formalDefinition="The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process)." )
2010        protected BooleanType estimate;
2011
2012        /**
2013         * The actual balance value calculated for the age defined in the term property.
2014         */
2015        @Child(name = "amount", type = {Money.class}, order=4, min=1, max=1, modifier=false, summary=false)
2016        @Description(shortDefinition="Calculated amount", formalDefinition="The actual balance value calculated for the age defined in the term property." )
2017        protected Money amount;
2018
2019        private static final long serialVersionUID = -338990145L;
2020
2021    /**
2022     * Constructor
2023     */
2024      public AccountBalanceComponent() {
2025        super();
2026      }
2027
2028    /**
2029     * Constructor
2030     */
2031      public AccountBalanceComponent(Money amount) {
2032        super();
2033        this.setAmount(amount);
2034      }
2035
2036        /**
2037         * @return {@link #aggregate} (Who is expected to pay this part of the balance.)
2038         */
2039        public CodeableConcept getAggregate() { 
2040          if (this.aggregate == null)
2041            if (Configuration.errorOnAutoCreate())
2042              throw new Error("Attempt to auto-create AccountBalanceComponent.aggregate");
2043            else if (Configuration.doAutoCreate())
2044              this.aggregate = new CodeableConcept(); // cc
2045          return this.aggregate;
2046        }
2047
2048        public boolean hasAggregate() { 
2049          return this.aggregate != null && !this.aggregate.isEmpty();
2050        }
2051
2052        /**
2053         * @param value {@link #aggregate} (Who is expected to pay this part of the balance.)
2054         */
2055        public AccountBalanceComponent setAggregate(CodeableConcept value) { 
2056          this.aggregate = value;
2057          return this;
2058        }
2059
2060        /**
2061         * @return {@link #term} (The term of the account balances - The balance value is the amount that was outstanding for this age.)
2062         */
2063        public CodeableConcept getTerm() { 
2064          if (this.term == null)
2065            if (Configuration.errorOnAutoCreate())
2066              throw new Error("Attempt to auto-create AccountBalanceComponent.term");
2067            else if (Configuration.doAutoCreate())
2068              this.term = new CodeableConcept(); // cc
2069          return this.term;
2070        }
2071
2072        public boolean hasTerm() { 
2073          return this.term != null && !this.term.isEmpty();
2074        }
2075
2076        /**
2077         * @param value {@link #term} (The term of the account balances - The balance value is the amount that was outstanding for this age.)
2078         */
2079        public AccountBalanceComponent setTerm(CodeableConcept value) { 
2080          this.term = value;
2081          return this;
2082        }
2083
2084        /**
2085         * @return {@link #estimate} (The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).). This is the underlying object with id, value and extensions. The accessor "getEstimate" gives direct access to the value
2086         */
2087        public BooleanType getEstimateElement() { 
2088          if (this.estimate == null)
2089            if (Configuration.errorOnAutoCreate())
2090              throw new Error("Attempt to auto-create AccountBalanceComponent.estimate");
2091            else if (Configuration.doAutoCreate())
2092              this.estimate = new BooleanType(); // bb
2093          return this.estimate;
2094        }
2095
2096        public boolean hasEstimateElement() { 
2097          return this.estimate != null && !this.estimate.isEmpty();
2098        }
2099
2100        public boolean hasEstimate() { 
2101          return this.estimate != null && !this.estimate.isEmpty();
2102        }
2103
2104        /**
2105         * @param value {@link #estimate} (The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).). This is the underlying object with id, value and extensions. The accessor "getEstimate" gives direct access to the value
2106         */
2107        public AccountBalanceComponent setEstimateElement(BooleanType value) { 
2108          this.estimate = value;
2109          return this;
2110        }
2111
2112        /**
2113         * @return The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).
2114         */
2115        public boolean getEstimate() { 
2116          return this.estimate == null || this.estimate.isEmpty() ? false : this.estimate.getValue();
2117        }
2118
2119        /**
2120         * @param value The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).
2121         */
2122        public AccountBalanceComponent setEstimate(boolean value) { 
2123            if (this.estimate == null)
2124              this.estimate = new BooleanType();
2125            this.estimate.setValue(value);
2126          return this;
2127        }
2128
2129        /**
2130         * @return {@link #amount} (The actual balance value calculated for the age defined in the term property.)
2131         */
2132        public Money getAmount() { 
2133          if (this.amount == null)
2134            if (Configuration.errorOnAutoCreate())
2135              throw new Error("Attempt to auto-create AccountBalanceComponent.amount");
2136            else if (Configuration.doAutoCreate())
2137              this.amount = new Money(); // cc
2138          return this.amount;
2139        }
2140
2141        public boolean hasAmount() { 
2142          return this.amount != null && !this.amount.isEmpty();
2143        }
2144
2145        /**
2146         * @param value {@link #amount} (The actual balance value calculated for the age defined in the term property.)
2147         */
2148        public AccountBalanceComponent setAmount(Money value) { 
2149          this.amount = value;
2150          return this;
2151        }
2152
2153        protected void listChildren(List<Property> children) {
2154          super.listChildren(children);
2155          children.add(new Property("aggregate", "CodeableConcept", "Who is expected to pay this part of the balance.", 0, 1, aggregate));
2156          children.add(new Property("term", "CodeableConcept", "The term of the account balances - The balance value is the amount that was outstanding for this age.", 0, 1, term));
2157          children.add(new Property("estimate", "boolean", "The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).", 0, 1, estimate));
2158          children.add(new Property("amount", "Money", "The actual balance value calculated for the age defined in the term property.", 0, 1, amount));
2159        }
2160
2161        @Override
2162        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2163          switch (_hash) {
2164          case 175177151: /*aggregate*/  return new Property("aggregate", "CodeableConcept", "Who is expected to pay this part of the balance.", 0, 1, aggregate);
2165          case 3556460: /*term*/  return new Property("term", "CodeableConcept", "The term of the account balances - The balance value is the amount that was outstanding for this age.", 0, 1, term);
2166          case -1959779032: /*estimate*/  return new Property("estimate", "boolean", "The amount is only an estimated value - this is likely common for `current` term balances, but not with known terms (that were generated by a backend process).", 0, 1, estimate);
2167          case -1413853096: /*amount*/  return new Property("amount", "Money", "The actual balance value calculated for the age defined in the term property.", 0, 1, amount);
2168          default: return super.getNamedProperty(_hash, _name, _checkValid);
2169          }
2170
2171        }
2172
2173      @Override
2174      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2175        switch (hash) {
2176        case 175177151: /*aggregate*/ return this.aggregate == null ? new Base[0] : new Base[] {this.aggregate}; // CodeableConcept
2177        case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept
2178        case -1959779032: /*estimate*/ return this.estimate == null ? new Base[0] : new Base[] {this.estimate}; // BooleanType
2179        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
2180        default: return super.getProperty(hash, name, checkValid);
2181        }
2182
2183      }
2184
2185      @Override
2186      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2187        switch (hash) {
2188        case 175177151: // aggregate
2189          this.aggregate = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2190          return value;
2191        case 3556460: // term
2192          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2193          return value;
2194        case -1959779032: // estimate
2195          this.estimate = TypeConvertor.castToBoolean(value); // BooleanType
2196          return value;
2197        case -1413853096: // amount
2198          this.amount = TypeConvertor.castToMoney(value); // Money
2199          return value;
2200        default: return super.setProperty(hash, name, value);
2201        }
2202
2203      }
2204
2205      @Override
2206      public Base setProperty(String name, Base value) throws FHIRException {
2207        if (name.equals("aggregate")) {
2208          this.aggregate = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2209        } else if (name.equals("term")) {
2210          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2211        } else if (name.equals("estimate")) {
2212          this.estimate = TypeConvertor.castToBoolean(value); // BooleanType
2213        } else if (name.equals("amount")) {
2214          this.amount = TypeConvertor.castToMoney(value); // Money
2215        } else
2216          return super.setProperty(name, value);
2217        return value;
2218      }
2219
2220      @Override
2221      public Base makeProperty(int hash, String name) throws FHIRException {
2222        switch (hash) {
2223        case 175177151:  return getAggregate();
2224        case 3556460:  return getTerm();
2225        case -1959779032:  return getEstimateElement();
2226        case -1413853096:  return getAmount();
2227        default: return super.makeProperty(hash, name);
2228        }
2229
2230      }
2231
2232      @Override
2233      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2234        switch (hash) {
2235        case 175177151: /*aggregate*/ return new String[] {"CodeableConcept"};
2236        case 3556460: /*term*/ return new String[] {"CodeableConcept"};
2237        case -1959779032: /*estimate*/ return new String[] {"boolean"};
2238        case -1413853096: /*amount*/ return new String[] {"Money"};
2239        default: return super.getTypesForProperty(hash, name);
2240        }
2241
2242      }
2243
2244      @Override
2245      public Base addChild(String name) throws FHIRException {
2246        if (name.equals("aggregate")) {
2247          this.aggregate = new CodeableConcept();
2248          return this.aggregate;
2249        }
2250        else if (name.equals("term")) {
2251          this.term = new CodeableConcept();
2252          return this.term;
2253        }
2254        else if (name.equals("estimate")) {
2255          throw new FHIRException("Cannot call addChild on a singleton property Account.balance.estimate");
2256        }
2257        else if (name.equals("amount")) {
2258          this.amount = new Money();
2259          return this.amount;
2260        }
2261        else
2262          return super.addChild(name);
2263      }
2264
2265      public AccountBalanceComponent copy() {
2266        AccountBalanceComponent dst = new AccountBalanceComponent();
2267        copyValues(dst);
2268        return dst;
2269      }
2270
2271      public void copyValues(AccountBalanceComponent dst) {
2272        super.copyValues(dst);
2273        dst.aggregate = aggregate == null ? null : aggregate.copy();
2274        dst.term = term == null ? null : term.copy();
2275        dst.estimate = estimate == null ? null : estimate.copy();
2276        dst.amount = amount == null ? null : amount.copy();
2277      }
2278
2279      @Override
2280      public boolean equalsDeep(Base other_) {
2281        if (!super.equalsDeep(other_))
2282          return false;
2283        if (!(other_ instanceof AccountBalanceComponent))
2284          return false;
2285        AccountBalanceComponent o = (AccountBalanceComponent) other_;
2286        return compareDeep(aggregate, o.aggregate, true) && compareDeep(term, o.term, true) && compareDeep(estimate, o.estimate, true)
2287           && compareDeep(amount, o.amount, true);
2288      }
2289
2290      @Override
2291      public boolean equalsShallow(Base other_) {
2292        if (!super.equalsShallow(other_))
2293          return false;
2294        if (!(other_ instanceof AccountBalanceComponent))
2295          return false;
2296        AccountBalanceComponent o = (AccountBalanceComponent) other_;
2297        return compareValues(estimate, o.estimate, true);
2298      }
2299
2300      public boolean isEmpty() {
2301        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(aggregate, term, estimate
2302          , amount);
2303      }
2304
2305  public String fhirType() {
2306    return "Account.balance";
2307
2308  }
2309
2310  }
2311
2312    /**
2313     * Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).
2314     */
2315    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2316    @Description(shortDefinition="Account number", formalDefinition="Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number)." )
2317    protected List<Identifier> identifier;
2318
2319    /**
2320     * Indicates whether the account is presently used/usable or not.
2321     */
2322    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2323    @Description(shortDefinition="active | inactive | entered-in-error | on-hold | unknown", formalDefinition="Indicates whether the account is presently used/usable or not." )
2324    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-status")
2325    protected Enumeration<AccountStatus> status;
2326
2327    /**
2328     * The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account.
2329     */
2330    @Child(name = "billingStatus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
2331    @Description(shortDefinition="Tracks the lifecycle of the account through the billing process", formalDefinition="The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account." )
2332    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-billing-status")
2333    protected CodeableConcept billingStatus;
2334
2335    /**
2336     * Categorizes the account for reporting and searching purposes.
2337     */
2338    @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
2339    @Description(shortDefinition="E.g. patient, expense, depreciation", formalDefinition="Categorizes the account for reporting and searching purposes." )
2340    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-type")
2341    protected CodeableConcept type;
2342
2343    /**
2344     * Name used for the account when displaying it to humans in reports, etc.
2345     */
2346    @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
2347    @Description(shortDefinition="Human-readable label", formalDefinition="Name used for the account when displaying it to humans in reports, etc." )
2348    protected StringType name;
2349
2350    /**
2351     * Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.
2352     */
2353    @Child(name = "subject", type = {Patient.class, Device.class, Practitioner.class, PractitionerRole.class, Location.class, HealthcareService.class, Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2354    @Description(shortDefinition="The entity that caused the expenses", formalDefinition="Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account." )
2355    protected List<Reference> subject;
2356
2357    /**
2358     * The date range of services associated with this account.
2359     */
2360    @Child(name = "servicePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true)
2361    @Description(shortDefinition="Transaction window", formalDefinition="The date range of services associated with this account." )
2362    protected Period servicePeriod;
2363
2364    /**
2365     * The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.
2366     */
2367    @Child(name = "coverage", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2368    @Description(shortDefinition="The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account", formalDefinition="The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account." )
2369    protected List<CoverageComponent> coverage;
2370
2371    /**
2372     * Indicates the service area, hospital, department, etc. with responsibility for managing the Account.
2373     */
2374    @Child(name = "owner", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=true)
2375    @Description(shortDefinition="Entity managing the Account", formalDefinition="Indicates the service area, hospital, department, etc. with responsibility for managing the Account." )
2376    protected Reference owner;
2377
2378    /**
2379     * Provides additional information about what the account tracks and how it is used.
2380     */
2381    @Child(name = "description", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true)
2382    @Description(shortDefinition="Explanation of purpose/use", formalDefinition="Provides additional information about what the account tracks and how it is used." )
2383    protected MarkdownType description;
2384
2385    /**
2386     * The parties responsible for balancing the account if other payment options fall short.
2387     */
2388    @Child(name = "guarantor", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2389    @Description(shortDefinition="The parties ultimately responsible for balancing the Account", formalDefinition="The parties responsible for balancing the account if other payment options fall short." )
2390    protected List<GuarantorComponent> guarantor;
2391
2392    /**
2393     * When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).
2394     */
2395    @Child(name = "diagnosis", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2396    @Description(shortDefinition="The list of diagnoses relevant to this account", formalDefinition="When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s)." )
2397    protected List<AccountDiagnosisComponent> diagnosis;
2398
2399    /**
2400     * When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).
2401     */
2402    @Child(name = "procedure", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2403    @Description(shortDefinition="The list of procedures relevant to this account", formalDefinition="When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s)." )
2404    protected List<AccountProcedureComponent> procedure;
2405
2406    /**
2407     * Other associated accounts related to this account.
2408     */
2409    @Child(name = "relatedAccount", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2410    @Description(shortDefinition="Other associated accounts related to this account", formalDefinition="Other associated accounts related to this account." )
2411    protected List<AccountRelatedAccountComponent> relatedAccount;
2412
2413    /**
2414     * The default currency for the account.
2415     */
2416    @Child(name = "currency", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false)
2417    @Description(shortDefinition="The base or default currency", formalDefinition="The default currency for the account." )
2418    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/currencies")
2419    protected CodeableConcept currency;
2420
2421    /**
2422     * The calculated account balances - these are calculated and processed by the finance system.
2423
2424The balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.
2425     */
2426    @Child(name = "balance", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2427    @Description(shortDefinition="Calculated account balance(s)", formalDefinition="The calculated account balances - these are calculated and processed by the finance system.\r\rThe balances with a `term` that is not current are usually generated/updated by an invoicing or similar process." )
2428    protected List<AccountBalanceComponent> balance;
2429
2430    /**
2431     * Time the balance amount was calculated.
2432     */
2433    @Child(name = "calculatedAt", type = {InstantType.class}, order=16, min=0, max=1, modifier=false, summary=false)
2434    @Description(shortDefinition="Time the balance amount was calculated", formalDefinition="Time the balance amount was calculated." )
2435    protected InstantType calculatedAt;
2436
2437    private static final long serialVersionUID = -924752626L;
2438
2439  /**
2440   * Constructor
2441   */
2442    public Account() {
2443      super();
2444    }
2445
2446  /**
2447   * Constructor
2448   */
2449    public Account(AccountStatus status) {
2450      super();
2451      this.setStatus(status);
2452    }
2453
2454    /**
2455     * @return {@link #identifier} (Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).)
2456     */
2457    public List<Identifier> getIdentifier() { 
2458      if (this.identifier == null)
2459        this.identifier = new ArrayList<Identifier>();
2460      return this.identifier;
2461    }
2462
2463    /**
2464     * @return Returns a reference to <code>this</code> for easy method chaining
2465     */
2466    public Account setIdentifier(List<Identifier> theIdentifier) { 
2467      this.identifier = theIdentifier;
2468      return this;
2469    }
2470
2471    public boolean hasIdentifier() { 
2472      if (this.identifier == null)
2473        return false;
2474      for (Identifier item : this.identifier)
2475        if (!item.isEmpty())
2476          return true;
2477      return false;
2478    }
2479
2480    public Identifier addIdentifier() { //3
2481      Identifier t = new Identifier();
2482      if (this.identifier == null)
2483        this.identifier = new ArrayList<Identifier>();
2484      this.identifier.add(t);
2485      return t;
2486    }
2487
2488    public Account addIdentifier(Identifier t) { //3
2489      if (t == null)
2490        return this;
2491      if (this.identifier == null)
2492        this.identifier = new ArrayList<Identifier>();
2493      this.identifier.add(t);
2494      return this;
2495    }
2496
2497    /**
2498     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2499     */
2500    public Identifier getIdentifierFirstRep() { 
2501      if (getIdentifier().isEmpty()) {
2502        addIdentifier();
2503      }
2504      return getIdentifier().get(0);
2505    }
2506
2507    /**
2508     * @return {@link #status} (Indicates whether the account is presently used/usable or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2509     */
2510    public Enumeration<AccountStatus> getStatusElement() { 
2511      if (this.status == null)
2512        if (Configuration.errorOnAutoCreate())
2513          throw new Error("Attempt to auto-create Account.status");
2514        else if (Configuration.doAutoCreate())
2515          this.status = new Enumeration<AccountStatus>(new AccountStatusEnumFactory()); // bb
2516      return this.status;
2517    }
2518
2519    public boolean hasStatusElement() { 
2520      return this.status != null && !this.status.isEmpty();
2521    }
2522
2523    public boolean hasStatus() { 
2524      return this.status != null && !this.status.isEmpty();
2525    }
2526
2527    /**
2528     * @param value {@link #status} (Indicates whether the account is presently used/usable or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2529     */
2530    public Account setStatusElement(Enumeration<AccountStatus> value) { 
2531      this.status = value;
2532      return this;
2533    }
2534
2535    /**
2536     * @return Indicates whether the account is presently used/usable or not.
2537     */
2538    public AccountStatus getStatus() { 
2539      return this.status == null ? null : this.status.getValue();
2540    }
2541
2542    /**
2543     * @param value Indicates whether the account is presently used/usable or not.
2544     */
2545    public Account setStatus(AccountStatus value) { 
2546        if (this.status == null)
2547          this.status = new Enumeration<AccountStatus>(new AccountStatusEnumFactory());
2548        this.status.setValue(value);
2549      return this;
2550    }
2551
2552    /**
2553     * @return {@link #billingStatus} (The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account.)
2554     */
2555    public CodeableConcept getBillingStatus() { 
2556      if (this.billingStatus == null)
2557        if (Configuration.errorOnAutoCreate())
2558          throw new Error("Attempt to auto-create Account.billingStatus");
2559        else if (Configuration.doAutoCreate())
2560          this.billingStatus = new CodeableConcept(); // cc
2561      return this.billingStatus;
2562    }
2563
2564    public boolean hasBillingStatus() { 
2565      return this.billingStatus != null && !this.billingStatus.isEmpty();
2566    }
2567
2568    /**
2569     * @param value {@link #billingStatus} (The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account.)
2570     */
2571    public Account setBillingStatus(CodeableConcept value) { 
2572      this.billingStatus = value;
2573      return this;
2574    }
2575
2576    /**
2577     * @return {@link #type} (Categorizes the account for reporting and searching purposes.)
2578     */
2579    public CodeableConcept getType() { 
2580      if (this.type == null)
2581        if (Configuration.errorOnAutoCreate())
2582          throw new Error("Attempt to auto-create Account.type");
2583        else if (Configuration.doAutoCreate())
2584          this.type = new CodeableConcept(); // cc
2585      return this.type;
2586    }
2587
2588    public boolean hasType() { 
2589      return this.type != null && !this.type.isEmpty();
2590    }
2591
2592    /**
2593     * @param value {@link #type} (Categorizes the account for reporting and searching purposes.)
2594     */
2595    public Account setType(CodeableConcept value) { 
2596      this.type = value;
2597      return this;
2598    }
2599
2600    /**
2601     * @return {@link #name} (Name used for the account when displaying it to humans in reports, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2602     */
2603    public StringType getNameElement() { 
2604      if (this.name == null)
2605        if (Configuration.errorOnAutoCreate())
2606          throw new Error("Attempt to auto-create Account.name");
2607        else if (Configuration.doAutoCreate())
2608          this.name = new StringType(); // bb
2609      return this.name;
2610    }
2611
2612    public boolean hasNameElement() { 
2613      return this.name != null && !this.name.isEmpty();
2614    }
2615
2616    public boolean hasName() { 
2617      return this.name != null && !this.name.isEmpty();
2618    }
2619
2620    /**
2621     * @param value {@link #name} (Name used for the account when displaying it to humans in reports, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2622     */
2623    public Account setNameElement(StringType value) { 
2624      this.name = value;
2625      return this;
2626    }
2627
2628    /**
2629     * @return Name used for the account when displaying it to humans in reports, etc.
2630     */
2631    public String getName() { 
2632      return this.name == null ? null : this.name.getValue();
2633    }
2634
2635    /**
2636     * @param value Name used for the account when displaying it to humans in reports, etc.
2637     */
2638    public Account setName(String value) { 
2639      if (Utilities.noString(value))
2640        this.name = null;
2641      else {
2642        if (this.name == null)
2643          this.name = new StringType();
2644        this.name.setValue(value);
2645      }
2646      return this;
2647    }
2648
2649    /**
2650     * @return {@link #subject} (Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.)
2651     */
2652    public List<Reference> getSubject() { 
2653      if (this.subject == null)
2654        this.subject = new ArrayList<Reference>();
2655      return this.subject;
2656    }
2657
2658    /**
2659     * @return Returns a reference to <code>this</code> for easy method chaining
2660     */
2661    public Account setSubject(List<Reference> theSubject) { 
2662      this.subject = theSubject;
2663      return this;
2664    }
2665
2666    public boolean hasSubject() { 
2667      if (this.subject == null)
2668        return false;
2669      for (Reference item : this.subject)
2670        if (!item.isEmpty())
2671          return true;
2672      return false;
2673    }
2674
2675    public Reference addSubject() { //3
2676      Reference t = new Reference();
2677      if (this.subject == null)
2678        this.subject = new ArrayList<Reference>();
2679      this.subject.add(t);
2680      return t;
2681    }
2682
2683    public Account addSubject(Reference t) { //3
2684      if (t == null)
2685        return this;
2686      if (this.subject == null)
2687        this.subject = new ArrayList<Reference>();
2688      this.subject.add(t);
2689      return this;
2690    }
2691
2692    /**
2693     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
2694     */
2695    public Reference getSubjectFirstRep() { 
2696      if (getSubject().isEmpty()) {
2697        addSubject();
2698      }
2699      return getSubject().get(0);
2700    }
2701
2702    /**
2703     * @return {@link #servicePeriod} (The date range of services associated with this account.)
2704     */
2705    public Period getServicePeriod() { 
2706      if (this.servicePeriod == null)
2707        if (Configuration.errorOnAutoCreate())
2708          throw new Error("Attempt to auto-create Account.servicePeriod");
2709        else if (Configuration.doAutoCreate())
2710          this.servicePeriod = new Period(); // cc
2711      return this.servicePeriod;
2712    }
2713
2714    public boolean hasServicePeriod() { 
2715      return this.servicePeriod != null && !this.servicePeriod.isEmpty();
2716    }
2717
2718    /**
2719     * @param value {@link #servicePeriod} (The date range of services associated with this account.)
2720     */
2721    public Account setServicePeriod(Period value) { 
2722      this.servicePeriod = value;
2723      return this;
2724    }
2725
2726    /**
2727     * @return {@link #coverage} (The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.)
2728     */
2729    public List<CoverageComponent> getCoverage() { 
2730      if (this.coverage == null)
2731        this.coverage = new ArrayList<CoverageComponent>();
2732      return this.coverage;
2733    }
2734
2735    /**
2736     * @return Returns a reference to <code>this</code> for easy method chaining
2737     */
2738    public Account setCoverage(List<CoverageComponent> theCoverage) { 
2739      this.coverage = theCoverage;
2740      return this;
2741    }
2742
2743    public boolean hasCoverage() { 
2744      if (this.coverage == null)
2745        return false;
2746      for (CoverageComponent item : this.coverage)
2747        if (!item.isEmpty())
2748          return true;
2749      return false;
2750    }
2751
2752    public CoverageComponent addCoverage() { //3
2753      CoverageComponent t = new CoverageComponent();
2754      if (this.coverage == null)
2755        this.coverage = new ArrayList<CoverageComponent>();
2756      this.coverage.add(t);
2757      return t;
2758    }
2759
2760    public Account addCoverage(CoverageComponent t) { //3
2761      if (t == null)
2762        return this;
2763      if (this.coverage == null)
2764        this.coverage = new ArrayList<CoverageComponent>();
2765      this.coverage.add(t);
2766      return this;
2767    }
2768
2769    /**
2770     * @return The first repetition of repeating field {@link #coverage}, creating it if it does not already exist {3}
2771     */
2772    public CoverageComponent getCoverageFirstRep() { 
2773      if (getCoverage().isEmpty()) {
2774        addCoverage();
2775      }
2776      return getCoverage().get(0);
2777    }
2778
2779    /**
2780     * @return {@link #owner} (Indicates the service area, hospital, department, etc. with responsibility for managing the Account.)
2781     */
2782    public Reference getOwner() { 
2783      if (this.owner == null)
2784        if (Configuration.errorOnAutoCreate())
2785          throw new Error("Attempt to auto-create Account.owner");
2786        else if (Configuration.doAutoCreate())
2787          this.owner = new Reference(); // cc
2788      return this.owner;
2789    }
2790
2791    public boolean hasOwner() { 
2792      return this.owner != null && !this.owner.isEmpty();
2793    }
2794
2795    /**
2796     * @param value {@link #owner} (Indicates the service area, hospital, department, etc. with responsibility for managing the Account.)
2797     */
2798    public Account setOwner(Reference value) { 
2799      this.owner = value;
2800      return this;
2801    }
2802
2803    /**
2804     * @return {@link #description} (Provides additional information about what the account tracks and how it is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2805     */
2806    public MarkdownType getDescriptionElement() { 
2807      if (this.description == null)
2808        if (Configuration.errorOnAutoCreate())
2809          throw new Error("Attempt to auto-create Account.description");
2810        else if (Configuration.doAutoCreate())
2811          this.description = new MarkdownType(); // bb
2812      return this.description;
2813    }
2814
2815    public boolean hasDescriptionElement() { 
2816      return this.description != null && !this.description.isEmpty();
2817    }
2818
2819    public boolean hasDescription() { 
2820      return this.description != null && !this.description.isEmpty();
2821    }
2822
2823    /**
2824     * @param value {@link #description} (Provides additional information about what the account tracks and how it is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2825     */
2826    public Account setDescriptionElement(MarkdownType value) { 
2827      this.description = value;
2828      return this;
2829    }
2830
2831    /**
2832     * @return Provides additional information about what the account tracks and how it is used.
2833     */
2834    public String getDescription() { 
2835      return this.description == null ? null : this.description.getValue();
2836    }
2837
2838    /**
2839     * @param value Provides additional information about what the account tracks and how it is used.
2840     */
2841    public Account setDescription(String value) { 
2842      if (Utilities.noString(value))
2843        this.description = null;
2844      else {
2845        if (this.description == null)
2846          this.description = new MarkdownType();
2847        this.description.setValue(value);
2848      }
2849      return this;
2850    }
2851
2852    /**
2853     * @return {@link #guarantor} (The parties responsible for balancing the account if other payment options fall short.)
2854     */
2855    public List<GuarantorComponent> getGuarantor() { 
2856      if (this.guarantor == null)
2857        this.guarantor = new ArrayList<GuarantorComponent>();
2858      return this.guarantor;
2859    }
2860
2861    /**
2862     * @return Returns a reference to <code>this</code> for easy method chaining
2863     */
2864    public Account setGuarantor(List<GuarantorComponent> theGuarantor) { 
2865      this.guarantor = theGuarantor;
2866      return this;
2867    }
2868
2869    public boolean hasGuarantor() { 
2870      if (this.guarantor == null)
2871        return false;
2872      for (GuarantorComponent item : this.guarantor)
2873        if (!item.isEmpty())
2874          return true;
2875      return false;
2876    }
2877
2878    public GuarantorComponent addGuarantor() { //3
2879      GuarantorComponent t = new GuarantorComponent();
2880      if (this.guarantor == null)
2881        this.guarantor = new ArrayList<GuarantorComponent>();
2882      this.guarantor.add(t);
2883      return t;
2884    }
2885
2886    public Account addGuarantor(GuarantorComponent t) { //3
2887      if (t == null)
2888        return this;
2889      if (this.guarantor == null)
2890        this.guarantor = new ArrayList<GuarantorComponent>();
2891      this.guarantor.add(t);
2892      return this;
2893    }
2894
2895    /**
2896     * @return The first repetition of repeating field {@link #guarantor}, creating it if it does not already exist {3}
2897     */
2898    public GuarantorComponent getGuarantorFirstRep() { 
2899      if (getGuarantor().isEmpty()) {
2900        addGuarantor();
2901      }
2902      return getGuarantor().get(0);
2903    }
2904
2905    /**
2906     * @return {@link #diagnosis} (When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).)
2907     */
2908    public List<AccountDiagnosisComponent> getDiagnosis() { 
2909      if (this.diagnosis == null)
2910        this.diagnosis = new ArrayList<AccountDiagnosisComponent>();
2911      return this.diagnosis;
2912    }
2913
2914    /**
2915     * @return Returns a reference to <code>this</code> for easy method chaining
2916     */
2917    public Account setDiagnosis(List<AccountDiagnosisComponent> theDiagnosis) { 
2918      this.diagnosis = theDiagnosis;
2919      return this;
2920    }
2921
2922    public boolean hasDiagnosis() { 
2923      if (this.diagnosis == null)
2924        return false;
2925      for (AccountDiagnosisComponent item : this.diagnosis)
2926        if (!item.isEmpty())
2927          return true;
2928      return false;
2929    }
2930
2931    public AccountDiagnosisComponent addDiagnosis() { //3
2932      AccountDiagnosisComponent t = new AccountDiagnosisComponent();
2933      if (this.diagnosis == null)
2934        this.diagnosis = new ArrayList<AccountDiagnosisComponent>();
2935      this.diagnosis.add(t);
2936      return t;
2937    }
2938
2939    public Account addDiagnosis(AccountDiagnosisComponent t) { //3
2940      if (t == null)
2941        return this;
2942      if (this.diagnosis == null)
2943        this.diagnosis = new ArrayList<AccountDiagnosisComponent>();
2944      this.diagnosis.add(t);
2945      return this;
2946    }
2947
2948    /**
2949     * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist {3}
2950     */
2951    public AccountDiagnosisComponent getDiagnosisFirstRep() { 
2952      if (getDiagnosis().isEmpty()) {
2953        addDiagnosis();
2954      }
2955      return getDiagnosis().get(0);
2956    }
2957
2958    /**
2959     * @return {@link #procedure} (When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).)
2960     */
2961    public List<AccountProcedureComponent> getProcedure() { 
2962      if (this.procedure == null)
2963        this.procedure = new ArrayList<AccountProcedureComponent>();
2964      return this.procedure;
2965    }
2966
2967    /**
2968     * @return Returns a reference to <code>this</code> for easy method chaining
2969     */
2970    public Account setProcedure(List<AccountProcedureComponent> theProcedure) { 
2971      this.procedure = theProcedure;
2972      return this;
2973    }
2974
2975    public boolean hasProcedure() { 
2976      if (this.procedure == null)
2977        return false;
2978      for (AccountProcedureComponent item : this.procedure)
2979        if (!item.isEmpty())
2980          return true;
2981      return false;
2982    }
2983
2984    public AccountProcedureComponent addProcedure() { //3
2985      AccountProcedureComponent t = new AccountProcedureComponent();
2986      if (this.procedure == null)
2987        this.procedure = new ArrayList<AccountProcedureComponent>();
2988      this.procedure.add(t);
2989      return t;
2990    }
2991
2992    public Account addProcedure(AccountProcedureComponent t) { //3
2993      if (t == null)
2994        return this;
2995      if (this.procedure == null)
2996        this.procedure = new ArrayList<AccountProcedureComponent>();
2997      this.procedure.add(t);
2998      return this;
2999    }
3000
3001    /**
3002     * @return The first repetition of repeating field {@link #procedure}, creating it if it does not already exist {3}
3003     */
3004    public AccountProcedureComponent getProcedureFirstRep() { 
3005      if (getProcedure().isEmpty()) {
3006        addProcedure();
3007      }
3008      return getProcedure().get(0);
3009    }
3010
3011    /**
3012     * @return {@link #relatedAccount} (Other associated accounts related to this account.)
3013     */
3014    public List<AccountRelatedAccountComponent> getRelatedAccount() { 
3015      if (this.relatedAccount == null)
3016        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
3017      return this.relatedAccount;
3018    }
3019
3020    /**
3021     * @return Returns a reference to <code>this</code> for easy method chaining
3022     */
3023    public Account setRelatedAccount(List<AccountRelatedAccountComponent> theRelatedAccount) { 
3024      this.relatedAccount = theRelatedAccount;
3025      return this;
3026    }
3027
3028    public boolean hasRelatedAccount() { 
3029      if (this.relatedAccount == null)
3030        return false;
3031      for (AccountRelatedAccountComponent item : this.relatedAccount)
3032        if (!item.isEmpty())
3033          return true;
3034      return false;
3035    }
3036
3037    public AccountRelatedAccountComponent addRelatedAccount() { //3
3038      AccountRelatedAccountComponent t = new AccountRelatedAccountComponent();
3039      if (this.relatedAccount == null)
3040        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
3041      this.relatedAccount.add(t);
3042      return t;
3043    }
3044
3045    public Account addRelatedAccount(AccountRelatedAccountComponent t) { //3
3046      if (t == null)
3047        return this;
3048      if (this.relatedAccount == null)
3049        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
3050      this.relatedAccount.add(t);
3051      return this;
3052    }
3053
3054    /**
3055     * @return The first repetition of repeating field {@link #relatedAccount}, creating it if it does not already exist {3}
3056     */
3057    public AccountRelatedAccountComponent getRelatedAccountFirstRep() { 
3058      if (getRelatedAccount().isEmpty()) {
3059        addRelatedAccount();
3060      }
3061      return getRelatedAccount().get(0);
3062    }
3063
3064    /**
3065     * @return {@link #currency} (The default currency for the account.)
3066     */
3067    public CodeableConcept getCurrency() { 
3068      if (this.currency == null)
3069        if (Configuration.errorOnAutoCreate())
3070          throw new Error("Attempt to auto-create Account.currency");
3071        else if (Configuration.doAutoCreate())
3072          this.currency = new CodeableConcept(); // cc
3073      return this.currency;
3074    }
3075
3076    public boolean hasCurrency() { 
3077      return this.currency != null && !this.currency.isEmpty();
3078    }
3079
3080    /**
3081     * @param value {@link #currency} (The default currency for the account.)
3082     */
3083    public Account setCurrency(CodeableConcept value) { 
3084      this.currency = value;
3085      return this;
3086    }
3087
3088    /**
3089     * @return {@link #balance} (The calculated account balances - these are calculated and processed by the finance system.
3090
3091The balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.)
3092     */
3093    public List<AccountBalanceComponent> getBalance() { 
3094      if (this.balance == null)
3095        this.balance = new ArrayList<AccountBalanceComponent>();
3096      return this.balance;
3097    }
3098
3099    /**
3100     * @return Returns a reference to <code>this</code> for easy method chaining
3101     */
3102    public Account setBalance(List<AccountBalanceComponent> theBalance) { 
3103      this.balance = theBalance;
3104      return this;
3105    }
3106
3107    public boolean hasBalance() { 
3108      if (this.balance == null)
3109        return false;
3110      for (AccountBalanceComponent item : this.balance)
3111        if (!item.isEmpty())
3112          return true;
3113      return false;
3114    }
3115
3116    public AccountBalanceComponent addBalance() { //3
3117      AccountBalanceComponent t = new AccountBalanceComponent();
3118      if (this.balance == null)
3119        this.balance = new ArrayList<AccountBalanceComponent>();
3120      this.balance.add(t);
3121      return t;
3122    }
3123
3124    public Account addBalance(AccountBalanceComponent t) { //3
3125      if (t == null)
3126        return this;
3127      if (this.balance == null)
3128        this.balance = new ArrayList<AccountBalanceComponent>();
3129      this.balance.add(t);
3130      return this;
3131    }
3132
3133    /**
3134     * @return The first repetition of repeating field {@link #balance}, creating it if it does not already exist {3}
3135     */
3136    public AccountBalanceComponent getBalanceFirstRep() { 
3137      if (getBalance().isEmpty()) {
3138        addBalance();
3139      }
3140      return getBalance().get(0);
3141    }
3142
3143    /**
3144     * @return {@link #calculatedAt} (Time the balance amount was calculated.). This is the underlying object with id, value and extensions. The accessor "getCalculatedAt" gives direct access to the value
3145     */
3146    public InstantType getCalculatedAtElement() { 
3147      if (this.calculatedAt == null)
3148        if (Configuration.errorOnAutoCreate())
3149          throw new Error("Attempt to auto-create Account.calculatedAt");
3150        else if (Configuration.doAutoCreate())
3151          this.calculatedAt = new InstantType(); // bb
3152      return this.calculatedAt;
3153    }
3154
3155    public boolean hasCalculatedAtElement() { 
3156      return this.calculatedAt != null && !this.calculatedAt.isEmpty();
3157    }
3158
3159    public boolean hasCalculatedAt() { 
3160      return this.calculatedAt != null && !this.calculatedAt.isEmpty();
3161    }
3162
3163    /**
3164     * @param value {@link #calculatedAt} (Time the balance amount was calculated.). This is the underlying object with id, value and extensions. The accessor "getCalculatedAt" gives direct access to the value
3165     */
3166    public Account setCalculatedAtElement(InstantType value) { 
3167      this.calculatedAt = value;
3168      return this;
3169    }
3170
3171    /**
3172     * @return Time the balance amount was calculated.
3173     */
3174    public Date getCalculatedAt() { 
3175      return this.calculatedAt == null ? null : this.calculatedAt.getValue();
3176    }
3177
3178    /**
3179     * @param value Time the balance amount was calculated.
3180     */
3181    public Account setCalculatedAt(Date value) { 
3182      if (value == null)
3183        this.calculatedAt = null;
3184      else {
3185        if (this.calculatedAt == null)
3186          this.calculatedAt = new InstantType();
3187        this.calculatedAt.setValue(value);
3188      }
3189      return this;
3190    }
3191
3192      protected void listChildren(List<Property> children) {
3193        super.listChildren(children);
3194        children.add(new Property("identifier", "Identifier", "Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).", 0, java.lang.Integer.MAX_VALUE, identifier));
3195        children.add(new Property("status", "code", "Indicates whether the account is presently used/usable or not.", 0, 1, status));
3196        children.add(new Property("billingStatus", "CodeableConcept", "The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account.", 0, 1, billingStatus));
3197        children.add(new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, 1, type));
3198        children.add(new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, 1, name));
3199        children.add(new Property("subject", "Reference(Patient|Device|Practitioner|PractitionerRole|Location|HealthcareService|Organization)", "Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.", 0, java.lang.Integer.MAX_VALUE, subject));
3200        children.add(new Property("servicePeriod", "Period", "The date range of services associated with this account.", 0, 1, servicePeriod));
3201        children.add(new Property("coverage", "", "The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.", 0, java.lang.Integer.MAX_VALUE, coverage));
3202        children.add(new Property("owner", "Reference(Organization)", "Indicates the service area, hospital, department, etc. with responsibility for managing the Account.", 0, 1, owner));
3203        children.add(new Property("description", "markdown", "Provides additional information about what the account tracks and how it is used.", 0, 1, description));
3204        children.add(new Property("guarantor", "", "The parties responsible for balancing the account if other payment options fall short.", 0, java.lang.Integer.MAX_VALUE, guarantor));
3205        children.add(new Property("diagnosis", "", "When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).", 0, java.lang.Integer.MAX_VALUE, diagnosis));
3206        children.add(new Property("procedure", "", "When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).", 0, java.lang.Integer.MAX_VALUE, procedure));
3207        children.add(new Property("relatedAccount", "", "Other associated accounts related to this account.", 0, java.lang.Integer.MAX_VALUE, relatedAccount));
3208        children.add(new Property("currency", "CodeableConcept", "The default currency for the account.", 0, 1, currency));
3209        children.add(new Property("balance", "", "The calculated account balances - these are calculated and processed by the finance system.\r\rThe balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.", 0, java.lang.Integer.MAX_VALUE, balance));
3210        children.add(new Property("calculatedAt", "instant", "Time the balance amount was calculated.", 0, 1, calculatedAt));
3211      }
3212
3213      @Override
3214      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3215        switch (_hash) {
3216        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).", 0, java.lang.Integer.MAX_VALUE, identifier);
3217        case -892481550: /*status*/  return new Property("status", "code", "Indicates whether the account is presently used/usable or not.", 0, 1, status);
3218        case -1524378035: /*billingStatus*/  return new Property("billingStatus", "CodeableConcept", "The BillingStatus tracks the lifecycle of the account through the billing process. It indicates how transactions are treated when they are allocated to the account.", 0, 1, billingStatus);
3219        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, 1, type);
3220        case 3373707: /*name*/  return new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, 1, name);
3221        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Device|Practitioner|PractitionerRole|Location|HealthcareService|Organization)", "Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.", 0, java.lang.Integer.MAX_VALUE, subject);
3222        case 2129104086: /*servicePeriod*/  return new Property("servicePeriod", "Period", "The date range of services associated with this account.", 0, 1, servicePeriod);
3223        case -351767064: /*coverage*/  return new Property("coverage", "", "The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.", 0, java.lang.Integer.MAX_VALUE, coverage);
3224        case 106164915: /*owner*/  return new Property("owner", "Reference(Organization)", "Indicates the service area, hospital, department, etc. with responsibility for managing the Account.", 0, 1, owner);
3225        case -1724546052: /*description*/  return new Property("description", "markdown", "Provides additional information about what the account tracks and how it is used.", 0, 1, description);
3226        case -188629045: /*guarantor*/  return new Property("guarantor", "", "The parties responsible for balancing the account if other payment options fall short.", 0, java.lang.Integer.MAX_VALUE, guarantor);
3227        case 1196993265: /*diagnosis*/  return new Property("diagnosis", "", "When using an account for billing a specific Encounter the set of diagnoses that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).", 0, java.lang.Integer.MAX_VALUE, diagnosis);
3228        case -1095204141: /*procedure*/  return new Property("procedure", "", "When using an account for billing a specific Encounter the set of procedures that are relevant for billing are stored here on the account where they are able to be sequenced appropriately prior to processing to produce claim(s).", 0, java.lang.Integer.MAX_VALUE, procedure);
3229        case 962039682: /*relatedAccount*/  return new Property("relatedAccount", "", "Other associated accounts related to this account.", 0, java.lang.Integer.MAX_VALUE, relatedAccount);
3230        case 575402001: /*currency*/  return new Property("currency", "CodeableConcept", "The default currency for the account.", 0, 1, currency);
3231        case -339185956: /*balance*/  return new Property("balance", "", "The calculated account balances - these are calculated and processed by the finance system.\r\rThe balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.", 0, java.lang.Integer.MAX_VALUE, balance);
3232        case 1089469073: /*calculatedAt*/  return new Property("calculatedAt", "instant", "Time the balance amount was calculated.", 0, 1, calculatedAt);
3233        default: return super.getNamedProperty(_hash, _name, _checkValid);
3234        }
3235
3236      }
3237
3238      @Override
3239      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3240        switch (hash) {
3241        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3242        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<AccountStatus>
3243        case -1524378035: /*billingStatus*/ return this.billingStatus == null ? new Base[0] : new Base[] {this.billingStatus}; // CodeableConcept
3244        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3245        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3246        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
3247        case 2129104086: /*servicePeriod*/ return this.servicePeriod == null ? new Base[0] : new Base[] {this.servicePeriod}; // Period
3248        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent
3249        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
3250        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
3251        case -188629045: /*guarantor*/ return this.guarantor == null ? new Base[0] : this.guarantor.toArray(new Base[this.guarantor.size()]); // GuarantorComponent
3252        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // AccountDiagnosisComponent
3253        case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // AccountProcedureComponent
3254        case 962039682: /*relatedAccount*/ return this.relatedAccount == null ? new Base[0] : this.relatedAccount.toArray(new Base[this.relatedAccount.size()]); // AccountRelatedAccountComponent
3255        case 575402001: /*currency*/ return this.currency == null ? new Base[0] : new Base[] {this.currency}; // CodeableConcept
3256        case -339185956: /*balance*/ return this.balance == null ? new Base[0] : this.balance.toArray(new Base[this.balance.size()]); // AccountBalanceComponent
3257        case 1089469073: /*calculatedAt*/ return this.calculatedAt == null ? new Base[0] : new Base[] {this.calculatedAt}; // InstantType
3258        default: return super.getProperty(hash, name, checkValid);
3259        }
3260
3261      }
3262
3263      @Override
3264      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3265        switch (hash) {
3266        case -1618432855: // identifier
3267          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3268          return value;
3269        case -892481550: // status
3270          value = new AccountStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3271          this.status = (Enumeration) value; // Enumeration<AccountStatus>
3272          return value;
3273        case -1524378035: // billingStatus
3274          this.billingStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3275          return value;
3276        case 3575610: // type
3277          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3278          return value;
3279        case 3373707: // name
3280          this.name = TypeConvertor.castToString(value); // StringType
3281          return value;
3282        case -1867885268: // subject
3283          this.getSubject().add(TypeConvertor.castToReference(value)); // Reference
3284          return value;
3285        case 2129104086: // servicePeriod
3286          this.servicePeriod = TypeConvertor.castToPeriod(value); // Period
3287          return value;
3288        case -351767064: // coverage
3289          this.getCoverage().add((CoverageComponent) value); // CoverageComponent
3290          return value;
3291        case 106164915: // owner
3292          this.owner = TypeConvertor.castToReference(value); // Reference
3293          return value;
3294        case -1724546052: // description
3295          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3296          return value;
3297        case -188629045: // guarantor
3298          this.getGuarantor().add((GuarantorComponent) value); // GuarantorComponent
3299          return value;
3300        case 1196993265: // diagnosis
3301          this.getDiagnosis().add((AccountDiagnosisComponent) value); // AccountDiagnosisComponent
3302          return value;
3303        case -1095204141: // procedure
3304          this.getProcedure().add((AccountProcedureComponent) value); // AccountProcedureComponent
3305          return value;
3306        case 962039682: // relatedAccount
3307          this.getRelatedAccount().add((AccountRelatedAccountComponent) value); // AccountRelatedAccountComponent
3308          return value;
3309        case 575402001: // currency
3310          this.currency = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3311          return value;
3312        case -339185956: // balance
3313          this.getBalance().add((AccountBalanceComponent) value); // AccountBalanceComponent
3314          return value;
3315        case 1089469073: // calculatedAt
3316          this.calculatedAt = TypeConvertor.castToInstant(value); // InstantType
3317          return value;
3318        default: return super.setProperty(hash, name, value);
3319        }
3320
3321      }
3322
3323      @Override
3324      public Base setProperty(String name, Base value) throws FHIRException {
3325        if (name.equals("identifier")) {
3326          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3327        } else if (name.equals("status")) {
3328          value = new AccountStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3329          this.status = (Enumeration) value; // Enumeration<AccountStatus>
3330        } else if (name.equals("billingStatus")) {
3331          this.billingStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3332        } else if (name.equals("type")) {
3333          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3334        } else if (name.equals("name")) {
3335          this.name = TypeConvertor.castToString(value); // StringType
3336        } else if (name.equals("subject")) {
3337          this.getSubject().add(TypeConvertor.castToReference(value));
3338        } else if (name.equals("servicePeriod")) {
3339          this.servicePeriod = TypeConvertor.castToPeriod(value); // Period
3340        } else if (name.equals("coverage")) {
3341          this.getCoverage().add((CoverageComponent) value);
3342        } else if (name.equals("owner")) {
3343          this.owner = TypeConvertor.castToReference(value); // Reference
3344        } else if (name.equals("description")) {
3345          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
3346        } else if (name.equals("guarantor")) {
3347          this.getGuarantor().add((GuarantorComponent) value);
3348        } else if (name.equals("diagnosis")) {
3349          this.getDiagnosis().add((AccountDiagnosisComponent) value);
3350        } else if (name.equals("procedure")) {
3351          this.getProcedure().add((AccountProcedureComponent) value);
3352        } else if (name.equals("relatedAccount")) {
3353          this.getRelatedAccount().add((AccountRelatedAccountComponent) value);
3354        } else if (name.equals("currency")) {
3355          this.currency = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3356        } else if (name.equals("balance")) {
3357          this.getBalance().add((AccountBalanceComponent) value);
3358        } else if (name.equals("calculatedAt")) {
3359          this.calculatedAt = TypeConvertor.castToInstant(value); // InstantType
3360        } else
3361          return super.setProperty(name, value);
3362        return value;
3363      }
3364
3365      @Override
3366      public Base makeProperty(int hash, String name) throws FHIRException {
3367        switch (hash) {
3368        case -1618432855:  return addIdentifier(); 
3369        case -892481550:  return getStatusElement();
3370        case -1524378035:  return getBillingStatus();
3371        case 3575610:  return getType();
3372        case 3373707:  return getNameElement();
3373        case -1867885268:  return addSubject(); 
3374        case 2129104086:  return getServicePeriod();
3375        case -351767064:  return addCoverage(); 
3376        case 106164915:  return getOwner();
3377        case -1724546052:  return getDescriptionElement();
3378        case -188629045:  return addGuarantor(); 
3379        case 1196993265:  return addDiagnosis(); 
3380        case -1095204141:  return addProcedure(); 
3381        case 962039682:  return addRelatedAccount(); 
3382        case 575402001:  return getCurrency();
3383        case -339185956:  return addBalance(); 
3384        case 1089469073:  return getCalculatedAtElement();
3385        default: return super.makeProperty(hash, name);
3386        }
3387
3388      }
3389
3390      @Override
3391      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3392        switch (hash) {
3393        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3394        case -892481550: /*status*/ return new String[] {"code"};
3395        case -1524378035: /*billingStatus*/ return new String[] {"CodeableConcept"};
3396        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3397        case 3373707: /*name*/ return new String[] {"string"};
3398        case -1867885268: /*subject*/ return new String[] {"Reference"};
3399        case 2129104086: /*servicePeriod*/ return new String[] {"Period"};
3400        case -351767064: /*coverage*/ return new String[] {};
3401        case 106164915: /*owner*/ return new String[] {"Reference"};
3402        case -1724546052: /*description*/ return new String[] {"markdown"};
3403        case -188629045: /*guarantor*/ return new String[] {};
3404        case 1196993265: /*diagnosis*/ return new String[] {};
3405        case -1095204141: /*procedure*/ return new String[] {};
3406        case 962039682: /*relatedAccount*/ return new String[] {};
3407        case 575402001: /*currency*/ return new String[] {"CodeableConcept"};
3408        case -339185956: /*balance*/ return new String[] {};
3409        case 1089469073: /*calculatedAt*/ return new String[] {"instant"};
3410        default: return super.getTypesForProperty(hash, name);
3411        }
3412
3413      }
3414
3415      @Override
3416      public Base addChild(String name) throws FHIRException {
3417        if (name.equals("identifier")) {
3418          return addIdentifier();
3419        }
3420        else if (name.equals("status")) {
3421          throw new FHIRException("Cannot call addChild on a singleton property Account.status");
3422        }
3423        else if (name.equals("billingStatus")) {
3424          this.billingStatus = new CodeableConcept();
3425          return this.billingStatus;
3426        }
3427        else if (name.equals("type")) {
3428          this.type = new CodeableConcept();
3429          return this.type;
3430        }
3431        else if (name.equals("name")) {
3432          throw new FHIRException("Cannot call addChild on a singleton property Account.name");
3433        }
3434        else if (name.equals("subject")) {
3435          return addSubject();
3436        }
3437        else if (name.equals("servicePeriod")) {
3438          this.servicePeriod = new Period();
3439          return this.servicePeriod;
3440        }
3441        else if (name.equals("coverage")) {
3442          return addCoverage();
3443        }
3444        else if (name.equals("owner")) {
3445          this.owner = new Reference();
3446          return this.owner;
3447        }
3448        else if (name.equals("description")) {
3449          throw new FHIRException("Cannot call addChild on a singleton property Account.description");
3450        }
3451        else if (name.equals("guarantor")) {
3452          return addGuarantor();
3453        }
3454        else if (name.equals("diagnosis")) {
3455          return addDiagnosis();
3456        }
3457        else if (name.equals("procedure")) {
3458          return addProcedure();
3459        }
3460        else if (name.equals("relatedAccount")) {
3461          return addRelatedAccount();
3462        }
3463        else if (name.equals("currency")) {
3464          this.currency = new CodeableConcept();
3465          return this.currency;
3466        }
3467        else if (name.equals("balance")) {
3468          return addBalance();
3469        }
3470        else if (name.equals("calculatedAt")) {
3471          throw new FHIRException("Cannot call addChild on a singleton property Account.calculatedAt");
3472        }
3473        else
3474          return super.addChild(name);
3475      }
3476
3477  public String fhirType() {
3478    return "Account";
3479
3480  }
3481
3482      public Account copy() {
3483        Account dst = new Account();
3484        copyValues(dst);
3485        return dst;
3486      }
3487
3488      public void copyValues(Account dst) {
3489        super.copyValues(dst);
3490        if (identifier != null) {
3491          dst.identifier = new ArrayList<Identifier>();
3492          for (Identifier i : identifier)
3493            dst.identifier.add(i.copy());
3494        };
3495        dst.status = status == null ? null : status.copy();
3496        dst.billingStatus = billingStatus == null ? null : billingStatus.copy();
3497        dst.type = type == null ? null : type.copy();
3498        dst.name = name == null ? null : name.copy();
3499        if (subject != null) {
3500          dst.subject = new ArrayList<Reference>();
3501          for (Reference i : subject)
3502            dst.subject.add(i.copy());
3503        };
3504        dst.servicePeriod = servicePeriod == null ? null : servicePeriod.copy();
3505        if (coverage != null) {
3506          dst.coverage = new ArrayList<CoverageComponent>();
3507          for (CoverageComponent i : coverage)
3508            dst.coverage.add(i.copy());
3509        };
3510        dst.owner = owner == null ? null : owner.copy();
3511        dst.description = description == null ? null : description.copy();
3512        if (guarantor != null) {
3513          dst.guarantor = new ArrayList<GuarantorComponent>();
3514          for (GuarantorComponent i : guarantor)
3515            dst.guarantor.add(i.copy());
3516        };
3517        if (diagnosis != null) {
3518          dst.diagnosis = new ArrayList<AccountDiagnosisComponent>();
3519          for (AccountDiagnosisComponent i : diagnosis)
3520            dst.diagnosis.add(i.copy());
3521        };
3522        if (procedure != null) {
3523          dst.procedure = new ArrayList<AccountProcedureComponent>();
3524          for (AccountProcedureComponent i : procedure)
3525            dst.procedure.add(i.copy());
3526        };
3527        if (relatedAccount != null) {
3528          dst.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
3529          for (AccountRelatedAccountComponent i : relatedAccount)
3530            dst.relatedAccount.add(i.copy());
3531        };
3532        dst.currency = currency == null ? null : currency.copy();
3533        if (balance != null) {
3534          dst.balance = new ArrayList<AccountBalanceComponent>();
3535          for (AccountBalanceComponent i : balance)
3536            dst.balance.add(i.copy());
3537        };
3538        dst.calculatedAt = calculatedAt == null ? null : calculatedAt.copy();
3539      }
3540
3541      protected Account typedCopy() {
3542        return copy();
3543      }
3544
3545      @Override
3546      public boolean equalsDeep(Base other_) {
3547        if (!super.equalsDeep(other_))
3548          return false;
3549        if (!(other_ instanceof Account))
3550          return false;
3551        Account o = (Account) other_;
3552        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(billingStatus, o.billingStatus, true)
3553           && compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(subject, o.subject, true)
3554           && compareDeep(servicePeriod, o.servicePeriod, true) && compareDeep(coverage, o.coverage, true)
3555           && compareDeep(owner, o.owner, true) && compareDeep(description, o.description, true) && compareDeep(guarantor, o.guarantor, true)
3556           && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(relatedAccount, o.relatedAccount, true)
3557           && compareDeep(currency, o.currency, true) && compareDeep(balance, o.balance, true) && compareDeep(calculatedAt, o.calculatedAt, true)
3558          ;
3559      }
3560
3561      @Override
3562      public boolean equalsShallow(Base other_) {
3563        if (!super.equalsShallow(other_))
3564          return false;
3565        if (!(other_ instanceof Account))
3566          return false;
3567        Account o = (Account) other_;
3568        return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true)
3569           && compareValues(calculatedAt, o.calculatedAt, true);
3570      }
3571
3572      public boolean isEmpty() {
3573        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, billingStatus
3574          , type, name, subject, servicePeriod, coverage, owner, description, guarantor
3575          , diagnosis, procedure, relatedAccount, currency, balance, calculatedAt);
3576      }
3577
3578  @Override
3579  public ResourceType getResourceType() {
3580    return ResourceType.Account;
3581   }
3582
3583 /**
3584   * Search parameter: <b>guarantor</b>
3585   * <p>
3586   * Description: <b>The parties ultimately responsible for balancing the Account</b><br>
3587   * Type: <b>reference</b><br>
3588   * Path: <b>Account.guarantor.party</b><br>
3589   * </p>
3590   */
3591  @SearchParamDefinition(name="guarantor", path="Account.guarantor.party", description="The parties ultimately responsible for balancing the Account", type="reference", target={Organization.class, Patient.class, RelatedPerson.class } )
3592  public static final String SP_GUARANTOR = "guarantor";
3593 /**
3594   * <b>Fluent Client</b> search parameter constant for <b>guarantor</b>
3595   * <p>
3596   * Description: <b>The parties ultimately responsible for balancing the Account</b><br>
3597   * Type: <b>reference</b><br>
3598   * Path: <b>Account.guarantor.party</b><br>
3599   * </p>
3600   */
3601  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GUARANTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GUARANTOR);
3602
3603/**
3604   * Constant for fluent queries to be used to add include statements. Specifies
3605   * the path value of "<b>Account:guarantor</b>".
3606   */
3607  public static final ca.uhn.fhir.model.api.Include INCLUDE_GUARANTOR = new ca.uhn.fhir.model.api.Include("Account:guarantor").toLocked();
3608
3609 /**
3610   * Search parameter: <b>name</b>
3611   * <p>
3612   * Description: <b>Human-readable label</b><br>
3613   * Type: <b>string</b><br>
3614   * Path: <b>Account.name</b><br>
3615   * </p>
3616   */
3617  @SearchParamDefinition(name="name", path="Account.name", description="Human-readable label", type="string" )
3618  public static final String SP_NAME = "name";
3619 /**
3620   * <b>Fluent Client</b> search parameter constant for <b>name</b>
3621   * <p>
3622   * Description: <b>Human-readable label</b><br>
3623   * Type: <b>string</b><br>
3624   * Path: <b>Account.name</b><br>
3625   * </p>
3626   */
3627  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
3628
3629 /**
3630   * Search parameter: <b>owner</b>
3631   * <p>
3632   * Description: <b>Entity managing the Account</b><br>
3633   * Type: <b>reference</b><br>
3634   * Path: <b>Account.owner</b><br>
3635   * </p>
3636   */
3637  @SearchParamDefinition(name="owner", path="Account.owner", description="Entity managing the Account", type="reference", target={Organization.class } )
3638  public static final String SP_OWNER = "owner";
3639 /**
3640   * <b>Fluent Client</b> search parameter constant for <b>owner</b>
3641   * <p>
3642   * Description: <b>Entity managing the Account</b><br>
3643   * Type: <b>reference</b><br>
3644   * Path: <b>Account.owner</b><br>
3645   * </p>
3646   */
3647  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER);
3648
3649/**
3650   * Constant for fluent queries to be used to add include statements. Specifies
3651   * the path value of "<b>Account:owner</b>".
3652   */
3653  public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Account:owner").toLocked();
3654
3655 /**
3656   * Search parameter: <b>period</b>
3657   * <p>
3658   * Description: <b>Transaction window</b><br>
3659   * Type: <b>date</b><br>
3660   * Path: <b>Account.servicePeriod</b><br>
3661   * </p>
3662   */
3663  @SearchParamDefinition(name="period", path="Account.servicePeriod", description="Transaction window", type="date" )
3664  public static final String SP_PERIOD = "period";
3665 /**
3666   * <b>Fluent Client</b> search parameter constant for <b>period</b>
3667   * <p>
3668   * Description: <b>Transaction window</b><br>
3669   * Type: <b>date</b><br>
3670   * Path: <b>Account.servicePeriod</b><br>
3671   * </p>
3672   */
3673  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
3674
3675 /**
3676   * Search parameter: <b>relatedaccount</b>
3677   * <p>
3678   * Description: <b>Parent and other related accounts</b><br>
3679   * Type: <b>reference</b><br>
3680   * Path: <b>Account.relatedAccount.account</b><br>
3681   * </p>
3682   */
3683  @SearchParamDefinition(name="relatedaccount", path="Account.relatedAccount.account", description="Parent and other related accounts", type="reference", target={Account.class } )
3684  public static final String SP_RELATEDACCOUNT = "relatedaccount";
3685 /**
3686   * <b>Fluent Client</b> search parameter constant for <b>relatedaccount</b>
3687   * <p>
3688   * Description: <b>Parent and other related accounts</b><br>
3689   * Type: <b>reference</b><br>
3690   * Path: <b>Account.relatedAccount.account</b><br>
3691   * </p>
3692   */
3693  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDACCOUNT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDACCOUNT);
3694
3695/**
3696   * Constant for fluent queries to be used to add include statements. Specifies
3697   * the path value of "<b>Account:relatedaccount</b>".
3698   */
3699  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDACCOUNT = new ca.uhn.fhir.model.api.Include("Account:relatedaccount").toLocked();
3700
3701 /**
3702   * Search parameter: <b>status</b>
3703   * <p>
3704   * Description: <b>active | inactive | entered-in-error | on-hold | unknown</b><br>
3705   * Type: <b>token</b><br>
3706   * Path: <b>Account.status</b><br>
3707   * </p>
3708   */
3709  @SearchParamDefinition(name="status", path="Account.status", description="active | inactive | entered-in-error | on-hold | unknown", type="token" )
3710  public static final String SP_STATUS = "status";
3711 /**
3712   * <b>Fluent Client</b> search parameter constant for <b>status</b>
3713   * <p>
3714   * Description: <b>active | inactive | entered-in-error | on-hold | unknown</b><br>
3715   * Type: <b>token</b><br>
3716   * Path: <b>Account.status</b><br>
3717   * </p>
3718   */
3719  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
3720
3721 /**
3722   * Search parameter: <b>subject</b>
3723   * <p>
3724   * Description: <b>The entity that caused the expenses</b><br>
3725   * Type: <b>reference</b><br>
3726   * Path: <b>Account.subject</b><br>
3727   * </p>
3728   */
3729  @SearchParamDefinition(name="subject", path="Account.subject", description="The entity that caused the expenses", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Device.class, HealthcareService.class, Location.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class } )
3730  public static final String SP_SUBJECT = "subject";
3731 /**
3732   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
3733   * <p>
3734   * Description: <b>The entity that caused the expenses</b><br>
3735   * Type: <b>reference</b><br>
3736   * Path: <b>Account.subject</b><br>
3737   * </p>
3738   */
3739  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
3740
3741/**
3742   * Constant for fluent queries to be used to add include statements. Specifies
3743   * the path value of "<b>Account:subject</b>".
3744   */
3745  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Account:subject").toLocked();
3746
3747 /**
3748   * Search parameter: <b>identifier</b>
3749   * <p>
3750   * Description: <b>Multiple Resources: 
3751
3752* [Account](account.html): Account number
3753* [AdverseEvent](adverseevent.html): Business identifier for the event
3754* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3755* [Appointment](appointment.html): An Identifier of the Appointment
3756* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3757* [Basic](basic.html): Business identifier
3758* [BodyStructure](bodystructure.html): Bodystructure identifier
3759* [CarePlan](careplan.html): External Ids for this plan
3760* [CareTeam](careteam.html): External Ids for this team
3761* [ChargeItem](chargeitem.html): Business Identifier for item
3762* [Claim](claim.html): The primary identifier of the financial resource
3763* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3764* [ClinicalImpression](clinicalimpression.html): Business identifier
3765* [Communication](communication.html): Unique identifier
3766* [CommunicationRequest](communicationrequest.html): Unique identifier
3767* [Composition](composition.html): Version-independent identifier for the Composition
3768* [Condition](condition.html): A unique identifier of the condition record
3769* [Consent](consent.html): Identifier for this record (external references)
3770* [Contract](contract.html): The identity of the contract
3771* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3772* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3773* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3774* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3775* [DeviceRequest](devicerequest.html): Business identifier for request/order
3776* [DeviceUsage](deviceusage.html): Search by identifier
3777* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3778* [DocumentReference](documentreference.html): Identifier of the attachment binary
3779* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3780* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3781* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3782* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3783* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3784* [Flag](flag.html): Business identifier
3785* [Goal](goal.html): External Ids for this goal
3786* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3787* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3788* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3789* [Immunization](immunization.html): Business identifier
3790* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3791* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3792* [Invoice](invoice.html): Business Identifier for item
3793* [List](list.html): Business identifier
3794* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3795* [Medication](medication.html): Returns medications with this external identifier
3796* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3797* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3798* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3799* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3800* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3801* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3802* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3803* [Observation](observation.html): The unique id for a particular observation
3804* [Person](person.html): A person Identifier
3805* [Procedure](procedure.html): A unique identifier for a procedure
3806* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3807* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3808* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3809* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3810* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3811* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3812* [Specimen](specimen.html): The unique identifier associated with the specimen
3813* [SupplyDelivery](supplydelivery.html): External identifier
3814* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3815* [Task](task.html): Search for a task instance by its business identifier
3816* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3817</b><br>
3818   * Type: <b>token</b><br>
3819   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
3820   * </p>
3821   */
3822  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
3823  public static final String SP_IDENTIFIER = "identifier";
3824 /**
3825   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3826   * <p>
3827   * Description: <b>Multiple Resources: 
3828
3829* [Account](account.html): Account number
3830* [AdverseEvent](adverseevent.html): Business identifier for the event
3831* [AllergyIntolerance](allergyintolerance.html): External ids for this item
3832* [Appointment](appointment.html): An Identifier of the Appointment
3833* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
3834* [Basic](basic.html): Business identifier
3835* [BodyStructure](bodystructure.html): Bodystructure identifier
3836* [CarePlan](careplan.html): External Ids for this plan
3837* [CareTeam](careteam.html): External Ids for this team
3838* [ChargeItem](chargeitem.html): Business Identifier for item
3839* [Claim](claim.html): The primary identifier of the financial resource
3840* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
3841* [ClinicalImpression](clinicalimpression.html): Business identifier
3842* [Communication](communication.html): Unique identifier
3843* [CommunicationRequest](communicationrequest.html): Unique identifier
3844* [Composition](composition.html): Version-independent identifier for the Composition
3845* [Condition](condition.html): A unique identifier of the condition record
3846* [Consent](consent.html): Identifier for this record (external references)
3847* [Contract](contract.html): The identity of the contract
3848* [Coverage](coverage.html): The primary identifier of the insured and the coverage
3849* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
3850* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
3851* [DetectedIssue](detectedissue.html): Unique id for the detected issue
3852* [DeviceRequest](devicerequest.html): Business identifier for request/order
3853* [DeviceUsage](deviceusage.html): Search by identifier
3854* [DiagnosticReport](diagnosticreport.html): An identifier for the report
3855* [DocumentReference](documentreference.html): Identifier of the attachment binary
3856* [Encounter](encounter.html): Identifier(s) by which this encounter is known
3857* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
3858* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
3859* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
3860* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
3861* [Flag](flag.html): Business identifier
3862* [Goal](goal.html): External Ids for this goal
3863* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
3864* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
3865* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
3866* [Immunization](immunization.html): Business identifier
3867* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
3868* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
3869* [Invoice](invoice.html): Business Identifier for item
3870* [List](list.html): Business identifier
3871* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
3872* [Medication](medication.html): Returns medications with this external identifier
3873* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
3874* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
3875* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
3876* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
3877* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
3878* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
3879* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
3880* [Observation](observation.html): The unique id for a particular observation
3881* [Person](person.html): A person Identifier
3882* [Procedure](procedure.html): A unique identifier for a procedure
3883* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
3884* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
3885* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
3886* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
3887* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
3888* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
3889* [Specimen](specimen.html): The unique identifier associated with the specimen
3890* [SupplyDelivery](supplydelivery.html): External identifier
3891* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
3892* [Task](task.html): Search for a task instance by its business identifier
3893* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
3894</b><br>
3895   * Type: <b>token</b><br>
3896   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
3897   * </p>
3898   */
3899  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3900
3901 /**
3902   * Search parameter: <b>patient</b>
3903   * <p>
3904   * Description: <b>Multiple Resources: 
3905
3906* [Account](account.html): The entity that caused the expenses
3907* [AdverseEvent](adverseevent.html): Subject impacted by event
3908* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3909* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3910* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3911* [AuditEvent](auditevent.html): Where the activity involved patient data
3912* [Basic](basic.html): Identifies the focus of this resource
3913* [BodyStructure](bodystructure.html): Who this is about
3914* [CarePlan](careplan.html): Who the care plan is for
3915* [CareTeam](careteam.html): Who care team is for
3916* [ChargeItem](chargeitem.html): Individual service was done for/to
3917* [Claim](claim.html): Patient receiving the products or services
3918* [ClaimResponse](claimresponse.html): The subject of care
3919* [ClinicalImpression](clinicalimpression.html): Patient assessed
3920* [Communication](communication.html): Focus of message
3921* [CommunicationRequest](communicationrequest.html): Focus of message
3922* [Composition](composition.html): Who and/or what the composition is about
3923* [Condition](condition.html): Who has the condition?
3924* [Consent](consent.html): Who the consent applies to
3925* [Contract](contract.html): The identity of the subject of the contract (if a patient)
3926* [Coverage](coverage.html): Retrieve coverages for a patient
3927* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
3928* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
3929* [DetectedIssue](detectedissue.html): Associated patient
3930* [DeviceRequest](devicerequest.html): Individual the service is ordered for
3931* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
3932* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
3933* [DocumentReference](documentreference.html): Who/what is the subject of the document
3934* [Encounter](encounter.html): The patient present at the encounter
3935* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
3936* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
3937* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
3938* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
3939* [Flag](flag.html): The identity of a subject to list flags for
3940* [Goal](goal.html): Who this goal is intended for
3941* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
3942* [ImagingSelection](imagingselection.html): Who the study is about
3943* [ImagingStudy](imagingstudy.html): Who the study is about
3944* [Immunization](immunization.html): The patient for the vaccination record
3945* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
3946* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
3947* [Invoice](invoice.html): Recipient(s) of goods and services
3948* [List](list.html): If all resources have the same subject
3949* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
3950* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
3951* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
3952* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
3953* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
3954* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
3955* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
3956* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
3957* [Observation](observation.html): The subject that the observation is about (if patient)
3958* [Person](person.html): The Person links to this Patient
3959* [Procedure](procedure.html): Search by subject - a patient
3960* [Provenance](provenance.html): Where the activity involved patient data
3961* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
3962* [RelatedPerson](relatedperson.html): The patient this related person is related to
3963* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
3964* [ResearchSubject](researchsubject.html): Who or what is part of study
3965* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
3966* [ServiceRequest](servicerequest.html): Search by subject - a patient
3967* [Specimen](specimen.html): The patient the specimen comes from
3968* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
3969* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
3970* [Task](task.html): Search by patient
3971* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
3972</b><br>
3973   * Type: <b>reference</b><br>
3974   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
3975   * </p>
3976   */
3977  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [Task](task.html): Search by patient\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={Patient.class } )
3978  public static final String SP_PATIENT = "patient";
3979 /**
3980   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
3981   * <p>
3982   * Description: <b>Multiple Resources: 
3983
3984* [Account](account.html): The entity that caused the expenses
3985* [AdverseEvent](adverseevent.html): Subject impacted by event
3986* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
3987* [Appointment](appointment.html): One of the individuals of the appointment is this patient
3988* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
3989* [AuditEvent](auditevent.html): Where the activity involved patient data
3990* [Basic](basic.html): Identifies the focus of this resource
3991* [BodyStructure](bodystructure.html): Who this is about
3992* [CarePlan](careplan.html): Who the care plan is for
3993* [CareTeam](careteam.html): Who care team is for
3994* [ChargeItem](chargeitem.html): Individual service was done for/to
3995* [Claim](claim.html): Patient receiving the products or services
3996* [ClaimResponse](claimresponse.html): The subject of care
3997* [ClinicalImpression](clinicalimpression.html): Patient assessed
3998* [Communication](communication.html): Focus of message
3999* [CommunicationRequest](communicationrequest.html): Focus of message
4000* [Composition](composition.html): Who and/or what the composition is about
4001* [Condition](condition.html): Who has the condition?
4002* [Consent](consent.html): Who the consent applies to
4003* [Contract](contract.html): The identity of the subject of the contract (if a patient)
4004* [Coverage](coverage.html): Retrieve coverages for a patient
4005* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
4006* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
4007* [DetectedIssue](detectedissue.html): Associated patient
4008* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4009* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4010* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4011* [DocumentReference](documentreference.html): Who/what is the subject of the document
4012* [Encounter](encounter.html): The patient present at the encounter
4013* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
4014* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4015* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
4016* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4017* [Flag](flag.html): The identity of a subject to list flags for
4018* [Goal](goal.html): Who this goal is intended for
4019* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
4020* [ImagingSelection](imagingselection.html): Who the study is about
4021* [ImagingStudy](imagingstudy.html): Who the study is about
4022* [Immunization](immunization.html): The patient for the vaccination record
4023* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
4024* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
4025* [Invoice](invoice.html): Recipient(s) of goods and services
4026* [List](list.html): If all resources have the same subject
4027* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
4028* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4029* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4030* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4031* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
4032* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
4033* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
4034* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
4035* [Observation](observation.html): The subject that the observation is about (if patient)
4036* [Person](person.html): The Person links to this Patient
4037* [Procedure](procedure.html): Search by subject - a patient
4038* [Provenance](provenance.html): Where the activity involved patient data
4039* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
4040* [RelatedPerson](relatedperson.html): The patient this related person is related to
4041* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
4042* [ResearchSubject](researchsubject.html): Who or what is part of study
4043* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4044* [ServiceRequest](servicerequest.html): Search by subject - a patient
4045* [Specimen](specimen.html): The patient the specimen comes from
4046* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4047* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
4048* [Task](task.html): Search by patient
4049* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4050</b><br>
4051   * Type: <b>reference</b><br>
4052   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
4053   * </p>
4054   */
4055  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4056
4057/**
4058   * Constant for fluent queries to be used to add include statements. Specifies
4059   * the path value of "<b>Account:patient</b>".
4060   */
4061  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Account:patient").toLocked();
4062
4063 /**
4064   * Search parameter: <b>type</b>
4065   * <p>
4066   * Description: <b>Multiple Resources: 
4067
4068* [Account](account.html): E.g. patient, expense, depreciation
4069* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
4070* [Composition](composition.html): Kind of composition (LOINC if possible)
4071* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
4072* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
4073* [Encounter](encounter.html): Specific type of encounter
4074* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
4075* [Invoice](invoice.html): Type of Invoice
4076* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
4077* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
4078* [Specimen](specimen.html): The specimen type
4079</b><br>
4080   * Type: <b>token</b><br>
4081   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
4082   * </p>
4083   */
4084  @SearchParamDefinition(name="type", path="Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type", description="Multiple Resources: \r\n\r\n* [Account](account.html): E.g. patient, expense, depreciation\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n* [Invoice](invoice.html): Type of Invoice\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type\r\n* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence\r\n* [Specimen](specimen.html): The specimen type\r\n", type="token" )
4085  public static final String SP_TYPE = "type";
4086 /**
4087   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4088   * <p>
4089   * Description: <b>Multiple Resources: 
4090
4091* [Account](account.html): E.g. patient, expense, depreciation
4092* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
4093* [Composition](composition.html): Kind of composition (LOINC if possible)
4094* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
4095* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
4096* [Encounter](encounter.html): Specific type of encounter
4097* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
4098* [Invoice](invoice.html): Type of Invoice
4099* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
4100* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
4101* [Specimen](specimen.html): The specimen type
4102</b><br>
4103   * Type: <b>token</b><br>
4104   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
4105   * </p>
4106   */
4107  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4108
4109
4110}
4111