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 Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
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 primitive type 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 primitive type 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 AccountRelatedAccountComponent extends BackboneElement implements IBaseBackboneElement {
713        /**
714         * Relationship of the associated Account.
715         */
716        @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
717        @Description(shortDefinition="Relationship of the associated Account", formalDefinition="Relationship of the associated Account." )
718        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-relationship")
719        protected CodeableConcept relationship;
720
721        /**
722         * Reference to an associated Account.
723         */
724        @Child(name = "account", type = {Account.class}, order=2, min=1, max=1, modifier=false, summary=false)
725        @Description(shortDefinition="Reference to an associated Account", formalDefinition="Reference to an associated Account." )
726        protected Reference account;
727
728        private static final long serialVersionUID = 1586291361L;
729
730    /**
731     * Constructor
732     */
733      public AccountRelatedAccountComponent() {
734        super();
735      }
736
737    /**
738     * Constructor
739     */
740      public AccountRelatedAccountComponent(Reference account) {
741        super();
742        this.setAccount(account);
743      }
744
745        /**
746         * @return {@link #relationship} (Relationship of the associated Account.)
747         */
748        public CodeableConcept getRelationship() { 
749          if (this.relationship == null)
750            if (Configuration.errorOnAutoCreate())
751              throw new Error("Attempt to auto-create AccountRelatedAccountComponent.relationship");
752            else if (Configuration.doAutoCreate())
753              this.relationship = new CodeableConcept(); // cc
754          return this.relationship;
755        }
756
757        public boolean hasRelationship() { 
758          return this.relationship != null && !this.relationship.isEmpty();
759        }
760
761        /**
762         * @param value {@link #relationship} (Relationship of the associated Account.)
763         */
764        public AccountRelatedAccountComponent setRelationship(CodeableConcept value) { 
765          this.relationship = value;
766          return this;
767        }
768
769        /**
770         * @return {@link #account} (Reference to an associated Account.)
771         */
772        public Reference getAccount() { 
773          if (this.account == null)
774            if (Configuration.errorOnAutoCreate())
775              throw new Error("Attempt to auto-create AccountRelatedAccountComponent.account");
776            else if (Configuration.doAutoCreate())
777              this.account = new Reference(); // cc
778          return this.account;
779        }
780
781        public boolean hasAccount() { 
782          return this.account != null && !this.account.isEmpty();
783        }
784
785        /**
786         * @param value {@link #account} (Reference to an associated Account.)
787         */
788        public AccountRelatedAccountComponent setAccount(Reference value) { 
789          this.account = value;
790          return this;
791        }
792
793        protected void listChildren(List<Property> children) {
794          super.listChildren(children);
795          children.add(new Property("relationship", "CodeableConcept", "Relationship of the associated Account.", 0, 1, relationship));
796          children.add(new Property("account", "Reference(Account)", "Reference to an associated Account.", 0, 1, account));
797        }
798
799        @Override
800        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
801          switch (_hash) {
802          case -261851592: /*relationship*/  return new Property("relationship", "CodeableConcept", "Relationship of the associated Account.", 0, 1, relationship);
803          case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "Reference to an associated Account.", 0, 1, account);
804          default: return super.getNamedProperty(_hash, _name, _checkValid);
805          }
806
807        }
808
809      @Override
810      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
811        switch (hash) {
812        case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept
813        case -1177318867: /*account*/ return this.account == null ? new Base[0] : new Base[] {this.account}; // Reference
814        default: return super.getProperty(hash, name, checkValid);
815        }
816
817      }
818
819      @Override
820      public Base setProperty(int hash, String name, Base value) throws FHIRException {
821        switch (hash) {
822        case -261851592: // relationship
823          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
824          return value;
825        case -1177318867: // account
826          this.account = TypeConvertor.castToReference(value); // Reference
827          return value;
828        default: return super.setProperty(hash, name, value);
829        }
830
831      }
832
833      @Override
834      public Base setProperty(String name, Base value) throws FHIRException {
835        if (name.equals("relationship")) {
836          this.relationship = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
837        } else if (name.equals("account")) {
838          this.account = TypeConvertor.castToReference(value); // Reference
839        } else
840          return super.setProperty(name, value);
841        return value;
842      }
843
844      @Override
845      public Base makeProperty(int hash, String name) throws FHIRException {
846        switch (hash) {
847        case -261851592:  return getRelationship();
848        case -1177318867:  return getAccount();
849        default: return super.makeProperty(hash, name);
850        }
851
852      }
853
854      @Override
855      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
856        switch (hash) {
857        case -261851592: /*relationship*/ return new String[] {"CodeableConcept"};
858        case -1177318867: /*account*/ return new String[] {"Reference"};
859        default: return super.getTypesForProperty(hash, name);
860        }
861
862      }
863
864      @Override
865      public Base addChild(String name) throws FHIRException {
866        if (name.equals("relationship")) {
867          this.relationship = new CodeableConcept();
868          return this.relationship;
869        }
870        else if (name.equals("account")) {
871          this.account = new Reference();
872          return this.account;
873        }
874        else
875          return super.addChild(name);
876      }
877
878      public AccountRelatedAccountComponent copy() {
879        AccountRelatedAccountComponent dst = new AccountRelatedAccountComponent();
880        copyValues(dst);
881        return dst;
882      }
883
884      public void copyValues(AccountRelatedAccountComponent dst) {
885        super.copyValues(dst);
886        dst.relationship = relationship == null ? null : relationship.copy();
887        dst.account = account == null ? null : account.copy();
888      }
889
890      @Override
891      public boolean equalsDeep(Base other_) {
892        if (!super.equalsDeep(other_))
893          return false;
894        if (!(other_ instanceof AccountRelatedAccountComponent))
895          return false;
896        AccountRelatedAccountComponent o = (AccountRelatedAccountComponent) other_;
897        return compareDeep(relationship, o.relationship, true) && compareDeep(account, o.account, true)
898          ;
899      }
900
901      @Override
902      public boolean equalsShallow(Base other_) {
903        if (!super.equalsShallow(other_))
904          return false;
905        if (!(other_ instanceof AccountRelatedAccountComponent))
906          return false;
907        AccountRelatedAccountComponent o = (AccountRelatedAccountComponent) other_;
908        return true;
909      }
910
911      public boolean isEmpty() {
912        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(relationship, account);
913      }
914
915  public String fhirType() {
916    return "Account.relatedAccount";
917
918  }
919
920  }
921
922    @Block()
923    public static class AccountBalanceComponent extends BackboneElement implements IBaseBackboneElement {
924        /**
925         * Who is expected to pay this part of the balance.
926         */
927        @Child(name = "aggregate", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
928        @Description(shortDefinition="Who is expected to pay this part of the balance", formalDefinition="Who is expected to pay this part of the balance." )
929        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-aggregate")
930        protected CodeableConcept aggregate;
931
932        /**
933         * The term of the account balances - The balance value is the amount that was outstanding for this age.
934         */
935        @Child(name = "term", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
936        @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." )
937        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-balance-term")
938        protected CodeableConcept term;
939
940        /**
941         * 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).
942         */
943        @Child(name = "estimate", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
944        @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)." )
945        protected BooleanType estimate;
946
947        /**
948         * The actual balance value calculated for the age defined in the term property.
949         */
950        @Child(name = "amount", type = {Money.class}, order=4, min=1, max=1, modifier=false, summary=false)
951        @Description(shortDefinition="Calculated amount", formalDefinition="The actual balance value calculated for the age defined in the term property." )
952        protected Money amount;
953
954        private static final long serialVersionUID = -338990145L;
955
956    /**
957     * Constructor
958     */
959      public AccountBalanceComponent() {
960        super();
961      }
962
963    /**
964     * Constructor
965     */
966      public AccountBalanceComponent(Money amount) {
967        super();
968        this.setAmount(amount);
969      }
970
971        /**
972         * @return {@link #aggregate} (Who is expected to pay this part of the balance.)
973         */
974        public CodeableConcept getAggregate() { 
975          if (this.aggregate == null)
976            if (Configuration.errorOnAutoCreate())
977              throw new Error("Attempt to auto-create AccountBalanceComponent.aggregate");
978            else if (Configuration.doAutoCreate())
979              this.aggregate = new CodeableConcept(); // cc
980          return this.aggregate;
981        }
982
983        public boolean hasAggregate() { 
984          return this.aggregate != null && !this.aggregate.isEmpty();
985        }
986
987        /**
988         * @param value {@link #aggregate} (Who is expected to pay this part of the balance.)
989         */
990        public AccountBalanceComponent setAggregate(CodeableConcept value) { 
991          this.aggregate = value;
992          return this;
993        }
994
995        /**
996         * @return {@link #term} (The term of the account balances - The balance value is the amount that was outstanding for this age.)
997         */
998        public CodeableConcept getTerm() { 
999          if (this.term == null)
1000            if (Configuration.errorOnAutoCreate())
1001              throw new Error("Attempt to auto-create AccountBalanceComponent.term");
1002            else if (Configuration.doAutoCreate())
1003              this.term = new CodeableConcept(); // cc
1004          return this.term;
1005        }
1006
1007        public boolean hasTerm() { 
1008          return this.term != null && !this.term.isEmpty();
1009        }
1010
1011        /**
1012         * @param value {@link #term} (The term of the account balances - The balance value is the amount that was outstanding for this age.)
1013         */
1014        public AccountBalanceComponent setTerm(CodeableConcept value) { 
1015          this.term = value;
1016          return this;
1017        }
1018
1019        /**
1020         * @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
1021         */
1022        public BooleanType getEstimateElement() { 
1023          if (this.estimate == null)
1024            if (Configuration.errorOnAutoCreate())
1025              throw new Error("Attempt to auto-create AccountBalanceComponent.estimate");
1026            else if (Configuration.doAutoCreate())
1027              this.estimate = new BooleanType(); // bb
1028          return this.estimate;
1029        }
1030
1031        public boolean hasEstimateElement() { 
1032          return this.estimate != null && !this.estimate.isEmpty();
1033        }
1034
1035        public boolean hasEstimate() { 
1036          return this.estimate != null && !this.estimate.isEmpty();
1037        }
1038
1039        /**
1040         * @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
1041         */
1042        public AccountBalanceComponent setEstimateElement(BooleanType value) { 
1043          this.estimate = value;
1044          return this;
1045        }
1046
1047        /**
1048         * @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).
1049         */
1050        public boolean getEstimate() { 
1051          return this.estimate == null || this.estimate.isEmpty() ? false : this.estimate.getValue();
1052        }
1053
1054        /**
1055         * @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).
1056         */
1057        public AccountBalanceComponent setEstimate(boolean value) { 
1058            if (this.estimate == null)
1059              this.estimate = new BooleanType();
1060            this.estimate.setValue(value);
1061          return this;
1062        }
1063
1064        /**
1065         * @return {@link #amount} (The actual balance value calculated for the age defined in the term property.)
1066         */
1067        public Money getAmount() { 
1068          if (this.amount == null)
1069            if (Configuration.errorOnAutoCreate())
1070              throw new Error("Attempt to auto-create AccountBalanceComponent.amount");
1071            else if (Configuration.doAutoCreate())
1072              this.amount = new Money(); // cc
1073          return this.amount;
1074        }
1075
1076        public boolean hasAmount() { 
1077          return this.amount != null && !this.amount.isEmpty();
1078        }
1079
1080        /**
1081         * @param value {@link #amount} (The actual balance value calculated for the age defined in the term property.)
1082         */
1083        public AccountBalanceComponent setAmount(Money value) { 
1084          this.amount = value;
1085          return this;
1086        }
1087
1088        protected void listChildren(List<Property> children) {
1089          super.listChildren(children);
1090          children.add(new Property("aggregate", "CodeableConcept", "Who is expected to pay this part of the balance.", 0, 1, aggregate));
1091          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));
1092          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));
1093          children.add(new Property("amount", "Money", "The actual balance value calculated for the age defined in the term property.", 0, 1, amount));
1094        }
1095
1096        @Override
1097        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1098          switch (_hash) {
1099          case 175177151: /*aggregate*/  return new Property("aggregate", "CodeableConcept", "Who is expected to pay this part of the balance.", 0, 1, aggregate);
1100          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);
1101          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);
1102          case -1413853096: /*amount*/  return new Property("amount", "Money", "The actual balance value calculated for the age defined in the term property.", 0, 1, amount);
1103          default: return super.getNamedProperty(_hash, _name, _checkValid);
1104          }
1105
1106        }
1107
1108      @Override
1109      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1110        switch (hash) {
1111        case 175177151: /*aggregate*/ return this.aggregate == null ? new Base[0] : new Base[] {this.aggregate}; // CodeableConcept
1112        case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // CodeableConcept
1113        case -1959779032: /*estimate*/ return this.estimate == null ? new Base[0] : new Base[] {this.estimate}; // BooleanType
1114        case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money
1115        default: return super.getProperty(hash, name, checkValid);
1116        }
1117
1118      }
1119
1120      @Override
1121      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1122        switch (hash) {
1123        case 175177151: // aggregate
1124          this.aggregate = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1125          return value;
1126        case 3556460: // term
1127          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1128          return value;
1129        case -1959779032: // estimate
1130          this.estimate = TypeConvertor.castToBoolean(value); // BooleanType
1131          return value;
1132        case -1413853096: // amount
1133          this.amount = TypeConvertor.castToMoney(value); // Money
1134          return value;
1135        default: return super.setProperty(hash, name, value);
1136        }
1137
1138      }
1139
1140      @Override
1141      public Base setProperty(String name, Base value) throws FHIRException {
1142        if (name.equals("aggregate")) {
1143          this.aggregate = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1144        } else if (name.equals("term")) {
1145          this.term = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1146        } else if (name.equals("estimate")) {
1147          this.estimate = TypeConvertor.castToBoolean(value); // BooleanType
1148        } else if (name.equals("amount")) {
1149          this.amount = TypeConvertor.castToMoney(value); // Money
1150        } else
1151          return super.setProperty(name, value);
1152        return value;
1153      }
1154
1155      @Override
1156      public Base makeProperty(int hash, String name) throws FHIRException {
1157        switch (hash) {
1158        case 175177151:  return getAggregate();
1159        case 3556460:  return getTerm();
1160        case -1959779032:  return getEstimateElement();
1161        case -1413853096:  return getAmount();
1162        default: return super.makeProperty(hash, name);
1163        }
1164
1165      }
1166
1167      @Override
1168      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1169        switch (hash) {
1170        case 175177151: /*aggregate*/ return new String[] {"CodeableConcept"};
1171        case 3556460: /*term*/ return new String[] {"CodeableConcept"};
1172        case -1959779032: /*estimate*/ return new String[] {"boolean"};
1173        case -1413853096: /*amount*/ return new String[] {"Money"};
1174        default: return super.getTypesForProperty(hash, name);
1175        }
1176
1177      }
1178
1179      @Override
1180      public Base addChild(String name) throws FHIRException {
1181        if (name.equals("aggregate")) {
1182          this.aggregate = new CodeableConcept();
1183          return this.aggregate;
1184        }
1185        else if (name.equals("term")) {
1186          this.term = new CodeableConcept();
1187          return this.term;
1188        }
1189        else if (name.equals("estimate")) {
1190          throw new FHIRException("Cannot call addChild on a primitive type Account.balance.estimate");
1191        }
1192        else if (name.equals("amount")) {
1193          this.amount = new Money();
1194          return this.amount;
1195        }
1196        else
1197          return super.addChild(name);
1198      }
1199
1200      public AccountBalanceComponent copy() {
1201        AccountBalanceComponent dst = new AccountBalanceComponent();
1202        copyValues(dst);
1203        return dst;
1204      }
1205
1206      public void copyValues(AccountBalanceComponent dst) {
1207        super.copyValues(dst);
1208        dst.aggregate = aggregate == null ? null : aggregate.copy();
1209        dst.term = term == null ? null : term.copy();
1210        dst.estimate = estimate == null ? null : estimate.copy();
1211        dst.amount = amount == null ? null : amount.copy();
1212      }
1213
1214      @Override
1215      public boolean equalsDeep(Base other_) {
1216        if (!super.equalsDeep(other_))
1217          return false;
1218        if (!(other_ instanceof AccountBalanceComponent))
1219          return false;
1220        AccountBalanceComponent o = (AccountBalanceComponent) other_;
1221        return compareDeep(aggregate, o.aggregate, true) && compareDeep(term, o.term, true) && compareDeep(estimate, o.estimate, true)
1222           && compareDeep(amount, o.amount, true);
1223      }
1224
1225      @Override
1226      public boolean equalsShallow(Base other_) {
1227        if (!super.equalsShallow(other_))
1228          return false;
1229        if (!(other_ instanceof AccountBalanceComponent))
1230          return false;
1231        AccountBalanceComponent o = (AccountBalanceComponent) other_;
1232        return compareValues(estimate, o.estimate, true);
1233      }
1234
1235      public boolean isEmpty() {
1236        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(aggregate, term, estimate
1237          , amount);
1238      }
1239
1240  public String fhirType() {
1241    return "Account.balance";
1242
1243  }
1244
1245  }
1246
1247    /**
1248     * Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).
1249     */
1250    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1251    @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)." )
1252    protected List<Identifier> identifier;
1253
1254    /**
1255     * Indicates whether the account is presently used/usable or not.
1256     */
1257    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1258    @Description(shortDefinition="active | inactive | entered-in-error | on-hold | unknown", formalDefinition="Indicates whether the account is presently used/usable or not." )
1259    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-status")
1260    protected Enumeration<AccountStatus> status;
1261
1262    /**
1263     * 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.
1264     */
1265    @Child(name = "billingStatus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
1266    @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." )
1267    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-billing-status")
1268    protected CodeableConcept billingStatus;
1269
1270    /**
1271     * Categorizes the account for reporting and searching purposes.
1272     */
1273    @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
1274    @Description(shortDefinition="E.g. patient, expense, depreciation", formalDefinition="Categorizes the account for reporting and searching purposes." )
1275    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/account-type")
1276    protected CodeableConcept type;
1277
1278    /**
1279     * Name used for the account when displaying it to humans in reports, etc.
1280     */
1281    @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
1282    @Description(shortDefinition="Human-readable label", formalDefinition="Name used for the account when displaying it to humans in reports, etc." )
1283    protected StringType name;
1284
1285    /**
1286     * 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.
1287     */
1288    @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)
1289    @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." )
1290    protected List<Reference> subject;
1291
1292    /**
1293     * The date range of services associated with this account.
1294     */
1295    @Child(name = "servicePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true)
1296    @Description(shortDefinition="Transaction window", formalDefinition="The date range of services associated with this account." )
1297    protected Period servicePeriod;
1298
1299    /**
1300     * The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.
1301     */
1302    @Child(name = "coverage", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1303    @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." )
1304    protected List<CoverageComponent> coverage;
1305
1306    /**
1307     * Indicates the service area, hospital, department, etc. with responsibility for managing the Account.
1308     */
1309    @Child(name = "owner", type = {Organization.class}, order=8, min=0, max=1, modifier=false, summary=true)
1310    @Description(shortDefinition="Entity managing the Account", formalDefinition="Indicates the service area, hospital, department, etc. with responsibility for managing the Account." )
1311    protected Reference owner;
1312
1313    /**
1314     * Provides additional information about what the account tracks and how it is used.
1315     */
1316    @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
1317    @Description(shortDefinition="Explanation of purpose/use", formalDefinition="Provides additional information about what the account tracks and how it is used." )
1318    protected StringType description;
1319
1320    /**
1321     * The parties responsible for balancing the account if other payment options fall short.
1322     */
1323    @Child(name = "guarantor", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1324    @Description(shortDefinition="The parties ultimately responsible for balancing the Account", formalDefinition="The parties responsible for balancing the account if other payment options fall short." )
1325    protected List<GuarantorComponent> guarantor;
1326
1327    /**
1328     * Other associated accounts related to this account.
1329     */
1330    @Child(name = "relatedAccount", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1331    @Description(shortDefinition="Other associated accounts related to this account", formalDefinition="Other associated accounts related to this account." )
1332    protected List<AccountRelatedAccountComponent> relatedAccount;
1333
1334    /**
1335     * The default currency for the account.
1336     */
1337    @Child(name = "currency", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false)
1338    @Description(shortDefinition="The base or default currency", formalDefinition="The default currency for the account." )
1339    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/currencies")
1340    protected CodeableConcept currency;
1341
1342    /**
1343     * The calculated account balances - these are calculated and processed by the finance system.
1344
1345The balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.
1346     */
1347    @Child(name = "balance", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1348    @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." )
1349    protected List<AccountBalanceComponent> balance;
1350
1351    /**
1352     * Time the balance amount was calculated.
1353     */
1354    @Child(name = "calculatedAt", type = {InstantType.class}, order=14, min=0, max=1, modifier=false, summary=false)
1355    @Description(shortDefinition="Time the balance amount was calculated", formalDefinition="Time the balance amount was calculated." )
1356    protected InstantType calculatedAt;
1357
1358    private static final long serialVersionUID = -589833144L;
1359
1360  /**
1361   * Constructor
1362   */
1363    public Account() {
1364      super();
1365    }
1366
1367  /**
1368   * Constructor
1369   */
1370    public Account(AccountStatus status) {
1371      super();
1372      this.setStatus(status);
1373    }
1374
1375    /**
1376     * @return {@link #identifier} (Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).)
1377     */
1378    public List<Identifier> getIdentifier() { 
1379      if (this.identifier == null)
1380        this.identifier = new ArrayList<Identifier>();
1381      return this.identifier;
1382    }
1383
1384    /**
1385     * @return Returns a reference to <code>this</code> for easy method chaining
1386     */
1387    public Account setIdentifier(List<Identifier> theIdentifier) { 
1388      this.identifier = theIdentifier;
1389      return this;
1390    }
1391
1392    public boolean hasIdentifier() { 
1393      if (this.identifier == null)
1394        return false;
1395      for (Identifier item : this.identifier)
1396        if (!item.isEmpty())
1397          return true;
1398      return false;
1399    }
1400
1401    public Identifier addIdentifier() { //3
1402      Identifier t = new Identifier();
1403      if (this.identifier == null)
1404        this.identifier = new ArrayList<Identifier>();
1405      this.identifier.add(t);
1406      return t;
1407    }
1408
1409    public Account addIdentifier(Identifier t) { //3
1410      if (t == null)
1411        return this;
1412      if (this.identifier == null)
1413        this.identifier = new ArrayList<Identifier>();
1414      this.identifier.add(t);
1415      return this;
1416    }
1417
1418    /**
1419     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1420     */
1421    public Identifier getIdentifierFirstRep() { 
1422      if (getIdentifier().isEmpty()) {
1423        addIdentifier();
1424      }
1425      return getIdentifier().get(0);
1426    }
1427
1428    /**
1429     * @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
1430     */
1431    public Enumeration<AccountStatus> getStatusElement() { 
1432      if (this.status == null)
1433        if (Configuration.errorOnAutoCreate())
1434          throw new Error("Attempt to auto-create Account.status");
1435        else if (Configuration.doAutoCreate())
1436          this.status = new Enumeration<AccountStatus>(new AccountStatusEnumFactory()); // bb
1437      return this.status;
1438    }
1439
1440    public boolean hasStatusElement() { 
1441      return this.status != null && !this.status.isEmpty();
1442    }
1443
1444    public boolean hasStatus() { 
1445      return this.status != null && !this.status.isEmpty();
1446    }
1447
1448    /**
1449     * @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
1450     */
1451    public Account setStatusElement(Enumeration<AccountStatus> value) { 
1452      this.status = value;
1453      return this;
1454    }
1455
1456    /**
1457     * @return Indicates whether the account is presently used/usable or not.
1458     */
1459    public AccountStatus getStatus() { 
1460      return this.status == null ? null : this.status.getValue();
1461    }
1462
1463    /**
1464     * @param value Indicates whether the account is presently used/usable or not.
1465     */
1466    public Account setStatus(AccountStatus value) { 
1467        if (this.status == null)
1468          this.status = new Enumeration<AccountStatus>(new AccountStatusEnumFactory());
1469        this.status.setValue(value);
1470      return this;
1471    }
1472
1473    /**
1474     * @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.)
1475     */
1476    public CodeableConcept getBillingStatus() { 
1477      if (this.billingStatus == null)
1478        if (Configuration.errorOnAutoCreate())
1479          throw new Error("Attempt to auto-create Account.billingStatus");
1480        else if (Configuration.doAutoCreate())
1481          this.billingStatus = new CodeableConcept(); // cc
1482      return this.billingStatus;
1483    }
1484
1485    public boolean hasBillingStatus() { 
1486      return this.billingStatus != null && !this.billingStatus.isEmpty();
1487    }
1488
1489    /**
1490     * @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.)
1491     */
1492    public Account setBillingStatus(CodeableConcept value) { 
1493      this.billingStatus = value;
1494      return this;
1495    }
1496
1497    /**
1498     * @return {@link #type} (Categorizes the account for reporting and searching purposes.)
1499     */
1500    public CodeableConcept getType() { 
1501      if (this.type == null)
1502        if (Configuration.errorOnAutoCreate())
1503          throw new Error("Attempt to auto-create Account.type");
1504        else if (Configuration.doAutoCreate())
1505          this.type = new CodeableConcept(); // cc
1506      return this.type;
1507    }
1508
1509    public boolean hasType() { 
1510      return this.type != null && !this.type.isEmpty();
1511    }
1512
1513    /**
1514     * @param value {@link #type} (Categorizes the account for reporting and searching purposes.)
1515     */
1516    public Account setType(CodeableConcept value) { 
1517      this.type = value;
1518      return this;
1519    }
1520
1521    /**
1522     * @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
1523     */
1524    public StringType getNameElement() { 
1525      if (this.name == null)
1526        if (Configuration.errorOnAutoCreate())
1527          throw new Error("Attempt to auto-create Account.name");
1528        else if (Configuration.doAutoCreate())
1529          this.name = new StringType(); // bb
1530      return this.name;
1531    }
1532
1533    public boolean hasNameElement() { 
1534      return this.name != null && !this.name.isEmpty();
1535    }
1536
1537    public boolean hasName() { 
1538      return this.name != null && !this.name.isEmpty();
1539    }
1540
1541    /**
1542     * @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
1543     */
1544    public Account setNameElement(StringType value) { 
1545      this.name = value;
1546      return this;
1547    }
1548
1549    /**
1550     * @return Name used for the account when displaying it to humans in reports, etc.
1551     */
1552    public String getName() { 
1553      return this.name == null ? null : this.name.getValue();
1554    }
1555
1556    /**
1557     * @param value Name used for the account when displaying it to humans in reports, etc.
1558     */
1559    public Account setName(String value) { 
1560      if (Utilities.noString(value))
1561        this.name = null;
1562      else {
1563        if (this.name == null)
1564          this.name = new StringType();
1565        this.name.setValue(value);
1566      }
1567      return this;
1568    }
1569
1570    /**
1571     * @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.)
1572     */
1573    public List<Reference> getSubject() { 
1574      if (this.subject == null)
1575        this.subject = new ArrayList<Reference>();
1576      return this.subject;
1577    }
1578
1579    /**
1580     * @return Returns a reference to <code>this</code> for easy method chaining
1581     */
1582    public Account setSubject(List<Reference> theSubject) { 
1583      this.subject = theSubject;
1584      return this;
1585    }
1586
1587    public boolean hasSubject() { 
1588      if (this.subject == null)
1589        return false;
1590      for (Reference item : this.subject)
1591        if (!item.isEmpty())
1592          return true;
1593      return false;
1594    }
1595
1596    public Reference addSubject() { //3
1597      Reference t = new Reference();
1598      if (this.subject == null)
1599        this.subject = new ArrayList<Reference>();
1600      this.subject.add(t);
1601      return t;
1602    }
1603
1604    public Account addSubject(Reference t) { //3
1605      if (t == null)
1606        return this;
1607      if (this.subject == null)
1608        this.subject = new ArrayList<Reference>();
1609      this.subject.add(t);
1610      return this;
1611    }
1612
1613    /**
1614     * @return The first repetition of repeating field {@link #subject}, creating it if it does not already exist {3}
1615     */
1616    public Reference getSubjectFirstRep() { 
1617      if (getSubject().isEmpty()) {
1618        addSubject();
1619      }
1620      return getSubject().get(0);
1621    }
1622
1623    /**
1624     * @return {@link #servicePeriod} (The date range of services associated with this account.)
1625     */
1626    public Period getServicePeriod() { 
1627      if (this.servicePeriod == null)
1628        if (Configuration.errorOnAutoCreate())
1629          throw new Error("Attempt to auto-create Account.servicePeriod");
1630        else if (Configuration.doAutoCreate())
1631          this.servicePeriod = new Period(); // cc
1632      return this.servicePeriod;
1633    }
1634
1635    public boolean hasServicePeriod() { 
1636      return this.servicePeriod != null && !this.servicePeriod.isEmpty();
1637    }
1638
1639    /**
1640     * @param value {@link #servicePeriod} (The date range of services associated with this account.)
1641     */
1642    public Account setServicePeriod(Period value) { 
1643      this.servicePeriod = value;
1644      return this;
1645    }
1646
1647    /**
1648     * @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.)
1649     */
1650    public List<CoverageComponent> getCoverage() { 
1651      if (this.coverage == null)
1652        this.coverage = new ArrayList<CoverageComponent>();
1653      return this.coverage;
1654    }
1655
1656    /**
1657     * @return Returns a reference to <code>this</code> for easy method chaining
1658     */
1659    public Account setCoverage(List<CoverageComponent> theCoverage) { 
1660      this.coverage = theCoverage;
1661      return this;
1662    }
1663
1664    public boolean hasCoverage() { 
1665      if (this.coverage == null)
1666        return false;
1667      for (CoverageComponent item : this.coverage)
1668        if (!item.isEmpty())
1669          return true;
1670      return false;
1671    }
1672
1673    public CoverageComponent addCoverage() { //3
1674      CoverageComponent t = new CoverageComponent();
1675      if (this.coverage == null)
1676        this.coverage = new ArrayList<CoverageComponent>();
1677      this.coverage.add(t);
1678      return t;
1679    }
1680
1681    public Account addCoverage(CoverageComponent t) { //3
1682      if (t == null)
1683        return this;
1684      if (this.coverage == null)
1685        this.coverage = new ArrayList<CoverageComponent>();
1686      this.coverage.add(t);
1687      return this;
1688    }
1689
1690    /**
1691     * @return The first repetition of repeating field {@link #coverage}, creating it if it does not already exist {3}
1692     */
1693    public CoverageComponent getCoverageFirstRep() { 
1694      if (getCoverage().isEmpty()) {
1695        addCoverage();
1696      }
1697      return getCoverage().get(0);
1698    }
1699
1700    /**
1701     * @return {@link #owner} (Indicates the service area, hospital, department, etc. with responsibility for managing the Account.)
1702     */
1703    public Reference getOwner() { 
1704      if (this.owner == null)
1705        if (Configuration.errorOnAutoCreate())
1706          throw new Error("Attempt to auto-create Account.owner");
1707        else if (Configuration.doAutoCreate())
1708          this.owner = new Reference(); // cc
1709      return this.owner;
1710    }
1711
1712    public boolean hasOwner() { 
1713      return this.owner != null && !this.owner.isEmpty();
1714    }
1715
1716    /**
1717     * @param value {@link #owner} (Indicates the service area, hospital, department, etc. with responsibility for managing the Account.)
1718     */
1719    public Account setOwner(Reference value) { 
1720      this.owner = value;
1721      return this;
1722    }
1723
1724    /**
1725     * @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
1726     */
1727    public StringType getDescriptionElement() { 
1728      if (this.description == null)
1729        if (Configuration.errorOnAutoCreate())
1730          throw new Error("Attempt to auto-create Account.description");
1731        else if (Configuration.doAutoCreate())
1732          this.description = new StringType(); // bb
1733      return this.description;
1734    }
1735
1736    public boolean hasDescriptionElement() { 
1737      return this.description != null && !this.description.isEmpty();
1738    }
1739
1740    public boolean hasDescription() { 
1741      return this.description != null && !this.description.isEmpty();
1742    }
1743
1744    /**
1745     * @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
1746     */
1747    public Account setDescriptionElement(StringType value) { 
1748      this.description = value;
1749      return this;
1750    }
1751
1752    /**
1753     * @return Provides additional information about what the account tracks and how it is used.
1754     */
1755    public String getDescription() { 
1756      return this.description == null ? null : this.description.getValue();
1757    }
1758
1759    /**
1760     * @param value Provides additional information about what the account tracks and how it is used.
1761     */
1762    public Account setDescription(String value) { 
1763      if (Utilities.noString(value))
1764        this.description = null;
1765      else {
1766        if (this.description == null)
1767          this.description = new StringType();
1768        this.description.setValue(value);
1769      }
1770      return this;
1771    }
1772
1773    /**
1774     * @return {@link #guarantor} (The parties responsible for balancing the account if other payment options fall short.)
1775     */
1776    public List<GuarantorComponent> getGuarantor() { 
1777      if (this.guarantor == null)
1778        this.guarantor = new ArrayList<GuarantorComponent>();
1779      return this.guarantor;
1780    }
1781
1782    /**
1783     * @return Returns a reference to <code>this</code> for easy method chaining
1784     */
1785    public Account setGuarantor(List<GuarantorComponent> theGuarantor) { 
1786      this.guarantor = theGuarantor;
1787      return this;
1788    }
1789
1790    public boolean hasGuarantor() { 
1791      if (this.guarantor == null)
1792        return false;
1793      for (GuarantorComponent item : this.guarantor)
1794        if (!item.isEmpty())
1795          return true;
1796      return false;
1797    }
1798
1799    public GuarantorComponent addGuarantor() { //3
1800      GuarantorComponent t = new GuarantorComponent();
1801      if (this.guarantor == null)
1802        this.guarantor = new ArrayList<GuarantorComponent>();
1803      this.guarantor.add(t);
1804      return t;
1805    }
1806
1807    public Account addGuarantor(GuarantorComponent t) { //3
1808      if (t == null)
1809        return this;
1810      if (this.guarantor == null)
1811        this.guarantor = new ArrayList<GuarantorComponent>();
1812      this.guarantor.add(t);
1813      return this;
1814    }
1815
1816    /**
1817     * @return The first repetition of repeating field {@link #guarantor}, creating it if it does not already exist {3}
1818     */
1819    public GuarantorComponent getGuarantorFirstRep() { 
1820      if (getGuarantor().isEmpty()) {
1821        addGuarantor();
1822      }
1823      return getGuarantor().get(0);
1824    }
1825
1826    /**
1827     * @return {@link #relatedAccount} (Other associated accounts related to this account.)
1828     */
1829    public List<AccountRelatedAccountComponent> getRelatedAccount() { 
1830      if (this.relatedAccount == null)
1831        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
1832      return this.relatedAccount;
1833    }
1834
1835    /**
1836     * @return Returns a reference to <code>this</code> for easy method chaining
1837     */
1838    public Account setRelatedAccount(List<AccountRelatedAccountComponent> theRelatedAccount) { 
1839      this.relatedAccount = theRelatedAccount;
1840      return this;
1841    }
1842
1843    public boolean hasRelatedAccount() { 
1844      if (this.relatedAccount == null)
1845        return false;
1846      for (AccountRelatedAccountComponent item : this.relatedAccount)
1847        if (!item.isEmpty())
1848          return true;
1849      return false;
1850    }
1851
1852    public AccountRelatedAccountComponent addRelatedAccount() { //3
1853      AccountRelatedAccountComponent t = new AccountRelatedAccountComponent();
1854      if (this.relatedAccount == null)
1855        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
1856      this.relatedAccount.add(t);
1857      return t;
1858    }
1859
1860    public Account addRelatedAccount(AccountRelatedAccountComponent t) { //3
1861      if (t == null)
1862        return this;
1863      if (this.relatedAccount == null)
1864        this.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
1865      this.relatedAccount.add(t);
1866      return this;
1867    }
1868
1869    /**
1870     * @return The first repetition of repeating field {@link #relatedAccount}, creating it if it does not already exist {3}
1871     */
1872    public AccountRelatedAccountComponent getRelatedAccountFirstRep() { 
1873      if (getRelatedAccount().isEmpty()) {
1874        addRelatedAccount();
1875      }
1876      return getRelatedAccount().get(0);
1877    }
1878
1879    /**
1880     * @return {@link #currency} (The default currency for the account.)
1881     */
1882    public CodeableConcept getCurrency() { 
1883      if (this.currency == null)
1884        if (Configuration.errorOnAutoCreate())
1885          throw new Error("Attempt to auto-create Account.currency");
1886        else if (Configuration.doAutoCreate())
1887          this.currency = new CodeableConcept(); // cc
1888      return this.currency;
1889    }
1890
1891    public boolean hasCurrency() { 
1892      return this.currency != null && !this.currency.isEmpty();
1893    }
1894
1895    /**
1896     * @param value {@link #currency} (The default currency for the account.)
1897     */
1898    public Account setCurrency(CodeableConcept value) { 
1899      this.currency = value;
1900      return this;
1901    }
1902
1903    /**
1904     * @return {@link #balance} (The calculated account balances - these are calculated and processed by the finance system.
1905
1906The balances with a `term` that is not current are usually generated/updated by an invoicing or similar process.)
1907     */
1908    public List<AccountBalanceComponent> getBalance() { 
1909      if (this.balance == null)
1910        this.balance = new ArrayList<AccountBalanceComponent>();
1911      return this.balance;
1912    }
1913
1914    /**
1915     * @return Returns a reference to <code>this</code> for easy method chaining
1916     */
1917    public Account setBalance(List<AccountBalanceComponent> theBalance) { 
1918      this.balance = theBalance;
1919      return this;
1920    }
1921
1922    public boolean hasBalance() { 
1923      if (this.balance == null)
1924        return false;
1925      for (AccountBalanceComponent item : this.balance)
1926        if (!item.isEmpty())
1927          return true;
1928      return false;
1929    }
1930
1931    public AccountBalanceComponent addBalance() { //3
1932      AccountBalanceComponent t = new AccountBalanceComponent();
1933      if (this.balance == null)
1934        this.balance = new ArrayList<AccountBalanceComponent>();
1935      this.balance.add(t);
1936      return t;
1937    }
1938
1939    public Account addBalance(AccountBalanceComponent t) { //3
1940      if (t == null)
1941        return this;
1942      if (this.balance == null)
1943        this.balance = new ArrayList<AccountBalanceComponent>();
1944      this.balance.add(t);
1945      return this;
1946    }
1947
1948    /**
1949     * @return The first repetition of repeating field {@link #balance}, creating it if it does not already exist {3}
1950     */
1951    public AccountBalanceComponent getBalanceFirstRep() { 
1952      if (getBalance().isEmpty()) {
1953        addBalance();
1954      }
1955      return getBalance().get(0);
1956    }
1957
1958    /**
1959     * @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
1960     */
1961    public InstantType getCalculatedAtElement() { 
1962      if (this.calculatedAt == null)
1963        if (Configuration.errorOnAutoCreate())
1964          throw new Error("Attempt to auto-create Account.calculatedAt");
1965        else if (Configuration.doAutoCreate())
1966          this.calculatedAt = new InstantType(); // bb
1967      return this.calculatedAt;
1968    }
1969
1970    public boolean hasCalculatedAtElement() { 
1971      return this.calculatedAt != null && !this.calculatedAt.isEmpty();
1972    }
1973
1974    public boolean hasCalculatedAt() { 
1975      return this.calculatedAt != null && !this.calculatedAt.isEmpty();
1976    }
1977
1978    /**
1979     * @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
1980     */
1981    public Account setCalculatedAtElement(InstantType value) { 
1982      this.calculatedAt = value;
1983      return this;
1984    }
1985
1986    /**
1987     * @return Time the balance amount was calculated.
1988     */
1989    public Date getCalculatedAt() { 
1990      return this.calculatedAt == null ? null : this.calculatedAt.getValue();
1991    }
1992
1993    /**
1994     * @param value Time the balance amount was calculated.
1995     */
1996    public Account setCalculatedAt(Date value) { 
1997      if (value == null)
1998        this.calculatedAt = null;
1999      else {
2000        if (this.calculatedAt == null)
2001          this.calculatedAt = new InstantType();
2002        this.calculatedAt.setValue(value);
2003      }
2004      return this;
2005    }
2006
2007      protected void listChildren(List<Property> children) {
2008        super.listChildren(children);
2009        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));
2010        children.add(new Property("status", "code", "Indicates whether the account is presently used/usable or not.", 0, 1, status));
2011        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));
2012        children.add(new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, 1, type));
2013        children.add(new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, 1, name));
2014        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));
2015        children.add(new Property("servicePeriod", "Period", "The date range of services associated with this account.", 0, 1, servicePeriod));
2016        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));
2017        children.add(new Property("owner", "Reference(Organization)", "Indicates the service area, hospital, department, etc. with responsibility for managing the Account.", 0, 1, owner));
2018        children.add(new Property("description", "string", "Provides additional information about what the account tracks and how it is used.", 0, 1, description));
2019        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));
2020        children.add(new Property("relatedAccount", "", "Other associated accounts related to this account.", 0, java.lang.Integer.MAX_VALUE, relatedAccount));
2021        children.add(new Property("currency", "CodeableConcept", "The default currency for the account.", 0, 1, currency));
2022        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));
2023        children.add(new Property("calculatedAt", "instant", "Time the balance amount was calculated.", 0, 1, calculatedAt));
2024      }
2025
2026      @Override
2027      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2028        switch (_hash) {
2029        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);
2030        case -892481550: /*status*/  return new Property("status", "code", "Indicates whether the account is presently used/usable or not.", 0, 1, status);
2031        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);
2032        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, 1, type);
2033        case 3373707: /*name*/  return new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, 1, name);
2034        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);
2035        case 2129104086: /*servicePeriod*/  return new Property("servicePeriod", "Period", "The date range of services associated with this account.", 0, 1, servicePeriod);
2036        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);
2037        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);
2038        case -1724546052: /*description*/  return new Property("description", "string", "Provides additional information about what the account tracks and how it is used.", 0, 1, description);
2039        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);
2040        case 962039682: /*relatedAccount*/  return new Property("relatedAccount", "", "Other associated accounts related to this account.", 0, java.lang.Integer.MAX_VALUE, relatedAccount);
2041        case 575402001: /*currency*/  return new Property("currency", "CodeableConcept", "The default currency for the account.", 0, 1, currency);
2042        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);
2043        case 1089469073: /*calculatedAt*/  return new Property("calculatedAt", "instant", "Time the balance amount was calculated.", 0, 1, calculatedAt);
2044        default: return super.getNamedProperty(_hash, _name, _checkValid);
2045        }
2046
2047      }
2048
2049      @Override
2050      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2051        switch (hash) {
2052        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2053        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<AccountStatus>
2054        case -1524378035: /*billingStatus*/ return this.billingStatus == null ? new Base[0] : new Base[] {this.billingStatus}; // CodeableConcept
2055        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
2056        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2057        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference
2058        case 2129104086: /*servicePeriod*/ return this.servicePeriod == null ? new Base[0] : new Base[] {this.servicePeriod}; // Period
2059        case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent
2060        case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference
2061        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2062        case -188629045: /*guarantor*/ return this.guarantor == null ? new Base[0] : this.guarantor.toArray(new Base[this.guarantor.size()]); // GuarantorComponent
2063        case 962039682: /*relatedAccount*/ return this.relatedAccount == null ? new Base[0] : this.relatedAccount.toArray(new Base[this.relatedAccount.size()]); // AccountRelatedAccountComponent
2064        case 575402001: /*currency*/ return this.currency == null ? new Base[0] : new Base[] {this.currency}; // CodeableConcept
2065        case -339185956: /*balance*/ return this.balance == null ? new Base[0] : this.balance.toArray(new Base[this.balance.size()]); // AccountBalanceComponent
2066        case 1089469073: /*calculatedAt*/ return this.calculatedAt == null ? new Base[0] : new Base[] {this.calculatedAt}; // InstantType
2067        default: return super.getProperty(hash, name, checkValid);
2068        }
2069
2070      }
2071
2072      @Override
2073      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2074        switch (hash) {
2075        case -1618432855: // identifier
2076          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2077          return value;
2078        case -892481550: // status
2079          value = new AccountStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2080          this.status = (Enumeration) value; // Enumeration<AccountStatus>
2081          return value;
2082        case -1524378035: // billingStatus
2083          this.billingStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2084          return value;
2085        case 3575610: // type
2086          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2087          return value;
2088        case 3373707: // name
2089          this.name = TypeConvertor.castToString(value); // StringType
2090          return value;
2091        case -1867885268: // subject
2092          this.getSubject().add(TypeConvertor.castToReference(value)); // Reference
2093          return value;
2094        case 2129104086: // servicePeriod
2095          this.servicePeriod = TypeConvertor.castToPeriod(value); // Period
2096          return value;
2097        case -351767064: // coverage
2098          this.getCoverage().add((CoverageComponent) value); // CoverageComponent
2099          return value;
2100        case 106164915: // owner
2101          this.owner = TypeConvertor.castToReference(value); // Reference
2102          return value;
2103        case -1724546052: // description
2104          this.description = TypeConvertor.castToString(value); // StringType
2105          return value;
2106        case -188629045: // guarantor
2107          this.getGuarantor().add((GuarantorComponent) value); // GuarantorComponent
2108          return value;
2109        case 962039682: // relatedAccount
2110          this.getRelatedAccount().add((AccountRelatedAccountComponent) value); // AccountRelatedAccountComponent
2111          return value;
2112        case 575402001: // currency
2113          this.currency = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2114          return value;
2115        case -339185956: // balance
2116          this.getBalance().add((AccountBalanceComponent) value); // AccountBalanceComponent
2117          return value;
2118        case 1089469073: // calculatedAt
2119          this.calculatedAt = TypeConvertor.castToInstant(value); // InstantType
2120          return value;
2121        default: return super.setProperty(hash, name, value);
2122        }
2123
2124      }
2125
2126      @Override
2127      public Base setProperty(String name, Base value) throws FHIRException {
2128        if (name.equals("identifier")) {
2129          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2130        } else if (name.equals("status")) {
2131          value = new AccountStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2132          this.status = (Enumeration) value; // Enumeration<AccountStatus>
2133        } else if (name.equals("billingStatus")) {
2134          this.billingStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2135        } else if (name.equals("type")) {
2136          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2137        } else if (name.equals("name")) {
2138          this.name = TypeConvertor.castToString(value); // StringType
2139        } else if (name.equals("subject")) {
2140          this.getSubject().add(TypeConvertor.castToReference(value));
2141        } else if (name.equals("servicePeriod")) {
2142          this.servicePeriod = TypeConvertor.castToPeriod(value); // Period
2143        } else if (name.equals("coverage")) {
2144          this.getCoverage().add((CoverageComponent) value);
2145        } else if (name.equals("owner")) {
2146          this.owner = TypeConvertor.castToReference(value); // Reference
2147        } else if (name.equals("description")) {
2148          this.description = TypeConvertor.castToString(value); // StringType
2149        } else if (name.equals("guarantor")) {
2150          this.getGuarantor().add((GuarantorComponent) value);
2151        } else if (name.equals("relatedAccount")) {
2152          this.getRelatedAccount().add((AccountRelatedAccountComponent) value);
2153        } else if (name.equals("currency")) {
2154          this.currency = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2155        } else if (name.equals("balance")) {
2156          this.getBalance().add((AccountBalanceComponent) value);
2157        } else if (name.equals("calculatedAt")) {
2158          this.calculatedAt = TypeConvertor.castToInstant(value); // InstantType
2159        } else
2160          return super.setProperty(name, value);
2161        return value;
2162      }
2163
2164      @Override
2165      public Base makeProperty(int hash, String name) throws FHIRException {
2166        switch (hash) {
2167        case -1618432855:  return addIdentifier(); 
2168        case -892481550:  return getStatusElement();
2169        case -1524378035:  return getBillingStatus();
2170        case 3575610:  return getType();
2171        case 3373707:  return getNameElement();
2172        case -1867885268:  return addSubject(); 
2173        case 2129104086:  return getServicePeriod();
2174        case -351767064:  return addCoverage(); 
2175        case 106164915:  return getOwner();
2176        case -1724546052:  return getDescriptionElement();
2177        case -188629045:  return addGuarantor(); 
2178        case 962039682:  return addRelatedAccount(); 
2179        case 575402001:  return getCurrency();
2180        case -339185956:  return addBalance(); 
2181        case 1089469073:  return getCalculatedAtElement();
2182        default: return super.makeProperty(hash, name);
2183        }
2184
2185      }
2186
2187      @Override
2188      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2189        switch (hash) {
2190        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2191        case -892481550: /*status*/ return new String[] {"code"};
2192        case -1524378035: /*billingStatus*/ return new String[] {"CodeableConcept"};
2193        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
2194        case 3373707: /*name*/ return new String[] {"string"};
2195        case -1867885268: /*subject*/ return new String[] {"Reference"};
2196        case 2129104086: /*servicePeriod*/ return new String[] {"Period"};
2197        case -351767064: /*coverage*/ return new String[] {};
2198        case 106164915: /*owner*/ return new String[] {"Reference"};
2199        case -1724546052: /*description*/ return new String[] {"string"};
2200        case -188629045: /*guarantor*/ return new String[] {};
2201        case 962039682: /*relatedAccount*/ return new String[] {};
2202        case 575402001: /*currency*/ return new String[] {"CodeableConcept"};
2203        case -339185956: /*balance*/ return new String[] {};
2204        case 1089469073: /*calculatedAt*/ return new String[] {"instant"};
2205        default: return super.getTypesForProperty(hash, name);
2206        }
2207
2208      }
2209
2210      @Override
2211      public Base addChild(String name) throws FHIRException {
2212        if (name.equals("identifier")) {
2213          return addIdentifier();
2214        }
2215        else if (name.equals("status")) {
2216          throw new FHIRException("Cannot call addChild on a primitive type Account.status");
2217        }
2218        else if (name.equals("billingStatus")) {
2219          this.billingStatus = new CodeableConcept();
2220          return this.billingStatus;
2221        }
2222        else if (name.equals("type")) {
2223          this.type = new CodeableConcept();
2224          return this.type;
2225        }
2226        else if (name.equals("name")) {
2227          throw new FHIRException("Cannot call addChild on a primitive type Account.name");
2228        }
2229        else if (name.equals("subject")) {
2230          return addSubject();
2231        }
2232        else if (name.equals("servicePeriod")) {
2233          this.servicePeriod = new Period();
2234          return this.servicePeriod;
2235        }
2236        else if (name.equals("coverage")) {
2237          return addCoverage();
2238        }
2239        else if (name.equals("owner")) {
2240          this.owner = new Reference();
2241          return this.owner;
2242        }
2243        else if (name.equals("description")) {
2244          throw new FHIRException("Cannot call addChild on a primitive type Account.description");
2245        }
2246        else if (name.equals("guarantor")) {
2247          return addGuarantor();
2248        }
2249        else if (name.equals("relatedAccount")) {
2250          return addRelatedAccount();
2251        }
2252        else if (name.equals("currency")) {
2253          this.currency = new CodeableConcept();
2254          return this.currency;
2255        }
2256        else if (name.equals("balance")) {
2257          return addBalance();
2258        }
2259        else if (name.equals("calculatedAt")) {
2260          throw new FHIRException("Cannot call addChild on a primitive type Account.calculatedAt");
2261        }
2262        else
2263          return super.addChild(name);
2264      }
2265
2266  public String fhirType() {
2267    return "Account";
2268
2269  }
2270
2271      public Account copy() {
2272        Account dst = new Account();
2273        copyValues(dst);
2274        return dst;
2275      }
2276
2277      public void copyValues(Account dst) {
2278        super.copyValues(dst);
2279        if (identifier != null) {
2280          dst.identifier = new ArrayList<Identifier>();
2281          for (Identifier i : identifier)
2282            dst.identifier.add(i.copy());
2283        };
2284        dst.status = status == null ? null : status.copy();
2285        dst.billingStatus = billingStatus == null ? null : billingStatus.copy();
2286        dst.type = type == null ? null : type.copy();
2287        dst.name = name == null ? null : name.copy();
2288        if (subject != null) {
2289          dst.subject = new ArrayList<Reference>();
2290          for (Reference i : subject)
2291            dst.subject.add(i.copy());
2292        };
2293        dst.servicePeriod = servicePeriod == null ? null : servicePeriod.copy();
2294        if (coverage != null) {
2295          dst.coverage = new ArrayList<CoverageComponent>();
2296          for (CoverageComponent i : coverage)
2297            dst.coverage.add(i.copy());
2298        };
2299        dst.owner = owner == null ? null : owner.copy();
2300        dst.description = description == null ? null : description.copy();
2301        if (guarantor != null) {
2302          dst.guarantor = new ArrayList<GuarantorComponent>();
2303          for (GuarantorComponent i : guarantor)
2304            dst.guarantor.add(i.copy());
2305        };
2306        if (relatedAccount != null) {
2307          dst.relatedAccount = new ArrayList<AccountRelatedAccountComponent>();
2308          for (AccountRelatedAccountComponent i : relatedAccount)
2309            dst.relatedAccount.add(i.copy());
2310        };
2311        dst.currency = currency == null ? null : currency.copy();
2312        if (balance != null) {
2313          dst.balance = new ArrayList<AccountBalanceComponent>();
2314          for (AccountBalanceComponent i : balance)
2315            dst.balance.add(i.copy());
2316        };
2317        dst.calculatedAt = calculatedAt == null ? null : calculatedAt.copy();
2318      }
2319
2320      protected Account typedCopy() {
2321        return copy();
2322      }
2323
2324      @Override
2325      public boolean equalsDeep(Base other_) {
2326        if (!super.equalsDeep(other_))
2327          return false;
2328        if (!(other_ instanceof Account))
2329          return false;
2330        Account o = (Account) other_;
2331        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(billingStatus, o.billingStatus, true)
2332           && compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(subject, o.subject, true)
2333           && compareDeep(servicePeriod, o.servicePeriod, true) && compareDeep(coverage, o.coverage, true)
2334           && compareDeep(owner, o.owner, true) && compareDeep(description, o.description, true) && compareDeep(guarantor, o.guarantor, true)
2335           && compareDeep(relatedAccount, o.relatedAccount, true) && compareDeep(currency, o.currency, true)
2336           && compareDeep(balance, o.balance, true) && compareDeep(calculatedAt, o.calculatedAt, true);
2337      }
2338
2339      @Override
2340      public boolean equalsShallow(Base other_) {
2341        if (!super.equalsShallow(other_))
2342          return false;
2343        if (!(other_ instanceof Account))
2344          return false;
2345        Account o = (Account) other_;
2346        return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true)
2347           && compareValues(calculatedAt, o.calculatedAt, true);
2348      }
2349
2350      public boolean isEmpty() {
2351        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, billingStatus
2352          , type, name, subject, servicePeriod, coverage, owner, description, guarantor
2353          , relatedAccount, currency, balance, calculatedAt);
2354      }
2355
2356  @Override
2357  public ResourceType getResourceType() {
2358    return ResourceType.Account;
2359   }
2360
2361 /**
2362   * Search parameter: <b>guarantor</b>
2363   * <p>
2364   * Description: <b>The parties ultimately responsible for balancing the Account</b><br>
2365   * Type: <b>reference</b><br>
2366   * Path: <b>Account.guarantor.party</b><br>
2367   * </p>
2368   */
2369  @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 } )
2370  public static final String SP_GUARANTOR = "guarantor";
2371 /**
2372   * <b>Fluent Client</b> search parameter constant for <b>guarantor</b>
2373   * <p>
2374   * Description: <b>The parties ultimately responsible for balancing the Account</b><br>
2375   * Type: <b>reference</b><br>
2376   * Path: <b>Account.guarantor.party</b><br>
2377   * </p>
2378   */
2379  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GUARANTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GUARANTOR);
2380
2381/**
2382   * Constant for fluent queries to be used to add include statements. Specifies
2383   * the path value of "<b>Account:guarantor</b>".
2384   */
2385  public static final ca.uhn.fhir.model.api.Include INCLUDE_GUARANTOR = new ca.uhn.fhir.model.api.Include("Account:guarantor").toLocked();
2386
2387 /**
2388   * Search parameter: <b>identifier</b>
2389   * <p>
2390   * Description: <b>Account number</b><br>
2391   * Type: <b>token</b><br>
2392   * Path: <b>Account.identifier</b><br>
2393   * </p>
2394   */
2395  @SearchParamDefinition(name="identifier", path="Account.identifier", description="Account number", type="token" )
2396  public static final String SP_IDENTIFIER = "identifier";
2397 /**
2398   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2399   * <p>
2400   * Description: <b>Account number</b><br>
2401   * Type: <b>token</b><br>
2402   * Path: <b>Account.identifier</b><br>
2403   * </p>
2404   */
2405  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2406
2407 /**
2408   * Search parameter: <b>name</b>
2409   * <p>
2410   * Description: <b>Human-readable label</b><br>
2411   * Type: <b>string</b><br>
2412   * Path: <b>Account.name</b><br>
2413   * </p>
2414   */
2415  @SearchParamDefinition(name="name", path="Account.name", description="Human-readable label", type="string" )
2416  public static final String SP_NAME = "name";
2417 /**
2418   * <b>Fluent Client</b> search parameter constant for <b>name</b>
2419   * <p>
2420   * Description: <b>Human-readable label</b><br>
2421   * Type: <b>string</b><br>
2422   * Path: <b>Account.name</b><br>
2423   * </p>
2424   */
2425  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
2426
2427 /**
2428   * Search parameter: <b>owner</b>
2429   * <p>
2430   * Description: <b>Entity managing the Account</b><br>
2431   * Type: <b>reference</b><br>
2432   * Path: <b>Account.owner</b><br>
2433   * </p>
2434   */
2435  @SearchParamDefinition(name="owner", path="Account.owner", description="Entity managing the Account", type="reference", target={Organization.class } )
2436  public static final String SP_OWNER = "owner";
2437 /**
2438   * <b>Fluent Client</b> search parameter constant for <b>owner</b>
2439   * <p>
2440   * Description: <b>Entity managing the Account</b><br>
2441   * Type: <b>reference</b><br>
2442   * Path: <b>Account.owner</b><br>
2443   * </p>
2444   */
2445  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER);
2446
2447/**
2448   * Constant for fluent queries to be used to add include statements. Specifies
2449   * the path value of "<b>Account:owner</b>".
2450   */
2451  public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Account:owner").toLocked();
2452
2453 /**
2454   * Search parameter: <b>patient</b>
2455   * <p>
2456   * Description: <b>The entity that caused the expenses</b><br>
2457   * Type: <b>reference</b><br>
2458   * Path: <b>Account.subject.where(resolve() is Patient)</b><br>
2459   * </p>
2460   */
2461  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient)", description="The entity that caused the expenses", type="reference", target={Patient.class } )
2462  public static final String SP_PATIENT = "patient";
2463 /**
2464   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2465   * <p>
2466   * Description: <b>The entity that caused the expenses</b><br>
2467   * Type: <b>reference</b><br>
2468   * Path: <b>Account.subject.where(resolve() is Patient)</b><br>
2469   * </p>
2470   */
2471  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2472
2473/**
2474   * Constant for fluent queries to be used to add include statements. Specifies
2475   * the path value of "<b>Account:patient</b>".
2476   */
2477  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Account:patient").toLocked();
2478
2479 /**
2480   * Search parameter: <b>period</b>
2481   * <p>
2482   * Description: <b>Transaction window</b><br>
2483   * Type: <b>date</b><br>
2484   * Path: <b>Account.servicePeriod</b><br>
2485   * </p>
2486   */
2487  @SearchParamDefinition(name="period", path="Account.servicePeriod", description="Transaction window", type="date" )
2488  public static final String SP_PERIOD = "period";
2489 /**
2490   * <b>Fluent Client</b> search parameter constant for <b>period</b>
2491   * <p>
2492   * Description: <b>Transaction window</b><br>
2493   * Type: <b>date</b><br>
2494   * Path: <b>Account.servicePeriod</b><br>
2495   * </p>
2496   */
2497  public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD);
2498
2499 /**
2500   * Search parameter: <b>relatedaccount</b>
2501   * <p>
2502   * Description: <b>Parent and other related accounts</b><br>
2503   * Type: <b>reference</b><br>
2504   * Path: <b>Account.relatedAccount.account</b><br>
2505   * </p>
2506   */
2507  @SearchParamDefinition(name="relatedaccount", path="Account.relatedAccount.account", description="Parent and other related accounts", type="reference", target={Account.class } )
2508  public static final String SP_RELATEDACCOUNT = "relatedaccount";
2509 /**
2510   * <b>Fluent Client</b> search parameter constant for <b>relatedaccount</b>
2511   * <p>
2512   * Description: <b>Parent and other related accounts</b><br>
2513   * Type: <b>reference</b><br>
2514   * Path: <b>Account.relatedAccount.account</b><br>
2515   * </p>
2516   */
2517  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDACCOUNT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDACCOUNT);
2518
2519/**
2520   * Constant for fluent queries to be used to add include statements. Specifies
2521   * the path value of "<b>Account:relatedaccount</b>".
2522   */
2523  public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDACCOUNT = new ca.uhn.fhir.model.api.Include("Account:relatedaccount").toLocked();
2524
2525 /**
2526   * Search parameter: <b>status</b>
2527   * <p>
2528   * Description: <b>active | inactive | entered-in-error | on-hold | unknown</b><br>
2529   * Type: <b>token</b><br>
2530   * Path: <b>Account.status</b><br>
2531   * </p>
2532   */
2533  @SearchParamDefinition(name="status", path="Account.status", description="active | inactive | entered-in-error | on-hold | unknown", type="token" )
2534  public static final String SP_STATUS = "status";
2535 /**
2536   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2537   * <p>
2538   * Description: <b>active | inactive | entered-in-error | on-hold | unknown</b><br>
2539   * Type: <b>token</b><br>
2540   * Path: <b>Account.status</b><br>
2541   * </p>
2542   */
2543  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2544
2545 /**
2546   * Search parameter: <b>subject</b>
2547   * <p>
2548   * Description: <b>The entity that caused the expenses</b><br>
2549   * Type: <b>reference</b><br>
2550   * Path: <b>Account.subject</b><br>
2551   * </p>
2552   */
2553  @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 } )
2554  public static final String SP_SUBJECT = "subject";
2555 /**
2556   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2557   * <p>
2558   * Description: <b>The entity that caused the expenses</b><br>
2559   * Type: <b>reference</b><br>
2560   * Path: <b>Account.subject</b><br>
2561   * </p>
2562   */
2563  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2564
2565/**
2566   * Constant for fluent queries to be used to add include statements. Specifies
2567   * the path value of "<b>Account:subject</b>".
2568   */
2569  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Account:subject").toLocked();
2570
2571 /**
2572   * Search parameter: <b>type</b>
2573   * <p>
2574   * Description: <b>E.g. patient, expense, depreciation</b><br>
2575   * Type: <b>token</b><br>
2576   * Path: <b>Account.type</b><br>
2577   * </p>
2578   */
2579  @SearchParamDefinition(name="type", path="Account.type", description="E.g. patient, expense, depreciation", type="token" )
2580  public static final String SP_TYPE = "type";
2581 /**
2582   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2583   * <p>
2584   * Description: <b>E.g. patient, expense, depreciation</b><br>
2585   * Type: <b>token</b><br>
2586   * Path: <b>Account.type</b><br>
2587   * </p>
2588   */
2589  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2590
2591
2592}