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 Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
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(Base code) throws FHIRException {
187          if (code == null)
188            return null;
189          if (code.isEmpty())
190            return new Enumeration<EpisodeOfCareStatus>(this);
191          String codeString = ((PrimitiveType) code).asStringValue();
192          if (codeString == null || "".equals(codeString))
193            return null;
194        if ("planned".equals(codeString))
195          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.PLANNED);
196        if ("waitlist".equals(codeString))
197          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.WAITLIST);
198        if ("active".equals(codeString))
199          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ACTIVE);
200        if ("onhold".equals(codeString))
201          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ONHOLD);
202        if ("finished".equals(codeString))
203          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.FINISHED);
204        if ("cancelled".equals(codeString))
205          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.CANCELLED);
206        if ("entered-in-error".equals(codeString))
207          return new Enumeration<EpisodeOfCareStatus>(this, EpisodeOfCareStatus.ENTEREDINERROR);
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 = {Condition.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        protected Reference condition;
473
474        /**
475         * Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).
476         */
477        @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
478        @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 ?)." )
479        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnosis-role")
480        protected CodeableConcept role;
481
482        /**
483         * Ranking of the diagnosis (for each role type).
484         */
485        @Child(name = "rank", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true)
486        @Description(shortDefinition="Ranking of the diagnosis (for each role type)", formalDefinition="Ranking of the diagnosis (for each role type)." )
487        protected PositiveIntType rank;
488
489        private static final long serialVersionUID = -294944963L;
490
491    /**
492     * Constructor
493     */
494      public DiagnosisComponent() {
495        super();
496      }
497
498    /**
499     * Constructor
500     */
501      public DiagnosisComponent(Reference condition) {
502        super();
503        this.setCondition(condition);
504      }
505
506        /**
507         * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.)
508         */
509        public Reference getCondition() { 
510          if (this.condition == null)
511            if (Configuration.errorOnAutoCreate())
512              throw new Error("Attempt to auto-create DiagnosisComponent.condition");
513            else if (Configuration.doAutoCreate())
514              this.condition = new Reference(); // cc
515          return this.condition;
516        }
517
518        public boolean hasCondition() { 
519          return this.condition != null && !this.condition.isEmpty();
520        }
521
522        /**
523         * @param value {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.)
524         */
525        public DiagnosisComponent setCondition(Reference value) { 
526          this.condition = value;
527          return this;
528        }
529
530        /**
531         * @return {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).)
532         */
533        public CodeableConcept getRole() { 
534          if (this.role == null)
535            if (Configuration.errorOnAutoCreate())
536              throw new Error("Attempt to auto-create DiagnosisComponent.role");
537            else if (Configuration.doAutoCreate())
538              this.role = new CodeableConcept(); // cc
539          return this.role;
540        }
541
542        public boolean hasRole() { 
543          return this.role != null && !this.role.isEmpty();
544        }
545
546        /**
547         * @param value {@link #role} (Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).)
548         */
549        public DiagnosisComponent setRole(CodeableConcept value) { 
550          this.role = value;
551          return this;
552        }
553
554        /**
555         * @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
556         */
557        public PositiveIntType getRankElement() { 
558          if (this.rank == null)
559            if (Configuration.errorOnAutoCreate())
560              throw new Error("Attempt to auto-create DiagnosisComponent.rank");
561            else if (Configuration.doAutoCreate())
562              this.rank = new PositiveIntType(); // bb
563          return this.rank;
564        }
565
566        public boolean hasRankElement() { 
567          return this.rank != null && !this.rank.isEmpty();
568        }
569
570        public boolean hasRank() { 
571          return this.rank != null && !this.rank.isEmpty();
572        }
573
574        /**
575         * @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
576         */
577        public DiagnosisComponent setRankElement(PositiveIntType value) { 
578          this.rank = value;
579          return this;
580        }
581
582        /**
583         * @return Ranking of the diagnosis (for each role type).
584         */
585        public int getRank() { 
586          return this.rank == null || this.rank.isEmpty() ? 0 : this.rank.getValue();
587        }
588
589        /**
590         * @param value Ranking of the diagnosis (for each role type).
591         */
592        public DiagnosisComponent setRank(int value) { 
593            if (this.rank == null)
594              this.rank = new PositiveIntType();
595            this.rank.setValue(value);
596          return this;
597        }
598
599        protected void listChildren(List<Property> children) {
600          super.listChildren(children);
601          children.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition));
602          children.add(new Property("role", "CodeableConcept", "Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge ?).", 0, 1, role));
603          children.add(new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank));
604        }
605
606        @Override
607        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
608          switch (_hash) {
609          case -861311717: /*condition*/  return new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, 1, condition);
610          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);
611          case 3492908: /*rank*/  return new Property("rank", "positiveInt", "Ranking of the diagnosis (for each role type).", 0, 1, rank);
612          default: return super.getNamedProperty(_hash, _name, _checkValid);
613          }
614
615        }
616
617      @Override
618      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
619        switch (hash) {
620        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // Reference
621        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
622        case 3492908: /*rank*/ return this.rank == null ? new Base[0] : new Base[] {this.rank}; // PositiveIntType
623        default: return super.getProperty(hash, name, checkValid);
624        }
625
626      }
627
628      @Override
629      public Base setProperty(int hash, String name, Base value) throws FHIRException {
630        switch (hash) {
631        case -861311717: // condition
632          this.condition = TypeConvertor.castToReference(value); // Reference
633          return value;
634        case 3506294: // role
635          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
636          return value;
637        case 3492908: // rank
638          this.rank = TypeConvertor.castToPositiveInt(value); // PositiveIntType
639          return value;
640        default: return super.setProperty(hash, name, value);
641        }
642
643      }
644
645      @Override
646      public Base setProperty(String name, Base value) throws FHIRException {
647        if (name.equals("condition")) {
648          this.condition = TypeConvertor.castToReference(value); // Reference
649        } else if (name.equals("role")) {
650          this.role = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
651        } else if (name.equals("rank")) {
652          this.rank = TypeConvertor.castToPositiveInt(value); // PositiveIntType
653        } else
654          return super.setProperty(name, value);
655        return value;
656      }
657
658      @Override
659      public Base makeProperty(int hash, String name) throws FHIRException {
660        switch (hash) {
661        case -861311717:  return getCondition();
662        case 3506294:  return getRole();
663        case 3492908:  return getRankElement();
664        default: return super.makeProperty(hash, name);
665        }
666
667      }
668
669      @Override
670      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
671        switch (hash) {
672        case -861311717: /*condition*/ return new String[] {"Reference"};
673        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
674        case 3492908: /*rank*/ return new String[] {"positiveInt"};
675        default: return super.getTypesForProperty(hash, name);
676        }
677
678      }
679
680      @Override
681      public Base addChild(String name) throws FHIRException {
682        if (name.equals("condition")) {
683          this.condition = new Reference();
684          return this.condition;
685        }
686        else if (name.equals("role")) {
687          this.role = new CodeableConcept();
688          return this.role;
689        }
690        else if (name.equals("rank")) {
691          throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.diagnosis.rank");
692        }
693        else
694          return super.addChild(name);
695      }
696
697      public DiagnosisComponent copy() {
698        DiagnosisComponent dst = new DiagnosisComponent();
699        copyValues(dst);
700        return dst;
701      }
702
703      public void copyValues(DiagnosisComponent dst) {
704        super.copyValues(dst);
705        dst.condition = condition == null ? null : condition.copy();
706        dst.role = role == null ? null : role.copy();
707        dst.rank = rank == null ? null : rank.copy();
708      }
709
710      @Override
711      public boolean equalsDeep(Base other_) {
712        if (!super.equalsDeep(other_))
713          return false;
714        if (!(other_ instanceof DiagnosisComponent))
715          return false;
716        DiagnosisComponent o = (DiagnosisComponent) other_;
717        return compareDeep(condition, o.condition, true) && compareDeep(role, o.role, true) && compareDeep(rank, o.rank, true)
718          ;
719      }
720
721      @Override
722      public boolean equalsShallow(Base other_) {
723        if (!super.equalsShallow(other_))
724          return false;
725        if (!(other_ instanceof DiagnosisComponent))
726          return false;
727        DiagnosisComponent o = (DiagnosisComponent) other_;
728        return compareValues(rank, o.rank, true);
729      }
730
731      public boolean isEmpty() {
732        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(condition, role, rank);
733      }
734
735  public String fhirType() {
736    return "EpisodeOfCare.diagnosis";
737
738  }
739
740  }
741
742    /**
743     * 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.
744     */
745    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
746    @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." )
747    protected List<Identifier> identifier;
748
749    /**
750     * planned | waitlist | active | onhold | finished | cancelled.
751     */
752    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
753    @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled | entered-in-error", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." )
754    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episode-of-care-status")
755    protected Enumeration<EpisodeOfCareStatus> status;
756
757    /**
758     * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).
759     */
760    @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
761    @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)." )
762    protected List<EpisodeOfCareStatusHistoryComponent> statusHistory;
763
764    /**
765     * A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.
766     */
767    @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
768    @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." )
769    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/episodeofcare-type")
770    protected List<CodeableConcept> type;
771
772    /**
773     * The list of diagnosis relevant to this episode of care.
774     */
775    @Child(name = "diagnosis", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
776    @Description(shortDefinition="The list of diagnosis relevant to this episode of care", formalDefinition="The list of diagnosis relevant to this episode of care." )
777    protected List<DiagnosisComponent> diagnosis;
778
779    /**
780     * The patient who is the focus of this episode of care.
781     */
782    @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true)
783    @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." )
784    protected Reference patient;
785
786    /**
787     * The organization that has assumed the specific responsibilities for the specified duration.
788     */
789    @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true)
790    @Description(shortDefinition="Organization that assumes care", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." )
791    protected Reference managingOrganization;
792
793    /**
794     * The interval during which the managing organization assumes the defined responsibility.
795     */
796    @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
797    @Description(shortDefinition="Interval during responsibility is assumed", formalDefinition="The interval during which the managing organization assumes the defined responsibility." )
798    protected Period period;
799
800    /**
801     * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.
802     */
803    @Child(name = "referralRequest", type = {ServiceRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
804    @Description(shortDefinition="Originating Referral Request(s)", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." )
805    protected List<Reference> referralRequest;
806
807    /**
808     * The practitioner that is the care manager/care coordinator for this patient.
809     */
810    @Child(name = "careManager", type = {Practitioner.class, PractitionerRole.class}, order=9, min=0, max=1, modifier=false, summary=false)
811    @Description(shortDefinition="Care manager/care coordinator for the patient", formalDefinition="The practitioner that is the care manager/care coordinator for this patient." )
812    protected Reference careManager;
813
814    /**
815     * The list of practitioners that may be facilitating this episode of care for specific purposes.
816     */
817    @Child(name = "team", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
818    @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." )
819    protected List<Reference> team;
820
821    /**
822     * The set of accounts that may be used for billing for this EpisodeOfCare.
823     */
824    @Child(name = "account", type = {Account.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
825    @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." )
826    protected List<Reference> account;
827
828    private static final long serialVersionUID = 202200834L;
829
830  /**
831   * Constructor
832   */
833    public EpisodeOfCare() {
834      super();
835    }
836
837  /**
838   * Constructor
839   */
840    public EpisodeOfCare(EpisodeOfCareStatus status, Reference patient) {
841      super();
842      this.setStatus(status);
843      this.setPatient(patient);
844    }
845
846    /**
847     * @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.)
848     */
849    public List<Identifier> getIdentifier() { 
850      if (this.identifier == null)
851        this.identifier = new ArrayList<Identifier>();
852      return this.identifier;
853    }
854
855    /**
856     * @return Returns a reference to <code>this</code> for easy method chaining
857     */
858    public EpisodeOfCare setIdentifier(List<Identifier> theIdentifier) { 
859      this.identifier = theIdentifier;
860      return this;
861    }
862
863    public boolean hasIdentifier() { 
864      if (this.identifier == null)
865        return false;
866      for (Identifier item : this.identifier)
867        if (!item.isEmpty())
868          return true;
869      return false;
870    }
871
872    public Identifier addIdentifier() { //3
873      Identifier t = new Identifier();
874      if (this.identifier == null)
875        this.identifier = new ArrayList<Identifier>();
876      this.identifier.add(t);
877      return t;
878    }
879
880    public EpisodeOfCare addIdentifier(Identifier t) { //3
881      if (t == null)
882        return this;
883      if (this.identifier == null)
884        this.identifier = new ArrayList<Identifier>();
885      this.identifier.add(t);
886      return this;
887    }
888
889    /**
890     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
891     */
892    public Identifier getIdentifierFirstRep() { 
893      if (getIdentifier().isEmpty()) {
894        addIdentifier();
895      }
896      return getIdentifier().get(0);
897    }
898
899    /**
900     * @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
901     */
902    public Enumeration<EpisodeOfCareStatus> getStatusElement() { 
903      if (this.status == null)
904        if (Configuration.errorOnAutoCreate())
905          throw new Error("Attempt to auto-create EpisodeOfCare.status");
906        else if (Configuration.doAutoCreate())
907          this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory()); // bb
908      return this.status;
909    }
910
911    public boolean hasStatusElement() { 
912      return this.status != null && !this.status.isEmpty();
913    }
914
915    public boolean hasStatus() { 
916      return this.status != null && !this.status.isEmpty();
917    }
918
919    /**
920     * @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
921     */
922    public EpisodeOfCare setStatusElement(Enumeration<EpisodeOfCareStatus> value) { 
923      this.status = value;
924      return this;
925    }
926
927    /**
928     * @return planned | waitlist | active | onhold | finished | cancelled.
929     */
930    public EpisodeOfCareStatus getStatus() { 
931      return this.status == null ? null : this.status.getValue();
932    }
933
934    /**
935     * @param value planned | waitlist | active | onhold | finished | cancelled.
936     */
937    public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { 
938        if (this.status == null)
939          this.status = new Enumeration<EpisodeOfCareStatus>(new EpisodeOfCareStatusEnumFactory());
940        this.status.setValue(value);
941      return this;
942    }
943
944    /**
945     * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).)
946     */
947    public List<EpisodeOfCareStatusHistoryComponent> getStatusHistory() { 
948      if (this.statusHistory == null)
949        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
950      return this.statusHistory;
951    }
952
953    /**
954     * @return Returns a reference to <code>this</code> for easy method chaining
955     */
956    public EpisodeOfCare setStatusHistory(List<EpisodeOfCareStatusHistoryComponent> theStatusHistory) { 
957      this.statusHistory = theStatusHistory;
958      return this;
959    }
960
961    public boolean hasStatusHistory() { 
962      if (this.statusHistory == null)
963        return false;
964      for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory)
965        if (!item.isEmpty())
966          return true;
967      return false;
968    }
969
970    public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3
971      EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent();
972      if (this.statusHistory == null)
973        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
974      this.statusHistory.add(t);
975      return t;
976    }
977
978    public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3
979      if (t == null)
980        return this;
981      if (this.statusHistory == null)
982        this.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
983      this.statusHistory.add(t);
984      return this;
985    }
986
987    /**
988     * @return The first repetition of repeating field {@link #statusHistory}, creating it if it does not already exist {3}
989     */
990    public EpisodeOfCareStatusHistoryComponent getStatusHistoryFirstRep() { 
991      if (getStatusHistory().isEmpty()) {
992        addStatusHistory();
993      }
994      return getStatusHistory().get(0);
995    }
996
997    /**
998     * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.)
999     */
1000    public List<CodeableConcept> getType() { 
1001      if (this.type == null)
1002        this.type = new ArrayList<CodeableConcept>();
1003      return this.type;
1004    }
1005
1006    /**
1007     * @return Returns a reference to <code>this</code> for easy method chaining
1008     */
1009    public EpisodeOfCare setType(List<CodeableConcept> theType) { 
1010      this.type = theType;
1011      return this;
1012    }
1013
1014    public boolean hasType() { 
1015      if (this.type == null)
1016        return false;
1017      for (CodeableConcept item : this.type)
1018        if (!item.isEmpty())
1019          return true;
1020      return false;
1021    }
1022
1023    public CodeableConcept addType() { //3
1024      CodeableConcept t = new CodeableConcept();
1025      if (this.type == null)
1026        this.type = new ArrayList<CodeableConcept>();
1027      this.type.add(t);
1028      return t;
1029    }
1030
1031    public EpisodeOfCare addType(CodeableConcept t) { //3
1032      if (t == null)
1033        return this;
1034      if (this.type == null)
1035        this.type = new ArrayList<CodeableConcept>();
1036      this.type.add(t);
1037      return this;
1038    }
1039
1040    /**
1041     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
1042     */
1043    public CodeableConcept getTypeFirstRep() { 
1044      if (getType().isEmpty()) {
1045        addType();
1046      }
1047      return getType().get(0);
1048    }
1049
1050    /**
1051     * @return {@link #diagnosis} (The list of diagnosis relevant to this episode of care.)
1052     */
1053    public List<DiagnosisComponent> getDiagnosis() { 
1054      if (this.diagnosis == null)
1055        this.diagnosis = new ArrayList<DiagnosisComponent>();
1056      return this.diagnosis;
1057    }
1058
1059    /**
1060     * @return Returns a reference to <code>this</code> for easy method chaining
1061     */
1062    public EpisodeOfCare setDiagnosis(List<DiagnosisComponent> theDiagnosis) { 
1063      this.diagnosis = theDiagnosis;
1064      return this;
1065    }
1066
1067    public boolean hasDiagnosis() { 
1068      if (this.diagnosis == null)
1069        return false;
1070      for (DiagnosisComponent item : this.diagnosis)
1071        if (!item.isEmpty())
1072          return true;
1073      return false;
1074    }
1075
1076    public DiagnosisComponent addDiagnosis() { //3
1077      DiagnosisComponent t = new DiagnosisComponent();
1078      if (this.diagnosis == null)
1079        this.diagnosis = new ArrayList<DiagnosisComponent>();
1080      this.diagnosis.add(t);
1081      return t;
1082    }
1083
1084    public EpisodeOfCare addDiagnosis(DiagnosisComponent t) { //3
1085      if (t == null)
1086        return this;
1087      if (this.diagnosis == null)
1088        this.diagnosis = new ArrayList<DiagnosisComponent>();
1089      this.diagnosis.add(t);
1090      return this;
1091    }
1092
1093    /**
1094     * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist {3}
1095     */
1096    public DiagnosisComponent getDiagnosisFirstRep() { 
1097      if (getDiagnosis().isEmpty()) {
1098        addDiagnosis();
1099      }
1100      return getDiagnosis().get(0);
1101    }
1102
1103    /**
1104     * @return {@link #patient} (The patient who is the focus of this episode of care.)
1105     */
1106    public Reference getPatient() { 
1107      if (this.patient == null)
1108        if (Configuration.errorOnAutoCreate())
1109          throw new Error("Attempt to auto-create EpisodeOfCare.patient");
1110        else if (Configuration.doAutoCreate())
1111          this.patient = new Reference(); // cc
1112      return this.patient;
1113    }
1114
1115    public boolean hasPatient() { 
1116      return this.patient != null && !this.patient.isEmpty();
1117    }
1118
1119    /**
1120     * @param value {@link #patient} (The patient who is the focus of this episode of care.)
1121     */
1122    public EpisodeOfCare setPatient(Reference value) { 
1123      this.patient = value;
1124      return this;
1125    }
1126
1127    /**
1128     * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.)
1129     */
1130    public Reference getManagingOrganization() { 
1131      if (this.managingOrganization == null)
1132        if (Configuration.errorOnAutoCreate())
1133          throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization");
1134        else if (Configuration.doAutoCreate())
1135          this.managingOrganization = new Reference(); // cc
1136      return this.managingOrganization;
1137    }
1138
1139    public boolean hasManagingOrganization() { 
1140      return this.managingOrganization != null && !this.managingOrganization.isEmpty();
1141    }
1142
1143    /**
1144     * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.)
1145     */
1146    public EpisodeOfCare setManagingOrganization(Reference value) { 
1147      this.managingOrganization = value;
1148      return this;
1149    }
1150
1151    /**
1152     * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.)
1153     */
1154    public Period getPeriod() { 
1155      if (this.period == null)
1156        if (Configuration.errorOnAutoCreate())
1157          throw new Error("Attempt to auto-create EpisodeOfCare.period");
1158        else if (Configuration.doAutoCreate())
1159          this.period = new Period(); // cc
1160      return this.period;
1161    }
1162
1163    public boolean hasPeriod() { 
1164      return this.period != null && !this.period.isEmpty();
1165    }
1166
1167    /**
1168     * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.)
1169     */
1170    public EpisodeOfCare setPeriod(Period value) { 
1171      this.period = value;
1172      return this;
1173    }
1174
1175    /**
1176     * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.)
1177     */
1178    public List<Reference> getReferralRequest() { 
1179      if (this.referralRequest == null)
1180        this.referralRequest = new ArrayList<Reference>();
1181      return this.referralRequest;
1182    }
1183
1184    /**
1185     * @return Returns a reference to <code>this</code> for easy method chaining
1186     */
1187    public EpisodeOfCare setReferralRequest(List<Reference> theReferralRequest) { 
1188      this.referralRequest = theReferralRequest;
1189      return this;
1190    }
1191
1192    public boolean hasReferralRequest() { 
1193      if (this.referralRequest == null)
1194        return false;
1195      for (Reference item : this.referralRequest)
1196        if (!item.isEmpty())
1197          return true;
1198      return false;
1199    }
1200
1201    public Reference addReferralRequest() { //3
1202      Reference t = new Reference();
1203      if (this.referralRequest == null)
1204        this.referralRequest = new ArrayList<Reference>();
1205      this.referralRequest.add(t);
1206      return t;
1207    }
1208
1209    public EpisodeOfCare addReferralRequest(Reference t) { //3
1210      if (t == null)
1211        return this;
1212      if (this.referralRequest == null)
1213        this.referralRequest = new ArrayList<Reference>();
1214      this.referralRequest.add(t);
1215      return this;
1216    }
1217
1218    /**
1219     * @return The first repetition of repeating field {@link #referralRequest}, creating it if it does not already exist {3}
1220     */
1221    public Reference getReferralRequestFirstRep() { 
1222      if (getReferralRequest().isEmpty()) {
1223        addReferralRequest();
1224      }
1225      return getReferralRequest().get(0);
1226    }
1227
1228    /**
1229     * @return {@link #careManager} (The practitioner that is the care manager/care coordinator for this patient.)
1230     */
1231    public Reference getCareManager() { 
1232      if (this.careManager == null)
1233        if (Configuration.errorOnAutoCreate())
1234          throw new Error("Attempt to auto-create EpisodeOfCare.careManager");
1235        else if (Configuration.doAutoCreate())
1236          this.careManager = new Reference(); // cc
1237      return this.careManager;
1238    }
1239
1240    public boolean hasCareManager() { 
1241      return this.careManager != null && !this.careManager.isEmpty();
1242    }
1243
1244    /**
1245     * @param value {@link #careManager} (The practitioner that is the care manager/care coordinator for this patient.)
1246     */
1247    public EpisodeOfCare setCareManager(Reference value) { 
1248      this.careManager = value;
1249      return this;
1250    }
1251
1252    /**
1253     * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.)
1254     */
1255    public List<Reference> getTeam() { 
1256      if (this.team == null)
1257        this.team = new ArrayList<Reference>();
1258      return this.team;
1259    }
1260
1261    /**
1262     * @return Returns a reference to <code>this</code> for easy method chaining
1263     */
1264    public EpisodeOfCare setTeam(List<Reference> theTeam) { 
1265      this.team = theTeam;
1266      return this;
1267    }
1268
1269    public boolean hasTeam() { 
1270      if (this.team == null)
1271        return false;
1272      for (Reference item : this.team)
1273        if (!item.isEmpty())
1274          return true;
1275      return false;
1276    }
1277
1278    public Reference addTeam() { //3
1279      Reference t = new Reference();
1280      if (this.team == null)
1281        this.team = new ArrayList<Reference>();
1282      this.team.add(t);
1283      return t;
1284    }
1285
1286    public EpisodeOfCare addTeam(Reference t) { //3
1287      if (t == null)
1288        return this;
1289      if (this.team == null)
1290        this.team = new ArrayList<Reference>();
1291      this.team.add(t);
1292      return this;
1293    }
1294
1295    /**
1296     * @return The first repetition of repeating field {@link #team}, creating it if it does not already exist {3}
1297     */
1298    public Reference getTeamFirstRep() { 
1299      if (getTeam().isEmpty()) {
1300        addTeam();
1301      }
1302      return getTeam().get(0);
1303    }
1304
1305    /**
1306     * @return {@link #account} (The set of accounts that may be used for billing for this EpisodeOfCare.)
1307     */
1308    public List<Reference> getAccount() { 
1309      if (this.account == null)
1310        this.account = new ArrayList<Reference>();
1311      return this.account;
1312    }
1313
1314    /**
1315     * @return Returns a reference to <code>this</code> for easy method chaining
1316     */
1317    public EpisodeOfCare setAccount(List<Reference> theAccount) { 
1318      this.account = theAccount;
1319      return this;
1320    }
1321
1322    public boolean hasAccount() { 
1323      if (this.account == null)
1324        return false;
1325      for (Reference item : this.account)
1326        if (!item.isEmpty())
1327          return true;
1328      return false;
1329    }
1330
1331    public Reference addAccount() { //3
1332      Reference t = new Reference();
1333      if (this.account == null)
1334        this.account = new ArrayList<Reference>();
1335      this.account.add(t);
1336      return t;
1337    }
1338
1339    public EpisodeOfCare addAccount(Reference t) { //3
1340      if (t == null)
1341        return this;
1342      if (this.account == null)
1343        this.account = new ArrayList<Reference>();
1344      this.account.add(t);
1345      return this;
1346    }
1347
1348    /**
1349     * @return The first repetition of repeating field {@link #account}, creating it if it does not already exist {3}
1350     */
1351    public Reference getAccountFirstRep() { 
1352      if (getAccount().isEmpty()) {
1353        addAccount();
1354      }
1355      return getAccount().get(0);
1356    }
1357
1358      protected void listChildren(List<Property> children) {
1359        super.listChildren(children);
1360        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));
1361        children.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status));
1362        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));
1363        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));
1364        children.add(new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
1365        children.add(new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient));
1366        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, 1, managingOrganization));
1367        children.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period));
1368        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));
1369        children.add(new Property("careManager", "Reference(Practitioner|PractitionerRole)", "The practitioner that is the care manager/care coordinator for this patient.", 0, 1, careManager));
1370        children.add(new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team));
1371        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));
1372      }
1373
1374      @Override
1375      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1376        switch (_hash) {
1377        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);
1378        case -892481550: /*status*/  return new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, 1, status);
1379        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);
1380        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);
1381        case 1196993265: /*diagnosis*/  return new Property("diagnosis", "", "The list of diagnosis relevant to this episode of care.", 0, java.lang.Integer.MAX_VALUE, diagnosis);
1382        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient who is the focus of this episode of care.", 0, 1, patient);
1383        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, 1, managingOrganization);
1384        case -991726143: /*period*/  return new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, 1, period);
1385        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);
1386        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);
1387        case 3555933: /*team*/  return new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team);
1388        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);
1389        default: return super.getNamedProperty(_hash, _name, _checkValid);
1390        }
1391
1392      }
1393
1394      @Override
1395      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1396        switch (hash) {
1397        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1398        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EpisodeOfCareStatus>
1399        case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EpisodeOfCareStatusHistoryComponent
1400        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
1401        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent
1402        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
1403        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference
1404        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1405        case -310299598: /*referralRequest*/ return this.referralRequest == null ? new Base[0] : this.referralRequest.toArray(new Base[this.referralRequest.size()]); // Reference
1406        case -1147746468: /*careManager*/ return this.careManager == null ? new Base[0] : new Base[] {this.careManager}; // Reference
1407        case 3555933: /*team*/ return this.team == null ? new Base[0] : this.team.toArray(new Base[this.team.size()]); // Reference
1408        case -1177318867: /*account*/ return this.account == null ? new Base[0] : this.account.toArray(new Base[this.account.size()]); // Reference
1409        default: return super.getProperty(hash, name, checkValid);
1410        }
1411
1412      }
1413
1414      @Override
1415      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1416        switch (hash) {
1417        case -1618432855: // identifier
1418          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1419          return value;
1420        case -892481550: // status
1421          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1422          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
1423          return value;
1424        case -986695614: // statusHistory
1425          this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); // EpisodeOfCareStatusHistoryComponent
1426          return value;
1427        case 3575610: // type
1428          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1429          return value;
1430        case 1196993265: // diagnosis
1431          this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent
1432          return value;
1433        case -791418107: // patient
1434          this.patient = TypeConvertor.castToReference(value); // Reference
1435          return value;
1436        case -2058947787: // managingOrganization
1437          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1438          return value;
1439        case -991726143: // period
1440          this.period = TypeConvertor.castToPeriod(value); // Period
1441          return value;
1442        case -310299598: // referralRequest
1443          this.getReferralRequest().add(TypeConvertor.castToReference(value)); // Reference
1444          return value;
1445        case -1147746468: // careManager
1446          this.careManager = TypeConvertor.castToReference(value); // Reference
1447          return value;
1448        case 3555933: // team
1449          this.getTeam().add(TypeConvertor.castToReference(value)); // Reference
1450          return value;
1451        case -1177318867: // account
1452          this.getAccount().add(TypeConvertor.castToReference(value)); // Reference
1453          return value;
1454        default: return super.setProperty(hash, name, value);
1455        }
1456
1457      }
1458
1459      @Override
1460      public Base setProperty(String name, Base value) throws FHIRException {
1461        if (name.equals("identifier")) {
1462          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1463        } else if (name.equals("status")) {
1464          value = new EpisodeOfCareStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1465          this.status = (Enumeration) value; // Enumeration<EpisodeOfCareStatus>
1466        } else if (name.equals("statusHistory")) {
1467          this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value);
1468        } else if (name.equals("type")) {
1469          this.getType().add(TypeConvertor.castToCodeableConcept(value));
1470        } else if (name.equals("diagnosis")) {
1471          this.getDiagnosis().add((DiagnosisComponent) value);
1472        } else if (name.equals("patient")) {
1473          this.patient = TypeConvertor.castToReference(value); // Reference
1474        } else if (name.equals("managingOrganization")) {
1475          this.managingOrganization = TypeConvertor.castToReference(value); // Reference
1476        } else if (name.equals("period")) {
1477          this.period = TypeConvertor.castToPeriod(value); // Period
1478        } else if (name.equals("referralRequest")) {
1479          this.getReferralRequest().add(TypeConvertor.castToReference(value));
1480        } else if (name.equals("careManager")) {
1481          this.careManager = TypeConvertor.castToReference(value); // Reference
1482        } else if (name.equals("team")) {
1483          this.getTeam().add(TypeConvertor.castToReference(value));
1484        } else if (name.equals("account")) {
1485          this.getAccount().add(TypeConvertor.castToReference(value));
1486        } else
1487          return super.setProperty(name, value);
1488        return value;
1489      }
1490
1491      @Override
1492      public Base makeProperty(int hash, String name) throws FHIRException {
1493        switch (hash) {
1494        case -1618432855:  return addIdentifier(); 
1495        case -892481550:  return getStatusElement();
1496        case -986695614:  return addStatusHistory(); 
1497        case 3575610:  return addType(); 
1498        case 1196993265:  return addDiagnosis(); 
1499        case -791418107:  return getPatient();
1500        case -2058947787:  return getManagingOrganization();
1501        case -991726143:  return getPeriod();
1502        case -310299598:  return addReferralRequest(); 
1503        case -1147746468:  return getCareManager();
1504        case 3555933:  return addTeam(); 
1505        case -1177318867:  return addAccount(); 
1506        default: return super.makeProperty(hash, name);
1507        }
1508
1509      }
1510
1511      @Override
1512      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1513        switch (hash) {
1514        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1515        case -892481550: /*status*/ return new String[] {"code"};
1516        case -986695614: /*statusHistory*/ return new String[] {};
1517        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1518        case 1196993265: /*diagnosis*/ return new String[] {};
1519        case -791418107: /*patient*/ return new String[] {"Reference"};
1520        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1521        case -991726143: /*period*/ return new String[] {"Period"};
1522        case -310299598: /*referralRequest*/ return new String[] {"Reference"};
1523        case -1147746468: /*careManager*/ return new String[] {"Reference"};
1524        case 3555933: /*team*/ return new String[] {"Reference"};
1525        case -1177318867: /*account*/ return new String[] {"Reference"};
1526        default: return super.getTypesForProperty(hash, name);
1527        }
1528
1529      }
1530
1531      @Override
1532      public Base addChild(String name) throws FHIRException {
1533        if (name.equals("identifier")) {
1534          return addIdentifier();
1535        }
1536        else if (name.equals("status")) {
1537          throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status");
1538        }
1539        else if (name.equals("statusHistory")) {
1540          return addStatusHistory();
1541        }
1542        else if (name.equals("type")) {
1543          return addType();
1544        }
1545        else if (name.equals("diagnosis")) {
1546          return addDiagnosis();
1547        }
1548        else if (name.equals("patient")) {
1549          this.patient = new Reference();
1550          return this.patient;
1551        }
1552        else if (name.equals("managingOrganization")) {
1553          this.managingOrganization = new Reference();
1554          return this.managingOrganization;
1555        }
1556        else if (name.equals("period")) {
1557          this.period = new Period();
1558          return this.period;
1559        }
1560        else if (name.equals("referralRequest")) {
1561          return addReferralRequest();
1562        }
1563        else if (name.equals("careManager")) {
1564          this.careManager = new Reference();
1565          return this.careManager;
1566        }
1567        else if (name.equals("team")) {
1568          return addTeam();
1569        }
1570        else if (name.equals("account")) {
1571          return addAccount();
1572        }
1573        else
1574          return super.addChild(name);
1575      }
1576
1577  public String fhirType() {
1578    return "EpisodeOfCare";
1579
1580  }
1581
1582      public EpisodeOfCare copy() {
1583        EpisodeOfCare dst = new EpisodeOfCare();
1584        copyValues(dst);
1585        return dst;
1586      }
1587
1588      public void copyValues(EpisodeOfCare dst) {
1589        super.copyValues(dst);
1590        if (identifier != null) {
1591          dst.identifier = new ArrayList<Identifier>();
1592          for (Identifier i : identifier)
1593            dst.identifier.add(i.copy());
1594        };
1595        dst.status = status == null ? null : status.copy();
1596        if (statusHistory != null) {
1597          dst.statusHistory = new ArrayList<EpisodeOfCareStatusHistoryComponent>();
1598          for (EpisodeOfCareStatusHistoryComponent i : statusHistory)
1599            dst.statusHistory.add(i.copy());
1600        };
1601        if (type != null) {
1602          dst.type = new ArrayList<CodeableConcept>();
1603          for (CodeableConcept i : type)
1604            dst.type.add(i.copy());
1605        };
1606        if (diagnosis != null) {
1607          dst.diagnosis = new ArrayList<DiagnosisComponent>();
1608          for (DiagnosisComponent i : diagnosis)
1609            dst.diagnosis.add(i.copy());
1610        };
1611        dst.patient = patient == null ? null : patient.copy();
1612        dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy();
1613        dst.period = period == null ? null : period.copy();
1614        if (referralRequest != null) {
1615          dst.referralRequest = new ArrayList<Reference>();
1616          for (Reference i : referralRequest)
1617            dst.referralRequest.add(i.copy());
1618        };
1619        dst.careManager = careManager == null ? null : careManager.copy();
1620        if (team != null) {
1621          dst.team = new ArrayList<Reference>();
1622          for (Reference i : team)
1623            dst.team.add(i.copy());
1624        };
1625        if (account != null) {
1626          dst.account = new ArrayList<Reference>();
1627          for (Reference i : account)
1628            dst.account.add(i.copy());
1629        };
1630      }
1631
1632      protected EpisodeOfCare typedCopy() {
1633        return copy();
1634      }
1635
1636      @Override
1637      public boolean equalsDeep(Base other_) {
1638        if (!super.equalsDeep(other_))
1639          return false;
1640        if (!(other_ instanceof EpisodeOfCare))
1641          return false;
1642        EpisodeOfCare o = (EpisodeOfCare) other_;
1643        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true)
1644           && compareDeep(type, o.type, true) && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(patient, o.patient, true)
1645           && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(period, o.period, true)
1646           && compareDeep(referralRequest, o.referralRequest, true) && compareDeep(careManager, o.careManager, true)
1647           && compareDeep(team, o.team, true) && compareDeep(account, o.account, true);
1648      }
1649
1650      @Override
1651      public boolean equalsShallow(Base other_) {
1652        if (!super.equalsShallow(other_))
1653          return false;
1654        if (!(other_ instanceof EpisodeOfCare))
1655          return false;
1656        EpisodeOfCare o = (EpisodeOfCare) other_;
1657        return compareValues(status, o.status, true);
1658      }
1659
1660      public boolean isEmpty() {
1661        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, statusHistory
1662          , type, diagnosis, patient, managingOrganization, period, referralRequest, careManager
1663          , team, account);
1664      }
1665
1666  @Override
1667  public ResourceType getResourceType() {
1668    return ResourceType.EpisodeOfCare;
1669   }
1670
1671 /**
1672   * Search parameter: <b>care-manager</b>
1673   * <p>
1674   * Description: <b>Care manager/care coordinator for the patient</b><br>
1675   * Type: <b>reference</b><br>
1676   * Path: <b>EpisodeOfCare.careManager.where(resolve() is Practitioner)</b><br>
1677   * </p>
1678   */
1679  @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 } )
1680  public static final String SP_CARE_MANAGER = "care-manager";
1681 /**
1682   * <b>Fluent Client</b> search parameter constant for <b>care-manager</b>
1683   * <p>
1684   * Description: <b>Care manager/care coordinator for the patient</b><br>
1685   * Type: <b>reference</b><br>
1686   * Path: <b>EpisodeOfCare.careManager.where(resolve() is Practitioner)</b><br>
1687   * </p>
1688   */
1689  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_MANAGER);
1690
1691/**
1692   * Constant for fluent queries to be used to add include statements. Specifies
1693   * the path value of "<b>EpisodeOfCare:care-manager</b>".
1694   */
1695  public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_MANAGER = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:care-manager").toLocked();
1696
1697 /**
1698   * Search parameter: <b>condition</b>
1699   * <p>
1700   * Description: <b>Conditions/problems/diagnoses this episode of care is for</b><br>
1701   * Type: <b>reference</b><br>
1702   * Path: <b>EpisodeOfCare.diagnosis.condition</b><br>
1703   * </p>
1704   */
1705  @SearchParamDefinition(name="condition", path="EpisodeOfCare.diagnosis.condition", description="Conditions/problems/diagnoses this episode of care is for", type="reference", target={Condition.class } )
1706  public static final String SP_CONDITION = "condition";
1707 /**
1708   * <b>Fluent Client</b> search parameter constant for <b>condition</b>
1709   * <p>
1710   * Description: <b>Conditions/problems/diagnoses this episode of care is for</b><br>
1711   * Type: <b>reference</b><br>
1712   * Path: <b>EpisodeOfCare.diagnosis.condition</b><br>
1713   * </p>
1714   */
1715  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION);
1716
1717/**
1718   * Constant for fluent queries to be used to add include statements. Specifies
1719   * the path value of "<b>EpisodeOfCare:condition</b>".
1720   */
1721  public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition").toLocked();
1722
1723 /**
1724   * Search parameter: <b>incoming-referral</b>
1725   * <p>
1726   * Description: <b>Incoming Referral Request</b><br>
1727   * Type: <b>reference</b><br>
1728   * Path: <b>EpisodeOfCare.referralRequest</b><br>
1729   * </p>
1730   */
1731  @SearchParamDefinition(name="incoming-referral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference", target={ServiceRequest.class } )
1732  public static final String SP_INCOMING_REFERRAL = "incoming-referral";
1733 /**
1734   * <b>Fluent Client</b> search parameter constant for <b>incoming-referral</b>
1735   * <p>
1736   * Description: <b>Incoming Referral Request</b><br>
1737   * Type: <b>reference</b><br>
1738   * Path: <b>EpisodeOfCare.referralRequest</b><br>
1739   * </p>
1740   */
1741  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMING_REFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMING_REFERRAL);
1742
1743/**
1744   * Constant for fluent queries to be used to add include statements. Specifies
1745   * the path value of "<b>EpisodeOfCare:incoming-referral</b>".
1746   */
1747  public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMING_REFERRAL = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:incoming-referral").toLocked();
1748
1749 /**
1750   * Search parameter: <b>organization</b>
1751   * <p>
1752   * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
1753   * Type: <b>reference</b><br>
1754   * Path: <b>EpisodeOfCare.managingOrganization</b><br>
1755   * </p>
1756   */
1757  @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference", target={Organization.class } )
1758  public static final String SP_ORGANIZATION = "organization";
1759 /**
1760   * <b>Fluent Client</b> search parameter constant for <b>organization</b>
1761   * <p>
1762   * Description: <b>The organization that has assumed the specific responsibilities of this EpisodeOfCare</b><br>
1763   * Type: <b>reference</b><br>
1764   * Path: <b>EpisodeOfCare.managingOrganization</b><br>
1765   * </p>
1766   */
1767  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION);
1768
1769/**
1770   * Constant for fluent queries to be used to add include statements. Specifies
1771   * the path value of "<b>EpisodeOfCare:organization</b>".
1772   */
1773  public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:organization").toLocked();
1774
1775 /**
1776   * Search parameter: <b>status</b>
1777   * <p>
1778   * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
1779   * Type: <b>token</b><br>
1780   * Path: <b>EpisodeOfCare.status</b><br>
1781   * </p>
1782   */
1783  @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" )
1784  public static final String SP_STATUS = "status";
1785 /**
1786   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1787   * <p>
1788   * Description: <b>The current status of the Episode of Care as provided (does not check the status history collection)</b><br>
1789   * Type: <b>token</b><br>
1790   * Path: <b>EpisodeOfCare.status</b><br>
1791   * </p>
1792   */
1793  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1794
1795 /**
1796   * Search parameter: <b>date</b>
1797   * <p>
1798   * Description: <b>Multiple Resources: 
1799
1800* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1801* [CarePlan](careplan.html): Time period plan covers
1802* [CareTeam](careteam.html): A date within the coverage time period.
1803* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1804* [Composition](composition.html): Composition editing time
1805* [Consent](consent.html): When consent was agreed to
1806* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1807* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1808* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1809* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1810* [Flag](flag.html): Time period when flag is active
1811* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1812* [List](list.html): When the list was prepared
1813* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1814* [Procedure](procedure.html): When the procedure occurred or is occurring
1815* [RiskAssessment](riskassessment.html): When was assessment made?
1816* [SupplyRequest](supplyrequest.html): When the request was made
1817</b><br>
1818   * Type: <b>date</b><br>
1819   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1820   * </p>
1821   */
1822  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (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" )
1823  public static final String SP_DATE = "date";
1824 /**
1825   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1826   * <p>
1827   * Description: <b>Multiple Resources: 
1828
1829* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
1830* [CarePlan](careplan.html): Time period plan covers
1831* [CareTeam](careteam.html): A date within the coverage time period.
1832* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
1833* [Composition](composition.html): Composition editing time
1834* [Consent](consent.html): When consent was agreed to
1835* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
1836* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
1837* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
1838* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
1839* [Flag](flag.html): Time period when flag is active
1840* [Immunization](immunization.html): Vaccination  (non)-Administration Date
1841* [List](list.html): When the list was prepared
1842* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
1843* [Procedure](procedure.html): When the procedure occurred or is occurring
1844* [RiskAssessment](riskassessment.html): When was assessment made?
1845* [SupplyRequest](supplyrequest.html): When the request was made
1846</b><br>
1847   * Type: <b>date</b><br>
1848   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
1849   * </p>
1850   */
1851  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1852
1853 /**
1854   * Search parameter: <b>identifier</b>
1855   * <p>
1856   * Description: <b>Multiple Resources: 
1857
1858* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1859* [CarePlan](careplan.html): External Ids for this plan
1860* [CareTeam](careteam.html): External Ids for this team
1861* [Composition](composition.html): Version-independent identifier for the Composition
1862* [Condition](condition.html): A unique identifier of the condition record
1863* [Consent](consent.html): Identifier for this record (external references)
1864* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1865* [DeviceRequest](devicerequest.html): Business identifier for request/order
1866* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1867* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1868* [DocumentReference](documentreference.html): Identifier of the attachment binary
1869* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1870* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1871* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1872* [Goal](goal.html): External Ids for this goal
1873* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1874* [Immunization](immunization.html): Business identifier
1875* [List](list.html): Business identifier
1876* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1877* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1878* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1879* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1880* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1881* [Observation](observation.html): The unique id for a particular observation
1882* [Procedure](procedure.html): A unique identifier for a procedure
1883* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1884* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1885* [SupplyDelivery](supplydelivery.html): External identifier
1886* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1887* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1888</b><br>
1889   * Type: <b>token</b><br>
1890   * 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>
1891   * </p>
1892   */
1893  @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" )
1894  public static final String SP_IDENTIFIER = "identifier";
1895 /**
1896   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1897   * <p>
1898   * Description: <b>Multiple Resources: 
1899
1900* [AllergyIntolerance](allergyintolerance.html): External ids for this item
1901* [CarePlan](careplan.html): External Ids for this plan
1902* [CareTeam](careteam.html): External Ids for this team
1903* [Composition](composition.html): Version-independent identifier for the Composition
1904* [Condition](condition.html): A unique identifier of the condition record
1905* [Consent](consent.html): Identifier for this record (external references)
1906* [DetectedIssue](detectedissue.html): Unique id for the detected issue
1907* [DeviceRequest](devicerequest.html): Business identifier for request/order
1908* [DiagnosticReport](diagnosticreport.html): An identifier for the report
1909* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
1910* [DocumentReference](documentreference.html): Identifier of the attachment binary
1911* [Encounter](encounter.html): Identifier(s) by which this encounter is known
1912* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
1913* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
1914* [Goal](goal.html): External Ids for this goal
1915* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
1916* [Immunization](immunization.html): Business identifier
1917* [List](list.html): Business identifier
1918* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
1919* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
1920* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
1921* [MedicationUsage](medicationusage.html): Return statements with this external identifier
1922* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
1923* [Observation](observation.html): The unique id for a particular observation
1924* [Procedure](procedure.html): A unique identifier for a procedure
1925* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
1926* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
1927* [SupplyDelivery](supplydelivery.html): External identifier
1928* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
1929* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
1930</b><br>
1931   * Type: <b>token</b><br>
1932   * 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>
1933   * </p>
1934   */
1935  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1936
1937 /**
1938   * Search parameter: <b>patient</b>
1939   * <p>
1940   * Description: <b>Multiple Resources: 
1941
1942* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
1943* [CarePlan](careplan.html): Who the care plan is for
1944* [CareTeam](careteam.html): Who care team is for
1945* [ClinicalImpression](clinicalimpression.html): Patient assessed
1946* [Composition](composition.html): Who and/or what the composition is about
1947* [Condition](condition.html): Who has the condition?
1948* [Consent](consent.html): Who the consent applies to
1949* [DetectedIssue](detectedissue.html): Associated patient
1950* [DeviceRequest](devicerequest.html): Individual the service is ordered for
1951* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
1952* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
1953* [DocumentManifest](documentmanifest.html): The subject of the set of documents
1954* [DocumentReference](documentreference.html): Who/what is the subject of the document
1955* [Encounter](encounter.html): The patient present at the encounter
1956* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
1957* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
1958* [Flag](flag.html): The identity of a subject to list flags for
1959* [Goal](goal.html): Who this goal is intended for
1960* [ImagingStudy](imagingstudy.html): Who the study is about
1961* [Immunization](immunization.html): The patient for the vaccination record
1962* [List](list.html): If all resources have the same subject
1963* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
1964* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
1965* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
1966* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
1967* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
1968* [Observation](observation.html): The subject that the observation is about (if patient)
1969* [Procedure](procedure.html): Search by subject - a patient
1970* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
1971* [ServiceRequest](servicerequest.html): Search by subject - a patient
1972* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
1973* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
1974</b><br>
1975   * Type: <b>reference</b><br>
1976   * 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.patient | 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.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 | VisionPrescription.patient</b><br>
1977   * </p>
1978   */
1979  @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.patient | 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.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 | 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 person 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* [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={Patient.class } )
1980  public static final String SP_PATIENT = "patient";
1981 /**
1982   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1983   * <p>
1984   * Description: <b>Multiple Resources: 
1985
1986* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
1987* [CarePlan](careplan.html): Who the care plan is for
1988* [CareTeam](careteam.html): Who care team is for
1989* [ClinicalImpression](clinicalimpression.html): Patient assessed
1990* [Composition](composition.html): Who and/or what the composition is about
1991* [Condition](condition.html): Who has the condition?
1992* [Consent](consent.html): Who the consent applies to
1993* [DetectedIssue](detectedissue.html): Associated patient
1994* [DeviceRequest](devicerequest.html): Individual the service is ordered for
1995* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
1996* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
1997* [DocumentManifest](documentmanifest.html): The subject of the set of documents
1998* [DocumentReference](documentreference.html): Who/what is the subject of the document
1999* [Encounter](encounter.html): The patient present at the encounter
2000* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2001* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2002* [Flag](flag.html): The identity of a subject to list flags for
2003* [Goal](goal.html): Who this goal is intended for
2004* [ImagingStudy](imagingstudy.html): Who the study is about
2005* [Immunization](immunization.html): The patient for the vaccination record
2006* [List](list.html): If all resources have the same subject
2007* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2008* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2009* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2010* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2011* [NutritionOrder](nutritionorder.html): The identity of the person who requires the diet, formula or nutritional supplement
2012* [Observation](observation.html): The subject that the observation is about (if patient)
2013* [Procedure](procedure.html): Search by subject - a patient
2014* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2015* [ServiceRequest](servicerequest.html): Search by subject - a patient
2016* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2017* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2018</b><br>
2019   * Type: <b>reference</b><br>
2020   * 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.patient | 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.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 | VisionPrescription.patient</b><br>
2021   * </p>
2022   */
2023  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2024
2025/**
2026   * Constant for fluent queries to be used to add include statements. Specifies
2027   * the path value of "<b>EpisodeOfCare:patient</b>".
2028   */
2029  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:patient").toLocked();
2030
2031 /**
2032   * Search parameter: <b>type</b>
2033   * <p>
2034   * Description: <b>Multiple Resources: 
2035
2036* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2037* [Composition](composition.html): Kind of composition (LOINC if possible)
2038* [DocumentManifest](documentmanifest.html): Kind of document set
2039* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2040* [Encounter](encounter.html): Specific type of encounter
2041* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2042</b><br>
2043   * Type: <b>token</b><br>
2044   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
2045   * </p>
2046   */
2047  @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" )
2048  public static final String SP_TYPE = "type";
2049 /**
2050   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2051   * <p>
2052   * Description: <b>Multiple Resources: 
2053
2054* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2055* [Composition](composition.html): Kind of composition (LOINC if possible)
2056* [DocumentManifest](documentmanifest.html): Kind of document set
2057* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2058* [Encounter](encounter.html): Specific type of encounter
2059* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
2060</b><br>
2061   * Type: <b>token</b><br>
2062   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
2063   * </p>
2064   */
2065  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2066
2067
2068}
2069