001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.
052 */
053@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare")
054public class EpisodeOfCare extends DomainResource {
055
056    public enum EpisodeOfCareStatus {
057        /**
058         * This episode of care is planned to start at the date specified in the period.start. During this status, an organization may perform assessments to determine if the patient is eligible to receive services, or be organizing to make resources available to provide care services.
059         */
060        PLANNED, 
061        /**
062         * This episode has been placed on a waitlist, pending the episode being made active (or cancelled).
063         */
064        WAITLIST, 
065        /**
066         * This episode of care is current.
067         */
068        ACTIVE, 
069        /**
070         * This episode of care is on hold; the organization has limited responsibility for the patient (such as while on respite).
071         */
072        ONHOLD, 
073        /**
074         * This episode of care is finished and the organization is not expecting to be providing further care to the patient. Can also be known as \"closed\", \"completed\" or other similar terms.
075         */
076        FINISHED, 
077        /**
078         * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow.
079         */
080        CANCELLED, 
081        /**
082         * This instance should not have been part of this patient's medical record.
083         */
084        ENTEREDINERROR, 
085        /**
086         * added to help the parsers with the generic types
087         */
088        NULL;
089        public static EpisodeOfCareStatus fromCode(String codeString) throws FHIRException {
090            if (codeString == null || "".equals(codeString))
091                return null;
092        if ("planned".equals(codeString))
093          return PLANNED;
094        if ("waitlist".equals(codeString))
095          return WAITLIST;
096        if ("active".equals(codeString))
097          return ACTIVE;
098        if ("onhold".equals(codeString))
099          return ONHOLD;
100        if ("finished".equals(codeString))
101          return FINISHED;
102        if ("cancelled".equals(codeString))
103          return CANCELLED;
104        if ("entered-in-error".equals(codeString))
105          return ENTEREDINERROR;
106        if (Configuration.isAcceptInvalidEnums())
107          return null;
108        else
109          throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'");
110        }
111        public String toCode() {
112          switch (this) {
113            case PLANNED: return "planned";
114            case WAITLIST: return "waitlist";
115            case ACTIVE: return "active";
116            case ONHOLD: return "onhold";
117            case FINISHED: return "finished";
118            case CANCELLED: return "cancelled";
119            case ENTEREDINERROR: return "entered-in-error";
120            case NULL: return null;
121            default: return "?";
122          }
123        }
124        public String getSystem() {
125          switch (this) {
126            case PLANNED: return "http://hl7.org/fhir/episode-of-care-status";
127            case WAITLIST: return "http://hl7.org/fhir/episode-of-care-status";
128            case ACTIVE: return "http://hl7.org/fhir/episode-of-care-status";
129            case ONHOLD: return "http://hl7.org/fhir/episode-of-care-status";
130            case FINISHED: return "http://hl7.org/fhir/episode-of-care-status";
131            case CANCELLED: return "http://hl7.org/fhir/episode-of-care-status";
132            case ENTEREDINERROR: return "http://hl7.org/fhir/episode-of-care-status";
133            case NULL: return null;
134            default: return "?";
135          }
136        }
137        public String getDefinition() {
138          switch (this) {
139            case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status, an organization may perform assessments to determine if the patient is eligible to receive services, or be organizing to make resources available to provide care services.";
140            case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled).";
141            case ACTIVE: return "This episode of care is current.";
142            case ONHOLD: return "This episode of care is on hold; the organization has limited responsibility for the patient (such as while on respite).";
143            case FINISHED: return "This episode of care is finished and the organization is not expecting to be providing further care to the patient. Can also be known as \"closed\", \"completed\" or other similar terms.";
144            case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow.";
145            case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record.";
146            case NULL: return null;
147            default: return "?";
148          }
149        }
150        public String getDisplay() {
151          switch (this) {
152            case PLANNED: return "Planned";
153            case WAITLIST: return "Waitlist";
154            case ACTIVE: return "Active";
155            case ONHOLD: return "On Hold";
156            case FINISHED: return "Finished";
157            case CANCELLED: return "Cancelled";
158            case ENTEREDINERROR: return "Entered in Error";
159            case NULL: return null;
160            default: return "?";
161          }
162        }
163    }
164
165  public static class EpisodeOfCareStatusEnumFactory implements EnumFactory<EpisodeOfCareStatus> {
166    public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException {
167      if (codeString == null || "".equals(codeString))
168            if (codeString == null || "".equals(codeString))
169                return null;
170        if ("planned".equals(codeString))
171          return EpisodeOfCareStatus.PLANNED;
172        if ("waitlist".equals(codeString))
173          return EpisodeOfCareStatus.WAITLIST;
174        if ("active".equals(codeString))
175          return EpisodeOfCareStatus.ACTIVE;
176        if ("onhold".equals(codeString))
177          return EpisodeOfCareStatus.ONHOLD;
178        if ("finished".equals(codeString))
179          return EpisodeOfCareStatus.FINISHED;
180        if ("cancelled".equals(codeString))
181          return EpisodeOfCareStatus.CANCELLED;
182        if ("entered-in-error".equals(codeString))
183          return EpisodeOfCareStatus.ENTEREDINERROR;
184        throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'");
185        }
186        public Enumeration<EpisodeOfCareStatus> fromType(PrimitiveType<?> code) throws FHIRException {
187          if (code == null)
188            return null;
189          if (code.isEmpty())
190            return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.NULL, code);
191          String codeString = ((PrimitiveType) code).asStringValue();
192          if (codeString == null || "".equals(codeString))
193            return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.NULL, code);
194        if ("planned".equals(codeString))
195          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.PLANNED, code);
196        if ("waitlist".equals(codeString))
197          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.WAITLIST, code);
198        if ("active".equals(codeString))
199          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ACTIVE, code);
200        if ("onhold".equals(codeString))
201          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ONHOLD, code);
202        if ("finished".equals(codeString))
203          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.FINISHED, code);
204        if ("cancelled".equals(codeString))
205          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.CANCELLED, code);
206        if ("entered-in-error".equals(codeString))
207          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ENTEREDINERROR, code);
208        throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'");
209        }
210    public String toCode(EpisodeOfCareStatus code) {
211      if (code == EpisodeOfCareStatus.PLANNED)
212        return "planned";
213      if (code == EpisodeOfCareStatus.WAITLIST)
214        return "waitlist";
215      if (code == EpisodeOfCareStatus.ACTIVE)
216        return "active";
217      if (code == EpisodeOfCareStatus.ONHOLD)
218        return "onhold";
219      if (code == EpisodeOfCareStatus.FINISHED)
220        return "finished";
221      if (code == EpisodeOfCareStatus.CANCELLED)
222        return "cancelled";
223      if (code == EpisodeOfCareStatus.ENTEREDINERROR)
224        return "entered-in-error";
225      return "?";
226      }
227    public String toSystem(EpisodeOfCareStatus code) {
228      return code.getSystem();
229      }
230    }
231
232    @Block()
233    public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement {
234        /**
235         * planned | waitlist | active | onhold | finished | cancelled.
236         */
237        @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
238        @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled | entered-in-error", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." )
239        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episode-of-care-status")
240        protected Enumeration<EpisodeOfCareStatus> status;
241
242        /**
243         * The period during this EpisodeOfCare that the specific status applied.
244         */
245        @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false)
246        @Description(shortDefinition="Duration the EpisodeOfCare was in the specified status", formalDefinition="The period during this EpisodeOfCare that the specific status applied." )
247        protected Period period;
248
249        private static final long serialVersionUID = -1192432864L;
250
251    /**
252     * Constructor
253     */
254      public EpisodeOfCareStatusHistoryComponent() {
255        super();
256      }
257
258    /**
259     * Constructor
260     */
261      public EpisodeOfCareStatusHistoryComponent(EpisodeOfCareStatus status, Period period) {
262        super();
263        this.setStatus(status);
264        this.setPeriod(period);
265      }
266
267        /**
268         * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
269         */
270        public Enumeration<EpisodeOfCareStatus> getStatusElement() { 
271          if (this.status == null)
272            if (Configuration.errorOnAutoCreate())
273              throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.status");
274            else if (Configuration.doAutoCreate())
275              this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); // bb
276          return this.status;
277        }
278
279        public boolean hasStatusElement() { 
280          return this.status != null && !this.status.isEmpty();
281        }
282
283        public boolean hasStatus() { 
284          return this.status != null && !this.status.isEmpty();
285        }
286
287        /**
288         * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
289         */
290        public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration<EpisodeOfCareStatus> value) { 
291          this.status = value;
292          return this;
293        }
294
295        /**
296         * @return planned | waitlist | active | onhold | finished | cancelled.
297         */
298        public EpisodeOfCareStatus getStatus() { 
299          return this.status == null ? null : this.status.getValue();
300        }
301
302        /**
303         * @param value planned | waitlist | active | onhold | finished | cancelled.
304         */
305        public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { 
306            if (this.status == null)
307              this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory());
308            this.status.setValue(value);
309          return this;
310        }
311
312        /**
313         * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.)
314         */
315        public Period getPeriod() { 
316          if (this.period == null)
317            if (Configuration.errorOnAutoCreate())
318              throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period");
319            else if (Configuration.doAutoCreate())
320              this.period = new Period(); // cc
321          return this.period;
322        }
323
324        public boolean hasPeriod() { 
325          return this.period != null && !this.period.isEmpty();
326        }
327
328        /**
329         * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.)
330         */
331        public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { 
332          this.period = value;
333          return this;
334        }
335
336        protected void listChildren(List<Property> children) {
337          super.listChildren(children);
338          children.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status));
339          children.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, 1, period));
340        }
341
342        @Override
343        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
344          switch (_hash) {
345          case -892481550: /*status*/  return new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status);
346          case -991726143: /*period*/  return new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, 1, period);
347          default: return super.getNamedProperty(_hash, _name, _checkValid);
348          }
349
350        }
351
352      @Override
353      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
354        switch (hash) {
355        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EpisodeOfCareStatus>
356        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
357        default: return super.getProperty(hash, name, checkValid);
358        }
359
360      }
361
362      @Override
363      public Base setProperty(int hash, String name, Base value) throws FHIRException {
364        switch (hash) {
365        case -892481550: // status
366          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
367          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
368          return value;
369        case -991726143: // period
370          this.period = TypeConvertor.castToPeriod(value); // Period
371          return value;
372        default: return super.setProperty(hash, name, value);
373        }
374
375      }
376
377      @Override
378      public Base setProperty(String name, Base value) throws FHIRException {
379        if (name.equals("status")) {
380          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
381          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
382        } else if (name.equals("period")) {
383          this.period = TypeConvertor.castToPeriod(value); // Period
384        } else
385          return super.setProperty(name, value);
386        return value;
387      }
388
389      @Override
390      public Base makeProperty(int hash, String name) throws FHIRException {
391        switch (hash) {
392        case -892481550:  return getStatusElement();
393        case -991726143:  return getPeriod();
394        default: return super.makeProperty(hash, name);
395        }
396
397      }
398
399      @Override
400      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
401        switch (hash) {
402        case -892481550: /*status*/ return new String[] {"code"};
403        case -991726143: /*period*/ return new String[] {"Period"};
404        default: return super.getTypesForProperty(hash, name);
405        }
406
407      }
408
409      @Override
410      public Base addChild(String name) throws FHIRException {
411        if (name.equals("status")) {
412          throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.statusHistory.status");
413        }
414        else if (name.equals("period")) {
415          this.period = new Period();
416          return this.period;
417        }
418        else
419          return super.addChild(name);
420      }
421
422      public EpisodeOfCareStatusHistoryComponent copy() {
423        EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent();
424        copyValues(dst);
425        return dst;
426      }
427
428      public void copyValues(EpisodeOfCareStatusHistoryComponent dst) {
429        super.copyValues(dst);
430        dst.status = status == null ? null : status.copy();
431        dst.period = period == null ? null : period.copy();
432      }
433
434      @Override
435      public boolean equalsDeep(Base other_) {
436        if (!super.equalsDeep(other_))
437          return false;
438        if (!(other_ instanceof EpisodeOfCareStatusHistoryComponent))
439          return false;
440        EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other_;
441        return compareDeep(status, o.status, true) && compareDeep(period, o.period, true);
442      }
443
444      @Override
445      public boolean equalsShallow(Base other_) {
446        if (!super.equalsShallow(other_))
447          return false;
448        if (!(other_ instanceof EpisodeOfCareStatusHistoryComponent))
449          return false;
450        EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other_;
451        return compareValues(status, o.status, true);
452      }
453
454      public boolean isEmpty() {
455        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(status, period);
456      }
457
458  public String fhirType() {
459    return "EpisodeOfCare.statusHistory";
460
461  }
462
463  }
464
465    @Block()
466    public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement {
467        /**
468         * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.
469         */
470        @Child(name = "condition", type = {CodeableReference.class}, order=1, min=1, max=1, modifier=false, summary=true)
471        @Description(shortDefinition="Conditions/problems/diagnoses this episode of care is for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." )
472        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
473        protected CodeableReference condition;
474
475        /**
476         * Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).
477         */
478        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
479        @Description(shortDefinition="Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …)", formalDefinition="Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …)." )
480        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnosis-role")
481        protected CodeableConcept role;
482
483        /**
484         * Ranking of the diagnosis (for each role type).
485         */
486        @Child(name = "rank", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true)
487        @Description(shortDefinition="Ranking of the diagnosis (for each role type)", formalDefinition="Ranking of the diagnosis (for each role type)." )
488        protected PositiveIntType rank;
489
490        private static final long serialVersionUID = 1545153316L;
491
492    /**
493     * Constructor
494     */
495      public DiagnosisComponent() {
496        super();
497      }
498
499    /**
500     * Constructor
501     */
502      public DiagnosisComponent(CodeableReference condition) {
503        super();
504        this.setCondition(condition);
505      }
506
507        /**
508         * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.)
509         */
510        public CodeableReference getCondition() { 
511          if (this.condition == null)
512            if (Configuration.errorOnAutoCreate())
513              throw new Error("Attempt to auto-create DiagnosisComponent.condition");
514            else if (Configuration.doAutoCreate())
515              this.condition = new CodeableReference(); // cc
516          return this.condition;
517        }
518
519        public boolean hasCondition() { 
520          return this.condition != null && !this.condition.isEmpty();
521        }
522
523        /**
524         * @param value {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.)
525         */
526        public DiagnosisComponent setCondition(CodeableReference value) { 
527          this.condition = value;
528          return this;
529        }
530
531        /**
532         * @return {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).)
533         */
534        public CodeableConcept getRole() { 
535          if (this.role == null)
536            if (Configuration.errorOnAutoCreate())
537              throw new Error("Attempt to auto-create DiagnosisComponent.role");
538            else if (Configuration.doAutoCreate())
539              this.role = new CodeableConcept(); // cc
540          return this.role;
541        }
542
543        public boolean hasRole() { 
544          return this.role != null && !this.role.isEmpty();
545        }
546
547        /**
548         * @param value {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).)
549         */
550        public DiagnosisComponent setRole(CodeableConcept value) { 
551          this.role = value;
552          return this;
553        }
554
555        /**
556         * @return {@link #rank} (Ranking of the diagnosis (for each role type).). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value
557         */
558        public PositiveIntType getRankElement() { 
559          if (this.rank == null)
560            if (Configuration.errorOnAutoCreate())
561              throw new Error("Attempt to auto-create DiagnosisComponent.rank");
562            else if (Configuration.doAutoCreate())
563              this.rank = new PositiveIntType(); // bb
564          return this.rank;
565        }
566
567        public boolean hasRankElement() { 
568          return this.rank != null && !this.rank.isEmpty();
569        }
570
571        public boolean hasRank() { 
572          return this.rank != null && !this.rank.isEmpty();
573        }
574
575        /**
576         * @param value {@link #rank} (Ranking of the diagnosis (for each role type).). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value
577         */
578        public DiagnosisComponent setRankElement(PositiveIntType value) { 
579          this.rank = value;
580          return this;
581        }
582
583        /**
584         * @return Ranking of the diagnosis (for each role type).
585         */
586        public int getRank() { 
587          return this.rank == null || this.rank.isEmpty() ? 0 : this.rank.getValue();
588        }
589
590        /**
591         * @param value Ranking of the diagnosis (for each role type).
592         */
593        public DiagnosisComponent setRank(int value) { 
594            if (this.rank == null)
595              this.rank = new PositiveIntType();
596            this.rank.setValue(value);
597          return this;
598        }
599
600        protected void listChildren(List<Property> children) {
601          super.listChildren(children);
602          children.add(new Property("condition", "CodeableReference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition));
603          children.add(new Property("role", "CodeableConcept", "Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).", 0, 1, role));
604          children.add(new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank));
605        }
606
607        @Override
608        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
609          switch (_hash) {
610          case -861311717: /*condition*/  return new Property("condition", "CodeableReference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition);
611          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).", 0, 1, role);
612          case 3492908: /*rank*/  return new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank);
613          default: return super.getNamedProperty(_hash, _name, _checkValid);
614          }
615
616        }
617
618      @Override
619      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
620        switch (hash) {
621        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // CodeableReference
622        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
623        case 3492908: /*rank*/ return this.rank == null ? new Base[0] : new Base[] {this.rank}; // PositiveIntType
624        default: return super.getProperty(hash, name, checkValid);
625        }
626
627      }
628
629      @Override
630      public Base setProperty(int hash, String name, Base value) throws FHIRException {
631        switch (hash) {
632        case -861311717: // condition
633          this.condition = TypeConvertor.castToCodeableReference(value); // CodeableReference
634          return value;
635        case 3506294: // role
636          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
637          return value;
638        case 3492908: // rank
639          this.rank = TypeConvertor.castToPositiveInt(value); // PositiveIntType
640          return value;
641        default: return super.setProperty(hash, name, value);
642        }
643
644      }
645
646      @Override
647      public Base setProperty(String name, Base value) throws FHIRException {
648        if (name.equals("condition")) {
649          this.condition = TypeConvertor.castToCodeableReference(value); // CodeableReference
650        } else if (name.equals("role")) {
651          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
652        } else if (name.equals("rank")) {
653          this.rank = TypeConvertor.castToPositiveInt(value); // PositiveIntType
654        } else
655          return super.setProperty(name, value);
656        return value;
657      }
658
659      @Override
660      public Base makeProperty(int hash, String name) throws FHIRException {
661        switch (hash) {
662        case -861311717:  return getCondition();
663        case 3506294:  return getRole();
664        case 3492908:  return getRankElement();
665        default: return super.makeProperty(hash, name);
666        }
667
668      }
669
670      @Override
671      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
672        switch (hash) {
673        case -861311717: /*condition*/ return new String[] {"CodeableReference"};
674        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
675        case 3492908: /*rank*/ return new String[] {"positiveInt"};
676        default: return super.getTypesForProperty(hash, name);
677        }
678
679      }
680
681      @Override
682      public Base addChild(String name) throws FHIRException {
683        if (name.equals("condition")) {
684          this.condition = new CodeableReference();
685          return this.condition;
686        }
687        else if (name.equals("role")) {
688          this.role = new CodeableConcept();
689          return this.role;
690        }
691        else if (name.equals("rank")) {
692          throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.diagnosis.rank");
693        }
694        else
695          return super.addChild(name);
696      }
697
698      public DiagnosisComponent copy() {
699        DiagnosisComponent dst = new DiagnosisComponent();
700        copyValues(dst);
701        return dst;
702      }
703
704      public void copyValues(DiagnosisComponent dst) {
705        super.copyValues(dst);
706        dst.condition = condition == null ? null : condition.copy();
707        dst.role = role == null ? null : role.copy();
708        dst.rank = rank == null ? null : rank.copy();
709      }
710
711      @Override
712      public boolean equalsDeep(Base other_) {
713        if (!super.equalsDeep(other_))
714          return false;
715        if (!(other_ instanceof DiagnosisComponent))
716          return false;
717        DiagnosisComponent o = (DiagnosisComponent) other_;
718        return compareDeep(condition, o.condition, true) && compareDeep(role, o.role, true) && compareDeep(rank, o.rank, true)
719          ;
720      }
721
722      @Override
723      public boolean equalsShallow(Base other_) {
724        if (!super.equalsShallow(other_))
725          return false;
726        if (!(other_ instanceof DiagnosisComponent))
727          return false;
728        DiagnosisComponent o = (DiagnosisComponent) other_;
729        return compareValues(rank, o.rank, true);
730      }
731
732      public boolean isEmpty() {
733        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(condition, role, rank);
734      }
735
736  public String fhirType() {
737    return "EpisodeOfCare.diagnosis";
738
739  }
740
741  }
742
743    /**
744     * The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.
745     */
746    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
747    @Description(shortDefinition="Business Identifier(s) relevant for this EpisodeOfCare", formalDefinition="The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes." )
748    protected List<Identifier> identifier;
749
750    /**
751     * planned | waitlist | active | onhold | finished | cancelled.
752     */
753    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
754    @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled | entered-in-error", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." )
755    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episode-of-care-status")
756    protected Enumeration<EpisodeOfCareStatus> status;
757
758    /**
759     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).
760     */
761    @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
762    @Description(shortDefinition="Past list of status codes (the current status may be included to cover the start date of the status)", formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)." )
763    protected List<EpisodeOfCareStatusHistoryComponent> statusHistory;
764
765    /**
766     * A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.
767     */
768    @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
769    @Description(shortDefinition="Type/class  - e.g. specialist referral, disease management", formalDefinition="A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care." )
770    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episodeofcare-type")
771    protected List<CodeableConcept> type;
772
773    /**
774     * The list of diagnosis relevant to this episode of care.
775     */
776    @Child(name = "diagnosis", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
777    @Description(shortDefinition="The list of diagnosis relevant to this episode of care", formalDefinition="The list of diagnosis relevant to this episode of care." )
778    protected List<DiagnosisComponent> diagnosis;
779
780    /**
781     * The patient who is the focus of this episode of care.
782     */
783    @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true)
784    @Description(shortDefinition="The patient who is the focus of this episode of care", formalDefinition="The patient who is the focus of this episode of care." )
785    protected Reference patient;
786
787    /**
788     * The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration.
789     */
790    @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
791    @Description(shortDefinition="Organization that assumes responsibility for care coordination", formalDefinition="The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration." )
792    protected Reference managingOrganization;
793
794    /**
795     * The interval during which the managing organization assumes the defined responsibility.
796     */
797    @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
798    @Description(shortDefinition="Interval during responsibility is assumed", formalDefinition="The interval during which the managing organization assumes the defined responsibility." )
799    protected Period period;
800
801    /**
802     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.
803     */
804    @Child(name = "referralRequest", type = {ServiceRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
805    @Description(shortDefinition="Originating Referral Request(s)", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." )
806    protected List<Reference> referralRequest;
807
808    /**
809     * The practitioner that is the care manager/care coordinator for this patient.
810     */
811    @Child(name = "careManager", type = {Practitioner.class, PractitionerRole.class}, order=9, min=0, max=1, modifier=false, summary=false)
812    @Description(shortDefinition="Care manager/care coordinator for the patient", formalDefinition="The practitioner that is the care manager/care coordinator for this patient." )
813    protected Reference careManager;
814
815    /**
816     * The list of practitioners that may be facilitating this episode of care for specific purposes.
817     */
818    @Child(name = "careTeam", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
819    @Description(shortDefinition="Other practitioners facilitating this episode of care", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." )
820    protected List<Reference> careTeam;
821
822    /**
823     * The set of accounts that may be used for billing for this EpisodeOfCare.
824     */
825    @Child(name = "account", type = {Account.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
826    @Description(shortDefinition="The set of accounts that may be used for billing for this EpisodeOfCare", formalDefinition="The set of accounts that may be used for billing for this EpisodeOfCare." )
827    protected List<Reference> account;
828
829    private static final long serialVersionUID = -542167503L;
830
831  /**
832   * Constructor
833   */
834    public EpisodeOfCare() {
835      super();
836    }
837
838  /**
839   * Constructor
840   */
841    public EpisodeOfCare(EpisodeOfCareStatus status, Reference patient) {
842      super();
843      this.setStatus(status);
844      this.setPatient(patient);
845    }
846
847    /**
848     * @return {@link #identifier} (The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.)
849     */
850    public List<Identifier> getIdentifier() { 
851      if (this.identifier == null)
852        this.identifier = new ArrayList<Identifier>();
853      return this.identifier;
854    }
855
856    /**
857     * @return Returns a reference to <code>this</code> for easy method chaining
858     */
859    public EpisodeOfCare setIdentifier(List<Identifier> theIdentifier) { 
860      this.identifier = theIdentifier;
861      return this;
862    }
863
864    public boolean hasIdentifier() { 
865      if (this.identifier == null)
866        return false;
867      for (Identifier item : this.identifier)
868        if (!item.isEmpty())
869          return true;
870      return false;
871    }
872
873    public Identifier addIdentifier() { //3
874      Identifier t = new Identifier();
875      if (this.identifier == null)
876        this.identifier = new ArrayList<Identifier>();
877      this.identifier.add(t);
878      return t;
879    }
880
881    public EpisodeOfCare addIdentifier(Identifier t) { //3
882      if (t == null)
883        return this;
884      if (this.identifier == null)
885        this.identifier = new ArrayList<Identifier>();
886      this.identifier.add(t);
887      return this;
888    }
889
890    /**
891     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
892     */
893    public Identifier getIdentifierFirstRep() { 
894      if (getIdentifier().isEmpty()) {
895        addIdentifier();
896      }
897      return getIdentifier().get(0);
898    }
899
900    /**
901     * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
902     */
903    public Enumeration<EpisodeOfCareStatus> getStatusElement() { 
904      if (this.status == null)
905        if (Configuration.errorOnAutoCreate())
906          throw new Error("Attempt to auto-create EpisodeOfCare.status");
907        else if (Configuration.doAutoCreate())
908          this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); // bb
909      return this.status;
910    }
911
912    public boolean hasStatusElement() { 
913      return this.status != null && !this.status.isEmpty();
914    }
915
916    public boolean hasStatus() { 
917      return this.status != null && !this.status.isEmpty();
918    }
919
920    /**
921     * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
922     */
923    public EpisodeOfCare setStatusElement(Enumeration<EpisodeOfCareStatus> value) { 
924      this.status = value;
925      return this;
926    }
927
928    /**
929     * @return planned | waitlist | active | onhold | finished | cancelled.
930     */
931    public EpisodeOfCareStatus getStatus() { 
932      return this.status == null ? null : this.status.getValue();
933    }
934
935    /**
936     * @param value planned | waitlist | active | onhold | finished | cancelled.
937     */
938    public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { 
939        if (this.status == null)
940          this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory());
941        this.status.setValue(value);
942      return this;
943    }
944
945    /**
946     * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).)
947     */
948    public List<EpisodeOfCareStatusHistoryComponent> getStatusHistory() { 
949      if (this.statusHistory == null)
950        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
951      return this.statusHistory;
952    }
953
954    /**
955     * @return Returns a reference to <code>this</code> for easy method chaining
956     */
957    public EpisodeOfCare setStatusHistory(List<EpisodeOfCareStatusHistoryComponent> theStatusHistory) { 
958      this.statusHistory = theStatusHistory;
959      return this;
960    }
961
962    public boolean hasStatusHistory() { 
963      if (this.statusHistory == null)
964        return false;
965      for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory)
966        if (!item.isEmpty())
967          return true;
968      return false;
969    }
970
971    public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3
972      EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent();
973      if (this.statusHistory == null)
974        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
975      this.statusHistory.add(t);
976      return t;
977    }
978
979    public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3
980      if (t == null)
981        return this;
982      if (this.statusHistory == null)
983        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
984      this.statusHistory.add(t);
985      return this;
986    }
987
988    /**
989     * @return The first repetition of repeating field {@link #statusHistory}, creating it if it does not already exist {3}
990     */
991    public EpisodeOfCareStatusHistoryComponent getStatusHistoryFirstRep() { 
992      if (getStatusHistory().isEmpty()) {
993        addStatusHistory();
994      }
995      return getStatusHistory().get(0);
996    }
997
998    /**
999     * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.)
1000     */
1001    public List<CodeableConcept> getType() { 
1002      if (this.type == null)
1003        this.type = new ArrayList<CodeableConcept>();
1004      return this.type;
1005    }
1006
1007    /**
1008     * @return Returns a reference to <code>this</code> for easy method chaining
1009     */
1010    public EpisodeOfCare setType(List<CodeableConcept> theType) { 
1011      this.type = theType;
1012      return this;
1013    }
1014
1015    public boolean hasType() { 
1016      if (this.type == null)
1017        return false;
1018      for (CodeableConcept item : this.type)
1019        if (!item.isEmpty())
1020          return true;
1021      return false;
1022    }
1023
1024    public CodeableConcept addType() { //3
1025      CodeableConcept t = new CodeableConcept();
1026      if (this.type == null)
1027        this.type = new ArrayList<CodeableConcept>();
1028      this.type.add(t);
1029      return t;
1030    }
1031
1032    public EpisodeOfCare addType(CodeableConcept t) { //3
1033      if (t == null)
1034        return this;
1035      if (this.type == null)
1036        this.type = new ArrayList<CodeableConcept>();
1037      this.type.add(t);
1038      return this;
1039    }
1040
1041    /**
1042     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
1043     */
1044    public CodeableConcept getTypeFirstRep() { 
1045      if (getType().isEmpty()) {
1046        addType();
1047      }
1048      return getType().get(0);
1049    }
1050
1051    /**
1052     * @return {@link #diagnosis} (The list of diagnosis relevant to this episode of care.)
1053     */
1054    public List<DiagnosisComponent> getDiagnosis() { 
1055      if (this.diagnosis == null)
1056        this.diagnosis = new ArrayList<DiagnosisComponent>();
1057      return this.diagnosis;
1058    }
1059
1060    /**
1061     * @return Returns a reference to <code>this</code> for easy method chaining
1062     */
1063    public EpisodeOfCare setDiagnosis(List<DiagnosisComponent> theDiagnosis) { 
1064      this.diagnosis = theDiagnosis;
1065      return this;
1066    }
1067
1068    public boolean hasDiagnosis() { 
1069      if (this.diagnosis == null)
1070        return false;
1071      for (DiagnosisComponent item : this.diagnosis)
1072        if (!item.isEmpty())
1073          return true;
1074      return false;
1075    }
1076
1077    public DiagnosisComponent addDiagnosis() { //3
1078      DiagnosisComponent t = new DiagnosisComponent();
1079      if (this.diagnosis == null)
1080        this.diagnosis = new ArrayList<DiagnosisComponent>();
1081      this.diagnosis.add(t);
1082      return t;
1083    }
1084
1085    public EpisodeOfCare addDiagnosis(DiagnosisComponent t) { //3
1086      if (t == null)
1087        return this;
1088      if (this.diagnosis == null)
1089        this.diagnosis = new ArrayList<DiagnosisComponent>();
1090      this.diagnosis.add(t);
1091      return this;
1092    }
1093
1094    /**
1095     * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist {3}
1096     */
1097    public DiagnosisComponent getDiagnosisFirstRep() { 
1098      if (getDiagnosis().isEmpty()) {
1099        addDiagnosis();
1100      }
1101      return getDiagnosis().get(0);
1102    }
1103
1104    /**
1105     * @return {@link #patient} (The patient who is the focus of this episode of care.)
1106     */
1107    public Reference getPatient() { 
1108      if (this.patient == null)
1109        if (Configuration.errorOnAutoCreate())
1110          throw new Error("Attempt to auto-create EpisodeOfCare.patient");
1111        else if (Configuration.doAutoCreate())
1112          this.patient = new Reference(); // cc
1113      return this.patient;
1114    }
1115
1116    public boolean hasPatient() { 
1117      return this.patient != null && !this.patient.isEmpty();
1118    }
1119
1120    /**
1121     * @param value {@link #patient} (The patient who is the focus of this episode of care.)
1122     */
1123    public EpisodeOfCare setPatient(Reference value) { 
1124      this.patient = value;
1125      return this;
1126    }
1127
1128    /**
1129     * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration.)
1130     */
1131    public Reference getManagingOrganization() { 
1132      if (this.managingOrganization == null)
1133        if (Configuration.errorOnAutoCreate())
1134          throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization");
1135        else if (Configuration.doAutoCreate())
1136          this.managingOrganization = new Reference(); // cc
1137      return this.managingOrganization;
1138    }
1139
1140    public boolean hasManagingOrganization() { 
1141      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
1142    }
1143
1144    /**
1145     * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration.)
1146     */
1147    public EpisodeOfCare setManagingOrganization(Reference value) { 
1148      this.managingOrganization = value;
1149      return this;
1150    }
1151
1152    /**
1153     * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.)
1154     */
1155    public Period getPeriod() { 
1156      if (this.period == null)
1157        if (Configuration.errorOnAutoCreate())
1158          throw new Error("Attempt to auto-create EpisodeOfCare.period");
1159        else if (Configuration.doAutoCreate())
1160          this.period = new Period(); // cc
1161      return this.period;
1162    }
1163
1164    public boolean hasPeriod() { 
1165      return this.period != null && !this.period.isEmpty();
1166    }
1167
1168    /**
1169     * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.)
1170     */
1171    public EpisodeOfCare setPeriod(Period value) { 
1172      this.period = value;
1173      return this;
1174    }
1175
1176    /**
1177     * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.)
1178     */
1179    public List<Reference> getReferralRequest() { 
1180      if (this.referralRequest == null)
1181        this.referralRequest = new ArrayList<Reference>();
1182      return this.referralRequest;
1183    }
1184
1185    /**
1186     * @return Returns a reference to <code>this</code> for easy method chaining
1187     */
1188    public EpisodeOfCare setReferralRequest(List<Reference> theReferralRequest) { 
1189      this.referralRequest = theReferralRequest;
1190      return this;
1191    }
1192
1193    public boolean hasReferralRequest() { 
1194      if (this.referralRequest == null)
1195        return false;
1196      for (Reference item : this.referralRequest)
1197        if (!item.isEmpty())
1198          return true;
1199      return false;
1200    }
1201
1202    public Reference addReferralRequest() { //3
1203      Reference t = new Reference();
1204      if (this.referralRequest == null)
1205        this.referralRequest = new ArrayList<Reference>();
1206      this.referralRequest.add(t);
1207      return t;
1208    }
1209
1210    public EpisodeOfCare addReferralRequest(Reference t) { //3
1211      if (t == null)
1212        return this;
1213      if (this.referralRequest == null)
1214        this.referralRequest = new ArrayList<Reference>();
1215      this.referralRequest.add(t);
1216      return this;
1217    }
1218
1219    /**
1220     * @return The first repetition of repeating field {@link #referralRequest}, creating it if it does not already exist {3}
1221     */
1222    public Reference getReferralRequestFirstRep() { 
1223      if (getReferralRequest().isEmpty()) {
1224        addReferralRequest();
1225      }
1226      return getReferralRequest().get(0);
1227    }
1228
1229    /**
1230     * @return {@link #careManager} (The practitioner that is the care manager/care coordinator for this patient.)
1231     */
1232    public Reference getCareManager() { 
1233      if (this.careManager == null)
1234        if (Configuration.errorOnAutoCreate())
1235          throw new Error("Attempt to auto-create EpisodeOfCare.careManager");
1236        else if (Configuration.doAutoCreate())
1237          this.careManager = new Reference(); // cc
1238      return this.careManager;
1239    }
1240
1241    public boolean hasCareManager() { 
1242      return this.careManager != null && !this.careManager.isEmpty();
1243    }
1244
1245    /**
1246     * @param value {@link #careManager} (The practitioner that is the care manager/care coordinator for this patient.)
1247     */
1248    public EpisodeOfCare setCareManager(Reference value) { 
1249      this.careManager = value;
1250      return this;
1251    }
1252
1253    /**
1254     * @return {@link #careTeam} (The list of practitioners that may be facilitating this episode of care for specific purposes.)
1255     */
1256    public List<Reference> getCareTeam() { 
1257      if (this.careTeam == null)
1258        this.careTeam = new ArrayList<Reference>();
1259      return this.careTeam;
1260    }
1261
1262    /**
1263     * @return Returns a reference to <code>this</code> for easy method chaining
1264     */
1265    public EpisodeOfCare setCareTeam(List<Reference> theCareTeam) { 
1266      this.careTeam = theCareTeam;
1267      return this;
1268    }
1269
1270    public boolean hasCareTeam() { 
1271      if (this.careTeam == null)
1272        return false;
1273      for (Reference item : this.careTeam)
1274        if (!item.isEmpty())
1275          return true;
1276      return false;
1277    }
1278
1279    public Reference addCareTeam() { //3
1280      Reference t = new Reference();
1281      if (this.careTeam == null)
1282        this.careTeam = new ArrayList<Reference>();
1283      this.careTeam.add(t);
1284      return t;
1285    }
1286
1287    public EpisodeOfCare addCareTeam(Reference t) { //3
1288      if (t == null)
1289        return this;
1290      if (this.careTeam == null)
1291        this.careTeam = new ArrayList<Reference>();
1292      this.careTeam.add(t);
1293      return this;
1294    }
1295
1296    /**
1297     * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist {3}
1298     */
1299    public Reference getCareTeamFirstRep() { 
1300      if (getCareTeam().isEmpty()) {
1301        addCareTeam();
1302      }
1303      return getCareTeam().get(0);
1304    }
1305
1306    /**
1307     * @return {@link #account} (The set of accounts that may be used for billing for this EpisodeOfCare.)
1308     */
1309    public List<Reference> getAccount() { 
1310      if (this.account == null)
1311        this.account = new ArrayList<Reference>();
1312      return this.account;
1313    }
1314
1315    /**
1316     * @return Returns a reference to <code>this</code> for easy method chaining
1317     */
1318    public EpisodeOfCare setAccount(List<Reference> theAccount) { 
1319      this.account = theAccount;
1320      return this;
1321    }
1322
1323    public boolean hasAccount() { 
1324      if (this.account == null)
1325        return false;
1326      for (Reference item : this.account)
1327        if (!item.isEmpty())
1328          return true;
1329      return false;
1330    }
1331
1332    public Reference addAccount() { //3
1333      Reference t = new Reference();
1334      if (this.account == null)
1335        this.account = new ArrayList<Reference>();
1336      this.account.add(t);
1337      return t;
1338    }
1339
1340    public EpisodeOfCare addAccount(Reference t) { //3
1341      if (t == null)
1342        return this;
1343      if (this.account == null)
1344        this.account = new ArrayList<Reference>();
1345      this.account.add(t);
1346      return this;
1347    }
1348
1349    /**
1350     * @return The first repetition of repeating field {@link #account}, creating it if it does not already exist {3}
1351     */
1352    public Reference getAccountFirstRep() { 
1353      if (getAccount().isEmpty()) {
1354        addAccount();
1355      }
1356      return getAccount().get(0);
1357    }
1358
1359      protected void listChildren(List<Property> children) {
1360        super.listChildren(children);
1361        children.add(new Property("identifier", "Identifier", "The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.", 0, java.lang.Integer.MAX_VALUE, identifier));
1362        children.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status));
1363        children.add(new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory));
1364        children.add(new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type));
1365        children.add(new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
1366        children.add(new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient));
1367        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration.", 0, 1, managingOrganization));
1368        children.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period));
1369        children.add(new Property("referralRequest", "Reference(ServiceRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest));
1370        children.add(new Property("careManager", "Reference(Practitioner|PractitionerRole)", "The practitioner that is the care manager/care coordinator for this patient.", 0, 1, careManager));
1371        children.add(new Property("careTeam", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, careTeam));
1372        children.add(new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, account));
1373      }
1374
1375      @Override
1376      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1377        switch (_hash) {
1378        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.", 0, java.lang.Integer.MAX_VALUE, identifier);
1379        case -892481550: /*status*/  return new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status);
1380        case -986695614: /*statusHistory*/  return new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory);
1381        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type);
1382        case 1196993265: /*diagnosis*/  return new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis);
1383        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient);
1384        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for care coordination, care delivery, or other services for the specified duration.", 0, 1, managingOrganization);
1385        case -991726143: /*period*/  return new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period);
1386        case -310299598: /*referralRequest*/  return new Property("referralRequest", "Reference(ServiceRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest);
1387        case -1147746468: /*careManager*/  return new Property("careManager", "Reference(Practitioner|PractitionerRole)", "The practitioner that is the care manager/care coordinator for this patient.", 0, 1, careManager);
1388        case -7323378: /*careTeam*/  return new Property("careTeam", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, careTeam);
1389        case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this EpisodeOfCare.", 0, java.lang.Integer.MAX_VALUE, account);
1390        default: return super.getNamedProperty(_hash, _name, _checkValid);
1391        }
1392
1393      }
1394
1395      @Override
1396      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1397        switch (hash) {
1398        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1399        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EpisodeOfCareStatus>
1400        case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EpisodeOfCareStatusHistoryComponent
1401        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1402        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent
1403        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1404        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
1405        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1406        case -310299598: /*referralRequest*/ return this.referralRequest == null ? new Base[0] : this.referralRequest.toArray(new Base[this.referralRequest.size()]); // Reference
1407        case -1147746468: /*careManager*/ return this.careManager == null ? new Base[0] : new Base[] {this.careManager}; // Reference
1408        case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // Reference
1409        case -1177318867: /*account*/ return this.account == null ? new Base[0] : this.account.toArray(new Base[this.account.size()]); // Reference
1410        default: return super.getProperty(hash, name, checkValid);
1411        }
1412
1413      }
1414
1415      @Override
1416      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1417        switch (hash) {
1418        case -1618432855: // identifier
1419          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1420          return value;
1421        case -892481550: // status
1422          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1423          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
1424          return value;
1425        case -986695614: // statusHistory
1426          this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); // EpisodeOfCareStatusHistoryComponent
1427          return value;
1428        case 3575610: // type
1429          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1430          return value;
1431        case 1196993265: // diagnosis
1432          this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent
1433          return value;
1434        case -791418107: // patient
1435          this.patient = TypeConvertor.castToReference(value); // Reference
1436          return value;
1437        case -2058947787: // managingOrganization
1438          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1439          return value;
1440        case -991726143: // period
1441          this.period = TypeConvertor.castToPeriod(value); // Period
1442          return value;
1443        case -310299598: // referralRequest
1444          this.getReferralRequest().add(TypeConvertor.castToReference(value)); // Reference
1445          return value;
1446        case -1147746468: // careManager
1447          this.careManager = TypeConvertor.castToReference(value); // Reference
1448          return value;
1449        case -7323378: // careTeam
1450          this.getCareTeam().add(TypeConvertor.castToReference(value)); // Reference
1451          return value;
1452        case -1177318867: // account
1453          this.getAccount().add(TypeConvertor.castToReference(value)); // Reference
1454          return value;
1455        default: return super.setProperty(hash, name, value);
1456        }
1457
1458      }
1459
1460      @Override
1461      public Base setProperty(String name, Base value) throws FHIRException {
1462        if (name.equals("identifier")) {
1463          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1464        } else if (name.equals("status")) {
1465          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1466          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
1467        } else if (name.equals("statusHistory")) {
1468          this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value);
1469        } else if (name.equals("type")) {
1470          this.getType().add(TypeConvertor.castToCodeableConcept(value));
1471        } else if (name.equals("diagnosis")) {
1472          this.getDiagnosis().add((DiagnosisComponent) value);
1473        } else if (name.equals("patient")) {
1474          this.patient = TypeConvertor.castToReference(value); // Reference
1475        } else if (name.equals("managingOrganization")) {
1476          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1477        } else if (name.equals("period")) {
1478          this.period = TypeConvertor.castToPeriod(value); // Period
1479        } else if (name.equals("referralRequest")) {
1480          this.getReferralRequest().add(TypeConvertor.castToReference(value));
1481        } else if (name.equals("careManager")) {
1482          this.careManager = TypeConvertor.castToReference(value); // Reference
1483        } else if (name.equals("careTeam")) {
1484          this.getCareTeam().add(TypeConvertor.castToReference(value));
1485        } else if (name.equals("account")) {
1486          this.getAccount().add(TypeConvertor.castToReference(value));
1487        } else
1488          return super.setProperty(name, value);
1489        return value;
1490      }
1491
1492      @Override
1493      public Base makeProperty(int hash, String name) throws FHIRException {
1494        switch (hash) {
1495        case -1618432855:  return addIdentifier(); 
1496        case -892481550:  return getStatusElement();
1497        case -986695614:  return addStatusHistory(); 
1498        case 3575610:  return addType(); 
1499        case 1196993265:  return addDiagnosis(); 
1500        case -791418107:  return getPatient();
1501        case -2058947787:  return getManagingOrganization();
1502        case -991726143:  return getPeriod();
1503        case -310299598:  return addReferralRequest(); 
1504        case -1147746468:  return getCareManager();
1505        case -7323378:  return addCareTeam(); 
1506        case -1177318867:  return addAccount(); 
1507        default: return super.makeProperty(hash, name);
1508        }
1509
1510      }
1511
1512      @Override
1513      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1514        switch (hash) {
1515        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1516        case -892481550: /*status*/ return new String[] {"code"};
1517        case -986695614: /*statusHistory*/ return new String[] {};
1518        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1519        case 1196993265: /*diagnosis*/ return new String[] {};
1520        case -791418107: /*patient*/ return new String[] {"Reference"};
1521        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1522        case -991726143: /*period*/ return new String[] {"Period"};
1523        case -310299598: /*referralRequest*/ return new String[] {"Reference"};
1524        case -1147746468: /*careManager*/ return new String[] {"Reference"};
1525        case -7323378: /*careTeam*/ return new String[] {"Reference"};
1526        case -1177318867: /*account*/ return new String[] {"Reference"};
1527        default: return super.getTypesForProperty(hash, name);
1528        }
1529
1530      }
1531
1532      @Override
1533      public Base addChild(String name) throws FHIRException {
1534        if (name.equals("identifier")) {
1535          return addIdentifier();
1536        }
1537        else if (name.equals("status")) {
1538          throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status");
1539        }
1540        else if (name.equals("statusHistory")) {
1541          return addStatusHistory();
1542        }
1543        else if (name.equals("type")) {
1544          return addType();
1545        }
1546        else if (name.equals("diagnosis")) {
1547          return addDiagnosis();
1548        }
1549        else if (name.equals("patient")) {
1550          this.patient = new Reference();
1551          return this.patient;
1552        }
1553        else if (name.equals("managingOrganization")) {
1554          this.managingOrganization = new Reference();
1555          return this.managingOrganization;
1556        }
1557        else if (name.equals("period")) {
1558          this.period = new Period();
1559          return this.period;
1560        }
1561        else if (name.equals("referralRequest")) {
1562          return addReferralRequest();
1563        }
1564        else if (name.equals("careManager")) {
1565          this.careManager = new Reference();
1566          return this.careManager;
1567        }
1568        else if (name.equals("careTeam")) {
1569          return addCareTeam();
1570        }
1571        else if (name.equals("account")) {
1572          return addAccount();
1573        }
1574        else
1575          return super.addChild(name);
1576      }
1577
1578  public String fhirType() {
1579    return "EpisodeOfCare";
1580
1581  }
1582
1583      public EpisodeOfCare copy() {
1584        EpisodeOfCare dst = new EpisodeOfCare();
1585        copyValues(dst);
1586        return dst;
1587      }
1588
1589      public void copyValues(EpisodeOfCare dst) {
1590        super.copyValues(dst);
1591        if (identifier != null) {
1592          dst.identifier = new ArrayList<Identifier>();
1593          for (Identifier i : identifier)
1594            dst.identifier.add(i.copy());
1595        };
1596        dst.status = status == null ? null : status.copy();
1597        if (statusHistory != null) {
1598          dst.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
1599          for (EpisodeOfCareStatusHistoryComponent i : statusHistory)
1600            dst.statusHistory.add(i.copy());
1601        };
1602        if (type != null) {
1603          dst.type = new ArrayList<CodeableConcept>();
1604          for (CodeableConcept i : type)
1605            dst.type.add(i.copy());
1606        };
1607        if (diagnosis != null) {
1608          dst.diagnosis = new ArrayList<DiagnosisComponent>();
1609          for (DiagnosisComponent i : diagnosis)
1610            dst.diagnosis.add(i.copy());
1611        };
1612        dst.patient = patient == null ? null : patient.copy();
1613        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1614        dst.period = period == null ? null : period.copy();
1615        if (referralRequest != null) {
1616          dst.referralRequest = new ArrayList<Reference>();
1617          for (Reference i : referralRequest)
1618            dst.referralRequest.add(i.copy());
1619        };
1620        dst.careManager = careManager == null ? null : careManager.copy();
1621        if (careTeam != null) {
1622          dst.careTeam = new ArrayList<Reference>();
1623          for (Reference i : careTeam)
1624            dst.careTeam.add(i.copy());
1625        };
1626        if (account != null) {
1627          dst.account = new ArrayList<Reference>();
1628          for (Reference i : account)
1629            dst.account.add(i.copy());
1630        };
1631      }
1632
1633      protected EpisodeOfCare typedCopy() {
1634        return copy();
1635      }
1636
1637      @Override
1638      public boolean equalsDeep(Base other_) {
1639        if (!super.equalsDeep(other_))
1640          return false;
1641        if (!(other_ instanceof EpisodeOfCare))
1642          return false;
1643        EpisodeOfCare o = (EpisodeOfCare) other_;
1644        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true)
1645           && compareDeep(type, o.type, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(patient, o.patient, true)
1646           && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(period, o.period, true)
1647           && compareDeep(referralRequest, o.referralRequest, true) && compareDeep(careManager, o.careManager, true)
1648           && compareDeep(careTeam, o.careTeam, true) && compareDeep(account, o.account, true);
1649      }
1650
1651      @Override
1652      public boolean equalsShallow(Base other_) {
1653        if (!super.equalsShallow(other_))
1654          return false;
1655        if (!(other_ instanceof EpisodeOfCare))
1656          return false;
1657        EpisodeOfCare o = (EpisodeOfCare) other_;
1658        return compareValues(status, o.status, true);
1659      }
1660
1661      public boolean isEmpty() {
1662        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, statusHistory
1663          , type, diagnosis, patient, managingOrganization, period, referralRequest, careManager
1664          , careTeam, account);
1665      }
1666
1667  @Override
1668  public ResourceType getResourceType() {
1669    return ResourceType.EpisodeOfCare;
1670   }
1671
1672 /**
1673   * Search parameter: <b>care-manager</b>
1674   * <p>
1675   * Description: <b>Care manager/care coordinator for the patient</b><br>
1676   * Type: <b>reference</b><br>
1677   * Path: <b>EpisodeOfCare.careManager.where(resolve() is Practitioner)</b><br>
1678   * </p>
1679   */
1680  @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager.where(resolve() is Practitioner)", description="Care manager/care coordinator for the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Practitioner.class } )
1681  public static final String SP_CARE_MANAGER = "care-manager";
1682 /**
1683   * <b>Fluent Client</b> search parameter constant for <b>care-manager</b>
1684   * <p>
1685   * Description: <b>Care manager/care coordinator for the patient</b><br>
1686   * Type: <b>reference</b><br>
1687   * Path: <b>EpisodeOfCare.careManager.where(resolve() is Practitioner)</b><br>
1688   * </p>
1689   */
1690  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_MANAGER);
1691
1692/**
1693   * Constant for fluent queries to be used to add include statements. Specifies
1694   * the path value of "<b>EpisodeOfCare:care-manager</b>".
1695   */
1696  public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_MANAGER = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:care-manager").toLocked();
1697
1698 /**
1699   * Search parameter: <b>condition-concept</b>
1700   * <p>
1701   * Description: <b>Conditions/problems/diagnoses this episode of care is for (coded)</b><br>
1702   * Type: <b>token</b><br>
1703   * Path: <b>EpisodeOfCare.diagnosis.condition.concept</b><br>
1704   * </p>
1705   */
1706  @SearchParamDefinition(name="condition-concept", path="EpisodeOfCare.diagnosis.condition.concept", description="Conditions/problems/diagnoses this episode of care is for (coded)", type="token" )
1707  public static final String SP_CONDITION_CONCEPT = "condition-concept";
1708 /**
1709   * <b>Fluent Client</b> search parameter constant for <b>condition-concept</b>
1710   * <p>
1711   * Description: <b>Conditions/problems/diagnoses this episode of care is for (coded)</b><br>
1712   * Type: <b>token</b><br>
1713   * Path: <b>EpisodeOfCare.diagnosis.condition.concept</b><br>
1714   * </p>
1715   */
1716  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONDITION_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONDITION_CONCEPT);
1717
1718 /**
1719   * Search parameter: <b>condition-reference</b>
1720   * <p>
1721   * Description: <b>Conditions/problems/diagnoses this episode of care is for (resource reference)</b><br>
1722   * Type: <b>reference</b><br>
1723   * Path: <b>EpisodeOfCare.diagnosis.condition.reference</b><br>
1724   * </p>
1725   */
1726  @SearchParamDefinition(name="condition-reference", path="EpisodeOfCare.diagnosis.condition.reference", description="Conditions/problems/diagnoses this episode of care is for (resource reference)", type="reference" )
1727  public static final String SP_CONDITION_REFERENCE = "condition-reference";
1728 /**
1729   * <b>Fluent Client</b> search parameter constant for <b>condition-reference</b>
1730   * <p>
1731   * Description: <b>Conditions/problems/diagnoses this episode of care is for (resource reference)</b><br>
1732   * Type: <b>reference</b><br>
1733   * Path: <b>EpisodeOfCare.diagnosis.condition.reference</b><br>
1734   * </p>
1735   */
1736  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION_REFERENCE);
1737
1738/**
1739   * Constant for fluent queries to be used to add include statements. Specifies
1740   * the path value of "<b>EpisodeOfCare:condition-reference</b>".
1741   */
1742  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION_REFERENCE = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition-reference").toLocked();
1743
1744 /**
1745   * Search parameter: <b>condition</b>
1746   * <p>
1747   * Description: <b>Conditions/problems/diagnoses this episode of care is for (legacy)</b><br>
1748   * Type: <b>reference</b><br>
1749   * Path: <b>EpisodeOfCare.diagnosis.condition.reference</b><br>
1750   * </p>
1751   */
1752  @SearchParamDefinition(name="condition", path="EpisodeOfCare.diagnosis.condition.reference", description="Conditions/problems/diagnoses this episode of care is for (legacy)", type="reference" )
1753  public static final String SP_CONDITION = "condition";
1754 /**
1755   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
1756   * <p>
1757   * Description: <b>Conditions/problems/diagnoses this episode of care is for (legacy)</b><br>
1758   * Type: <b>reference</b><br>
1759   * Path: <b>EpisodeOfCare.diagnosis.condition.reference</b><br>
1760   * </p>
1761   */
1762  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION);
1763
1764/**
1765   * Constant for fluent queries to be used to add include statements. Specifies
1766   * the path value of "<b>EpisodeOfCare:condition</b>".
1767   */
1768  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition").toLocked();
1769
1770 /**
1771   * Search parameter: <b>incoming-referral</b>
1772   * <p>
1773   * Description: <b>Incoming Referral Request</b><br>
1774   * Type: <b>reference</b><br>
1775   * Path: <b>EpisodeOfCare.referralRequest</b><br>
1776   * </p>
1777   */
1778  @SearchParamDefinition(name="incoming-referral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference", target={ServiceRequest.class } )
1779  public static final String SP_INCOMING_REFERRAL = "incoming-referral";
1780 /**
1781   * <b>Fluent Client</b> search parameter constant for <b>incoming-referral</b>
1782   * <p>
1783   * Description: <b>Incoming Referral Request</b><br>
1784   * Type: <b>reference</b><br>
1785   * Path: <b>EpisodeOfCare.referralRequest</b><br>
1786   * </p>
1787   */
1788  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMING_REFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMING_REFERRAL);
1789
1790/**
1791   * Constant for fluent queries to be used to add include statements. Specifies
1792   * the path value of "<b>EpisodeOfCare:incoming-referral</b>".
1793   */
1794  public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMING_REFERRAL = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:incoming-referral").toLocked();
1795
1796 /**
1797   * Search parameter: <b>organization</b>
1798   * <p>
1799   * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
1800   * Type: <b>reference</b><br>
1801   * Path: <b>EpisodeOfCare.managingOrganization</b><br>
1802   * </p>
1803   */
1804  @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference", target={Organization.class } )
1805  public static final String SP_ORGANIZATION = "organization";
1806 /**
1807   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1808   * <p>
1809   * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
1810   * Type: <b>reference</b><br>
1811   * Path: <b>EpisodeOfCare.managingOrganization</b><br>
1812   * </p>
1813   */
1814  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1815
1816/**
1817   * Constant for fluent queries to be used to add include statements. Specifies
1818   * the path value of "<b>EpisodeOfCare:organization</b>".
1819   */
1820  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:organization").toLocked();
1821
1822 /**
1823   * Search parameter: <b>status</b>
1824   * <p>
1825   * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
1826   * Type: <b>token</b><br>
1827   * Path: <b>EpisodeOfCare.status</b><br>
1828   * </p>
1829   */
1830  @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" )
1831  public static final String SP_STATUS = "status";
1832 /**
1833   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1834   * <p>
1835   * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
1836   * Type: <b>token</b><br>
1837   * Path: <b>EpisodeOfCare.status</b><br>
1838   * </p>
1839   */
1840  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1841
1842 /**
1843   * Search parameter: <b>date</b>
1844   * <p>
1845   * Description: <b>Multiple Resources: 
1846
1847* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1848* [CarePlan](careplan.html): Time period plan covers
1849* [CareTeam](careteam.html): A date within the coverage time period.
1850* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1851* [Composition](composition.html): Composition editing time
1852* [Consent](consent.html): When consent was agreed to
1853* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1854* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1855* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1856* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1857* [Flag](flag.html): Time period when flag is active
1858* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1859* [List](list.html): When the list was prepared
1860* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1861* [Procedure](procedure.html): When the procedure occurred or is occurring
1862* [RiskAssessment](riskassessment.html): When was assessment made?
1863* [SupplyRequest](supplyrequest.html): When the request was made
1864</b><br>
1865   * Type: <b>date</b><br>
1866   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1867   * </p>
1868   */
1869  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
1870  public static final String SP_DATE = "date";
1871 /**
1872   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1873   * <p>
1874   * Description: <b>Multiple Resources: 
1875
1876* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1877* [CarePlan](careplan.html): Time period plan covers
1878* [CareTeam](careteam.html): A date within the coverage time period.
1879* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1880* [Composition](composition.html): Composition editing time
1881* [Consent](consent.html): When consent was agreed to
1882* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1883* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1884* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1885* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1886* [Flag](flag.html): Time period when flag is active
1887* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1888* [List](list.html): When the list was prepared
1889* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1890* [Procedure](procedure.html): When the procedure occurred or is occurring
1891* [RiskAssessment](riskassessment.html): When was assessment made?
1892* [SupplyRequest](supplyrequest.html): When the request was made
1893</b><br>
1894   * Type: <b>date</b><br>
1895   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1896   * </p>
1897   */
1898  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1899
1900 /**
1901   * Search parameter: <b>identifier</b>
1902   * <p>
1903   * Description: <b>Multiple Resources: 
1904
1905* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1906* [CarePlan](careplan.html): External Ids for this plan
1907* [CareTeam](careteam.html): External Ids for this team
1908* [Composition](composition.html): Version-independent identifier for the Composition
1909* [Condition](condition.html): A unique identifier of the condition record
1910* [Consent](consent.html): Identifier for this record (external references)
1911* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1912* [DeviceRequest](devicerequest.html): Business identifier for request/order
1913* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1914* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1915* [DocumentReference](documentreference.html): Identifier of the attachment binary
1916* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1917* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1918* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1919* [Goal](goal.html): External Ids for this goal
1920* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1921* [Immunization](immunization.html): Business identifier
1922* [List](list.html): Business identifier
1923* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1924* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1925* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1926* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1927* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1928* [Observation](observation.html): The unique id for a particular observation
1929* [Procedure](procedure.html): A unique identifier for a procedure
1930* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1931* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1932* [SupplyDelivery](supplydelivery.html): External identifier
1933* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1934* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1935</b><br>
1936   * Type: <b>token</b><br>
1937   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
1938   * </p>
1939   */
1940  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\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* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\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* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business 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* [MedicationUsage](medicationusage.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* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
1941  public static final String SP_IDENTIFIER = "identifier";
1942 /**
1943   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1944   * <p>
1945   * Description: <b>Multiple Resources: 
1946
1947* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1948* [CarePlan](careplan.html): External Ids for this plan
1949* [CareTeam](careteam.html): External Ids for this team
1950* [Composition](composition.html): Version-independent identifier for the Composition
1951* [Condition](condition.html): A unique identifier of the condition record
1952* [Consent](consent.html): Identifier for this record (external references)
1953* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1954* [DeviceRequest](devicerequest.html): Business identifier for request/order
1955* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1956* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1957* [DocumentReference](documentreference.html): Identifier of the attachment binary
1958* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1959* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1960* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1961* [Goal](goal.html): External Ids for this goal
1962* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1963* [Immunization](immunization.html): Business identifier
1964* [List](list.html): Business identifier
1965* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1966* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1967* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1968* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1969* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1970* [Observation](observation.html): The unique id for a particular observation
1971* [Procedure](procedure.html): A unique identifier for a procedure
1972* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1973* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1974* [SupplyDelivery](supplydelivery.html): External identifier
1975* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1976* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1977</b><br>
1978   * Type: <b>token</b><br>
1979   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
1980   * </p>
1981   */
1982  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1983
1984 /**
1985   * Search parameter: <b>patient</b>
1986   * <p>
1987   * Description: <b>Multiple Resources: 
1988
1989* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
1990* [CarePlan](careplan.html): Who the care plan is for
1991* [CareTeam](careteam.html): Who care team is for
1992* [ClinicalImpression](clinicalimpression.html): Patient assessed
1993* [Composition](composition.html): Who and/or what the composition is about
1994* [Condition](condition.html): Who has the condition?
1995* [Consent](consent.html): Who the consent applies to
1996* [DetectedIssue](detectedissue.html): Associated patient
1997* [DeviceRequest](devicerequest.html): Individual the service is ordered for
1998* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
1999* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2000* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2001* [DocumentReference](documentreference.html): Who/what is the subject of the document
2002* [Encounter](encounter.html): The patient present at the encounter
2003* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2004* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2005* [Flag](flag.html): The identity of a subject to list flags for
2006* [Goal](goal.html): Who this goal is intended for
2007* [ImagingStudy](imagingstudy.html): Who the study is about
2008* [Immunization](immunization.html): The patient for the vaccination record
2009* [List](list.html): If all resources have the same subject
2010* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2011* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2012* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2013* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2014* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2015* [Observation](observation.html): The subject that the observation is about (if patient)
2016* [Procedure](procedure.html): Search by subject - a patient
2017* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2018* [ServiceRequest](servicerequest.html): Search by subject - a patient
2019* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2020* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2021* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2022</b><br>
2023   * Type: <b>reference</b><br>
2024   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2025   * </p>
2026   */
2027  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\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* [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* [DocumentManifest](documentmanifest.html): The subject of the set of documents\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* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\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* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\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* [MedicationUsage](medicationusage.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* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\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* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={BiologicallyDerivedProduct.class, Device.class, Group.class, Location.class, Medication.class, NutritionProduct.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Substance.class } )
2028  public static final String SP_PATIENT = "patient";
2029 /**
2030   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2031   * <p>
2032   * Description: <b>Multiple Resources: 
2033
2034* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2035* [CarePlan](careplan.html): Who the care plan is for
2036* [CareTeam](careteam.html): Who care team is for
2037* [ClinicalImpression](clinicalimpression.html): Patient assessed
2038* [Composition](composition.html): Who and/or what the composition is about
2039* [Condition](condition.html): Who has the condition?
2040* [Consent](consent.html): Who the consent applies to
2041* [DetectedIssue](detectedissue.html): Associated patient
2042* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2043* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2044* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2045* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2046* [DocumentReference](documentreference.html): Who/what is the subject of the document
2047* [Encounter](encounter.html): The patient present at the encounter
2048* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2049* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2050* [Flag](flag.html): The identity of a subject to list flags for
2051* [Goal](goal.html): Who this goal is intended for
2052* [ImagingStudy](imagingstudy.html): Who the study is about
2053* [Immunization](immunization.html): The patient for the vaccination record
2054* [List](list.html): If all resources have the same subject
2055* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2056* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2057* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2058* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2059* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2060* [Observation](observation.html): The subject that the observation is about (if patient)
2061* [Procedure](procedure.html): Search by subject - a patient
2062* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2063* [ServiceRequest](servicerequest.html): Search by subject - a patient
2064* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2065* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2066* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2067</b><br>
2068   * Type: <b>reference</b><br>
2069   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2070   * </p>
2071   */
2072  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2073
2074/**
2075   * Constant for fluent queries to be used to add include statements. Specifies
2076   * the path value of "<b>EpisodeOfCare:patient</b>".
2077   */
2078  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:patient").toLocked();
2079
2080 /**
2081   * Search parameter: <b>type</b>
2082   * <p>
2083   * Description: <b>Multiple Resources: 
2084
2085* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2086* [Composition](composition.html): Kind of composition (LOINC if possible)
2087* [DocumentManifest](documentmanifest.html): Kind of document set
2088* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2089* [Encounter](encounter.html): Specific type of encounter
2090* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2091</b><br>
2092   * Type: <b>token</b><br>
2093   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
2094   * </p>
2095   */
2096  @SearchParamDefinition(name="type", path="AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [DocumentManifest](documentmanifest.html): Kind of document set\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", type="token" )
2097  public static final String SP_TYPE = "type";
2098 /**
2099   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2100   * <p>
2101   * Description: <b>Multiple Resources: 
2102
2103* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2104* [Composition](composition.html): Kind of composition (LOINC if possible)
2105* [DocumentManifest](documentmanifest.html): Kind of document set
2106* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2107* [Encounter](encounter.html): Specific type of encounter
2108* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2109</b><br>
2110   * Type: <b>token</b><br>
2111   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
2112   * </p>
2113   */
2114  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2115
2116
2117}