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