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