001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * An interaction between healthcare provider(s), and/or patient(s) for the purpose of providing healthcare service(s) or assessing the health status of patient(s).
052 */
053@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/StructureDefinition/Encounter")
054public class Encounter extends DomainResource {
055
056    public enum EncounterLocationStatus {
057        /**
058         * The patient is planned to be moved to this location at some point in the future.
059         */
060        PLANNED, 
061        /**
062         * The patient is currently at this location, or was between the period specified.\r\rA system may update these records when the patient leaves the location to either reserved, or completed.
063         */
064        ACTIVE, 
065        /**
066         * This location is held empty for this patient.
067         */
068        RESERVED, 
069        /**
070         * The patient was at this location during the period specified.\r\rNot to be used when the patient is currently at the location.
071         */
072        COMPLETED, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static EncounterLocationStatus fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("planned".equals(codeString))
081          return PLANNED;
082        if ("active".equals(codeString))
083          return ACTIVE;
084        if ("reserved".equals(codeString))
085          return RESERVED;
086        if ("completed".equals(codeString))
087          return COMPLETED;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case PLANNED: return "planned";
096            case ACTIVE: return "active";
097            case RESERVED: return "reserved";
098            case COMPLETED: return "completed";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case PLANNED: return "http://hl7.org/fhir/encounter-location-status";
106            case ACTIVE: return "http://hl7.org/fhir/encounter-location-status";
107            case RESERVED: return "http://hl7.org/fhir/encounter-location-status";
108            case COMPLETED: return "http://hl7.org/fhir/encounter-location-status";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case PLANNED: return "The patient is planned to be moved to this location at some point in the future.";
116            case ACTIVE: return "The patient is currently at this location, or was between the period specified.\r\rA system may update these records when the patient leaves the location to either reserved, or completed.";
117            case RESERVED: return "This location is held empty for this patient.";
118            case COMPLETED: return "The patient was at this location during the period specified.\r\rNot to be used when the patient is currently at the location.";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getDisplay() {
124          switch (this) {
125            case PLANNED: return "Planned";
126            case ACTIVE: return "Active";
127            case RESERVED: return "Reserved";
128            case COMPLETED: return "Completed";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133    }
134
135  public static class EncounterLocationStatusEnumFactory implements EnumFactory<EncounterLocationStatus> {
136    public EncounterLocationStatus fromCode(String codeString) throws IllegalArgumentException {
137      if (codeString == null || "".equals(codeString))
138            if (codeString == null || "".equals(codeString))
139                return null;
140        if ("planned".equals(codeString))
141          return EncounterLocationStatus.PLANNED;
142        if ("active".equals(codeString))
143          return EncounterLocationStatus.ACTIVE;
144        if ("reserved".equals(codeString))
145          return EncounterLocationStatus.RESERVED;
146        if ("completed".equals(codeString))
147          return EncounterLocationStatus.COMPLETED;
148        throw new IllegalArgumentException("Unknown EncounterLocationStatus code '"+codeString+"'");
149        }
150        public Enumeration<EncounterLocationStatus> fromType(PrimitiveType<?> code) throws FHIRException {
151          if (code == null)
152            return null;
153          if (code.isEmpty())
154            return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.NULL, code);
155          String codeString = ((PrimitiveType) code).asStringValue();
156          if (codeString == null || "".equals(codeString))
157            return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.NULL, code);
158        if ("planned".equals(codeString))
159          return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.PLANNED, code);
160        if ("active".equals(codeString))
161          return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.ACTIVE, code);
162        if ("reserved".equals(codeString))
163          return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.RESERVED, code);
164        if ("completed".equals(codeString))
165          return new Enumeration<EncounterLocationStatus>(this, EncounterLocationStatus.COMPLETED, code);
166        throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'");
167        }
168    public String toCode(EncounterLocationStatus code) {
169      if (code == EncounterLocationStatus.PLANNED)
170        return "planned";
171      if (code == EncounterLocationStatus.ACTIVE)
172        return "active";
173      if (code == EncounterLocationStatus.RESERVED)
174        return "reserved";
175      if (code == EncounterLocationStatus.COMPLETED)
176        return "completed";
177      return "?";
178      }
179    public String toSystem(EncounterLocationStatus code) {
180      return code.getSystem();
181      }
182    }
183
184    @Block()
185    public static class EncounterParticipantComponent extends BackboneElement implements IBaseBackboneElement {
186        /**
187         * Role of participant in encounter.
188         */
189        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
190        @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." )
191        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-participant-type")
192        protected List<CodeableConcept> type;
193
194        /**
195         * The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.
196         */
197        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false)
198        @Description(shortDefinition="Period of time during the encounter that the participant participated", formalDefinition="The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period." )
199        protected Period period;
200
201        /**
202         * Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times.
203         */
204        @Child(name = "actor", type = {Patient.class, Group.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class, Device.class, HealthcareService.class}, order=3, min=0, max=1, modifier=false, summary=true)
205        @Description(shortDefinition="The individual, device, or service participating in the encounter", formalDefinition="Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times." )
206        protected Reference actor;
207
208        private static final long serialVersionUID = 1982623707L;
209
210    /**
211     * Constructor
212     */
213      public EncounterParticipantComponent() {
214        super();
215      }
216
217        /**
218         * @return {@link #type} (Role of participant in encounter.)
219         */
220        public List<CodeableConcept> getType() { 
221          if (this.type == null)
222            this.type = new ArrayList<CodeableConcept>();
223          return this.type;
224        }
225
226        /**
227         * @return Returns a reference to <code>this</code> for easy method chaining
228         */
229        public EncounterParticipantComponent setType(List<CodeableConcept> theType) { 
230          this.type = theType;
231          return this;
232        }
233
234        public boolean hasType() { 
235          if (this.type == null)
236            return false;
237          for (CodeableConcept item : this.type)
238            if (!item.isEmpty())
239              return true;
240          return false;
241        }
242
243        public CodeableConcept addType() { //3
244          CodeableConcept t = new CodeableConcept();
245          if (this.type == null)
246            this.type = new ArrayList<CodeableConcept>();
247          this.type.add(t);
248          return t;
249        }
250
251        public EncounterParticipantComponent addType(CodeableConcept t) { //3
252          if (t == null)
253            return this;
254          if (this.type == null)
255            this.type = new ArrayList<CodeableConcept>();
256          this.type.add(t);
257          return this;
258        }
259
260        /**
261         * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
262         */
263        public CodeableConcept getTypeFirstRep() { 
264          if (getType().isEmpty()) {
265            addType();
266          }
267          return getType().get(0);
268        }
269
270        /**
271         * @return {@link #period} (The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.)
272         */
273        public Period getPeriod() { 
274          if (this.period == null)
275            if (Configuration.errorOnAutoCreate())
276              throw new Error("Attempt to auto-create EncounterParticipantComponent.period");
277            else if (Configuration.doAutoCreate())
278              this.period = new Period(); // cc
279          return this.period;
280        }
281
282        public boolean hasPeriod() { 
283          return this.period != null && !this.period.isEmpty();
284        }
285
286        /**
287         * @param value {@link #period} (The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.)
288         */
289        public EncounterParticipantComponent setPeriod(Period value) { 
290          this.period = value;
291          return this;
292        }
293
294        /**
295         * @return {@link #actor} (Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times.)
296         */
297        public Reference getActor() { 
298          if (this.actor == null)
299            if (Configuration.errorOnAutoCreate())
300              throw new Error("Attempt to auto-create EncounterParticipantComponent.actor");
301            else if (Configuration.doAutoCreate())
302              this.actor = new Reference(); // cc
303          return this.actor;
304        }
305
306        public boolean hasActor() { 
307          return this.actor != null && !this.actor.isEmpty();
308        }
309
310        /**
311         * @param value {@link #actor} (Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times.)
312         */
313        public EncounterParticipantComponent setActor(Reference value) { 
314          this.actor = value;
315          return this;
316        }
317
318        protected void listChildren(List<Property> children) {
319          super.listChildren(children);
320          children.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type));
321          children.add(new Property("period", "Period", "The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.", 0, 1, period));
322          children.add(new Property("actor", "Reference(Patient|Group|RelatedPerson|Practitioner|PractitionerRole|Device|HealthcareService)", "Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times.", 0, 1, actor));
323        }
324
325        @Override
326        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
327          switch (_hash) {
328          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type);
329          case -991726143: /*period*/  return new Property("period", "Period", "The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.", 0, 1, period);
330          case 92645877: /*actor*/  return new Property("actor", "Reference(Patient|Group|RelatedPerson|Practitioner|PractitionerRole|Device|HealthcareService)", "Person involved in the encounter, the patient/group is also included here to indicate that the patient was actually participating in the encounter. Not including the patient here covers use cases such as a case meeting between practitioners about a patient - non contact times.", 0, 1, actor);
331          default: return super.getNamedProperty(_hash, _name, _checkValid);
332          }
333
334        }
335
336      @Override
337      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
338        switch (hash) {
339        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
340        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
341        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
342        default: return super.getProperty(hash, name, checkValid);
343        }
344
345      }
346
347      @Override
348      public Base setProperty(int hash, String name, Base value) throws FHIRException {
349        switch (hash) {
350        case 3575610: // type
351          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
352          return value;
353        case -991726143: // period
354          this.period = TypeConvertor.castToPeriod(value); // Period
355          return value;
356        case 92645877: // actor
357          this.actor = TypeConvertor.castToReference(value); // Reference
358          return value;
359        default: return super.setProperty(hash, name, value);
360        }
361
362      }
363
364      @Override
365      public Base setProperty(String name, Base value) throws FHIRException {
366        if (name.equals("type")) {
367          this.getType().add(TypeConvertor.castToCodeableConcept(value));
368        } else if (name.equals("period")) {
369          this.period = TypeConvertor.castToPeriod(value); // Period
370        } else if (name.equals("actor")) {
371          this.actor = TypeConvertor.castToReference(value); // Reference
372        } else
373          return super.setProperty(name, value);
374        return value;
375      }
376
377      @Override
378      public Base makeProperty(int hash, String name) throws FHIRException {
379        switch (hash) {
380        case 3575610:  return addType(); 
381        case -991726143:  return getPeriod();
382        case 92645877:  return getActor();
383        default: return super.makeProperty(hash, name);
384        }
385
386      }
387
388      @Override
389      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
390        switch (hash) {
391        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
392        case -991726143: /*period*/ return new String[] {"Period"};
393        case 92645877: /*actor*/ return new String[] {"Reference"};
394        default: return super.getTypesForProperty(hash, name);
395        }
396
397      }
398
399      @Override
400      public Base addChild(String name) throws FHIRException {
401        if (name.equals("type")) {
402          return addType();
403        }
404        else if (name.equals("period")) {
405          this.period = new Period();
406          return this.period;
407        }
408        else if (name.equals("actor")) {
409          this.actor = new Reference();
410          return this.actor;
411        }
412        else
413          return super.addChild(name);
414      }
415
416      public EncounterParticipantComponent copy() {
417        EncounterParticipantComponent dst = new EncounterParticipantComponent();
418        copyValues(dst);
419        return dst;
420      }
421
422      public void copyValues(EncounterParticipantComponent dst) {
423        super.copyValues(dst);
424        if (type != null) {
425          dst.type = new ArrayList<CodeableConcept>();
426          for (CodeableConcept i : type)
427            dst.type.add(i.copy());
428        };
429        dst.period = period == null ? null : period.copy();
430        dst.actor = actor == null ? null : actor.copy();
431      }
432
433      @Override
434      public boolean equalsDeep(Base other_) {
435        if (!super.equalsDeep(other_))
436          return false;
437        if (!(other_ instanceof EncounterParticipantComponent))
438          return false;
439        EncounterParticipantComponent o = (EncounterParticipantComponent) other_;
440        return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(actor, o.actor, true)
441          ;
442      }
443
444      @Override
445      public boolean equalsShallow(Base other_) {
446        if (!super.equalsShallow(other_))
447          return false;
448        if (!(other_ instanceof EncounterParticipantComponent))
449          return false;
450        EncounterParticipantComponent o = (EncounterParticipantComponent) other_;
451        return true;
452      }
453
454      public boolean isEmpty() {
455        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, period, actor);
456      }
457
458  public String fhirType() {
459    return "Encounter.participant";
460
461  }
462
463  }
464
465    @Block()
466    public static class ReasonComponent extends BackboneElement implements IBaseBackboneElement {
467        /**
468         * What the reason value should be used as e.g. Chief Complaint, Health Concern, Health Maintenance (including screening).
469         */
470        @Child(name = "use", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
471        @Description(shortDefinition="What the reason value should be used for/as", formalDefinition="What the reason value should be used as e.g. Chief Complaint, Health Concern, Health Maintenance (including screening)." )
472        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-reason-use")
473        protected List<CodeableConcept> use;
474
475        /**
476         * Reason the encounter takes place, expressed as a code or a reference to another resource. For admissions, this can be used for a coded admission diagnosis.
477         */
478        @Child(name = "value", type = {CodeableReference.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
479        @Description(shortDefinition="Reason the encounter takes place (core or reference)", formalDefinition="Reason the encounter takes place, expressed as a code or a reference to another resource. For admissions, this can be used for a coded admission diagnosis." )
480        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-reason")
481        protected List<CodeableReference> value;
482
483        private static final long serialVersionUID = 1305979913L;
484
485    /**
486     * Constructor
487     */
488      public ReasonComponent() {
489        super();
490      }
491
492        /**
493         * @return {@link #use} (What the reason value should be used as e.g. Chief Complaint, Health Concern, Health Maintenance (including screening).)
494         */
495        public List<CodeableConcept> getUse() { 
496          if (this.use == null)
497            this.use = new ArrayList<CodeableConcept>();
498          return this.use;
499        }
500
501        /**
502         * @return Returns a reference to <code>this</code> for easy method chaining
503         */
504        public ReasonComponent setUse(List<CodeableConcept> theUse) { 
505          this.use = theUse;
506          return this;
507        }
508
509        public boolean hasUse() { 
510          if (this.use == null)
511            return false;
512          for (CodeableConcept item : this.use)
513            if (!item.isEmpty())
514              return true;
515          return false;
516        }
517
518        public CodeableConcept addUse() { //3
519          CodeableConcept t = new CodeableConcept();
520          if (this.use == null)
521            this.use = new ArrayList<CodeableConcept>();
522          this.use.add(t);
523          return t;
524        }
525
526        public ReasonComponent addUse(CodeableConcept t) { //3
527          if (t == null)
528            return this;
529          if (this.use == null)
530            this.use = new ArrayList<CodeableConcept>();
531          this.use.add(t);
532          return this;
533        }
534
535        /**
536         * @return The first repetition of repeating field {@link #use}, creating it if it does not already exist {3}
537         */
538        public CodeableConcept getUseFirstRep() { 
539          if (getUse().isEmpty()) {
540            addUse();
541          }
542          return getUse().get(0);
543        }
544
545        /**
546         * @return {@link #value} (Reason the encounter takes place, expressed as a code or a reference to another resource. For admissions, this can be used for a coded admission diagnosis.)
547         */
548        public List<CodeableReference> getValue() { 
549          if (this.value == null)
550            this.value = new ArrayList<CodeableReference>();
551          return this.value;
552        }
553
554        /**
555         * @return Returns a reference to <code>this</code> for easy method chaining
556         */
557        public ReasonComponent setValue(List<CodeableReference> theValue) { 
558          this.value = theValue;
559          return this;
560        }
561
562        public boolean hasValue() { 
563          if (this.value == null)
564            return false;
565          for (CodeableReference item : this.value)
566            if (!item.isEmpty())
567              return true;
568          return false;
569        }
570
571        public CodeableReference addValue() { //3
572          CodeableReference t = new CodeableReference();
573          if (this.value == null)
574            this.value = new ArrayList<CodeableReference>();
575          this.value.add(t);
576          return t;
577        }
578
579        public ReasonComponent addValue(CodeableReference t) { //3
580          if (t == null)
581            return this;
582          if (this.value == null)
583            this.value = new ArrayList<CodeableReference>();
584          this.value.add(t);
585          return this;
586        }
587
588        /**
589         * @return The first repetition of repeating field {@link #value}, creating it if it does not already exist {3}
590         */
591        public CodeableReference getValueFirstRep() { 
592          if (getValue().isEmpty()) {
593            addValue();
594          }
595          return getValue().get(0);
596        }
597
598        protected void listChildren(List<Property> children) {
599          super.listChildren(children);
600          children.add(new Property("use", "CodeableConcept", "What the reason value should be used as e.g. Chief Complaint, Health Concern, Health Maintenance (including screening).", 0, java.lang.Integer.MAX_VALUE, use));
601          children.add(new Property("value", "CodeableReference(Condition|DiagnosticReport|Observation|ImmunizationRecommendation|Procedure)", "Reason the encounter takes place, expressed as a code or a reference to another resource. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, value));
602        }
603
604        @Override
605        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
606          switch (_hash) {
607          case 116103: /*use*/  return new Property("use", "CodeableConcept", "What the reason value should be used as e.g. Chief Complaint, Health Concern, Health Maintenance (including screening).", 0, java.lang.Integer.MAX_VALUE, use);
608          case 111972721: /*value*/  return new Property("value", "CodeableReference(Condition|DiagnosticReport|Observation|ImmunizationRecommendation|Procedure)", "Reason the encounter takes place, expressed as a code or a reference to another resource. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, value);
609          default: return super.getNamedProperty(_hash, _name, _checkValid);
610          }
611
612        }
613
614      @Override
615      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
616        switch (hash) {
617        case 116103: /*use*/ return this.use == null ? new Base[0] : this.use.toArray(new Base[this.use.size()]); // CodeableConcept
618        case 111972721: /*value*/ return this.value == null ? new Base[0] : this.value.toArray(new Base[this.value.size()]); // CodeableReference
619        default: return super.getProperty(hash, name, checkValid);
620        }
621
622      }
623
624      @Override
625      public Base setProperty(int hash, String name, Base value) throws FHIRException {
626        switch (hash) {
627        case 116103: // use
628          this.getUse().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
629          return value;
630        case 111972721: // value
631          this.getValue().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
632          return value;
633        default: return super.setProperty(hash, name, value);
634        }
635
636      }
637
638      @Override
639      public Base setProperty(String name, Base value) throws FHIRException {
640        if (name.equals("use")) {
641          this.getUse().add(TypeConvertor.castToCodeableConcept(value));
642        } else if (name.equals("value")) {
643          this.getValue().add(TypeConvertor.castToCodeableReference(value));
644        } else
645          return super.setProperty(name, value);
646        return value;
647      }
648
649      @Override
650      public Base makeProperty(int hash, String name) throws FHIRException {
651        switch (hash) {
652        case 116103:  return addUse(); 
653        case 111972721:  return addValue(); 
654        default: return super.makeProperty(hash, name);
655        }
656
657      }
658
659      @Override
660      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
661        switch (hash) {
662        case 116103: /*use*/ return new String[] {"CodeableConcept"};
663        case 111972721: /*value*/ return new String[] {"CodeableReference"};
664        default: return super.getTypesForProperty(hash, name);
665        }
666
667      }
668
669      @Override
670      public Base addChild(String name) throws FHIRException {
671        if (name.equals("use")) {
672          return addUse();
673        }
674        else if (name.equals("value")) {
675          return addValue();
676        }
677        else
678          return super.addChild(name);
679      }
680
681      public ReasonComponent copy() {
682        ReasonComponent dst = new ReasonComponent();
683        copyValues(dst);
684        return dst;
685      }
686
687      public void copyValues(ReasonComponent dst) {
688        super.copyValues(dst);
689        if (use != null) {
690          dst.use = new ArrayList<CodeableConcept>();
691          for (CodeableConcept i : use)
692            dst.use.add(i.copy());
693        };
694        if (value != null) {
695          dst.value = new ArrayList<CodeableReference>();
696          for (CodeableReference i : value)
697            dst.value.add(i.copy());
698        };
699      }
700
701      @Override
702      public boolean equalsDeep(Base other_) {
703        if (!super.equalsDeep(other_))
704          return false;
705        if (!(other_ instanceof ReasonComponent))
706          return false;
707        ReasonComponent o = (ReasonComponent) other_;
708        return compareDeep(use, o.use, true) && compareDeep(value, o.value, true);
709      }
710
711      @Override
712      public boolean equalsShallow(Base other_) {
713        if (!super.equalsShallow(other_))
714          return false;
715        if (!(other_ instanceof ReasonComponent))
716          return false;
717        ReasonComponent o = (ReasonComponent) other_;
718        return true;
719      }
720
721      public boolean isEmpty() {
722        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(use, value);
723      }
724
725  public String fhirType() {
726    return "Encounter.reason";
727
728  }
729
730  }
731
732    @Block()
733    public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement {
734        /**
735         * The coded diagnosis or a reference to a Condition (with other resources referenced in the evidence.detail), the use property will indicate the purpose of this specific diagnosis.
736         */
737        @Child(name = "condition", type = {CodeableReference.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
738        @Description(shortDefinition="The diagnosis relevant to the encounter", formalDefinition="The coded diagnosis or a reference to a Condition (with other resources referenced in the evidence.detail), the use property will indicate the purpose of this specific diagnosis." )
739        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/condition-code")
740        protected List<CodeableReference> condition;
741
742        /**
743         * Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?).
744         */
745        @Child(name = "use", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
746        @Description(shortDefinition="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?)", formalDefinition="Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?)." )
747        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-diagnosis-use")
748        protected List<CodeableConcept> use;
749
750        private static final long serialVersionUID = 1029565663L;
751
752    /**
753     * Constructor
754     */
755      public DiagnosisComponent() {
756        super();
757      }
758
759        /**
760         * @return {@link #condition} (The coded diagnosis or a reference to a Condition (with other resources referenced in the evidence.detail), the use property will indicate the purpose of this specific diagnosis.)
761         */
762        public List<CodeableReference> getCondition() { 
763          if (this.condition == null)
764            this.condition = new ArrayList<CodeableReference>();
765          return this.condition;
766        }
767
768        /**
769         * @return Returns a reference to <code>this</code> for easy method chaining
770         */
771        public DiagnosisComponent setCondition(List<CodeableReference> theCondition) { 
772          this.condition = theCondition;
773          return this;
774        }
775
776        public boolean hasCondition() { 
777          if (this.condition == null)
778            return false;
779          for (CodeableReference item : this.condition)
780            if (!item.isEmpty())
781              return true;
782          return false;
783        }
784
785        public CodeableReference addCondition() { //3
786          CodeableReference t = new CodeableReference();
787          if (this.condition == null)
788            this.condition = new ArrayList<CodeableReference>();
789          this.condition.add(t);
790          return t;
791        }
792
793        public DiagnosisComponent addCondition(CodeableReference t) { //3
794          if (t == null)
795            return this;
796          if (this.condition == null)
797            this.condition = new ArrayList<CodeableReference>();
798          this.condition.add(t);
799          return this;
800        }
801
802        /**
803         * @return The first repetition of repeating field {@link #condition}, creating it if it does not already exist {3}
804         */
805        public CodeableReference getConditionFirstRep() { 
806          if (getCondition().isEmpty()) {
807            addCondition();
808          }
809          return getCondition().get(0);
810        }
811
812        /**
813         * @return {@link #use} (Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?).)
814         */
815        public List<CodeableConcept> getUse() { 
816          if (this.use == null)
817            this.use = new ArrayList<CodeableConcept>();
818          return this.use;
819        }
820
821        /**
822         * @return Returns a reference to <code>this</code> for easy method chaining
823         */
824        public DiagnosisComponent setUse(List<CodeableConcept> theUse) { 
825          this.use = theUse;
826          return this;
827        }
828
829        public boolean hasUse() { 
830          if (this.use == null)
831            return false;
832          for (CodeableConcept item : this.use)
833            if (!item.isEmpty())
834              return true;
835          return false;
836        }
837
838        public CodeableConcept addUse() { //3
839          CodeableConcept t = new CodeableConcept();
840          if (this.use == null)
841            this.use = new ArrayList<CodeableConcept>();
842          this.use.add(t);
843          return t;
844        }
845
846        public DiagnosisComponent addUse(CodeableConcept t) { //3
847          if (t == null)
848            return this;
849          if (this.use == null)
850            this.use = new ArrayList<CodeableConcept>();
851          this.use.add(t);
852          return this;
853        }
854
855        /**
856         * @return The first repetition of repeating field {@link #use}, creating it if it does not already exist {3}
857         */
858        public CodeableConcept getUseFirstRep() { 
859          if (getUse().isEmpty()) {
860            addUse();
861          }
862          return getUse().get(0);
863        }
864
865        protected void listChildren(List<Property> children) {
866          super.listChildren(children);
867          children.add(new Property("condition", "CodeableReference(Condition)", "The coded diagnosis or a reference to a Condition (with other resources referenced in the evidence.detail), the use property will indicate the purpose of this specific diagnosis.", 0, java.lang.Integer.MAX_VALUE, condition));
868          children.add(new Property("use", "CodeableConcept", "Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?).", 0, java.lang.Integer.MAX_VALUE, use));
869        }
870
871        @Override
872        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
873          switch (_hash) {
874          case -861311717: /*condition*/  return new Property("condition", "CodeableReference(Condition)", "The coded diagnosis or a reference to a Condition (with other resources referenced in the evidence.detail), the use property will indicate the purpose of this specific diagnosis.", 0, java.lang.Integer.MAX_VALUE, condition);
875          case 116103: /*use*/  return new Property("use", "CodeableConcept", "Role that this diagnosis has within the encounter (e.g. admission, billing, discharge ?).", 0, java.lang.Integer.MAX_VALUE, use);
876          default: return super.getNamedProperty(_hash, _name, _checkValid);
877          }
878
879        }
880
881      @Override
882      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
883        switch (hash) {
884        case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // CodeableReference
885        case 116103: /*use*/ return this.use == null ? new Base[0] : this.use.toArray(new Base[this.use.size()]); // CodeableConcept
886        default: return super.getProperty(hash, name, checkValid);
887        }
888
889      }
890
891      @Override
892      public Base setProperty(int hash, String name, Base value) throws FHIRException {
893        switch (hash) {
894        case -861311717: // condition
895          this.getCondition().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
896          return value;
897        case 116103: // use
898          this.getUse().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
899          return value;
900        default: return super.setProperty(hash, name, value);
901        }
902
903      }
904
905      @Override
906      public Base setProperty(String name, Base value) throws FHIRException {
907        if (name.equals("condition")) {
908          this.getCondition().add(TypeConvertor.castToCodeableReference(value));
909        } else if (name.equals("use")) {
910          this.getUse().add(TypeConvertor.castToCodeableConcept(value));
911        } else
912          return super.setProperty(name, value);
913        return value;
914      }
915
916      @Override
917      public Base makeProperty(int hash, String name) throws FHIRException {
918        switch (hash) {
919        case -861311717:  return addCondition(); 
920        case 116103:  return addUse(); 
921        default: return super.makeProperty(hash, name);
922        }
923
924      }
925
926      @Override
927      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
928        switch (hash) {
929        case -861311717: /*condition*/ return new String[] {"CodeableReference"};
930        case 116103: /*use*/ return new String[] {"CodeableConcept"};
931        default: return super.getTypesForProperty(hash, name);
932        }
933
934      }
935
936      @Override
937      public Base addChild(String name) throws FHIRException {
938        if (name.equals("condition")) {
939          return addCondition();
940        }
941        else if (name.equals("use")) {
942          return addUse();
943        }
944        else
945          return super.addChild(name);
946      }
947
948      public DiagnosisComponent copy() {
949        DiagnosisComponent dst = new DiagnosisComponent();
950        copyValues(dst);
951        return dst;
952      }
953
954      public void copyValues(DiagnosisComponent dst) {
955        super.copyValues(dst);
956        if (condition != null) {
957          dst.condition = new ArrayList<CodeableReference>();
958          for (CodeableReference i : condition)
959            dst.condition.add(i.copy());
960        };
961        if (use != null) {
962          dst.use = new ArrayList<CodeableConcept>();
963          for (CodeableConcept i : use)
964            dst.use.add(i.copy());
965        };
966      }
967
968      @Override
969      public boolean equalsDeep(Base other_) {
970        if (!super.equalsDeep(other_))
971          return false;
972        if (!(other_ instanceof DiagnosisComponent))
973          return false;
974        DiagnosisComponent o = (DiagnosisComponent) other_;
975        return compareDeep(condition, o.condition, true) && compareDeep(use, o.use, true);
976      }
977
978      @Override
979      public boolean equalsShallow(Base other_) {
980        if (!super.equalsShallow(other_))
981          return false;
982        if (!(other_ instanceof DiagnosisComponent))
983          return false;
984        DiagnosisComponent o = (DiagnosisComponent) other_;
985        return true;
986      }
987
988      public boolean isEmpty() {
989        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(condition, use);
990      }
991
992  public String fhirType() {
993    return "Encounter.diagnosis";
994
995  }
996
997  }
998
999    @Block()
1000    public static class EncounterAdmissionComponent extends BackboneElement implements IBaseBackboneElement {
1001        /**
1002         * Pre-admission identifier.
1003         */
1004        @Child(name = "preAdmissionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false)
1005        @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." )
1006        protected Identifier preAdmissionIdentifier;
1007
1008        /**
1009         * The location/organization from which the patient came before admission.
1010         */
1011        @Child(name = "origin", type = {Location.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=false)
1012        @Description(shortDefinition="The location/organization from which the patient came before admission", formalDefinition="The location/organization from which the patient came before admission." )
1013        protected Reference origin;
1014
1015        /**
1016         * From where patient was admitted (physician referral, transfer).
1017         */
1018        @Child(name = "admitSource", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1019        @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." )
1020        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-admit-source")
1021        protected CodeableConcept admitSource;
1022
1023        /**
1024         * Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed.
1025         */
1026        @Child(name = "reAdmission", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false)
1027        @Description(shortDefinition="Indicates that the patient is being re-admitted", formalDefinition="Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed." )
1028        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v2-0092")
1029        protected CodeableConcept reAdmission;
1030
1031        /**
1032         * Location/organization to which the patient is discharged.
1033         */
1034        @Child(name = "destination", type = {Location.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=false)
1035        @Description(shortDefinition="Location/organization to which the patient is discharged", formalDefinition="Location/organization to which the patient is discharged." )
1036        protected Reference destination;
1037
1038        /**
1039         * Category or kind of location after discharge.
1040         */
1041        @Child(name = "dischargeDisposition", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
1042        @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." )
1043        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-discharge-disposition")
1044        protected CodeableConcept dischargeDisposition;
1045
1046        private static final long serialVersionUID = -1702856594L;
1047
1048    /**
1049     * Constructor
1050     */
1051      public EncounterAdmissionComponent() {
1052        super();
1053      }
1054
1055        /**
1056         * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.)
1057         */
1058        public Identifier getPreAdmissionIdentifier() { 
1059          if (this.preAdmissionIdentifier == null)
1060            if (Configuration.errorOnAutoCreate())
1061              throw new Error("Attempt to auto-create EncounterAdmissionComponent.preAdmissionIdentifier");
1062            else if (Configuration.doAutoCreate())
1063              this.preAdmissionIdentifier = new Identifier(); // cc
1064          return this.preAdmissionIdentifier;
1065        }
1066
1067        public boolean hasPreAdmissionIdentifier() { 
1068          return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty();
1069        }
1070
1071        /**
1072         * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.)
1073         */
1074        public EncounterAdmissionComponent setPreAdmissionIdentifier(Identifier value) { 
1075          this.preAdmissionIdentifier = value;
1076          return this;
1077        }
1078
1079        /**
1080         * @return {@link #origin} (The location/organization from which the patient came before admission.)
1081         */
1082        public Reference getOrigin() { 
1083          if (this.origin == null)
1084            if (Configuration.errorOnAutoCreate())
1085              throw new Error("Attempt to auto-create EncounterAdmissionComponent.origin");
1086            else if (Configuration.doAutoCreate())
1087              this.origin = new Reference(); // cc
1088          return this.origin;
1089        }
1090
1091        public boolean hasOrigin() { 
1092          return this.origin != null && !this.origin.isEmpty();
1093        }
1094
1095        /**
1096         * @param value {@link #origin} (The location/organization from which the patient came before admission.)
1097         */
1098        public EncounterAdmissionComponent setOrigin(Reference value) { 
1099          this.origin = value;
1100          return this;
1101        }
1102
1103        /**
1104         * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).)
1105         */
1106        public CodeableConcept getAdmitSource() { 
1107          if (this.admitSource == null)
1108            if (Configuration.errorOnAutoCreate())
1109              throw new Error("Attempt to auto-create EncounterAdmissionComponent.admitSource");
1110            else if (Configuration.doAutoCreate())
1111              this.admitSource = new CodeableConcept(); // cc
1112          return this.admitSource;
1113        }
1114
1115        public boolean hasAdmitSource() { 
1116          return this.admitSource != null && !this.admitSource.isEmpty();
1117        }
1118
1119        /**
1120         * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).)
1121         */
1122        public EncounterAdmissionComponent setAdmitSource(CodeableConcept value) { 
1123          this.admitSource = value;
1124          return this;
1125        }
1126
1127        /**
1128         * @return {@link #reAdmission} (Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed.)
1129         */
1130        public CodeableConcept getReAdmission() { 
1131          if (this.reAdmission == null)
1132            if (Configuration.errorOnAutoCreate())
1133              throw new Error("Attempt to auto-create EncounterAdmissionComponent.reAdmission");
1134            else if (Configuration.doAutoCreate())
1135              this.reAdmission = new CodeableConcept(); // cc
1136          return this.reAdmission;
1137        }
1138
1139        public boolean hasReAdmission() { 
1140          return this.reAdmission != null && !this.reAdmission.isEmpty();
1141        }
1142
1143        /**
1144         * @param value {@link #reAdmission} (Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed.)
1145         */
1146        public EncounterAdmissionComponent setReAdmission(CodeableConcept value) { 
1147          this.reAdmission = value;
1148          return this;
1149        }
1150
1151        /**
1152         * @return {@link #destination} (Location/organization to which the patient is discharged.)
1153         */
1154        public Reference getDestination() { 
1155          if (this.destination == null)
1156            if (Configuration.errorOnAutoCreate())
1157              throw new Error("Attempt to auto-create EncounterAdmissionComponent.destination");
1158            else if (Configuration.doAutoCreate())
1159              this.destination = new Reference(); // cc
1160          return this.destination;
1161        }
1162
1163        public boolean hasDestination() { 
1164          return this.destination != null && !this.destination.isEmpty();
1165        }
1166
1167        /**
1168         * @param value {@link #destination} (Location/organization to which the patient is discharged.)
1169         */
1170        public EncounterAdmissionComponent setDestination(Reference value) { 
1171          this.destination = value;
1172          return this;
1173        }
1174
1175        /**
1176         * @return {@link #dischargeDisposition} (Category or kind of location after discharge.)
1177         */
1178        public CodeableConcept getDischargeDisposition() { 
1179          if (this.dischargeDisposition == null)
1180            if (Configuration.errorOnAutoCreate())
1181              throw new Error("Attempt to auto-create EncounterAdmissionComponent.dischargeDisposition");
1182            else if (Configuration.doAutoCreate())
1183              this.dischargeDisposition = new CodeableConcept(); // cc
1184          return this.dischargeDisposition;
1185        }
1186
1187        public boolean hasDischargeDisposition() { 
1188          return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty();
1189        }
1190
1191        /**
1192         * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.)
1193         */
1194        public EncounterAdmissionComponent setDischargeDisposition(CodeableConcept value) { 
1195          this.dischargeDisposition = value;
1196          return this;
1197        }
1198
1199        protected void listChildren(List<Property> children) {
1200          super.listChildren(children);
1201          children.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, 1, preAdmissionIdentifier));
1202          children.add(new Property("origin", "Reference(Location|Organization)", "The location/organization from which the patient came before admission.", 0, 1, origin));
1203          children.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, 1, admitSource));
1204          children.add(new Property("reAdmission", "CodeableConcept", "Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed.", 0, 1, reAdmission));
1205          children.add(new Property("destination", "Reference(Location|Organization)", "Location/organization to which the patient is discharged.", 0, 1, destination));
1206          children.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, 1, dischargeDisposition));
1207        }
1208
1209        @Override
1210        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1211          switch (_hash) {
1212          case -965394961: /*preAdmissionIdentifier*/  return new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, 1, preAdmissionIdentifier);
1213          case -1008619738: /*origin*/  return new Property("origin", "Reference(Location|Organization)", "The location/organization from which the patient came before admission.", 0, 1, origin);
1214          case 538887120: /*admitSource*/  return new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, 1, admitSource);
1215          case 669348630: /*reAdmission*/  return new Property("reAdmission", "CodeableConcept", "Indicates that this encounter is directly related to a prior admission, often because the conditions addressed in the prior admission were not fully addressed.", 0, 1, reAdmission);
1216          case -1429847026: /*destination*/  return new Property("destination", "Reference(Location|Organization)", "Location/organization to which the patient is discharged.", 0, 1, destination);
1217          case 528065941: /*dischargeDisposition*/  return new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, 1, dischargeDisposition);
1218          default: return super.getNamedProperty(_hash, _name, _checkValid);
1219          }
1220
1221        }
1222
1223      @Override
1224      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1225        switch (hash) {
1226        case -965394961: /*preAdmissionIdentifier*/ return this.preAdmissionIdentifier == null ? new Base[0] : new Base[] {this.preAdmissionIdentifier}; // Identifier
1227        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // Reference
1228        case 538887120: /*admitSource*/ return this.admitSource == null ? new Base[0] : new Base[] {this.admitSource}; // CodeableConcept
1229        case 669348630: /*reAdmission*/ return this.reAdmission == null ? new Base[0] : new Base[] {this.reAdmission}; // CodeableConcept
1230        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference
1231        case 528065941: /*dischargeDisposition*/ return this.dischargeDisposition == null ? new Base[0] : new Base[] {this.dischargeDisposition}; // CodeableConcept
1232        default: return super.getProperty(hash, name, checkValid);
1233        }
1234
1235      }
1236
1237      @Override
1238      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1239        switch (hash) {
1240        case -965394961: // preAdmissionIdentifier
1241          this.preAdmissionIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1242          return value;
1243        case -1008619738: // origin
1244          this.origin = TypeConvertor.castToReference(value); // Reference
1245          return value;
1246        case 538887120: // admitSource
1247          this.admitSource = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1248          return value;
1249        case 669348630: // reAdmission
1250          this.reAdmission = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1251          return value;
1252        case -1429847026: // destination
1253          this.destination = TypeConvertor.castToReference(value); // Reference
1254          return value;
1255        case 528065941: // dischargeDisposition
1256          this.dischargeDisposition = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1257          return value;
1258        default: return super.setProperty(hash, name, value);
1259        }
1260
1261      }
1262
1263      @Override
1264      public Base setProperty(String name, Base value) throws FHIRException {
1265        if (name.equals("preAdmissionIdentifier")) {
1266          this.preAdmissionIdentifier = TypeConvertor.castToIdentifier(value); // Identifier
1267        } else if (name.equals("origin")) {
1268          this.origin = TypeConvertor.castToReference(value); // Reference
1269        } else if (name.equals("admitSource")) {
1270          this.admitSource = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1271        } else if (name.equals("reAdmission")) {
1272          this.reAdmission = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1273        } else if (name.equals("destination")) {
1274          this.destination = TypeConvertor.castToReference(value); // Reference
1275        } else if (name.equals("dischargeDisposition")) {
1276          this.dischargeDisposition = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1277        } else
1278          return super.setProperty(name, value);
1279        return value;
1280      }
1281
1282      @Override
1283      public Base makeProperty(int hash, String name) throws FHIRException {
1284        switch (hash) {
1285        case -965394961:  return getPreAdmissionIdentifier();
1286        case -1008619738:  return getOrigin();
1287        case 538887120:  return getAdmitSource();
1288        case 669348630:  return getReAdmission();
1289        case -1429847026:  return getDestination();
1290        case 528065941:  return getDischargeDisposition();
1291        default: return super.makeProperty(hash, name);
1292        }
1293
1294      }
1295
1296      @Override
1297      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1298        switch (hash) {
1299        case -965394961: /*preAdmissionIdentifier*/ return new String[] {"Identifier"};
1300        case -1008619738: /*origin*/ return new String[] {"Reference"};
1301        case 538887120: /*admitSource*/ return new String[] {"CodeableConcept"};
1302        case 669348630: /*reAdmission*/ return new String[] {"CodeableConcept"};
1303        case -1429847026: /*destination*/ return new String[] {"Reference"};
1304        case 528065941: /*dischargeDisposition*/ return new String[] {"CodeableConcept"};
1305        default: return super.getTypesForProperty(hash, name);
1306        }
1307
1308      }
1309
1310      @Override
1311      public Base addChild(String name) throws FHIRException {
1312        if (name.equals("preAdmissionIdentifier")) {
1313          this.preAdmissionIdentifier = new Identifier();
1314          return this.preAdmissionIdentifier;
1315        }
1316        else if (name.equals("origin")) {
1317          this.origin = new Reference();
1318          return this.origin;
1319        }
1320        else if (name.equals("admitSource")) {
1321          this.admitSource = new CodeableConcept();
1322          return this.admitSource;
1323        }
1324        else if (name.equals("reAdmission")) {
1325          this.reAdmission = new CodeableConcept();
1326          return this.reAdmission;
1327        }
1328        else if (name.equals("destination")) {
1329          this.destination = new Reference();
1330          return this.destination;
1331        }
1332        else if (name.equals("dischargeDisposition")) {
1333          this.dischargeDisposition = new CodeableConcept();
1334          return this.dischargeDisposition;
1335        }
1336        else
1337          return super.addChild(name);
1338      }
1339
1340      public EncounterAdmissionComponent copy() {
1341        EncounterAdmissionComponent dst = new EncounterAdmissionComponent();
1342        copyValues(dst);
1343        return dst;
1344      }
1345
1346      public void copyValues(EncounterAdmissionComponent dst) {
1347        super.copyValues(dst);
1348        dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy();
1349        dst.origin = origin == null ? null : origin.copy();
1350        dst.admitSource = admitSource == null ? null : admitSource.copy();
1351        dst.reAdmission = reAdmission == null ? null : reAdmission.copy();
1352        dst.destination = destination == null ? null : destination.copy();
1353        dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy();
1354      }
1355
1356      @Override
1357      public boolean equalsDeep(Base other_) {
1358        if (!super.equalsDeep(other_))
1359          return false;
1360        if (!(other_ instanceof EncounterAdmissionComponent))
1361          return false;
1362        EncounterAdmissionComponent o = (EncounterAdmissionComponent) other_;
1363        return compareDeep(preAdmissionIdentifier, o.preAdmissionIdentifier, true) && compareDeep(origin, o.origin, true)
1364           && compareDeep(admitSource, o.admitSource, true) && compareDeep(reAdmission, o.reAdmission, true)
1365           && compareDeep(destination, o.destination, true) && compareDeep(dischargeDisposition, o.dischargeDisposition, true)
1366          ;
1367      }
1368
1369      @Override
1370      public boolean equalsShallow(Base other_) {
1371        if (!super.equalsShallow(other_))
1372          return false;
1373        if (!(other_ instanceof EncounterAdmissionComponent))
1374          return false;
1375        EncounterAdmissionComponent o = (EncounterAdmissionComponent) other_;
1376        return true;
1377      }
1378
1379      public boolean isEmpty() {
1380        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(preAdmissionIdentifier, origin
1381          , admitSource, reAdmission, destination, dischargeDisposition);
1382      }
1383
1384  public String fhirType() {
1385    return "Encounter.admission";
1386
1387  }
1388
1389  }
1390
1391    @Block()
1392    public static class EncounterLocationComponent extends BackboneElement implements IBaseBackboneElement {
1393        /**
1394         * The location where the encounter takes place.
1395         */
1396        @Child(name = "location", type = {Location.class}, order=1, min=1, max=1, modifier=false, summary=false)
1397        @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." )
1398        protected Reference location;
1399
1400        /**
1401         * The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.
1402         */
1403        @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1404        @Description(shortDefinition="planned | active | reserved | completed", formalDefinition="The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time." )
1405        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-location-status")
1406        protected Enumeration<EncounterLocationStatus> status;
1407
1408        /**
1409         * This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.
1410         */
1411        @Child(name = "form", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1412        @Description(shortDefinition="The physical type of the location (usually the level in the location hierarchy - bed, room, ward, virtual etc.)", formalDefinition="This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query." )
1413        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/location-form")
1414        protected CodeableConcept form;
1415
1416        /**
1417         * Time period during which the patient was present at the location.
1418         */
1419        @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
1420        @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." )
1421        protected Period period;
1422
1423        private static final long serialVersionUID = -1665957440L;
1424
1425    /**
1426     * Constructor
1427     */
1428      public EncounterLocationComponent() {
1429        super();
1430      }
1431
1432    /**
1433     * Constructor
1434     */
1435      public EncounterLocationComponent(Reference location) {
1436        super();
1437        this.setLocation(location);
1438      }
1439
1440        /**
1441         * @return {@link #location} (The location where the encounter takes place.)
1442         */
1443        public Reference getLocation() { 
1444          if (this.location == null)
1445            if (Configuration.errorOnAutoCreate())
1446              throw new Error("Attempt to auto-create EncounterLocationComponent.location");
1447            else if (Configuration.doAutoCreate())
1448              this.location = new Reference(); // cc
1449          return this.location;
1450        }
1451
1452        public boolean hasLocation() { 
1453          return this.location != null && !this.location.isEmpty();
1454        }
1455
1456        /**
1457         * @param value {@link #location} (The location where the encounter takes place.)
1458         */
1459        public EncounterLocationComponent setLocation(Reference value) { 
1460          this.location = value;
1461          return this;
1462        }
1463
1464        /**
1465         * @return {@link #status} (The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1466         */
1467        public Enumeration<EncounterLocationStatus> getStatusElement() { 
1468          if (this.status == null)
1469            if (Configuration.errorOnAutoCreate())
1470              throw new Error("Attempt to auto-create EncounterLocationComponent.status");
1471            else if (Configuration.doAutoCreate())
1472              this.status = new Enumeration<EncounterLocationStatus>(new EncounterLocationStatusEnumFactory()); // bb
1473          return this.status;
1474        }
1475
1476        public boolean hasStatusElement() { 
1477          return this.status != null && !this.status.isEmpty();
1478        }
1479
1480        public boolean hasStatus() { 
1481          return this.status != null && !this.status.isEmpty();
1482        }
1483
1484        /**
1485         * @param value {@link #status} (The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
1486         */
1487        public EncounterLocationComponent setStatusElement(Enumeration<EncounterLocationStatus> value) { 
1488          this.status = value;
1489          return this;
1490        }
1491
1492        /**
1493         * @return The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.
1494         */
1495        public EncounterLocationStatus getStatus() { 
1496          return this.status == null ? null : this.status.getValue();
1497        }
1498
1499        /**
1500         * @param value The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.
1501         */
1502        public EncounterLocationComponent setStatus(EncounterLocationStatus value) { 
1503          if (value == null)
1504            this.status = null;
1505          else {
1506            if (this.status == null)
1507              this.status = new Enumeration<EncounterLocationStatus>(new EncounterLocationStatusEnumFactory());
1508            this.status.setValue(value);
1509          }
1510          return this;
1511        }
1512
1513        /**
1514         * @return {@link #form} (This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.)
1515         */
1516        public CodeableConcept getForm() { 
1517          if (this.form == null)
1518            if (Configuration.errorOnAutoCreate())
1519              throw new Error("Attempt to auto-create EncounterLocationComponent.form");
1520            else if (Configuration.doAutoCreate())
1521              this.form = new CodeableConcept(); // cc
1522          return this.form;
1523        }
1524
1525        public boolean hasForm() { 
1526          return this.form != null && !this.form.isEmpty();
1527        }
1528
1529        /**
1530         * @param value {@link #form} (This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.)
1531         */
1532        public EncounterLocationComponent setForm(CodeableConcept value) { 
1533          this.form = value;
1534          return this;
1535        }
1536
1537        /**
1538         * @return {@link #period} (Time period during which the patient was present at the location.)
1539         */
1540        public Period getPeriod() { 
1541          if (this.period == null)
1542            if (Configuration.errorOnAutoCreate())
1543              throw new Error("Attempt to auto-create EncounterLocationComponent.period");
1544            else if (Configuration.doAutoCreate())
1545              this.period = new Period(); // cc
1546          return this.period;
1547        }
1548
1549        public boolean hasPeriod() { 
1550          return this.period != null && !this.period.isEmpty();
1551        }
1552
1553        /**
1554         * @param value {@link #period} (Time period during which the patient was present at the location.)
1555         */
1556        public EncounterLocationComponent setPeriod(Period value) { 
1557          this.period = value;
1558          return this;
1559        }
1560
1561        protected void listChildren(List<Property> children) {
1562          super.listChildren(children);
1563          children.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, 1, location));
1564          children.add(new Property("status", "code", "The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.", 0, 1, status));
1565          children.add(new Property("form", "CodeableConcept", "This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.", 0, 1, form));
1566          children.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, 1, period));
1567        }
1568
1569        @Override
1570        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1571          switch (_hash) {
1572          case 1901043637: /*location*/  return new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, 1, location);
1573          case -892481550: /*status*/  return new Property("status", "code", "The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.", 0, 1, status);
1574          case 3148996: /*form*/  return new Property("form", "CodeableConcept", "This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.", 0, 1, form);
1575          case -991726143: /*period*/  return new Property("period", "Period", "Time period during which the patient was present at the location.", 0, 1, period);
1576          default: return super.getNamedProperty(_hash, _name, _checkValid);
1577          }
1578
1579        }
1580
1581      @Override
1582      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1583        switch (hash) {
1584        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1585        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EncounterLocationStatus>
1586        case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept
1587        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1588        default: return super.getProperty(hash, name, checkValid);
1589        }
1590
1591      }
1592
1593      @Override
1594      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1595        switch (hash) {
1596        case 1901043637: // location
1597          this.location = TypeConvertor.castToReference(value); // Reference
1598          return value;
1599        case -892481550: // status
1600          value = new EncounterLocationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1601          this.status = (Enumeration) value; // Enumeration<EncounterLocationStatus>
1602          return value;
1603        case 3148996: // form
1604          this.form = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1605          return value;
1606        case -991726143: // period
1607          this.period = TypeConvertor.castToPeriod(value); // Period
1608          return value;
1609        default: return super.setProperty(hash, name, value);
1610        }
1611
1612      }
1613
1614      @Override
1615      public Base setProperty(String name, Base value) throws FHIRException {
1616        if (name.equals("location")) {
1617          this.location = TypeConvertor.castToReference(value); // Reference
1618        } else if (name.equals("status")) {
1619          value = new EncounterLocationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1620          this.status = (Enumeration) value; // Enumeration<EncounterLocationStatus>
1621        } else if (name.equals("form")) {
1622          this.form = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1623        } else if (name.equals("period")) {
1624          this.period = TypeConvertor.castToPeriod(value); // Period
1625        } else
1626          return super.setProperty(name, value);
1627        return value;
1628      }
1629
1630      @Override
1631      public Base makeProperty(int hash, String name) throws FHIRException {
1632        switch (hash) {
1633        case 1901043637:  return getLocation();
1634        case -892481550:  return getStatusElement();
1635        case 3148996:  return getForm();
1636        case -991726143:  return getPeriod();
1637        default: return super.makeProperty(hash, name);
1638        }
1639
1640      }
1641
1642      @Override
1643      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1644        switch (hash) {
1645        case 1901043637: /*location*/ return new String[] {"Reference"};
1646        case -892481550: /*status*/ return new String[] {"code"};
1647        case 3148996: /*form*/ return new String[] {"CodeableConcept"};
1648        case -991726143: /*period*/ return new String[] {"Period"};
1649        default: return super.getTypesForProperty(hash, name);
1650        }
1651
1652      }
1653
1654      @Override
1655      public Base addChild(String name) throws FHIRException {
1656        if (name.equals("location")) {
1657          this.location = new Reference();
1658          return this.location;
1659        }
1660        else if (name.equals("status")) {
1661          throw new FHIRException("Cannot call addChild on a singleton property Encounter.location.status");
1662        }
1663        else if (name.equals("form")) {
1664          this.form = new CodeableConcept();
1665          return this.form;
1666        }
1667        else if (name.equals("period")) {
1668          this.period = new Period();
1669          return this.period;
1670        }
1671        else
1672          return super.addChild(name);
1673      }
1674
1675      public EncounterLocationComponent copy() {
1676        EncounterLocationComponent dst = new EncounterLocationComponent();
1677        copyValues(dst);
1678        return dst;
1679      }
1680
1681      public void copyValues(EncounterLocationComponent dst) {
1682        super.copyValues(dst);
1683        dst.location = location == null ? null : location.copy();
1684        dst.status = status == null ? null : status.copy();
1685        dst.form = form == null ? null : form.copy();
1686        dst.period = period == null ? null : period.copy();
1687      }
1688
1689      @Override
1690      public boolean equalsDeep(Base other_) {
1691        if (!super.equalsDeep(other_))
1692          return false;
1693        if (!(other_ instanceof EncounterLocationComponent))
1694          return false;
1695        EncounterLocationComponent o = (EncounterLocationComponent) other_;
1696        return compareDeep(location, o.location, true) && compareDeep(status, o.status, true) && compareDeep(form, o.form, true)
1697           && compareDeep(period, o.period, true);
1698      }
1699
1700      @Override
1701      public boolean equalsShallow(Base other_) {
1702        if (!super.equalsShallow(other_))
1703          return false;
1704        if (!(other_ instanceof EncounterLocationComponent))
1705          return false;
1706        EncounterLocationComponent o = (EncounterLocationComponent) other_;
1707        return compareValues(status, o.status, true);
1708      }
1709
1710      public boolean isEmpty() {
1711        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(location, status, form, period
1712          );
1713      }
1714
1715  public String fhirType() {
1716    return "Encounter.location";
1717
1718  }
1719
1720  }
1721
1722    /**
1723     * Identifier(s) by which this encounter is known.
1724     */
1725    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1726    @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." )
1727    protected List<Identifier> identifier;
1728
1729    /**
1730     * The current state of the encounter (not the state of the patient within the encounter - that is subjectState).
1731     */
1732    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
1733    @Description(shortDefinition="planned | in-progress | on-hold | discharged | completed | cancelled | discontinued | entered-in-error | unknown", formalDefinition="The current state of the encounter (not the state of the patient within the encounter - that is subjectState)." )
1734    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-status")
1735    protected Enumeration<EncounterStatus> status;
1736
1737    /**
1738     * Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.
1739     */
1740    @Child(name = "class", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1741    @Description(shortDefinition="Classification of patient encounter context - e.g. Inpatient, outpatient", formalDefinition="Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations." )
1742    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/encounter-class")
1743    protected List<CodeableConcept> class_;
1744
1745    /**
1746     * Indicates the urgency of the encounter.
1747     */
1748    @Child(name = "priority", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false)
1749    @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." )
1750    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v3-ActPriority")
1751    protected CodeableConcept priority;
1752
1753    /**
1754     * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).
1755     */
1756    @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1757    @Description(shortDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, ...)", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." )
1758    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-type")
1759    protected List<CodeableConcept> type;
1760
1761    /**
1762     * Broad categorization of the service that is to be provided (e.g. cardiology).
1763     */
1764    @Child(name = "serviceType", type = {CodeableReference.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1765    @Description(shortDefinition="Specific type of service", formalDefinition="Broad categorization of the service that is to be provided (e.g. cardiology)." )
1766    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/service-type")
1767    protected List<CodeableReference> serviceType;
1768
1769    /**
1770     * The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam.
1771     */
1772    @Child(name = "subject", type = {Patient.class, Group.class}, order=6, min=0, max=1, modifier=false, summary=true)
1773    @Description(shortDefinition="The patient or group related to this encounter", formalDefinition="The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam." )
1774    protected Reference subject;
1775
1776    /**
1777     * The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status.
1778     */
1779    @Child(name = "subjectStatus", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
1780    @Description(shortDefinition="The current status of the subject in relation to the Encounter", formalDefinition="The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status." )
1781    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-subject-status")
1782    protected CodeableConcept subjectStatus;
1783
1784    /**
1785     * Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).
1786     */
1787    @Child(name = "episodeOfCare", type = {EpisodeOfCare.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1788    @Description(shortDefinition="Episode(s) of care that this encounter should be recorded against", formalDefinition="Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years)." )
1789    protected List<Reference> episodeOfCare;
1790
1791    /**
1792     * The request this encounter satisfies (e.g. incoming referral or procedure request).
1793     */
1794    @Child(name = "basedOn", type = {CarePlan.class, DeviceRequest.class, MedicationRequest.class, ServiceRequest.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1795    @Description(shortDefinition="The request that initiated this encounter", formalDefinition="The request this encounter satisfies (e.g. incoming referral or procedure request)." )
1796    protected List<Reference> basedOn;
1797
1798    /**
1799     * The group(s) of individuals, organizations that are allocated to participate in this encounter. The participants backbone will record the actuals of when these individuals participated during the encounter.
1800     */
1801    @Child(name = "careTeam", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1802    @Description(shortDefinition="The group(s) that are allocated to participate in this encounter", formalDefinition="The group(s) of individuals, organizations that are allocated to participate in this encounter. The participants backbone will record the actuals of when these individuals participated during the encounter." )
1803    protected List<Reference> careTeam;
1804
1805    /**
1806     * Another Encounter of which this encounter is a part of (administratively or in time).
1807     */
1808    @Child(name = "partOf", type = {Encounter.class}, order=11, min=0, max=1, modifier=false, summary=false)
1809    @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." )
1810    protected Reference partOf;
1811
1812    /**
1813     * The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab.
1814     */
1815    @Child(name = "serviceProvider", type = {Organization.class}, order=12, min=0, max=1, modifier=false, summary=false)
1816    @Description(shortDefinition="The organization (facility) responsible for this encounter", formalDefinition="The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab." )
1817    protected Reference serviceProvider;
1818
1819    /**
1820     * The list of people responsible for providing the service.
1821     */
1822    @Child(name = "participant", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1823    @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The list of people responsible for providing the service." )
1824    protected List<EncounterParticipantComponent> participant;
1825
1826    /**
1827     * The appointment that scheduled this encounter.
1828     */
1829    @Child(name = "appointment", type = {Appointment.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1830    @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." )
1831    protected List<Reference> appointment;
1832
1833    /**
1834     * Connection details of a virtual service (e.g. conference call).
1835     */
1836    @Child(name = "virtualService", type = {VirtualServiceDetail.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1837    @Description(shortDefinition="Connection details of a virtual service (e.g. conference call)", formalDefinition="Connection details of a virtual service (e.g. conference call)." )
1838    protected List<VirtualServiceDetail> virtualService;
1839
1840    /**
1841     * The actual start and end time of the encounter.
1842     */
1843    @Child(name = "actualPeriod", type = {Period.class}, order=16, min=0, max=1, modifier=false, summary=false)
1844    @Description(shortDefinition="The actual start and end time of the encounter", formalDefinition="The actual start and end time of the encounter." )
1845    protected Period actualPeriod;
1846
1847    /**
1848     * The planned start date/time (or admission date) of the encounter.
1849     */
1850    @Child(name = "plannedStartDate", type = {DateTimeType.class}, order=17, min=0, max=1, modifier=false, summary=false)
1851    @Description(shortDefinition="The planned start date/time (or admission date) of the encounter", formalDefinition="The planned start date/time (or admission date) of the encounter." )
1852    protected DateTimeType plannedStartDate;
1853
1854    /**
1855     * The planned end date/time (or discharge date) of the encounter.
1856     */
1857    @Child(name = "plannedEndDate", type = {DateTimeType.class}, order=18, min=0, max=1, modifier=false, summary=false)
1858    @Description(shortDefinition="The planned end date/time (or discharge date) of the encounter", formalDefinition="The planned end date/time (or discharge date) of the encounter." )
1859    protected DateTimeType plannedEndDate;
1860
1861    /**
1862     * Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.
1863
1864When missing it is the time in between the start and end values.
1865     */
1866    @Child(name = "length", type = {Duration.class}, order=19, min=0, max=1, modifier=false, summary=false)
1867    @Description(shortDefinition="Actual quantity of time the encounter lasted (less time absent)", formalDefinition="Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.\r\rWhen missing it is the time in between the start and end values." )
1868    protected Duration length;
1869
1870    /**
1871     * The list of medical reasons that are expected to be addressed during the episode of care.
1872     */
1873    @Child(name = "reason", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1874    @Description(shortDefinition="The list of medical reasons that are expected to be addressed during the episode of care", formalDefinition="The list of medical reasons that are expected to be addressed during the episode of care." )
1875    protected List<ReasonComponent> reason;
1876
1877    /**
1878     * The list of diagnosis relevant to this encounter.
1879     */
1880    @Child(name = "diagnosis", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1881    @Description(shortDefinition="The list of diagnosis relevant to this encounter", formalDefinition="The list of diagnosis relevant to this encounter." )
1882    protected List<DiagnosisComponent> diagnosis;
1883
1884    /**
1885     * The set of accounts that may be used for billing for this Encounter.
1886     */
1887    @Child(name = "account", type = {Account.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1888    @Description(shortDefinition="The set of accounts that may be used for billing for this Encounter", formalDefinition="The set of accounts that may be used for billing for this Encounter." )
1889    protected List<Reference> account;
1890
1891    /**
1892     * Diet preferences reported by the patient.
1893     */
1894    @Child(name = "dietPreference", type = {CodeableConcept.class}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1895    @Description(shortDefinition="Diet preferences reported by the patient", formalDefinition="Diet preferences reported by the patient." )
1896    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-diet")
1897    protected List<CodeableConcept> dietPreference;
1898
1899    /**
1900     * Any special requests that have been made for this encounter, such as the provision of specific equipment or other things.
1901     */
1902    @Child(name = "specialArrangement", type = {CodeableConcept.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1903    @Description(shortDefinition="Wheelchair, translator, stretcher, etc", formalDefinition="Any special requests that have been made for this encounter, such as the provision of specific equipment or other things." )
1904    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-special-arrangements")
1905    protected List<CodeableConcept> specialArrangement;
1906
1907    /**
1908     * Special courtesies that may be provided to the patient during the encounter (VIP, board member, professional courtesy).
1909     */
1910    @Child(name = "specialCourtesy", type = {CodeableConcept.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1911    @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies that may be provided to the patient during the encounter (VIP, board member, professional courtesy)." )
1912    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/encounter-special-courtesy")
1913    protected List<CodeableConcept> specialCourtesy;
1914
1915    /**
1916     * Details about the stay during which a healthcare service is provided.
1917
1918This does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge.
1919     */
1920    @Child(name = "admission", type = {}, order=26, min=0, max=1, modifier=false, summary=false)
1921    @Description(shortDefinition="Details about the admission to a healthcare service", formalDefinition="Details about the stay during which a healthcare service is provided.\r\rThis does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge." )
1922    protected EncounterAdmissionComponent admission;
1923
1924    /**
1925     * List of locations where  the patient has been during this encounter.
1926     */
1927    @Child(name = "location", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1928    @Description(shortDefinition="List of locations where the patient has been", formalDefinition="List of locations where  the patient has been during this encounter." )
1929    protected List<EncounterLocationComponent> location;
1930
1931    private static final long serialVersionUID = -1336316477L;
1932
1933  /**
1934   * Constructor
1935   */
1936    public Encounter() {
1937      super();
1938    }
1939
1940  /**
1941   * Constructor
1942   */
1943    public Encounter(EncounterStatus status) {
1944      super();
1945      this.setStatus(status);
1946    }
1947
1948    /**
1949     * @return {@link #identifier} (Identifier(s) by which this encounter is known.)
1950     */
1951    public List<Identifier> getIdentifier() { 
1952      if (this.identifier == null)
1953        this.identifier = new ArrayList<Identifier>();
1954      return this.identifier;
1955    }
1956
1957    /**
1958     * @return Returns a reference to <code>this</code> for easy method chaining
1959     */
1960    public Encounter setIdentifier(List<Identifier> theIdentifier) { 
1961      this.identifier = theIdentifier;
1962      return this;
1963    }
1964
1965    public boolean hasIdentifier() { 
1966      if (this.identifier == null)
1967        return false;
1968      for (Identifier item : this.identifier)
1969        if (!item.isEmpty())
1970          return true;
1971      return false;
1972    }
1973
1974    public Identifier addIdentifier() { //3
1975      Identifier t = new Identifier();
1976      if (this.identifier == null)
1977        this.identifier = new ArrayList<Identifier>();
1978      this.identifier.add(t);
1979      return t;
1980    }
1981
1982    public Encounter addIdentifier(Identifier t) { //3
1983      if (t == null)
1984        return this;
1985      if (this.identifier == null)
1986        this.identifier = new ArrayList<Identifier>();
1987      this.identifier.add(t);
1988      return this;
1989    }
1990
1991    /**
1992     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1993     */
1994    public Identifier getIdentifierFirstRep() { 
1995      if (getIdentifier().isEmpty()) {
1996        addIdentifier();
1997      }
1998      return getIdentifier().get(0);
1999    }
2000
2001    /**
2002     * @return {@link #status} (The current state of the encounter (not the state of the patient within the encounter - that is subjectState).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2003     */
2004    public Enumeration<EncounterStatus> getStatusElement() { 
2005      if (this.status == null)
2006        if (Configuration.errorOnAutoCreate())
2007          throw new Error("Attempt to auto-create Encounter.status");
2008        else if (Configuration.doAutoCreate())
2009          this.status = new Enumeration<EncounterStatus>(new EncounterStatusEnumFactory()); // bb
2010      return this.status;
2011    }
2012
2013    public boolean hasStatusElement() { 
2014      return this.status != null && !this.status.isEmpty();
2015    }
2016
2017    public boolean hasStatus() { 
2018      return this.status != null && !this.status.isEmpty();
2019    }
2020
2021    /**
2022     * @param value {@link #status} (The current state of the encounter (not the state of the patient within the encounter - that is subjectState).). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2023     */
2024    public Encounter setStatusElement(Enumeration<EncounterStatus> value) { 
2025      this.status = value;
2026      return this;
2027    }
2028
2029    /**
2030     * @return The current state of the encounter (not the state of the patient within the encounter - that is subjectState).
2031     */
2032    public EncounterStatus getStatus() { 
2033      return this.status == null ? null : this.status.getValue();
2034    }
2035
2036    /**
2037     * @param value The current state of the encounter (not the state of the patient within the encounter - that is subjectState).
2038     */
2039    public Encounter setStatus(EncounterStatus value) { 
2040        if (this.status == null)
2041          this.status = new Enumeration<EncounterStatus>(new EncounterStatusEnumFactory());
2042        this.status.setValue(value);
2043      return this;
2044    }
2045
2046    /**
2047     * @return {@link #class_} (Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.)
2048     */
2049    public List<CodeableConcept> getClass_() { 
2050      if (this.class_ == null)
2051        this.class_ = new ArrayList<CodeableConcept>();
2052      return this.class_;
2053    }
2054
2055    /**
2056     * @return Returns a reference to <code>this</code> for easy method chaining
2057     */
2058    public Encounter setClass_(List<CodeableConcept> theClass_) { 
2059      this.class_ = theClass_;
2060      return this;
2061    }
2062
2063    public boolean hasClass_() { 
2064      if (this.class_ == null)
2065        return false;
2066      for (CodeableConcept item : this.class_)
2067        if (!item.isEmpty())
2068          return true;
2069      return false;
2070    }
2071
2072    public CodeableConcept addClass_() { //3
2073      CodeableConcept t = new CodeableConcept();
2074      if (this.class_ == null)
2075        this.class_ = new ArrayList<CodeableConcept>();
2076      this.class_.add(t);
2077      return t;
2078    }
2079
2080    public Encounter addClass_(CodeableConcept t) { //3
2081      if (t == null)
2082        return this;
2083      if (this.class_ == null)
2084        this.class_ = new ArrayList<CodeableConcept>();
2085      this.class_.add(t);
2086      return this;
2087    }
2088
2089    /**
2090     * @return The first repetition of repeating field {@link #class_}, creating it if it does not already exist {3}
2091     */
2092    public CodeableConcept getClass_FirstRep() { 
2093      if (getClass_().isEmpty()) {
2094        addClass_();
2095      }
2096      return getClass_().get(0);
2097    }
2098
2099    /**
2100     * @return {@link #priority} (Indicates the urgency of the encounter.)
2101     */
2102    public CodeableConcept getPriority() { 
2103      if (this.priority == null)
2104        if (Configuration.errorOnAutoCreate())
2105          throw new Error("Attempt to auto-create Encounter.priority");
2106        else if (Configuration.doAutoCreate())
2107          this.priority = new CodeableConcept(); // cc
2108      return this.priority;
2109    }
2110
2111    public boolean hasPriority() { 
2112      return this.priority != null && !this.priority.isEmpty();
2113    }
2114
2115    /**
2116     * @param value {@link #priority} (Indicates the urgency of the encounter.)
2117     */
2118    public Encounter setPriority(CodeableConcept value) { 
2119      this.priority = value;
2120      return this;
2121    }
2122
2123    /**
2124     * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).)
2125     */
2126    public List<CodeableConcept> getType() { 
2127      if (this.type == null)
2128        this.type = new ArrayList<CodeableConcept>();
2129      return this.type;
2130    }
2131
2132    /**
2133     * @return Returns a reference to <code>this</code> for easy method chaining
2134     */
2135    public Encounter setType(List<CodeableConcept> theType) { 
2136      this.type = theType;
2137      return this;
2138    }
2139
2140    public boolean hasType() { 
2141      if (this.type == null)
2142        return false;
2143      for (CodeableConcept item : this.type)
2144        if (!item.isEmpty())
2145          return true;
2146      return false;
2147    }
2148
2149    public CodeableConcept addType() { //3
2150      CodeableConcept t = new CodeableConcept();
2151      if (this.type == null)
2152        this.type = new ArrayList<CodeableConcept>();
2153      this.type.add(t);
2154      return t;
2155    }
2156
2157    public Encounter addType(CodeableConcept t) { //3
2158      if (t == null)
2159        return this;
2160      if (this.type == null)
2161        this.type = new ArrayList<CodeableConcept>();
2162      this.type.add(t);
2163      return this;
2164    }
2165
2166    /**
2167     * @return The first repetition of repeating field {@link #type}, creating it if it does not already exist {3}
2168     */
2169    public CodeableConcept getTypeFirstRep() { 
2170      if (getType().isEmpty()) {
2171        addType();
2172      }
2173      return getType().get(0);
2174    }
2175
2176    /**
2177     * @return {@link #serviceType} (Broad categorization of the service that is to be provided (e.g. cardiology).)
2178     */
2179    public List<CodeableReference> getServiceType() { 
2180      if (this.serviceType == null)
2181        this.serviceType = new ArrayList<CodeableReference>();
2182      return this.serviceType;
2183    }
2184
2185    /**
2186     * @return Returns a reference to <code>this</code> for easy method chaining
2187     */
2188    public Encounter setServiceType(List<CodeableReference> theServiceType) { 
2189      this.serviceType = theServiceType;
2190      return this;
2191    }
2192
2193    public boolean hasServiceType() { 
2194      if (this.serviceType == null)
2195        return false;
2196      for (CodeableReference item : this.serviceType)
2197        if (!item.isEmpty())
2198          return true;
2199      return false;
2200    }
2201
2202    public CodeableReference addServiceType() { //3
2203      CodeableReference t = new CodeableReference();
2204      if (this.serviceType == null)
2205        this.serviceType = new ArrayList<CodeableReference>();
2206      this.serviceType.add(t);
2207      return t;
2208    }
2209
2210    public Encounter addServiceType(CodeableReference t) { //3
2211      if (t == null)
2212        return this;
2213      if (this.serviceType == null)
2214        this.serviceType = new ArrayList<CodeableReference>();
2215      this.serviceType.add(t);
2216      return this;
2217    }
2218
2219    /**
2220     * @return The first repetition of repeating field {@link #serviceType}, creating it if it does not already exist {3}
2221     */
2222    public CodeableReference getServiceTypeFirstRep() { 
2223      if (getServiceType().isEmpty()) {
2224        addServiceType();
2225      }
2226      return getServiceType().get(0);
2227    }
2228
2229    /**
2230     * @return {@link #subject} (The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam.)
2231     */
2232    public Reference getSubject() { 
2233      if (this.subject == null)
2234        if (Configuration.errorOnAutoCreate())
2235          throw new Error("Attempt to auto-create Encounter.subject");
2236        else if (Configuration.doAutoCreate())
2237          this.subject = new Reference(); // cc
2238      return this.subject;
2239    }
2240
2241    public boolean hasSubject() { 
2242      return this.subject != null && !this.subject.isEmpty();
2243    }
2244
2245    /**
2246     * @param value {@link #subject} (The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam.)
2247     */
2248    public Encounter setSubject(Reference value) { 
2249      this.subject = value;
2250      return this;
2251    }
2252
2253    /**
2254     * @return {@link #subjectStatus} (The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status.)
2255     */
2256    public CodeableConcept getSubjectStatus() { 
2257      if (this.subjectStatus == null)
2258        if (Configuration.errorOnAutoCreate())
2259          throw new Error("Attempt to auto-create Encounter.subjectStatus");
2260        else if (Configuration.doAutoCreate())
2261          this.subjectStatus = new CodeableConcept(); // cc
2262      return this.subjectStatus;
2263    }
2264
2265    public boolean hasSubjectStatus() { 
2266      return this.subjectStatus != null && !this.subjectStatus.isEmpty();
2267    }
2268
2269    /**
2270     * @param value {@link #subjectStatus} (The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status.)
2271     */
2272    public Encounter setSubjectStatus(CodeableConcept value) { 
2273      this.subjectStatus = value;
2274      return this;
2275    }
2276
2277    /**
2278     * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).)
2279     */
2280    public List<Reference> getEpisodeOfCare() { 
2281      if (this.episodeOfCare == null)
2282        this.episodeOfCare = new ArrayList<Reference>();
2283      return this.episodeOfCare;
2284    }
2285
2286    /**
2287     * @return Returns a reference to <code>this</code> for easy method chaining
2288     */
2289    public Encounter setEpisodeOfCare(List<Reference> theEpisodeOfCare) { 
2290      this.episodeOfCare = theEpisodeOfCare;
2291      return this;
2292    }
2293
2294    public boolean hasEpisodeOfCare() { 
2295      if (this.episodeOfCare == null)
2296        return false;
2297      for (Reference item : this.episodeOfCare)
2298        if (!item.isEmpty())
2299          return true;
2300      return false;
2301    }
2302
2303    public Reference addEpisodeOfCare() { //3
2304      Reference t = new Reference();
2305      if (this.episodeOfCare == null)
2306        this.episodeOfCare = new ArrayList<Reference>();
2307      this.episodeOfCare.add(t);
2308      return t;
2309    }
2310
2311    public Encounter addEpisodeOfCare(Reference t) { //3
2312      if (t == null)
2313        return this;
2314      if (this.episodeOfCare == null)
2315        this.episodeOfCare = new ArrayList<Reference>();
2316      this.episodeOfCare.add(t);
2317      return this;
2318    }
2319
2320    /**
2321     * @return The first repetition of repeating field {@link #episodeOfCare}, creating it if it does not already exist {3}
2322     */
2323    public Reference getEpisodeOfCareFirstRep() { 
2324      if (getEpisodeOfCare().isEmpty()) {
2325        addEpisodeOfCare();
2326      }
2327      return getEpisodeOfCare().get(0);
2328    }
2329
2330    /**
2331     * @return {@link #basedOn} (The request this encounter satisfies (e.g. incoming referral or procedure request).)
2332     */
2333    public List<Reference> getBasedOn() { 
2334      if (this.basedOn == null)
2335        this.basedOn = new ArrayList<Reference>();
2336      return this.basedOn;
2337    }
2338
2339    /**
2340     * @return Returns a reference to <code>this</code> for easy method chaining
2341     */
2342    public Encounter setBasedOn(List<Reference> theBasedOn) { 
2343      this.basedOn = theBasedOn;
2344      return this;
2345    }
2346
2347    public boolean hasBasedOn() { 
2348      if (this.basedOn == null)
2349        return false;
2350      for (Reference item : this.basedOn)
2351        if (!item.isEmpty())
2352          return true;
2353      return false;
2354    }
2355
2356    public Reference addBasedOn() { //3
2357      Reference t = new Reference();
2358      if (this.basedOn == null)
2359        this.basedOn = new ArrayList<Reference>();
2360      this.basedOn.add(t);
2361      return t;
2362    }
2363
2364    public Encounter addBasedOn(Reference t) { //3
2365      if (t == null)
2366        return this;
2367      if (this.basedOn == null)
2368        this.basedOn = new ArrayList<Reference>();
2369      this.basedOn.add(t);
2370      return this;
2371    }
2372
2373    /**
2374     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
2375     */
2376    public Reference getBasedOnFirstRep() { 
2377      if (getBasedOn().isEmpty()) {
2378        addBasedOn();
2379      }
2380      return getBasedOn().get(0);
2381    }
2382
2383    /**
2384     * @return {@link #careTeam} (The group(s) of individuals, organizations that are allocated to participate in this encounter. The participants backbone will record the actuals of when these individuals participated during the encounter.)
2385     */
2386    public List<Reference> getCareTeam() { 
2387      if (this.careTeam == null)
2388        this.careTeam = new ArrayList<Reference>();
2389      return this.careTeam;
2390    }
2391
2392    /**
2393     * @return Returns a reference to <code>this</code> for easy method chaining
2394     */
2395    public Encounter setCareTeam(List<Reference> theCareTeam) { 
2396      this.careTeam = theCareTeam;
2397      return this;
2398    }
2399
2400    public boolean hasCareTeam() { 
2401      if (this.careTeam == null)
2402        return false;
2403      for (Reference item : this.careTeam)
2404        if (!item.isEmpty())
2405          return true;
2406      return false;
2407    }
2408
2409    public Reference addCareTeam() { //3
2410      Reference t = new Reference();
2411      if (this.careTeam == null)
2412        this.careTeam = new ArrayList<Reference>();
2413      this.careTeam.add(t);
2414      return t;
2415    }
2416
2417    public Encounter addCareTeam(Reference t) { //3
2418      if (t == null)
2419        return this;
2420      if (this.careTeam == null)
2421        this.careTeam = new ArrayList<Reference>();
2422      this.careTeam.add(t);
2423      return this;
2424    }
2425
2426    /**
2427     * @return The first repetition of repeating field {@link #careTeam}, creating it if it does not already exist {3}
2428     */
2429    public Reference getCareTeamFirstRep() { 
2430      if (getCareTeam().isEmpty()) {
2431        addCareTeam();
2432      }
2433      return getCareTeam().get(0);
2434    }
2435
2436    /**
2437     * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).)
2438     */
2439    public Reference getPartOf() { 
2440      if (this.partOf == null)
2441        if (Configuration.errorOnAutoCreate())
2442          throw new Error("Attempt to auto-create Encounter.partOf");
2443        else if (Configuration.doAutoCreate())
2444          this.partOf = new Reference(); // cc
2445      return this.partOf;
2446    }
2447
2448    public boolean hasPartOf() { 
2449      return this.partOf != null && !this.partOf.isEmpty();
2450    }
2451
2452    /**
2453     * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).)
2454     */
2455    public Encounter setPartOf(Reference value) { 
2456      this.partOf = value;
2457      return this;
2458    }
2459
2460    /**
2461     * @return {@link #serviceProvider} (The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab.)
2462     */
2463    public Reference getServiceProvider() { 
2464      if (this.serviceProvider == null)
2465        if (Configuration.errorOnAutoCreate())
2466          throw new Error("Attempt to auto-create Encounter.serviceProvider");
2467        else if (Configuration.doAutoCreate())
2468          this.serviceProvider = new Reference(); // cc
2469      return this.serviceProvider;
2470    }
2471
2472    public boolean hasServiceProvider() { 
2473      return this.serviceProvider != null && !this.serviceProvider.isEmpty();
2474    }
2475
2476    /**
2477     * @param value {@link #serviceProvider} (The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab.)
2478     */
2479    public Encounter setServiceProvider(Reference value) { 
2480      this.serviceProvider = value;
2481      return this;
2482    }
2483
2484    /**
2485     * @return {@link #participant} (The list of people responsible for providing the service.)
2486     */
2487    public List<EncounterParticipantComponent> getParticipant() { 
2488      if (this.participant == null)
2489        this.participant = new ArrayList<EncounterParticipantComponent>();
2490      return this.participant;
2491    }
2492
2493    /**
2494     * @return Returns a reference to <code>this</code> for easy method chaining
2495     */
2496    public Encounter setParticipant(List<EncounterParticipantComponent> theParticipant) { 
2497      this.participant = theParticipant;
2498      return this;
2499    }
2500
2501    public boolean hasParticipant() { 
2502      if (this.participant == null)
2503        return false;
2504      for (EncounterParticipantComponent item : this.participant)
2505        if (!item.isEmpty())
2506          return true;
2507      return false;
2508    }
2509
2510    public EncounterParticipantComponent addParticipant() { //3
2511      EncounterParticipantComponent t = new EncounterParticipantComponent();
2512      if (this.participant == null)
2513        this.participant = new ArrayList<EncounterParticipantComponent>();
2514      this.participant.add(t);
2515      return t;
2516    }
2517
2518    public Encounter addParticipant(EncounterParticipantComponent t) { //3
2519      if (t == null)
2520        return this;
2521      if (this.participant == null)
2522        this.participant = new ArrayList<EncounterParticipantComponent>();
2523      this.participant.add(t);
2524      return this;
2525    }
2526
2527    /**
2528     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist {3}
2529     */
2530    public EncounterParticipantComponent getParticipantFirstRep() { 
2531      if (getParticipant().isEmpty()) {
2532        addParticipant();
2533      }
2534      return getParticipant().get(0);
2535    }
2536
2537    /**
2538     * @return {@link #appointment} (The appointment that scheduled this encounter.)
2539     */
2540    public List<Reference> getAppointment() { 
2541      if (this.appointment == null)
2542        this.appointment = new ArrayList<Reference>();
2543      return this.appointment;
2544    }
2545
2546    /**
2547     * @return Returns a reference to <code>this</code> for easy method chaining
2548     */
2549    public Encounter setAppointment(List<Reference> theAppointment) { 
2550      this.appointment = theAppointment;
2551      return this;
2552    }
2553
2554    public boolean hasAppointment() { 
2555      if (this.appointment == null)
2556        return false;
2557      for (Reference item : this.appointment)
2558        if (!item.isEmpty())
2559          return true;
2560      return false;
2561    }
2562
2563    public Reference addAppointment() { //3
2564      Reference t = new Reference();
2565      if (this.appointment == null)
2566        this.appointment = new ArrayList<Reference>();
2567      this.appointment.add(t);
2568      return t;
2569    }
2570
2571    public Encounter addAppointment(Reference t) { //3
2572      if (t == null)
2573        return this;
2574      if (this.appointment == null)
2575        this.appointment = new ArrayList<Reference>();
2576      this.appointment.add(t);
2577      return this;
2578    }
2579
2580    /**
2581     * @return The first repetition of repeating field {@link #appointment}, creating it if it does not already exist {3}
2582     */
2583    public Reference getAppointmentFirstRep() { 
2584      if (getAppointment().isEmpty()) {
2585        addAppointment();
2586      }
2587      return getAppointment().get(0);
2588    }
2589
2590    /**
2591     * @return {@link #virtualService} (Connection details of a virtual service (e.g. conference call).)
2592     */
2593    public List<VirtualServiceDetail> getVirtualService() { 
2594      if (this.virtualService == null)
2595        this.virtualService = new ArrayList<VirtualServiceDetail>();
2596      return this.virtualService;
2597    }
2598
2599    /**
2600     * @return Returns a reference to <code>this</code> for easy method chaining
2601     */
2602    public Encounter setVirtualService(List<VirtualServiceDetail> theVirtualService) { 
2603      this.virtualService = theVirtualService;
2604      return this;
2605    }
2606
2607    public boolean hasVirtualService() { 
2608      if (this.virtualService == null)
2609        return false;
2610      for (VirtualServiceDetail item : this.virtualService)
2611        if (!item.isEmpty())
2612          return true;
2613      return false;
2614    }
2615
2616    public VirtualServiceDetail addVirtualService() { //3
2617      VirtualServiceDetail t = new VirtualServiceDetail();
2618      if (this.virtualService == null)
2619        this.virtualService = new ArrayList<VirtualServiceDetail>();
2620      this.virtualService.add(t);
2621      return t;
2622    }
2623
2624    public Encounter addVirtualService(VirtualServiceDetail t) { //3
2625      if (t == null)
2626        return this;
2627      if (this.virtualService == null)
2628        this.virtualService = new ArrayList<VirtualServiceDetail>();
2629      this.virtualService.add(t);
2630      return this;
2631    }
2632
2633    /**
2634     * @return The first repetition of repeating field {@link #virtualService}, creating it if it does not already exist {3}
2635     */
2636    public VirtualServiceDetail getVirtualServiceFirstRep() { 
2637      if (getVirtualService().isEmpty()) {
2638        addVirtualService();
2639      }
2640      return getVirtualService().get(0);
2641    }
2642
2643    /**
2644     * @return {@link #actualPeriod} (The actual start and end time of the encounter.)
2645     */
2646    public Period getActualPeriod() { 
2647      if (this.actualPeriod == null)
2648        if (Configuration.errorOnAutoCreate())
2649          throw new Error("Attempt to auto-create Encounter.actualPeriod");
2650        else if (Configuration.doAutoCreate())
2651          this.actualPeriod = new Period(); // cc
2652      return this.actualPeriod;
2653    }
2654
2655    public boolean hasActualPeriod() { 
2656      return this.actualPeriod != null && !this.actualPeriod.isEmpty();
2657    }
2658
2659    /**
2660     * @param value {@link #actualPeriod} (The actual start and end time of the encounter.)
2661     */
2662    public Encounter setActualPeriod(Period value) { 
2663      this.actualPeriod = value;
2664      return this;
2665    }
2666
2667    /**
2668     * @return {@link #plannedStartDate} (The planned start date/time (or admission date) of the encounter.). This is the underlying object with id, value and extensions. The accessor "getPlannedStartDate" gives direct access to the value
2669     */
2670    public DateTimeType getPlannedStartDateElement() { 
2671      if (this.plannedStartDate == null)
2672        if (Configuration.errorOnAutoCreate())
2673          throw new Error("Attempt to auto-create Encounter.plannedStartDate");
2674        else if (Configuration.doAutoCreate())
2675          this.plannedStartDate = new DateTimeType(); // bb
2676      return this.plannedStartDate;
2677    }
2678
2679    public boolean hasPlannedStartDateElement() { 
2680      return this.plannedStartDate != null && !this.plannedStartDate.isEmpty();
2681    }
2682
2683    public boolean hasPlannedStartDate() { 
2684      return this.plannedStartDate != null && !this.plannedStartDate.isEmpty();
2685    }
2686
2687    /**
2688     * @param value {@link #plannedStartDate} (The planned start date/time (or admission date) of the encounter.). This is the underlying object with id, value and extensions. The accessor "getPlannedStartDate" gives direct access to the value
2689     */
2690    public Encounter setPlannedStartDateElement(DateTimeType value) { 
2691      this.plannedStartDate = value;
2692      return this;
2693    }
2694
2695    /**
2696     * @return The planned start date/time (or admission date) of the encounter.
2697     */
2698    public Date getPlannedStartDate() { 
2699      return this.plannedStartDate == null ? null : this.plannedStartDate.getValue();
2700    }
2701
2702    /**
2703     * @param value The planned start date/time (or admission date) of the encounter.
2704     */
2705    public Encounter setPlannedStartDate(Date value) { 
2706      if (value == null)
2707        this.plannedStartDate = null;
2708      else {
2709        if (this.plannedStartDate == null)
2710          this.plannedStartDate = new DateTimeType();
2711        this.plannedStartDate.setValue(value);
2712      }
2713      return this;
2714    }
2715
2716    /**
2717     * @return {@link #plannedEndDate} (The planned end date/time (or discharge date) of the encounter.). This is the underlying object with id, value and extensions. The accessor "getPlannedEndDate" gives direct access to the value
2718     */
2719    public DateTimeType getPlannedEndDateElement() { 
2720      if (this.plannedEndDate == null)
2721        if (Configuration.errorOnAutoCreate())
2722          throw new Error("Attempt to auto-create Encounter.plannedEndDate");
2723        else if (Configuration.doAutoCreate())
2724          this.plannedEndDate = new DateTimeType(); // bb
2725      return this.plannedEndDate;
2726    }
2727
2728    public boolean hasPlannedEndDateElement() { 
2729      return this.plannedEndDate != null && !this.plannedEndDate.isEmpty();
2730    }
2731
2732    public boolean hasPlannedEndDate() { 
2733      return this.plannedEndDate != null && !this.plannedEndDate.isEmpty();
2734    }
2735
2736    /**
2737     * @param value {@link #plannedEndDate} (The planned end date/time (or discharge date) of the encounter.). This is the underlying object with id, value and extensions. The accessor "getPlannedEndDate" gives direct access to the value
2738     */
2739    public Encounter setPlannedEndDateElement(DateTimeType value) { 
2740      this.plannedEndDate = value;
2741      return this;
2742    }
2743
2744    /**
2745     * @return The planned end date/time (or discharge date) of the encounter.
2746     */
2747    public Date getPlannedEndDate() { 
2748      return this.plannedEndDate == null ? null : this.plannedEndDate.getValue();
2749    }
2750
2751    /**
2752     * @param value The planned end date/time (or discharge date) of the encounter.
2753     */
2754    public Encounter setPlannedEndDate(Date value) { 
2755      if (value == null)
2756        this.plannedEndDate = null;
2757      else {
2758        if (this.plannedEndDate == null)
2759          this.plannedEndDate = new DateTimeType();
2760        this.plannedEndDate.setValue(value);
2761      }
2762      return this;
2763    }
2764
2765    /**
2766     * @return {@link #length} (Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.
2767
2768When missing it is the time in between the start and end values.)
2769     */
2770    public Duration getLength() { 
2771      if (this.length == null)
2772        if (Configuration.errorOnAutoCreate())
2773          throw new Error("Attempt to auto-create Encounter.length");
2774        else if (Configuration.doAutoCreate())
2775          this.length = new Duration(); // cc
2776      return this.length;
2777    }
2778
2779    public boolean hasLength() { 
2780      return this.length != null && !this.length.isEmpty();
2781    }
2782
2783    /**
2784     * @param value {@link #length} (Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.
2785
2786When missing it is the time in between the start and end values.)
2787     */
2788    public Encounter setLength(Duration value) { 
2789      this.length = value;
2790      return this;
2791    }
2792
2793    /**
2794     * @return {@link #reason} (The list of medical reasons that are expected to be addressed during the episode of care.)
2795     */
2796    public List<ReasonComponent> getReason() { 
2797      if (this.reason == null)
2798        this.reason = new ArrayList<ReasonComponent>();
2799      return this.reason;
2800    }
2801
2802    /**
2803     * @return Returns a reference to <code>this</code> for easy method chaining
2804     */
2805    public Encounter setReason(List<ReasonComponent> theReason) { 
2806      this.reason = theReason;
2807      return this;
2808    }
2809
2810    public boolean hasReason() { 
2811      if (this.reason == null)
2812        return false;
2813      for (ReasonComponent item : this.reason)
2814        if (!item.isEmpty())
2815          return true;
2816      return false;
2817    }
2818
2819    public ReasonComponent addReason() { //3
2820      ReasonComponent t = new ReasonComponent();
2821      if (this.reason == null)
2822        this.reason = new ArrayList<ReasonComponent>();
2823      this.reason.add(t);
2824      return t;
2825    }
2826
2827    public Encounter addReason(ReasonComponent t) { //3
2828      if (t == null)
2829        return this;
2830      if (this.reason == null)
2831        this.reason = new ArrayList<ReasonComponent>();
2832      this.reason.add(t);
2833      return this;
2834    }
2835
2836    /**
2837     * @return The first repetition of repeating field {@link #reason}, creating it if it does not already exist {3}
2838     */
2839    public ReasonComponent getReasonFirstRep() { 
2840      if (getReason().isEmpty()) {
2841        addReason();
2842      }
2843      return getReason().get(0);
2844    }
2845
2846    /**
2847     * @return {@link #diagnosis} (The list of diagnosis relevant to this encounter.)
2848     */
2849    public List<DiagnosisComponent> getDiagnosis() { 
2850      if (this.diagnosis == null)
2851        this.diagnosis = new ArrayList<DiagnosisComponent>();
2852      return this.diagnosis;
2853    }
2854
2855    /**
2856     * @return Returns a reference to <code>this</code> for easy method chaining
2857     */
2858    public Encounter setDiagnosis(List<DiagnosisComponent> theDiagnosis) { 
2859      this.diagnosis = theDiagnosis;
2860      return this;
2861    }
2862
2863    public boolean hasDiagnosis() { 
2864      if (this.diagnosis == null)
2865        return false;
2866      for (DiagnosisComponent item : this.diagnosis)
2867        if (!item.isEmpty())
2868          return true;
2869      return false;
2870    }
2871
2872    public DiagnosisComponent addDiagnosis() { //3
2873      DiagnosisComponent t = new DiagnosisComponent();
2874      if (this.diagnosis == null)
2875        this.diagnosis = new ArrayList<DiagnosisComponent>();
2876      this.diagnosis.add(t);
2877      return t;
2878    }
2879
2880    public Encounter addDiagnosis(DiagnosisComponent t) { //3
2881      if (t == null)
2882        return this;
2883      if (this.diagnosis == null)
2884        this.diagnosis = new ArrayList<DiagnosisComponent>();
2885      this.diagnosis.add(t);
2886      return this;
2887    }
2888
2889    /**
2890     * @return The first repetition of repeating field {@link #diagnosis}, creating it if it does not already exist {3}
2891     */
2892    public DiagnosisComponent getDiagnosisFirstRep() { 
2893      if (getDiagnosis().isEmpty()) {
2894        addDiagnosis();
2895      }
2896      return getDiagnosis().get(0);
2897    }
2898
2899    /**
2900     * @return {@link #account} (The set of accounts that may be used for billing for this Encounter.)
2901     */
2902    public List<Reference> getAccount() { 
2903      if (this.account == null)
2904        this.account = new ArrayList<Reference>();
2905      return this.account;
2906    }
2907
2908    /**
2909     * @return Returns a reference to <code>this</code> for easy method chaining
2910     */
2911    public Encounter setAccount(List<Reference> theAccount) { 
2912      this.account = theAccount;
2913      return this;
2914    }
2915
2916    public boolean hasAccount() { 
2917      if (this.account == null)
2918        return false;
2919      for (Reference item : this.account)
2920        if (!item.isEmpty())
2921          return true;
2922      return false;
2923    }
2924
2925    public Reference addAccount() { //3
2926      Reference t = new Reference();
2927      if (this.account == null)
2928        this.account = new ArrayList<Reference>();
2929      this.account.add(t);
2930      return t;
2931    }
2932
2933    public Encounter addAccount(Reference t) { //3
2934      if (t == null)
2935        return this;
2936      if (this.account == null)
2937        this.account = new ArrayList<Reference>();
2938      this.account.add(t);
2939      return this;
2940    }
2941
2942    /**
2943     * @return The first repetition of repeating field {@link #account}, creating it if it does not already exist {3}
2944     */
2945    public Reference getAccountFirstRep() { 
2946      if (getAccount().isEmpty()) {
2947        addAccount();
2948      }
2949      return getAccount().get(0);
2950    }
2951
2952    /**
2953     * @return {@link #dietPreference} (Diet preferences reported by the patient.)
2954     */
2955    public List<CodeableConcept> getDietPreference() { 
2956      if (this.dietPreference == null)
2957        this.dietPreference = new ArrayList<CodeableConcept>();
2958      return this.dietPreference;
2959    }
2960
2961    /**
2962     * @return Returns a reference to <code>this</code> for easy method chaining
2963     */
2964    public Encounter setDietPreference(List<CodeableConcept> theDietPreference) { 
2965      this.dietPreference = theDietPreference;
2966      return this;
2967    }
2968
2969    public boolean hasDietPreference() { 
2970      if (this.dietPreference == null)
2971        return false;
2972      for (CodeableConcept item : this.dietPreference)
2973        if (!item.isEmpty())
2974          return true;
2975      return false;
2976    }
2977
2978    public CodeableConcept addDietPreference() { //3
2979      CodeableConcept t = new CodeableConcept();
2980      if (this.dietPreference == null)
2981        this.dietPreference = new ArrayList<CodeableConcept>();
2982      this.dietPreference.add(t);
2983      return t;
2984    }
2985
2986    public Encounter addDietPreference(CodeableConcept t) { //3
2987      if (t == null)
2988        return this;
2989      if (this.dietPreference == null)
2990        this.dietPreference = new ArrayList<CodeableConcept>();
2991      this.dietPreference.add(t);
2992      return this;
2993    }
2994
2995    /**
2996     * @return The first repetition of repeating field {@link #dietPreference}, creating it if it does not already exist {3}
2997     */
2998    public CodeableConcept getDietPreferenceFirstRep() { 
2999      if (getDietPreference().isEmpty()) {
3000        addDietPreference();
3001      }
3002      return getDietPreference().get(0);
3003    }
3004
3005    /**
3006     * @return {@link #specialArrangement} (Any special requests that have been made for this encounter, such as the provision of specific equipment or other things.)
3007     */
3008    public List<CodeableConcept> getSpecialArrangement() { 
3009      if (this.specialArrangement == null)
3010        this.specialArrangement = new ArrayList<CodeableConcept>();
3011      return this.specialArrangement;
3012    }
3013
3014    /**
3015     * @return Returns a reference to <code>this</code> for easy method chaining
3016     */
3017    public Encounter setSpecialArrangement(List<CodeableConcept> theSpecialArrangement) { 
3018      this.specialArrangement = theSpecialArrangement;
3019      return this;
3020    }
3021
3022    public boolean hasSpecialArrangement() { 
3023      if (this.specialArrangement == null)
3024        return false;
3025      for (CodeableConcept item : this.specialArrangement)
3026        if (!item.isEmpty())
3027          return true;
3028      return false;
3029    }
3030
3031    public CodeableConcept addSpecialArrangement() { //3
3032      CodeableConcept t = new CodeableConcept();
3033      if (this.specialArrangement == null)
3034        this.specialArrangement = new ArrayList<CodeableConcept>();
3035      this.specialArrangement.add(t);
3036      return t;
3037    }
3038
3039    public Encounter addSpecialArrangement(CodeableConcept t) { //3
3040      if (t == null)
3041        return this;
3042      if (this.specialArrangement == null)
3043        this.specialArrangement = new ArrayList<CodeableConcept>();
3044      this.specialArrangement.add(t);
3045      return this;
3046    }
3047
3048    /**
3049     * @return The first repetition of repeating field {@link #specialArrangement}, creating it if it does not already exist {3}
3050     */
3051    public CodeableConcept getSpecialArrangementFirstRep() { 
3052      if (getSpecialArrangement().isEmpty()) {
3053        addSpecialArrangement();
3054      }
3055      return getSpecialArrangement().get(0);
3056    }
3057
3058    /**
3059     * @return {@link #specialCourtesy} (Special courtesies that may be provided to the patient during the encounter (VIP, board member, professional courtesy).)
3060     */
3061    public List<CodeableConcept> getSpecialCourtesy() { 
3062      if (this.specialCourtesy == null)
3063        this.specialCourtesy = new ArrayList<CodeableConcept>();
3064      return this.specialCourtesy;
3065    }
3066
3067    /**
3068     * @return Returns a reference to <code>this</code> for easy method chaining
3069     */
3070    public Encounter setSpecialCourtesy(List<CodeableConcept> theSpecialCourtesy) { 
3071      this.specialCourtesy = theSpecialCourtesy;
3072      return this;
3073    }
3074
3075    public boolean hasSpecialCourtesy() { 
3076      if (this.specialCourtesy == null)
3077        return false;
3078      for (CodeableConcept item : this.specialCourtesy)
3079        if (!item.isEmpty())
3080          return true;
3081      return false;
3082    }
3083
3084    public CodeableConcept addSpecialCourtesy() { //3
3085      CodeableConcept t = new CodeableConcept();
3086      if (this.specialCourtesy == null)
3087        this.specialCourtesy = new ArrayList<CodeableConcept>();
3088      this.specialCourtesy.add(t);
3089      return t;
3090    }
3091
3092    public Encounter addSpecialCourtesy(CodeableConcept t) { //3
3093      if (t == null)
3094        return this;
3095      if (this.specialCourtesy == null)
3096        this.specialCourtesy = new ArrayList<CodeableConcept>();
3097      this.specialCourtesy.add(t);
3098      return this;
3099    }
3100
3101    /**
3102     * @return The first repetition of repeating field {@link #specialCourtesy}, creating it if it does not already exist {3}
3103     */
3104    public CodeableConcept getSpecialCourtesyFirstRep() { 
3105      if (getSpecialCourtesy().isEmpty()) {
3106        addSpecialCourtesy();
3107      }
3108      return getSpecialCourtesy().get(0);
3109    }
3110
3111    /**
3112     * @return {@link #admission} (Details about the stay during which a healthcare service is provided.
3113
3114This does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge.)
3115     */
3116    public EncounterAdmissionComponent getAdmission() { 
3117      if (this.admission == null)
3118        if (Configuration.errorOnAutoCreate())
3119          throw new Error("Attempt to auto-create Encounter.admission");
3120        else if (Configuration.doAutoCreate())
3121          this.admission = new EncounterAdmissionComponent(); // cc
3122      return this.admission;
3123    }
3124
3125    public boolean hasAdmission() { 
3126      return this.admission != null && !this.admission.isEmpty();
3127    }
3128
3129    /**
3130     * @param value {@link #admission} (Details about the stay during which a healthcare service is provided.
3131
3132This does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge.)
3133     */
3134    public Encounter setAdmission(EncounterAdmissionComponent value) { 
3135      this.admission = value;
3136      return this;
3137    }
3138
3139    /**
3140     * @return {@link #location} (List of locations where  the patient has been during this encounter.)
3141     */
3142    public List<EncounterLocationComponent> getLocation() { 
3143      if (this.location == null)
3144        this.location = new ArrayList<EncounterLocationComponent>();
3145      return this.location;
3146    }
3147
3148    /**
3149     * @return Returns a reference to <code>this</code> for easy method chaining
3150     */
3151    public Encounter setLocation(List<EncounterLocationComponent> theLocation) { 
3152      this.location = theLocation;
3153      return this;
3154    }
3155
3156    public boolean hasLocation() { 
3157      if (this.location == null)
3158        return false;
3159      for (EncounterLocationComponent item : this.location)
3160        if (!item.isEmpty())
3161          return true;
3162      return false;
3163    }
3164
3165    public EncounterLocationComponent addLocation() { //3
3166      EncounterLocationComponent t = new EncounterLocationComponent();
3167      if (this.location == null)
3168        this.location = new ArrayList<EncounterLocationComponent>();
3169      this.location.add(t);
3170      return t;
3171    }
3172
3173    public Encounter addLocation(EncounterLocationComponent t) { //3
3174      if (t == null)
3175        return this;
3176      if (this.location == null)
3177        this.location = new ArrayList<EncounterLocationComponent>();
3178      this.location.add(t);
3179      return this;
3180    }
3181
3182    /**
3183     * @return The first repetition of repeating field {@link #location}, creating it if it does not already exist {3}
3184     */
3185    public EncounterLocationComponent getLocationFirstRep() { 
3186      if (getLocation().isEmpty()) {
3187        addLocation();
3188      }
3189      return getLocation().get(0);
3190    }
3191
3192      protected void listChildren(List<Property> children) {
3193        super.listChildren(children);
3194        children.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier));
3195        children.add(new Property("status", "code", "The current state of the encounter (not the state of the patient within the encounter - that is subjectState).", 0, 1, status));
3196        children.add(new Property("class", "CodeableConcept", "Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.", 0, java.lang.Integer.MAX_VALUE, class_));
3197        children.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, 1, priority));
3198        children.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type));
3199        children.add(new Property("serviceType", "CodeableReference(HealthcareService)", "Broad categorization of the service that is to be provided (e.g. cardiology).", 0, java.lang.Integer.MAX_VALUE, serviceType));
3200        children.add(new Property("subject", "Reference(Patient|Group)", "The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam.", 0, 1, subject));
3201        children.add(new Property("subjectStatus", "CodeableConcept", "The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status.", 0, 1, subjectStatus));
3202        children.add(new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).", 0, java.lang.Integer.MAX_VALUE, episodeOfCare));
3203        children.add(new Property("basedOn", "Reference(CarePlan|DeviceRequest|MedicationRequest|ServiceRequest)", "The request this encounter satisfies (e.g. incoming referral or procedure request).", 0, java.lang.Integer.MAX_VALUE, basedOn));
3204        children.add(new Property("careTeam", "Reference(CareTeam)", "The group(s) of individuals, organizations that are allocated to participate in this encounter. The participants backbone will record the actuals of when these individuals participated during the encounter.", 0, java.lang.Integer.MAX_VALUE, careTeam));
3205        children.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, 1, partOf));
3206        children.add(new Property("serviceProvider", "Reference(Organization)", "The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab.", 0, 1, serviceProvider));
3207        children.add(new Property("participant", "", "The list of people responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant));
3208        children.add(new Property("appointment", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, appointment));
3209        children.add(new Property("virtualService", "VirtualServiceDetail", "Connection details of a virtual service (e.g. conference call).", 0, java.lang.Integer.MAX_VALUE, virtualService));
3210        children.add(new Property("actualPeriod", "Period", "The actual start and end time of the encounter.", 0, 1, actualPeriod));
3211        children.add(new Property("plannedStartDate", "dateTime", "The planned start date/time (or admission date) of the encounter.", 0, 1, plannedStartDate));
3212        children.add(new Property("plannedEndDate", "dateTime", "The planned end date/time (or discharge date) of the encounter.", 0, 1, plannedEndDate));
3213        children.add(new Property("length", "Duration", "Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.\r\rWhen missing it is the time in between the start and end values.", 0, 1, length));
3214        children.add(new Property("reason", "", "The list of medical reasons that are expected to be addressed during the episode of care.", 0, java.lang.Integer.MAX_VALUE, reason));
3215        children.add(new Property("diagnosis", "", "The list of diagnosis relevant to this encounter.", 0, java.lang.Integer.MAX_VALUE, diagnosis));
3216        children.add(new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this Encounter.", 0, java.lang.Integer.MAX_VALUE, account));
3217        children.add(new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference));
3218        children.add(new Property("specialArrangement", "CodeableConcept", "Any special requests that have been made for this encounter, such as the provision of specific equipment or other things.", 0, java.lang.Integer.MAX_VALUE, specialArrangement));
3219        children.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies that may be provided to the patient during the encounter (VIP, board member, professional courtesy).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy));
3220        children.add(new Property("admission", "", "Details about the stay during which a healthcare service is provided.\r\rThis does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge.", 0, 1, admission));
3221        children.add(new Property("location", "", "List of locations where  the patient has been during this encounter.", 0, java.lang.Integer.MAX_VALUE, location));
3222      }
3223
3224      @Override
3225      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3226        switch (_hash) {
3227        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier);
3228        case -892481550: /*status*/  return new Property("status", "code", "The current state of the encounter (not the state of the patient within the encounter - that is subjectState).", 0, 1, status);
3229        case 94742904: /*class*/  return new Property("class", "CodeableConcept", "Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.", 0, java.lang.Integer.MAX_VALUE, class_);
3230        case -1165461084: /*priority*/  return new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, 1, priority);
3231        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type);
3232        case -1928370289: /*serviceType*/  return new Property("serviceType", "CodeableReference(HealthcareService)", "Broad categorization of the service that is to be provided (e.g. cardiology).", 0, java.lang.Integer.MAX_VALUE, serviceType);
3233        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "The patient or group related to this encounter. In some use-cases the patient MAY not be present, such as a case meeting about a patient between several practitioners or a careteam.", 0, 1, subject);
3234        case 110854206: /*subjectStatus*/  return new Property("subjectStatus", "CodeableConcept", "The subjectStatus value can be used to track the patient's status within the encounter. It details whether the patient has arrived or departed, has been triaged or is currently in a waiting status.", 0, 1, subjectStatus);
3235        case -1892140189: /*episodeOfCare*/  return new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).", 0, java.lang.Integer.MAX_VALUE, episodeOfCare);
3236        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|DeviceRequest|MedicationRequest|ServiceRequest)", "The request this encounter satisfies (e.g. incoming referral or procedure request).", 0, java.lang.Integer.MAX_VALUE, basedOn);
3237        case -7323378: /*careTeam*/  return new Property("careTeam", "Reference(CareTeam)", "The group(s) of individuals, organizations that are allocated to participate in this encounter. The participants backbone will record the actuals of when these individuals participated during the encounter.", 0, java.lang.Integer.MAX_VALUE, careTeam);
3238        case -995410646: /*partOf*/  return new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, 1, partOf);
3239        case 243182534: /*serviceProvider*/  return new Property("serviceProvider", "Reference(Organization)", "The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the colonoscopy example on the Encounter examples tab.", 0, 1, serviceProvider);
3240        case 767422259: /*participant*/  return new Property("participant", "", "The list of people responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant);
3241        case -1474995297: /*appointment*/  return new Property("appointment", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, appointment);
3242        case 1420774698: /*virtualService*/  return new Property("virtualService", "VirtualServiceDetail", "Connection details of a virtual service (e.g. conference call).", 0, java.lang.Integer.MAX_VALUE, virtualService);
3243        case 789194991: /*actualPeriod*/  return new Property("actualPeriod", "Period", "The actual start and end time of the encounter.", 0, 1, actualPeriod);
3244        case 460857804: /*plannedStartDate*/  return new Property("plannedStartDate", "dateTime", "The planned start date/time (or admission date) of the encounter.", 0, 1, plannedStartDate);
3245        case 1657534661: /*plannedEndDate*/  return new Property("plannedEndDate", "dateTime", "The planned end date/time (or discharge date) of the encounter.", 0, 1, plannedEndDate);
3246        case -1106363674: /*length*/  return new Property("length", "Duration", "Actual quantity of time the encounter lasted. This excludes the time during leaves of absence.\r\rWhen missing it is the time in between the start and end values.", 0, 1, length);
3247        case -934964668: /*reason*/  return new Property("reason", "", "The list of medical reasons that are expected to be addressed during the episode of care.", 0, java.lang.Integer.MAX_VALUE, reason);
3248        case 1196993265: /*diagnosis*/  return new Property("diagnosis", "", "The list of diagnosis relevant to this encounter.", 0, java.lang.Integer.MAX_VALUE, diagnosis);
3249        case -1177318867: /*account*/  return new Property("account", "Reference(Account)", "The set of accounts that may be used for billing for this Encounter.", 0, java.lang.Integer.MAX_VALUE, account);
3250        case -1360641041: /*dietPreference*/  return new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference);
3251        case 47410321: /*specialArrangement*/  return new Property("specialArrangement", "CodeableConcept", "Any special requests that have been made for this encounter, such as the provision of specific equipment or other things.", 0, java.lang.Integer.MAX_VALUE, specialArrangement);
3252        case 1583588345: /*specialCourtesy*/  return new Property("specialCourtesy", "CodeableConcept", "Special courtesies that may be provided to the patient during the encounter (VIP, board member, professional courtesy).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy);
3253        case 27400201: /*admission*/  return new Property("admission", "", "Details about the stay during which a healthcare service is provided.\r\rThis does not describe the event of admitting the patient, but rather any information that is relevant from the time of admittance until the time of discharge.", 0, 1, admission);
3254        case 1901043637: /*location*/  return new Property("location", "", "List of locations where  the patient has been during this encounter.", 0, java.lang.Integer.MAX_VALUE, location);
3255        default: return super.getNamedProperty(_hash, _name, _checkValid);
3256        }
3257
3258      }
3259
3260      @Override
3261      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3262        switch (hash) {
3263        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3264        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<EncounterStatus>
3265        case 94742904: /*class*/ return this.class_ == null ? new Base[0] : this.class_.toArray(new Base[this.class_.size()]); // CodeableConcept
3266        case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept
3267        case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept
3268        case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableReference
3269        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
3270        case 110854206: /*subjectStatus*/ return this.subjectStatus == null ? new Base[0] : new Base[] {this.subjectStatus}; // CodeableConcept
3271        case -1892140189: /*episodeOfCare*/ return this.episodeOfCare == null ? new Base[0] : this.episodeOfCare.toArray(new Base[this.episodeOfCare.size()]); // Reference
3272        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
3273        case -7323378: /*careTeam*/ return this.careTeam == null ? new Base[0] : this.careTeam.toArray(new Base[this.careTeam.size()]); // Reference
3274        case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference
3275        case 243182534: /*serviceProvider*/ return this.serviceProvider == null ? new Base[0] : new Base[] {this.serviceProvider}; // Reference
3276        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // EncounterParticipantComponent
3277        case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : this.appointment.toArray(new Base[this.appointment.size()]); // Reference
3278        case 1420774698: /*virtualService*/ return this.virtualService == null ? new Base[0] : this.virtualService.toArray(new Base[this.virtualService.size()]); // VirtualServiceDetail
3279        case 789194991: /*actualPeriod*/ return this.actualPeriod == null ? new Base[0] : new Base[] {this.actualPeriod}; // Period
3280        case 460857804: /*plannedStartDate*/ return this.plannedStartDate == null ? new Base[0] : new Base[] {this.plannedStartDate}; // DateTimeType
3281        case 1657534661: /*plannedEndDate*/ return this.plannedEndDate == null ? new Base[0] : new Base[] {this.plannedEndDate}; // DateTimeType
3282        case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // Duration
3283        case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // ReasonComponent
3284        case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent
3285        case -1177318867: /*account*/ return this.account == null ? new Base[0] : this.account.toArray(new Base[this.account.size()]); // Reference
3286        case -1360641041: /*dietPreference*/ return this.dietPreference == null ? new Base[0] : this.dietPreference.toArray(new Base[this.dietPreference.size()]); // CodeableConcept
3287        case 47410321: /*specialArrangement*/ return this.specialArrangement == null ? new Base[0] : this.specialArrangement.toArray(new Base[this.specialArrangement.size()]); // CodeableConcept
3288        case 1583588345: /*specialCourtesy*/ return this.specialCourtesy == null ? new Base[0] : this.specialCourtesy.toArray(new Base[this.specialCourtesy.size()]); // CodeableConcept
3289        case 27400201: /*admission*/ return this.admission == null ? new Base[0] : new Base[] {this.admission}; // EncounterAdmissionComponent
3290        case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // EncounterLocationComponent
3291        default: return super.getProperty(hash, name, checkValid);
3292        }
3293
3294      }
3295
3296      @Override
3297      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3298        switch (hash) {
3299        case -1618432855: // identifier
3300          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3301          return value;
3302        case -892481550: // status
3303          value = new EncounterStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3304          this.status = (Enumeration) value; // Enumeration<EncounterStatus>
3305          return value;
3306        case 94742904: // class
3307          this.getClass_().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3308          return value;
3309        case -1165461084: // priority
3310          this.priority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3311          return value;
3312        case 3575610: // type
3313          this.getType().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3314          return value;
3315        case -1928370289: // serviceType
3316          this.getServiceType().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
3317          return value;
3318        case -1867885268: // subject
3319          this.subject = TypeConvertor.castToReference(value); // Reference
3320          return value;
3321        case 110854206: // subjectStatus
3322          this.subjectStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3323          return value;
3324        case -1892140189: // episodeOfCare
3325          this.getEpisodeOfCare().add(TypeConvertor.castToReference(value)); // Reference
3326          return value;
3327        case -332612366: // basedOn
3328          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
3329          return value;
3330        case -7323378: // careTeam
3331          this.getCareTeam().add(TypeConvertor.castToReference(value)); // Reference
3332          return value;
3333        case -995410646: // partOf
3334          this.partOf = TypeConvertor.castToReference(value); // Reference
3335          return value;
3336        case 243182534: // serviceProvider
3337          this.serviceProvider = TypeConvertor.castToReference(value); // Reference
3338          return value;
3339        case 767422259: // participant
3340          this.getParticipant().add((EncounterParticipantComponent) value); // EncounterParticipantComponent
3341          return value;
3342        case -1474995297: // appointment
3343          this.getAppointment().add(TypeConvertor.castToReference(value)); // Reference
3344          return value;
3345        case 1420774698: // virtualService
3346          this.getVirtualService().add(TypeConvertor.castToVirtualServiceDetail(value)); // VirtualServiceDetail
3347          return value;
3348        case 789194991: // actualPeriod
3349          this.actualPeriod = TypeConvertor.castToPeriod(value); // Period
3350          return value;
3351        case 460857804: // plannedStartDate
3352          this.plannedStartDate = TypeConvertor.castToDateTime(value); // DateTimeType
3353          return value;
3354        case 1657534661: // plannedEndDate
3355          this.plannedEndDate = TypeConvertor.castToDateTime(value); // DateTimeType
3356          return value;
3357        case -1106363674: // length
3358          this.length = TypeConvertor.castToDuration(value); // Duration
3359          return value;
3360        case -934964668: // reason
3361          this.getReason().add((ReasonComponent) value); // ReasonComponent
3362          return value;
3363        case 1196993265: // diagnosis
3364          this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent
3365          return value;
3366        case -1177318867: // account
3367          this.getAccount().add(TypeConvertor.castToReference(value)); // Reference
3368          return value;
3369        case -1360641041: // dietPreference
3370          this.getDietPreference().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3371          return value;
3372        case 47410321: // specialArrangement
3373          this.getSpecialArrangement().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3374          return value;
3375        case 1583588345: // specialCourtesy
3376          this.getSpecialCourtesy().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
3377          return value;
3378        case 27400201: // admission
3379          this.admission = (EncounterAdmissionComponent) value; // EncounterAdmissionComponent
3380          return value;
3381        case 1901043637: // location
3382          this.getLocation().add((EncounterLocationComponent) value); // EncounterLocationComponent
3383          return value;
3384        default: return super.setProperty(hash, name, value);
3385        }
3386
3387      }
3388
3389      @Override
3390      public Base setProperty(String name, Base value) throws FHIRException {
3391        if (name.equals("identifier")) {
3392          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
3393        } else if (name.equals("status")) {
3394          value = new EncounterStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3395          this.status = (Enumeration) value; // Enumeration<EncounterStatus>
3396        } else if (name.equals("class")) {
3397          this.getClass_().add(TypeConvertor.castToCodeableConcept(value));
3398        } else if (name.equals("priority")) {
3399          this.priority = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3400        } else if (name.equals("type")) {
3401          this.getType().add(TypeConvertor.castToCodeableConcept(value));
3402        } else if (name.equals("serviceType")) {
3403          this.getServiceType().add(TypeConvertor.castToCodeableReference(value));
3404        } else if (name.equals("subject")) {
3405          this.subject = TypeConvertor.castToReference(value); // Reference
3406        } else if (name.equals("subjectStatus")) {
3407          this.subjectStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3408        } else if (name.equals("episodeOfCare")) {
3409          this.getEpisodeOfCare().add(TypeConvertor.castToReference(value));
3410        } else if (name.equals("basedOn")) {
3411          this.getBasedOn().add(TypeConvertor.castToReference(value));
3412        } else if (name.equals("careTeam")) {
3413          this.getCareTeam().add(TypeConvertor.castToReference(value));
3414        } else if (name.equals("partOf")) {
3415          this.partOf = TypeConvertor.castToReference(value); // Reference
3416        } else if (name.equals("serviceProvider")) {
3417          this.serviceProvider = TypeConvertor.castToReference(value); // Reference
3418        } else if (name.equals("participant")) {
3419          this.getParticipant().add((EncounterParticipantComponent) value);
3420        } else if (name.equals("appointment")) {
3421          this.getAppointment().add(TypeConvertor.castToReference(value));
3422        } else if (name.equals("virtualService")) {
3423          this.getVirtualService().add(TypeConvertor.castToVirtualServiceDetail(value));
3424        } else if (name.equals("actualPeriod")) {
3425          this.actualPeriod = TypeConvertor.castToPeriod(value); // Period
3426        } else if (name.equals("plannedStartDate")) {
3427          this.plannedStartDate = TypeConvertor.castToDateTime(value); // DateTimeType
3428        } else if (name.equals("plannedEndDate")) {
3429          this.plannedEndDate = TypeConvertor.castToDateTime(value); // DateTimeType
3430        } else if (name.equals("length")) {
3431          this.length = TypeConvertor.castToDuration(value); // Duration
3432        } else if (name.equals("reason")) {
3433          this.getReason().add((ReasonComponent) value);
3434        } else if (name.equals("diagnosis")) {
3435          this.getDiagnosis().add((DiagnosisComponent) value);
3436        } else if (name.equals("account")) {
3437          this.getAccount().add(TypeConvertor.castToReference(value));
3438        } else if (name.equals("dietPreference")) {
3439          this.getDietPreference().add(TypeConvertor.castToCodeableConcept(value));
3440        } else if (name.equals("specialArrangement")) {
3441          this.getSpecialArrangement().add(TypeConvertor.castToCodeableConcept(value));
3442        } else if (name.equals("specialCourtesy")) {
3443          this.getSpecialCourtesy().add(TypeConvertor.castToCodeableConcept(value));
3444        } else if (name.equals("admission")) {
3445          this.admission = (EncounterAdmissionComponent) value; // EncounterAdmissionComponent
3446        } else if (name.equals("location")) {
3447          this.getLocation().add((EncounterLocationComponent) value);
3448        } else
3449          return super.setProperty(name, value);
3450        return value;
3451      }
3452
3453      @Override
3454      public Base makeProperty(int hash, String name) throws FHIRException {
3455        switch (hash) {
3456        case -1618432855:  return addIdentifier(); 
3457        case -892481550:  return getStatusElement();
3458        case 94742904:  return addClass_(); 
3459        case -1165461084:  return getPriority();
3460        case 3575610:  return addType(); 
3461        case -1928370289:  return addServiceType(); 
3462        case -1867885268:  return getSubject();
3463        case 110854206:  return getSubjectStatus();
3464        case -1892140189:  return addEpisodeOfCare(); 
3465        case -332612366:  return addBasedOn(); 
3466        case -7323378:  return addCareTeam(); 
3467        case -995410646:  return getPartOf();
3468        case 243182534:  return getServiceProvider();
3469        case 767422259:  return addParticipant(); 
3470        case -1474995297:  return addAppointment(); 
3471        case 1420774698:  return addVirtualService(); 
3472        case 789194991:  return getActualPeriod();
3473        case 460857804:  return getPlannedStartDateElement();
3474        case 1657534661:  return getPlannedEndDateElement();
3475        case -1106363674:  return getLength();
3476        case -934964668:  return addReason(); 
3477        case 1196993265:  return addDiagnosis(); 
3478        case -1177318867:  return addAccount(); 
3479        case -1360641041:  return addDietPreference(); 
3480        case 47410321:  return addSpecialArrangement(); 
3481        case 1583588345:  return addSpecialCourtesy(); 
3482        case 27400201:  return getAdmission();
3483        case 1901043637:  return addLocation(); 
3484        default: return super.makeProperty(hash, name);
3485        }
3486
3487      }
3488
3489      @Override
3490      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3491        switch (hash) {
3492        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3493        case -892481550: /*status*/ return new String[] {"code"};
3494        case 94742904: /*class*/ return new String[] {"CodeableConcept"};
3495        case -1165461084: /*priority*/ return new String[] {"CodeableConcept"};
3496        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
3497        case -1928370289: /*serviceType*/ return new String[] {"CodeableReference"};
3498        case -1867885268: /*subject*/ return new String[] {"Reference"};
3499        case 110854206: /*subjectStatus*/ return new String[] {"CodeableConcept"};
3500        case -1892140189: /*episodeOfCare*/ return new String[] {"Reference"};
3501        case -332612366: /*basedOn*/ return new String[] {"Reference"};
3502        case -7323378: /*careTeam*/ return new String[] {"Reference"};
3503        case -995410646: /*partOf*/ return new String[] {"Reference"};
3504        case 243182534: /*serviceProvider*/ return new String[] {"Reference"};
3505        case 767422259: /*participant*/ return new String[] {};
3506        case -1474995297: /*appointment*/ return new String[] {"Reference"};
3507        case 1420774698: /*virtualService*/ return new String[] {"VirtualServiceDetail"};
3508        case 789194991: /*actualPeriod*/ return new String[] {"Period"};
3509        case 460857804: /*plannedStartDate*/ return new String[] {"dateTime"};
3510        case 1657534661: /*plannedEndDate*/ return new String[] {"dateTime"};
3511        case -1106363674: /*length*/ return new String[] {"Duration"};
3512        case -934964668: /*reason*/ return new String[] {};
3513        case 1196993265: /*diagnosis*/ return new String[] {};
3514        case -1177318867: /*account*/ return new String[] {"Reference"};
3515        case -1360641041: /*dietPreference*/ return new String[] {"CodeableConcept"};
3516        case 47410321: /*specialArrangement*/ return new String[] {"CodeableConcept"};
3517        case 1583588345: /*specialCourtesy*/ return new String[] {"CodeableConcept"};
3518        case 27400201: /*admission*/ return new String[] {};
3519        case 1901043637: /*location*/ return new String[] {};
3520        default: return super.getTypesForProperty(hash, name);
3521        }
3522
3523      }
3524
3525      @Override
3526      public Base addChild(String name) throws FHIRException {
3527        if (name.equals("identifier")) {
3528          return addIdentifier();
3529        }
3530        else if (name.equals("status")) {
3531          throw new FHIRException("Cannot call addChild on a singleton property Encounter.status");
3532        }
3533        else if (name.equals("class")) {
3534          return addClass_();
3535        }
3536        else if (name.equals("priority")) {
3537          this.priority = new CodeableConcept();
3538          return this.priority;
3539        }
3540        else if (name.equals("type")) {
3541          return addType();
3542        }
3543        else if (name.equals("serviceType")) {
3544          return addServiceType();
3545        }
3546        else if (name.equals("subject")) {
3547          this.subject = new Reference();
3548          return this.subject;
3549        }
3550        else if (name.equals("subjectStatus")) {
3551          this.subjectStatus = new CodeableConcept();
3552          return this.subjectStatus;
3553        }
3554        else if (name.equals("episodeOfCare")) {
3555          return addEpisodeOfCare();
3556        }
3557        else if (name.equals("basedOn")) {
3558          return addBasedOn();
3559        }
3560        else if (name.equals("careTeam")) {
3561          return addCareTeam();
3562        }
3563        else if (name.equals("partOf")) {
3564          this.partOf = new Reference();
3565          return this.partOf;
3566        }
3567        else if (name.equals("serviceProvider")) {
3568          this.serviceProvider = new Reference();
3569          return this.serviceProvider;
3570        }
3571        else if (name.equals("participant")) {
3572          return addParticipant();
3573        }
3574        else if (name.equals("appointment")) {
3575          return addAppointment();
3576        }
3577        else if (name.equals("virtualService")) {
3578          return addVirtualService();
3579        }
3580        else if (name.equals("actualPeriod")) {
3581          this.actualPeriod = new Period();
3582          return this.actualPeriod;
3583        }
3584        else if (name.equals("plannedStartDate")) {
3585          throw new FHIRException("Cannot call addChild on a singleton property Encounter.plannedStartDate");
3586        }
3587        else if (name.equals("plannedEndDate")) {
3588          throw new FHIRException("Cannot call addChild on a singleton property Encounter.plannedEndDate");
3589        }
3590        else if (name.equals("length")) {
3591          this.length = new Duration();
3592          return this.length;
3593        }
3594        else if (name.equals("reason")) {
3595          return addReason();
3596        }
3597        else if (name.equals("diagnosis")) {
3598          return addDiagnosis();
3599        }
3600        else if (name.equals("account")) {
3601          return addAccount();
3602        }
3603        else if (name.equals("dietPreference")) {
3604          return addDietPreference();
3605        }
3606        else if (name.equals("specialArrangement")) {
3607          return addSpecialArrangement();
3608        }
3609        else if (name.equals("specialCourtesy")) {
3610          return addSpecialCourtesy();
3611        }
3612        else if (name.equals("admission")) {
3613          this.admission = new EncounterAdmissionComponent();
3614          return this.admission;
3615        }
3616        else if (name.equals("location")) {
3617          return addLocation();
3618        }
3619        else
3620          return super.addChild(name);
3621      }
3622
3623  public String fhirType() {
3624    return "Encounter";
3625
3626  }
3627
3628      public Encounter copy() {
3629        Encounter dst = new Encounter();
3630        copyValues(dst);
3631        return dst;
3632      }
3633
3634      public void copyValues(Encounter dst) {
3635        super.copyValues(dst);
3636        if (identifier != null) {
3637          dst.identifier = new ArrayList<Identifier>();
3638          for (Identifier i : identifier)
3639            dst.identifier.add(i.copy());
3640        };
3641        dst.status = status == null ? null : status.copy();
3642        if (class_ != null) {
3643          dst.class_ = new ArrayList<CodeableConcept>();
3644          for (CodeableConcept i : class_)
3645            dst.class_.add(i.copy());
3646        };
3647        dst.priority = priority == null ? null : priority.copy();
3648        if (type != null) {
3649          dst.type = new ArrayList<CodeableConcept>();
3650          for (CodeableConcept i : type)
3651            dst.type.add(i.copy());
3652        };
3653        if (serviceType != null) {
3654          dst.serviceType = new ArrayList<CodeableReference>();
3655          for (CodeableReference i : serviceType)
3656            dst.serviceType.add(i.copy());
3657        };
3658        dst.subject = subject == null ? null : subject.copy();
3659        dst.subjectStatus = subjectStatus == null ? null : subjectStatus.copy();
3660        if (episodeOfCare != null) {
3661          dst.episodeOfCare = new ArrayList<Reference>();
3662          for (Reference i : episodeOfCare)
3663            dst.episodeOfCare.add(i.copy());
3664        };
3665        if (basedOn != null) {
3666          dst.basedOn = new ArrayList<Reference>();
3667          for (Reference i : basedOn)
3668            dst.basedOn.add(i.copy());
3669        };
3670        if (careTeam != null) {
3671          dst.careTeam = new ArrayList<Reference>();
3672          for (Reference i : careTeam)
3673            dst.careTeam.add(i.copy());
3674        };
3675        dst.partOf = partOf == null ? null : partOf.copy();
3676        dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy();
3677        if (participant != null) {
3678          dst.participant = new ArrayList<EncounterParticipantComponent>();
3679          for (EncounterParticipantComponent i : participant)
3680            dst.participant.add(i.copy());
3681        };
3682        if (appointment != null) {
3683          dst.appointment = new ArrayList<Reference>();
3684          for (Reference i : appointment)
3685            dst.appointment.add(i.copy());
3686        };
3687        if (virtualService != null) {
3688          dst.virtualService = new ArrayList<VirtualServiceDetail>();
3689          for (VirtualServiceDetail i : virtualService)
3690            dst.virtualService.add(i.copy());
3691        };
3692        dst.actualPeriod = actualPeriod == null ? null : actualPeriod.copy();
3693        dst.plannedStartDate = plannedStartDate == null ? null : plannedStartDate.copy();
3694        dst.plannedEndDate = plannedEndDate == null ? null : plannedEndDate.copy();
3695        dst.length = length == null ? null : length.copy();
3696        if (reason != null) {
3697          dst.reason = new ArrayList<ReasonComponent>();
3698          for (ReasonComponent i : reason)
3699            dst.reason.add(i.copy());
3700        };
3701        if (diagnosis != null) {
3702          dst.diagnosis = new ArrayList<DiagnosisComponent>();
3703          for (DiagnosisComponent i : diagnosis)
3704            dst.diagnosis.add(i.copy());
3705        };
3706        if (account != null) {
3707          dst.account = new ArrayList<Reference>();
3708          for (Reference i : account)
3709            dst.account.add(i.copy());
3710        };
3711        if (dietPreference != null) {
3712          dst.dietPreference = new ArrayList<CodeableConcept>();
3713          for (CodeableConcept i : dietPreference)
3714            dst.dietPreference.add(i.copy());
3715        };
3716        if (specialArrangement != null) {
3717          dst.specialArrangement = new ArrayList<CodeableConcept>();
3718          for (CodeableConcept i : specialArrangement)
3719            dst.specialArrangement.add(i.copy());
3720        };
3721        if (specialCourtesy != null) {
3722          dst.specialCourtesy = new ArrayList<CodeableConcept>();
3723          for (CodeableConcept i : specialCourtesy)
3724            dst.specialCourtesy.add(i.copy());
3725        };
3726        dst.admission = admission == null ? null : admission.copy();
3727        if (location != null) {
3728          dst.location = new ArrayList<EncounterLocationComponent>();
3729          for (EncounterLocationComponent i : location)
3730            dst.location.add(i.copy());
3731        };
3732      }
3733
3734      protected Encounter typedCopy() {
3735        return copy();
3736      }
3737
3738      @Override
3739      public boolean equalsDeep(Base other_) {
3740        if (!super.equalsDeep(other_))
3741          return false;
3742        if (!(other_ instanceof Encounter))
3743          return false;
3744        Encounter o = (Encounter) other_;
3745        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(class_, o.class_, true)
3746           && compareDeep(priority, o.priority, true) && compareDeep(type, o.type, true) && compareDeep(serviceType, o.serviceType, true)
3747           && compareDeep(subject, o.subject, true) && compareDeep(subjectStatus, o.subjectStatus, true) && compareDeep(episodeOfCare, o.episodeOfCare, true)
3748           && compareDeep(basedOn, o.basedOn, true) && compareDeep(careTeam, o.careTeam, true) && compareDeep(partOf, o.partOf, true)
3749           && compareDeep(serviceProvider, o.serviceProvider, true) && compareDeep(participant, o.participant, true)
3750           && compareDeep(appointment, o.appointment, true) && compareDeep(virtualService, o.virtualService, true)
3751           && compareDeep(actualPeriod, o.actualPeriod, true) && compareDeep(plannedStartDate, o.plannedStartDate, true)
3752           && compareDeep(plannedEndDate, o.plannedEndDate, true) && compareDeep(length, o.length, true) && compareDeep(reason, o.reason, true)
3753           && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(account, o.account, true) && compareDeep(dietPreference, o.dietPreference, true)
3754           && compareDeep(specialArrangement, o.specialArrangement, true) && compareDeep(specialCourtesy, o.specialCourtesy, true)
3755           && compareDeep(admission, o.admission, true) && compareDeep(location, o.location, true);
3756      }
3757
3758      @Override
3759      public boolean equalsShallow(Base other_) {
3760        if (!super.equalsShallow(other_))
3761          return false;
3762        if (!(other_ instanceof Encounter))
3763          return false;
3764        Encounter o = (Encounter) other_;
3765        return compareValues(status, o.status, true) && compareValues(plannedStartDate, o.plannedStartDate, true)
3766           && compareValues(plannedEndDate, o.plannedEndDate, true);
3767      }
3768
3769      public boolean isEmpty() {
3770        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, class_
3771          , priority, type, serviceType, subject, subjectStatus, episodeOfCare, basedOn
3772          , careTeam, partOf, serviceProvider, participant, appointment, virtualService, actualPeriod
3773          , plannedStartDate, plannedEndDate, length, reason, diagnosis, account, dietPreference
3774          , specialArrangement, specialCourtesy, admission, location);
3775      }
3776
3777  @Override
3778  public ResourceType getResourceType() {
3779    return ResourceType.Encounter;
3780   }
3781
3782 /**
3783   * Search parameter: <b>account</b>
3784   * <p>
3785   * Description: <b>The set of accounts that may be used for billing for this Encounter</b><br>
3786   * Type: <b>reference</b><br>
3787   * Path: <b>Encounter.account</b><br>
3788   * </p>
3789   */
3790  @SearchParamDefinition(name="account", path="Encounter.account", description="The set of accounts that may be used for billing for this Encounter", type="reference", target={Account.class } )
3791  public static final String SP_ACCOUNT = "account";
3792 /**
3793   * <b>Fluent Client</b> search parameter constant for <b>account</b>
3794   * <p>
3795   * Description: <b>The set of accounts that may be used for billing for this Encounter</b><br>
3796   * Type: <b>reference</b><br>
3797   * Path: <b>Encounter.account</b><br>
3798   * </p>
3799   */
3800  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACCOUNT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACCOUNT);
3801
3802/**
3803   * Constant for fluent queries to be used to add include statements. Specifies
3804   * the path value of "<b>Encounter:account</b>".
3805   */
3806  public static final ca.uhn.fhir.model.api.Include INCLUDE_ACCOUNT = new ca.uhn.fhir.model.api.Include("Encounter:account").toLocked();
3807
3808 /**
3809   * Search parameter: <b>appointment</b>
3810   * <p>
3811   * Description: <b>The appointment that scheduled this encounter</b><br>
3812   * Type: <b>reference</b><br>
3813   * Path: <b>Encounter.appointment</b><br>
3814   * </p>
3815   */
3816  @SearchParamDefinition(name="appointment", path="Encounter.appointment", description="The appointment that scheduled this encounter", type="reference", target={Appointment.class } )
3817  public static final String SP_APPOINTMENT = "appointment";
3818 /**
3819   * <b>Fluent Client</b> search parameter constant for <b>appointment</b>
3820   * <p>
3821   * Description: <b>The appointment that scheduled this encounter</b><br>
3822   * Type: <b>reference</b><br>
3823   * Path: <b>Encounter.appointment</b><br>
3824   * </p>
3825   */
3826  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT);
3827
3828/**
3829   * Constant for fluent queries to be used to add include statements. Specifies
3830   * the path value of "<b>Encounter:appointment</b>".
3831   */
3832  public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("Encounter:appointment").toLocked();
3833
3834 /**
3835   * Search parameter: <b>based-on</b>
3836   * <p>
3837   * Description: <b>The ServiceRequest that initiated this encounter</b><br>
3838   * Type: <b>reference</b><br>
3839   * Path: <b>Encounter.basedOn</b><br>
3840   * </p>
3841   */
3842  @SearchParamDefinition(name="based-on", path="Encounter.basedOn", description="The ServiceRequest that initiated this encounter", type="reference", target={CarePlan.class, DeviceRequest.class, MedicationRequest.class, ServiceRequest.class } )
3843  public static final String SP_BASED_ON = "based-on";
3844 /**
3845   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
3846   * <p>
3847   * Description: <b>The ServiceRequest that initiated this encounter</b><br>
3848   * Type: <b>reference</b><br>
3849   * Path: <b>Encounter.basedOn</b><br>
3850   * </p>
3851   */
3852  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
3853
3854/**
3855   * Constant for fluent queries to be used to add include statements. Specifies
3856   * the path value of "<b>Encounter:based-on</b>".
3857   */
3858  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("Encounter:based-on").toLocked();
3859
3860 /**
3861   * Search parameter: <b>careteam</b>
3862   * <p>
3863   * Description: <b>Careteam allocated to participate in the encounter</b><br>
3864   * Type: <b>reference</b><br>
3865   * Path: <b>Encounter.careTeam</b><br>
3866   * </p>
3867   */
3868  @SearchParamDefinition(name="careteam", path="Encounter.careTeam", description="Careteam allocated to participate in the encounter", type="reference", target={CareTeam.class } )
3869  public static final String SP_CARETEAM = "careteam";
3870 /**
3871   * <b>Fluent Client</b> search parameter constant for <b>careteam</b>
3872   * <p>
3873   * Description: <b>Careteam allocated to participate in the encounter</b><br>
3874   * Type: <b>reference</b><br>
3875   * Path: <b>Encounter.careTeam</b><br>
3876   * </p>
3877   */
3878  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARETEAM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARETEAM);
3879
3880/**
3881   * Constant for fluent queries to be used to add include statements. Specifies
3882   * the path value of "<b>Encounter:careteam</b>".
3883   */
3884  public static final ca.uhn.fhir.model.api.Include INCLUDE_CARETEAM = new ca.uhn.fhir.model.api.Include("Encounter:careteam").toLocked();
3885
3886 /**
3887   * Search parameter: <b>class</b>
3888   * <p>
3889   * Description: <b>Classification of patient encounter</b><br>
3890   * Type: <b>token</b><br>
3891   * Path: <b>Encounter.class</b><br>
3892   * </p>
3893   */
3894  @SearchParamDefinition(name="class", path="Encounter.class", description="Classification of patient encounter", type="token" )
3895  public static final String SP_CLASS = "class";
3896 /**
3897   * <b>Fluent Client</b> search parameter constant for <b>class</b>
3898   * <p>
3899   * Description: <b>Classification of patient encounter</b><br>
3900   * Type: <b>token</b><br>
3901   * Path: <b>Encounter.class</b><br>
3902   * </p>
3903   */
3904  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS);
3905
3906 /**
3907   * Search parameter: <b>date-start</b>
3908   * <p>
3909   * Description: <b>The actual start date of the Encounter</b><br>
3910   * Type: <b>date</b><br>
3911   * Path: <b>Encounter.actualPeriod.start</b><br>
3912   * </p>
3913   */
3914  @SearchParamDefinition(name="date-start", path="Encounter.actualPeriod.start", description="The actual start date of the Encounter", type="date" )
3915  public static final String SP_DATE_START = "date-start";
3916 /**
3917   * <b>Fluent Client</b> search parameter constant for <b>date-start</b>
3918   * <p>
3919   * Description: <b>The actual start date of the Encounter</b><br>
3920   * Type: <b>date</b><br>
3921   * Path: <b>Encounter.actualPeriod.start</b><br>
3922   * </p>
3923   */
3924  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE_START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE_START);
3925
3926 /**
3927   * Search parameter: <b>diagnosis-code</b>
3928   * <p>
3929   * Description: <b>The diagnosis or procedure relevant to the encounter (coded)</b><br>
3930   * Type: <b>token</b><br>
3931   * Path: <b>Encounter.diagnosis.condition.concept</b><br>
3932   * </p>
3933   */
3934  @SearchParamDefinition(name="diagnosis-code", path="Encounter.diagnosis.condition.concept", description="The diagnosis or procedure relevant to the encounter (coded)", type="token" )
3935  public static final String SP_DIAGNOSIS_CODE = "diagnosis-code";
3936 /**
3937   * <b>Fluent Client</b> search parameter constant for <b>diagnosis-code</b>
3938   * <p>
3939   * Description: <b>The diagnosis or procedure relevant to the encounter (coded)</b><br>
3940   * Type: <b>token</b><br>
3941   * Path: <b>Encounter.diagnosis.condition.concept</b><br>
3942   * </p>
3943   */
3944  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DIAGNOSIS_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIAGNOSIS_CODE);
3945
3946 /**
3947   * Search parameter: <b>diagnosis-reference</b>
3948   * <p>
3949   * Description: <b>The diagnosis or procedure relevant to the encounter (resource reference)</b><br>
3950   * Type: <b>reference</b><br>
3951   * Path: <b>Encounter.diagnosis.condition.reference</b><br>
3952   * </p>
3953   */
3954  @SearchParamDefinition(name="diagnosis-reference", path="Encounter.diagnosis.condition.reference", description="The diagnosis or procedure relevant to the encounter (resource reference)", type="reference", target={Condition.class } )
3955  public static final String SP_DIAGNOSIS_REFERENCE = "diagnosis-reference";
3956 /**
3957   * <b>Fluent Client</b> search parameter constant for <b>diagnosis-reference</b>
3958   * <p>
3959   * Description: <b>The diagnosis or procedure relevant to the encounter (resource reference)</b><br>
3960   * Type: <b>reference</b><br>
3961   * Path: <b>Encounter.diagnosis.condition.reference</b><br>
3962   * </p>
3963   */
3964  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DIAGNOSIS_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DIAGNOSIS_REFERENCE);
3965
3966/**
3967   * Constant for fluent queries to be used to add include statements. Specifies
3968   * the path value of "<b>Encounter:diagnosis-reference</b>".
3969   */
3970  public static final ca.uhn.fhir.model.api.Include INCLUDE_DIAGNOSIS_REFERENCE = new ca.uhn.fhir.model.api.Include("Encounter:diagnosis-reference").toLocked();
3971
3972 /**
3973   * Search parameter: <b>end-date</b>
3974   * <p>
3975   * Description: <b>The actual end date of the Encounter</b><br>
3976   * Type: <b>date</b><br>
3977   * Path: <b>Encounter.actualPeriod.end</b><br>
3978   * </p>
3979   */
3980  @SearchParamDefinition(name="end-date", path="Encounter.actualPeriod.end", description="The actual end date of the Encounter", type="date" )
3981  public static final String SP_END_DATE = "end-date";
3982 /**
3983   * <b>Fluent Client</b> search parameter constant for <b>end-date</b>
3984   * <p>
3985   * Description: <b>The actual end date of the Encounter</b><br>
3986   * Type: <b>date</b><br>
3987   * Path: <b>Encounter.actualPeriod.end</b><br>
3988   * </p>
3989   */
3990  public static final ca.uhn.fhir.rest.gclient.DateClientParam END_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_END_DATE);
3991
3992 /**
3993   * Search parameter: <b>episode-of-care</b>
3994   * <p>
3995   * Description: <b>Episode(s) of care that this encounter should be recorded against</b><br>
3996   * Type: <b>reference</b><br>
3997   * Path: <b>Encounter.episodeOfCare</b><br>
3998   * </p>
3999   */
4000  @SearchParamDefinition(name="episode-of-care", path="Encounter.episodeOfCare", description="Episode(s) of care that this encounter should be recorded against", type="reference", target={EpisodeOfCare.class } )
4001  public static final String SP_EPISODE_OF_CARE = "episode-of-care";
4002 /**
4003   * <b>Fluent Client</b> search parameter constant for <b>episode-of-care</b>
4004   * <p>
4005   * Description: <b>Episode(s) of care that this encounter should be recorded against</b><br>
4006   * Type: <b>reference</b><br>
4007   * Path: <b>Encounter.episodeOfCare</b><br>
4008   * </p>
4009   */
4010  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EPISODE_OF_CARE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EPISODE_OF_CARE);
4011
4012/**
4013   * Constant for fluent queries to be used to add include statements. Specifies
4014   * the path value of "<b>Encounter:episode-of-care</b>".
4015   */
4016  public static final ca.uhn.fhir.model.api.Include INCLUDE_EPISODE_OF_CARE = new ca.uhn.fhir.model.api.Include("Encounter:episode-of-care").toLocked();
4017
4018 /**
4019   * Search parameter: <b>length</b>
4020   * <p>
4021   * Description: <b>Length of encounter in days</b><br>
4022   * Type: <b>quantity</b><br>
4023   * Path: <b>Encounter.length</b><br>
4024   * </p>
4025   */
4026  @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="quantity" )
4027  public static final String SP_LENGTH = "length";
4028 /**
4029   * <b>Fluent Client</b> search parameter constant for <b>length</b>
4030   * <p>
4031   * Description: <b>Length of encounter in days</b><br>
4032   * Type: <b>quantity</b><br>
4033   * Path: <b>Encounter.length</b><br>
4034   * </p>
4035   */
4036  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam LENGTH = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_LENGTH);
4037
4038 /**
4039   * Search parameter: <b>location</b>
4040   * <p>
4041   * Description: <b>Location the encounter takes place</b><br>
4042   * Type: <b>reference</b><br>
4043   * Path: <b>Encounter.location.location</b><br>
4044   * </p>
4045   */
4046  @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference", target={Location.class } )
4047  public static final String SP_LOCATION = "location";
4048 /**
4049   * <b>Fluent Client</b> search parameter constant for <b>location</b>
4050   * <p>
4051   * Description: <b>Location the encounter takes place</b><br>
4052   * Type: <b>reference</b><br>
4053   * Path: <b>Encounter.location.location</b><br>
4054   * </p>
4055   */
4056  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
4057
4058/**
4059   * Constant for fluent queries to be used to add include statements. Specifies
4060   * the path value of "<b>Encounter:location</b>".
4061   */
4062  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Encounter:location").toLocked();
4063
4064 /**
4065   * Search parameter: <b>part-of</b>
4066   * <p>
4067   * Description: <b>Another Encounter this encounter is part of</b><br>
4068   * Type: <b>reference</b><br>
4069   * Path: <b>Encounter.partOf</b><br>
4070   * </p>
4071   */
4072  @SearchParamDefinition(name="part-of", path="Encounter.partOf", description="Another Encounter this encounter is part of", type="reference", target={Encounter.class } )
4073  public static final String SP_PART_OF = "part-of";
4074 /**
4075   * <b>Fluent Client</b> search parameter constant for <b>part-of</b>
4076   * <p>
4077   * Description: <b>Another Encounter this encounter is part of</b><br>
4078   * Type: <b>reference</b><br>
4079   * Path: <b>Encounter.partOf</b><br>
4080   * </p>
4081   */
4082  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF);
4083
4084/**
4085   * Constant for fluent queries to be used to add include statements. Specifies
4086   * the path value of "<b>Encounter:part-of</b>".
4087   */
4088  public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Encounter:part-of").toLocked();
4089
4090 /**
4091   * Search parameter: <b>participant-type</b>
4092   * <p>
4093   * Description: <b>Role of participant in encounter</b><br>
4094   * Type: <b>token</b><br>
4095   * Path: <b>Encounter.participant.type</b><br>
4096   * </p>
4097   */
4098  @SearchParamDefinition(name="participant-type", path="Encounter.participant.type", description="Role of participant in encounter", type="token" )
4099  public static final String SP_PARTICIPANT_TYPE = "participant-type";
4100 /**
4101   * <b>Fluent Client</b> search parameter constant for <b>participant-type</b>
4102   * <p>
4103   * Description: <b>Role of participant in encounter</b><br>
4104   * Type: <b>token</b><br>
4105   * Path: <b>Encounter.participant.type</b><br>
4106   * </p>
4107   */
4108  public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARTICIPANT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARTICIPANT_TYPE);
4109
4110 /**
4111   * Search parameter: <b>participant</b>
4112   * <p>
4113   * Description: <b>Persons involved in the encounter other than the patient</b><br>
4114   * Type: <b>reference</b><br>
4115   * Path: <b>Encounter.participant.actor</b><br>
4116   * </p>
4117   */
4118  @SearchParamDefinition(name="participant", path="Encounter.participant.actor", description="Persons involved in the encounter other than the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={Device.class, Group.class, HealthcareService.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
4119  public static final String SP_PARTICIPANT = "participant";
4120 /**
4121   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
4122   * <p>
4123   * Description: <b>Persons involved in the encounter other than the patient</b><br>
4124   * Type: <b>reference</b><br>
4125   * Path: <b>Encounter.participant.actor</b><br>
4126   * </p>
4127   */
4128  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT);
4129
4130/**
4131   * Constant for fluent queries to be used to add include statements. Specifies
4132   * the path value of "<b>Encounter:participant</b>".
4133   */
4134  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("Encounter:participant").toLocked();
4135
4136 /**
4137   * Search parameter: <b>practitioner</b>
4138   * <p>
4139   * Description: <b>Persons involved in the encounter other than the patient</b><br>
4140   * Type: <b>reference</b><br>
4141   * Path: <b>Encounter.participant.actor.where(resolve() is Practitioner)</b><br>
4142   * </p>
4143   */
4144  @SearchParamDefinition(name="practitioner", path="Encounter.participant.actor.where(resolve() is Practitioner)", description="Persons involved in the encounter other than the patient", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner") }, target={Practitioner.class } )
4145  public static final String SP_PRACTITIONER = "practitioner";
4146 /**
4147   * <b>Fluent Client</b> search parameter constant for <b>practitioner</b>
4148   * <p>
4149   * Description: <b>Persons involved in the encounter other than the patient</b><br>
4150   * Type: <b>reference</b><br>
4151   * Path: <b>Encounter.participant.actor.where(resolve() is Practitioner)</b><br>
4152   * </p>
4153   */
4154  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER);
4155
4156/**
4157   * Constant for fluent queries to be used to add include statements. Specifies
4158   * the path value of "<b>Encounter:practitioner</b>".
4159   */
4160  public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Encounter:practitioner").toLocked();
4161
4162 /**
4163   * Search parameter: <b>reason-code</b>
4164   * <p>
4165   * Description: <b>Reference to a concept (coded)</b><br>
4166   * Type: <b>token</b><br>
4167   * Path: <b>Encounter.reason.value.concept</b><br>
4168   * </p>
4169   */
4170  @SearchParamDefinition(name="reason-code", path="Encounter.reason.value.concept", description="Reference to a concept (coded)", type="token" )
4171  public static final String SP_REASON_CODE = "reason-code";
4172 /**
4173   * <b>Fluent Client</b> search parameter constant for <b>reason-code</b>
4174   * <p>
4175   * Description: <b>Reference to a concept (coded)</b><br>
4176   * Type: <b>token</b><br>
4177   * Path: <b>Encounter.reason.value.concept</b><br>
4178   * </p>
4179   */
4180  public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_CODE);
4181
4182 /**
4183   * Search parameter: <b>reason-reference</b>
4184   * <p>
4185   * Description: <b>Reference to a resource (resource reference)</b><br>
4186   * Type: <b>reference</b><br>
4187   * Path: <b>Encounter.reason.value.reference</b><br>
4188   * </p>
4189   */
4190  @SearchParamDefinition(name="reason-reference", path="Encounter.reason.value.reference", description="Reference to a resource (resource reference)", type="reference", target={Condition.class, DiagnosticReport.class, ImmunizationRecommendation.class, Observation.class, Procedure.class } )
4191  public static final String SP_REASON_REFERENCE = "reason-reference";
4192 /**
4193   * <b>Fluent Client</b> search parameter constant for <b>reason-reference</b>
4194   * <p>
4195   * Description: <b>Reference to a resource (resource reference)</b><br>
4196   * Type: <b>reference</b><br>
4197   * Path: <b>Encounter.reason.value.reference</b><br>
4198   * </p>
4199   */
4200  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REASON_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REASON_REFERENCE);
4201
4202/**
4203   * Constant for fluent queries to be used to add include statements. Specifies
4204   * the path value of "<b>Encounter:reason-reference</b>".
4205   */
4206  public static final ca.uhn.fhir.model.api.Include INCLUDE_REASON_REFERENCE = new ca.uhn.fhir.model.api.Include("Encounter:reason-reference").toLocked();
4207
4208 /**
4209   * Search parameter: <b>service-provider</b>
4210   * <p>
4211   * Description: <b>The organization (facility) responsible for this encounter</b><br>
4212   * Type: <b>reference</b><br>
4213   * Path: <b>Encounter.serviceProvider</b><br>
4214   * </p>
4215   */
4216  @SearchParamDefinition(name="service-provider", path="Encounter.serviceProvider", description="The organization (facility) responsible for this encounter", type="reference", target={Organization.class } )
4217  public static final String SP_SERVICE_PROVIDER = "service-provider";
4218 /**
4219   * <b>Fluent Client</b> search parameter constant for <b>service-provider</b>
4220   * <p>
4221   * Description: <b>The organization (facility) responsible for this encounter</b><br>
4222   * Type: <b>reference</b><br>
4223   * Path: <b>Encounter.serviceProvider</b><br>
4224   * </p>
4225   */
4226  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SERVICE_PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SERVICE_PROVIDER);
4227
4228/**
4229   * Constant for fluent queries to be used to add include statements. Specifies
4230   * the path value of "<b>Encounter:service-provider</b>".
4231   */
4232  public static final ca.uhn.fhir.model.api.Include INCLUDE_SERVICE_PROVIDER = new ca.uhn.fhir.model.api.Include("Encounter:service-provider").toLocked();
4233
4234 /**
4235   * Search parameter: <b>special-arrangement</b>
4236   * <p>
4237   * Description: <b>Wheelchair, translator, stretcher, etc.</b><br>
4238   * Type: <b>token</b><br>
4239   * Path: <b>Encounter.specialArrangement</b><br>
4240   * </p>
4241   */
4242  @SearchParamDefinition(name="special-arrangement", path="Encounter.specialArrangement", description="Wheelchair, translator, stretcher, etc.", type="token" )
4243  public static final String SP_SPECIAL_ARRANGEMENT = "special-arrangement";
4244 /**
4245   * <b>Fluent Client</b> search parameter constant for <b>special-arrangement</b>
4246   * <p>
4247   * Description: <b>Wheelchair, translator, stretcher, etc.</b><br>
4248   * Type: <b>token</b><br>
4249   * Path: <b>Encounter.specialArrangement</b><br>
4250   * </p>
4251   */
4252  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIAL_ARRANGEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIAL_ARRANGEMENT);
4253
4254 /**
4255   * Search parameter: <b>status</b>
4256   * <p>
4257   * Description: <b>planned | in-progress | on-hold | completed | cancelled | entered-in-error | unknown</b><br>
4258   * Type: <b>token</b><br>
4259   * Path: <b>Encounter.status</b><br>
4260   * </p>
4261   */
4262  @SearchParamDefinition(name="status", path="Encounter.status", description="planned | in-progress | on-hold | completed | cancelled | entered-in-error | unknown", type="token" )
4263  public static final String SP_STATUS = "status";
4264 /**
4265   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4266   * <p>
4267   * Description: <b>planned | in-progress | on-hold | completed | cancelled | entered-in-error | unknown</b><br>
4268   * Type: <b>token</b><br>
4269   * Path: <b>Encounter.status</b><br>
4270   * </p>
4271   */
4272  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4273
4274 /**
4275   * Search parameter: <b>subject-status</b>
4276   * <p>
4277   * Description: <b>The current status of the subject in relation to the Encounter</b><br>
4278   * Type: <b>token</b><br>
4279   * Path: <b>Encounter.subjectStatus</b><br>
4280   * </p>
4281   */
4282  @SearchParamDefinition(name="subject-status", path="Encounter.subjectStatus", description="The current status of the subject in relation to the Encounter", type="token" )
4283  public static final String SP_SUBJECT_STATUS = "subject-status";
4284 /**
4285   * <b>Fluent Client</b> search parameter constant for <b>subject-status</b>
4286   * <p>
4287   * Description: <b>The current status of the subject in relation to the Encounter</b><br>
4288   * Type: <b>token</b><br>
4289   * Path: <b>Encounter.subjectStatus</b><br>
4290   * </p>
4291   */
4292  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBJECT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBJECT_STATUS);
4293
4294 /**
4295   * Search parameter: <b>subject</b>
4296   * <p>
4297   * Description: <b>The patient or group present at the encounter</b><br>
4298   * Type: <b>reference</b><br>
4299   * Path: <b>Encounter.subject</b><br>
4300   * </p>
4301   */
4302  @SearchParamDefinition(name="subject", path="Encounter.subject", description="The patient or group present at the encounter", type="reference", target={Group.class, Patient.class } )
4303  public static final String SP_SUBJECT = "subject";
4304 /**
4305   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
4306   * <p>
4307   * Description: <b>The patient or group present at the encounter</b><br>
4308   * Type: <b>reference</b><br>
4309   * Path: <b>Encounter.subject</b><br>
4310   * </p>
4311   */
4312  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
4313
4314/**
4315   * Constant for fluent queries to be used to add include statements. Specifies
4316   * the path value of "<b>Encounter:subject</b>".
4317   */
4318  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Encounter:subject").toLocked();
4319
4320 /**
4321   * Search parameter: <b>date</b>
4322   * <p>
4323   * Description: <b>Multiple Resources: 
4324
4325* [AdverseEvent](adverseevent.html): When the event occurred
4326* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
4327* [Appointment](appointment.html): Appointment date/time.
4328* [AuditEvent](auditevent.html): Time when the event was recorded
4329* [CarePlan](careplan.html): Time period plan covers
4330* [CareTeam](careteam.html): A date within the coverage time period.
4331* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
4332* [Composition](composition.html): Composition editing time
4333* [Consent](consent.html): When consent was agreed to
4334* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
4335* [DocumentReference](documentreference.html): When this document reference was created
4336* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
4337* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
4338* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
4339* [Flag](flag.html): Time period when flag is active
4340* [Immunization](immunization.html): Vaccination  (non)-Administration Date
4341* [ImmunizationEvaluation](immunizationevaluation.html): Date the evaluation was generated
4342* [ImmunizationRecommendation](immunizationrecommendation.html): Date recommendation(s) created
4343* [Invoice](invoice.html): Invoice date / posting date
4344* [List](list.html): When the list was prepared
4345* [MeasureReport](measurereport.html): The date of the measure report
4346* [NutritionIntake](nutritionintake.html): Date when patient was taking (or not taking) the medication
4347* [Observation](observation.html): Clinically relevant time/time-period for observation
4348* [Procedure](procedure.html): When the procedure occurred or is occurring
4349* [ResearchSubject](researchsubject.html): Start and end of participation
4350* [RiskAssessment](riskassessment.html): When was assessment made?
4351* [SupplyRequest](supplyrequest.html): When the request was made
4352</b><br>
4353   * Type: <b>date</b><br>
4354   * Path: <b>AdverseEvent.occurrence.ofType(dateTime) | AdverseEvent.occurrence.ofType(Period) | AdverseEvent.occurrence.ofType(Timing) | AllergyIntolerance.recordedDate | (start | requestedPeriod.start).first() | AuditEvent.recorded | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.ofType(dateTime) | DiagnosticReport.effective.ofType(Period) | DocumentReference.date | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence.ofType(dateTime)) | ImmunizationEvaluation.date | ImmunizationRecommendation.date | Invoice.date | List.date | MeasureReport.date | NutritionIntake.occurrence.ofType(dateTime) | NutritionIntake.occurrence.ofType(Period) | Observation.effective.ofType(dateTime) | Observation.effective.ofType(Period) | Observation.effective.ofType(Timing) | Observation.effective.ofType(instant) | Procedure.occurrence.ofType(dateTime) | Procedure.occurrence.ofType(Period) | Procedure.occurrence.ofType(Timing) | ResearchSubject.period | (RiskAssessment.occurrence.ofType(dateTime)) | SupplyRequest.authoredOn</b><br>
4355   * </p>
4356   */
4357  @SearchParamDefinition(name="date", path="AdverseEvent.occurrence.ofType(dateTime) | AdverseEvent.occurrence.ofType(Period) | AdverseEvent.occurrence.ofType(Timing) | AllergyIntolerance.recordedDate | (start | requestedPeriod.start).first() | AuditEvent.recorded | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.ofType(dateTime) | DiagnosticReport.effective.ofType(Period) | DocumentReference.date | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence.ofType(dateTime)) | ImmunizationEvaluation.date | ImmunizationRecommendation.date | Invoice.date | List.date | MeasureReport.date | NutritionIntake.occurrence.ofType(dateTime) | NutritionIntake.occurrence.ofType(Period) | Observation.effective.ofType(dateTime) | Observation.effective.ofType(Period) | Observation.effective.ofType(Timing) | Observation.effective.ofType(instant) | Procedure.occurrence.ofType(dateTime) | Procedure.occurrence.ofType(Period) | Procedure.occurrence.ofType(Timing) | ResearchSubject.period | (RiskAssessment.occurrence.ofType(dateTime)) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AdverseEvent](adverseevent.html): When the event occurred\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [Appointment](appointment.html): Appointment date/time.\r\n* [AuditEvent](auditevent.html): Time when the event 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* [DocumentReference](documentreference.html): When this document reference was created\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [ImmunizationEvaluation](immunizationevaluation.html): Date the evaluation was generated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Date recommendation(s) created\r\n* [Invoice](invoice.html): Invoice date / posting date\r\n* [List](list.html): When the list was prepared\r\n* [MeasureReport](measurereport.html): The date of the measure report\r\n* [NutritionIntake](nutritionintake.html): Date when patient was taking (or not taking) the medication\r\n* [Observation](observation.html): Clinically relevant time/time-period for observation\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [ResearchSubject](researchsubject.html): Start and end of participation\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
4358  public static final String SP_DATE = "date";
4359 /**
4360   * <b>Fluent Client</b> search parameter constant for <b>date</b>
4361   * <p>
4362   * Description: <b>Multiple Resources: 
4363
4364* [AdverseEvent](adverseevent.html): When the event occurred
4365* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
4366* [Appointment](appointment.html): Appointment date/time.
4367* [AuditEvent](auditevent.html): Time when the event was recorded
4368* [CarePlan](careplan.html): Time period plan covers
4369* [CareTeam](careteam.html): A date within the coverage time period.
4370* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
4371* [Composition](composition.html): Composition editing time
4372* [Consent](consent.html): When consent was agreed to
4373* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
4374* [DocumentReference](documentreference.html): When this document reference was created
4375* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
4376* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
4377* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
4378* [Flag](flag.html): Time period when flag is active
4379* [Immunization](immunization.html): Vaccination  (non)-Administration Date
4380* [ImmunizationEvaluation](immunizationevaluation.html): Date the evaluation was generated
4381* [ImmunizationRecommendation](immunizationrecommendation.html): Date recommendation(s) created
4382* [Invoice](invoice.html): Invoice date / posting date
4383* [List](list.html): When the list was prepared
4384* [MeasureReport](measurereport.html): The date of the measure report
4385* [NutritionIntake](nutritionintake.html): Date when patient was taking (or not taking) the medication
4386* [Observation](observation.html): Clinically relevant time/time-period for observation
4387* [Procedure](procedure.html): When the procedure occurred or is occurring
4388* [ResearchSubject](researchsubject.html): Start and end of participation
4389* [RiskAssessment](riskassessment.html): When was assessment made?
4390* [SupplyRequest](supplyrequest.html): When the request was made
4391</b><br>
4392   * Type: <b>date</b><br>
4393   * Path: <b>AdverseEvent.occurrence.ofType(dateTime) | AdverseEvent.occurrence.ofType(Period) | AdverseEvent.occurrence.ofType(Timing) | AllergyIntolerance.recordedDate | (start | requestedPeriod.start).first() | AuditEvent.recorded | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.ofType(dateTime) | DiagnosticReport.effective.ofType(Period) | DocumentReference.date | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence.ofType(dateTime)) | ImmunizationEvaluation.date | ImmunizationRecommendation.date | Invoice.date | List.date | MeasureReport.date | NutritionIntake.occurrence.ofType(dateTime) | NutritionIntake.occurrence.ofType(Period) | Observation.effective.ofType(dateTime) | Observation.effective.ofType(Period) | Observation.effective.ofType(Timing) | Observation.effective.ofType(instant) | Procedure.occurrence.ofType(dateTime) | Procedure.occurrence.ofType(Period) | Procedure.occurrence.ofType(Timing) | ResearchSubject.period | (RiskAssessment.occurrence.ofType(dateTime)) | SupplyRequest.authoredOn</b><br>
4394   * </p>
4395   */
4396  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
4397
4398 /**
4399   * Search parameter: <b>identifier</b>
4400   * <p>
4401   * Description: <b>Multiple Resources: 
4402
4403* [Account](account.html): Account number
4404* [AdverseEvent](adverseevent.html): Business identifier for the event
4405* [AllergyIntolerance](allergyintolerance.html): External ids for this item
4406* [Appointment](appointment.html): An Identifier of the Appointment
4407* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
4408* [Basic](basic.html): Business identifier
4409* [BodyStructure](bodystructure.html): Bodystructure identifier
4410* [CarePlan](careplan.html): External Ids for this plan
4411* [CareTeam](careteam.html): External Ids for this team
4412* [ChargeItem](chargeitem.html): Business Identifier for item
4413* [Claim](claim.html): The primary identifier of the financial resource
4414* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
4415* [ClinicalImpression](clinicalimpression.html): Business identifier
4416* [Communication](communication.html): Unique identifier
4417* [CommunicationRequest](communicationrequest.html): Unique identifier
4418* [Composition](composition.html): Version-independent identifier for the Composition
4419* [Condition](condition.html): A unique identifier of the condition record
4420* [Consent](consent.html): Identifier for this record (external references)
4421* [Contract](contract.html): The identity of the contract
4422* [Coverage](coverage.html): The primary identifier of the insured and the coverage
4423* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
4424* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
4425* [DetectedIssue](detectedissue.html): Unique id for the detected issue
4426* [DeviceRequest](devicerequest.html): Business identifier for request/order
4427* [DeviceUsage](deviceusage.html): Search by identifier
4428* [DiagnosticReport](diagnosticreport.html): An identifier for the report
4429* [DocumentReference](documentreference.html): Identifier of the attachment binary
4430* [Encounter](encounter.html): Identifier(s) by which this encounter is known
4431* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
4432* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
4433* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
4434* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
4435* [Flag](flag.html): Business identifier
4436* [Goal](goal.html): External Ids for this goal
4437* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
4438* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
4439* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
4440* [Immunization](immunization.html): Business identifier
4441* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
4442* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
4443* [Invoice](invoice.html): Business Identifier for item
4444* [List](list.html): Business identifier
4445* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
4446* [Medication](medication.html): Returns medications with this external identifier
4447* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
4448* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
4449* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
4450* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
4451* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
4452* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
4453* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
4454* [Observation](observation.html): The unique id for a particular observation
4455* [Person](person.html): A person Identifier
4456* [Procedure](procedure.html): A unique identifier for a procedure
4457* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
4458* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
4459* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
4460* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
4461* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
4462* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
4463* [Specimen](specimen.html): The unique identifier associated with the specimen
4464* [SupplyDelivery](supplydelivery.html): External identifier
4465* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
4466* [Task](task.html): Search for a task instance by its business identifier
4467* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
4468</b><br>
4469   * Type: <b>token</b><br>
4470   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
4471   * </p>
4472   */
4473  @SearchParamDefinition(name="identifier", path="Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [Account](account.html): Account number\r\n* [AdverseEvent](adverseevent.html): Business identifier for the event\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [Appointment](appointment.html): An Identifier of the Appointment\r\n* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response\r\n* [Basic](basic.html): Business identifier\r\n* [BodyStructure](bodystructure.html): Bodystructure identifier\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [ChargeItem](chargeitem.html): Business Identifier for item\r\n* [Claim](claim.html): The primary identifier of the financial resource\r\n* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse\r\n* [ClinicalImpression](clinicalimpression.html): Business identifier\r\n* [Communication](communication.html): Unique identifier\r\n* [CommunicationRequest](communicationrequest.html): Unique identifier\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [Contract](contract.html): The identity of the contract\r\n* [Coverage](coverage.html): The primary identifier of the insured and the coverage\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DeviceUsage](deviceusage.html): Search by identifier\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Flag](flag.html): Business identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response\r\n* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier\r\n* [Invoice](invoice.html): Business Identifier for item\r\n* [List](list.html): Business identifier\r\n* [MeasureReport](measurereport.html): External identifier of the measure report to be returned\r\n* [Medication](medication.html): Returns medications with this external identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationStatement](medicationstatement.html): Return statements with this external identifier\r\n* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence\r\n* [NutritionIntake](nutritionintake.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Person](person.html): A person Identifier\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response\r\n* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson\r\n* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration\r\n* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [Specimen](specimen.html): The unique identifier associated with the specimen\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [Task](task.html): Search for a task instance by its business identifier\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
4474  public static final String SP_IDENTIFIER = "identifier";
4475 /**
4476   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4477   * <p>
4478   * Description: <b>Multiple Resources: 
4479
4480* [Account](account.html): Account number
4481* [AdverseEvent](adverseevent.html): Business identifier for the event
4482* [AllergyIntolerance](allergyintolerance.html): External ids for this item
4483* [Appointment](appointment.html): An Identifier of the Appointment
4484* [AppointmentResponse](appointmentresponse.html): An Identifier in this appointment response
4485* [Basic](basic.html): Business identifier
4486* [BodyStructure](bodystructure.html): Bodystructure identifier
4487* [CarePlan](careplan.html): External Ids for this plan
4488* [CareTeam](careteam.html): External Ids for this team
4489* [ChargeItem](chargeitem.html): Business Identifier for item
4490* [Claim](claim.html): The primary identifier of the financial resource
4491* [ClaimResponse](claimresponse.html): The identity of the ClaimResponse
4492* [ClinicalImpression](clinicalimpression.html): Business identifier
4493* [Communication](communication.html): Unique identifier
4494* [CommunicationRequest](communicationrequest.html): Unique identifier
4495* [Composition](composition.html): Version-independent identifier for the Composition
4496* [Condition](condition.html): A unique identifier of the condition record
4497* [Consent](consent.html): Identifier for this record (external references)
4498* [Contract](contract.html): The identity of the contract
4499* [Coverage](coverage.html): The primary identifier of the insured and the coverage
4500* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The business identifier of the Eligibility
4501* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The business identifier
4502* [DetectedIssue](detectedissue.html): Unique id for the detected issue
4503* [DeviceRequest](devicerequest.html): Business identifier for request/order
4504* [DeviceUsage](deviceusage.html): Search by identifier
4505* [DiagnosticReport](diagnosticreport.html): An identifier for the report
4506* [DocumentReference](documentreference.html): Identifier of the attachment binary
4507* [Encounter](encounter.html): Identifier(s) by which this encounter is known
4508* [EnrollmentRequest](enrollmentrequest.html): The business identifier of the Enrollment
4509* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
4510* [ExplanationOfBenefit](explanationofbenefit.html): The business identifier of the Explanation of Benefit
4511* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
4512* [Flag](flag.html): Business identifier
4513* [Goal](goal.html): External Ids for this goal
4514* [GuidanceResponse](guidanceresponse.html): The identifier of the guidance response
4515* [ImagingSelection](imagingselection.html): Identifiers for the imaging selection
4516* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
4517* [Immunization](immunization.html): Business identifier
4518* [ImmunizationEvaluation](immunizationevaluation.html): ID of the evaluation
4519* [ImmunizationRecommendation](immunizationrecommendation.html): Business identifier
4520* [Invoice](invoice.html): Business Identifier for item
4521* [List](list.html): Business identifier
4522* [MeasureReport](measurereport.html): External identifier of the measure report to be returned
4523* [Medication](medication.html): Returns medications with this external identifier
4524* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
4525* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
4526* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
4527* [MedicationStatement](medicationstatement.html): Return statements with this external identifier
4528* [MolecularSequence](molecularsequence.html): The unique identity for a particular sequence
4529* [NutritionIntake](nutritionintake.html): Return statements with this external identifier
4530* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
4531* [Observation](observation.html): The unique id for a particular observation
4532* [Person](person.html): A person Identifier
4533* [Procedure](procedure.html): A unique identifier for a procedure
4534* [QuestionnaireResponse](questionnaireresponse.html): The unique identifier for the questionnaire response
4535* [RelatedPerson](relatedperson.html): An Identifier of the RelatedPerson
4536* [RequestOrchestration](requestorchestration.html): External identifiers for the request orchestration
4537* [ResearchSubject](researchsubject.html): Business Identifier for research subject in a study
4538* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
4539* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
4540* [Specimen](specimen.html): The unique identifier associated with the specimen
4541* [SupplyDelivery](supplydelivery.html): External identifier
4542* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
4543* [Task](task.html): Search for a task instance by its business identifier
4544* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
4545</b><br>
4546   * Type: <b>token</b><br>
4547   * Path: <b>Account.identifier | AdverseEvent.identifier | AllergyIntolerance.identifier | Appointment.identifier | AppointmentResponse.identifier | Basic.identifier | BodyStructure.identifier | CarePlan.identifier | CareTeam.identifier | ChargeItem.identifier | Claim.identifier | ClaimResponse.identifier | ClinicalImpression.identifier | Communication.identifier | CommunicationRequest.identifier | Composition.identifier | Condition.identifier | Consent.identifier | Contract.identifier | Coverage.identifier | CoverageEligibilityRequest.identifier | CoverageEligibilityResponse.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DeviceUsage.identifier | DiagnosticReport.identifier | DocumentReference.identifier | Encounter.identifier | EnrollmentRequest.identifier | EpisodeOfCare.identifier | ExplanationOfBenefit.identifier | FamilyMemberHistory.identifier | Flag.identifier | Goal.identifier | GuidanceResponse.identifier | ImagingSelection.identifier | ImagingStudy.identifier | Immunization.identifier | ImmunizationEvaluation.identifier | ImmunizationRecommendation.identifier | Invoice.identifier | List.identifier | MeasureReport.identifier | Medication.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationStatement.identifier | MolecularSequence.identifier | NutritionIntake.identifier | NutritionOrder.identifier | Observation.identifier | Person.identifier | Procedure.identifier | QuestionnaireResponse.identifier | RelatedPerson.identifier | RequestOrchestration.identifier | ResearchSubject.identifier | RiskAssessment.identifier | ServiceRequest.identifier | Specimen.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | Task.identifier | VisionPrescription.identifier</b><br>
4548   * </p>
4549   */
4550  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4551
4552 /**
4553   * Search parameter: <b>patient</b>
4554   * <p>
4555   * Description: <b>Multiple Resources: 
4556
4557* [Account](account.html): The entity that caused the expenses
4558* [AdverseEvent](adverseevent.html): Subject impacted by event
4559* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4560* [Appointment](appointment.html): One of the individuals of the appointment is this patient
4561* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
4562* [AuditEvent](auditevent.html): Where the activity involved patient data
4563* [Basic](basic.html): Identifies the focus of this resource
4564* [BodyStructure](bodystructure.html): Who this is about
4565* [CarePlan](careplan.html): Who the care plan is for
4566* [CareTeam](careteam.html): Who care team is for
4567* [ChargeItem](chargeitem.html): Individual service was done for/to
4568* [Claim](claim.html): Patient receiving the products or services
4569* [ClaimResponse](claimresponse.html): The subject of care
4570* [ClinicalImpression](clinicalimpression.html): Patient assessed
4571* [Communication](communication.html): Focus of message
4572* [CommunicationRequest](communicationrequest.html): Focus of message
4573* [Composition](composition.html): Who and/or what the composition is about
4574* [Condition](condition.html): Who has the condition?
4575* [Consent](consent.html): Who the consent applies to
4576* [Contract](contract.html): The identity of the subject of the contract (if a patient)
4577* [Coverage](coverage.html): Retrieve coverages for a patient
4578* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
4579* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
4580* [DetectedIssue](detectedissue.html): Associated patient
4581* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4582* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4583* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4584* [DocumentReference](documentreference.html): Who/what is the subject of the document
4585* [Encounter](encounter.html): The patient present at the encounter
4586* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
4587* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4588* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
4589* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4590* [Flag](flag.html): The identity of a subject to list flags for
4591* [Goal](goal.html): Who this goal is intended for
4592* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
4593* [ImagingSelection](imagingselection.html): Who the study is about
4594* [ImagingStudy](imagingstudy.html): Who the study is about
4595* [Immunization](immunization.html): The patient for the vaccination record
4596* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
4597* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
4598* [Invoice](invoice.html): Recipient(s) of goods and services
4599* [List](list.html): If all resources have the same subject
4600* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
4601* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4602* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4603* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4604* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
4605* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
4606* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
4607* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
4608* [Observation](observation.html): The subject that the observation is about (if patient)
4609* [Person](person.html): The Person links to this Patient
4610* [Procedure](procedure.html): Search by subject - a patient
4611* [Provenance](provenance.html): Where the activity involved patient data
4612* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
4613* [RelatedPerson](relatedperson.html): The patient this related person is related to
4614* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
4615* [ResearchSubject](researchsubject.html): Who or what is part of study
4616* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4617* [ServiceRequest](servicerequest.html): Search by subject - a patient
4618* [Specimen](specimen.html): The patient the specimen comes from
4619* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4620* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
4621* [Task](task.html): Search by patient
4622* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4623</b><br>
4624   * Type: <b>reference</b><br>
4625   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
4626   * </p>
4627   */
4628  @SearchParamDefinition(name="patient", path="Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [Account](account.html): The entity that caused the expenses\r\n* [AdverseEvent](adverseevent.html): Subject impacted by event\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [Appointment](appointment.html): One of the individuals of the appointment is this patient\r\n* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient\r\n* [AuditEvent](auditevent.html): Where the activity involved patient data\r\n* [Basic](basic.html): Identifies the focus of this resource\r\n* [BodyStructure](bodystructure.html): Who this is about\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ChargeItem](chargeitem.html): Individual service was done for/to\r\n* [Claim](claim.html): Patient receiving the products or services\r\n* [ClaimResponse](claimresponse.html): The subject of care\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Communication](communication.html): Focus of message\r\n* [CommunicationRequest](communicationrequest.html): Focus of message\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [Contract](contract.html): The identity of the subject of the contract (if a patient)\r\n* [Coverage](coverage.html): Retrieve coverages for a patient\r\n* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient\r\n* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results\r\n* [ImagingSelection](imagingselection.html): Who the study is about\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated\r\n* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for\r\n* [Invoice](invoice.html): Recipient(s) of goods and services\r\n* [List](list.html): If all resources have the same subject\r\n* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.\r\n* [MolecularSequence](molecularsequence.html): The subject that the sequence is about\r\n* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Person](person.html): The Person links to this Patient\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [Provenance](provenance.html): Where the activity involved patient data\r\n* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response\r\n* [RelatedPerson](relatedperson.html): The patient this related person is related to\r\n* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations\r\n* [ResearchSubject](researchsubject.html): Who or what is part of study\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [Specimen](specimen.html): The patient the specimen comes from\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [Task](task.html): Search by patient\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={Patient.class } )
4629  public static final String SP_PATIENT = "patient";
4630 /**
4631   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
4632   * <p>
4633   * Description: <b>Multiple Resources: 
4634
4635* [Account](account.html): The entity that caused the expenses
4636* [AdverseEvent](adverseevent.html): Subject impacted by event
4637* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
4638* [Appointment](appointment.html): One of the individuals of the appointment is this patient
4639* [AppointmentResponse](appointmentresponse.html): This Response is for this Patient
4640* [AuditEvent](auditevent.html): Where the activity involved patient data
4641* [Basic](basic.html): Identifies the focus of this resource
4642* [BodyStructure](bodystructure.html): Who this is about
4643* [CarePlan](careplan.html): Who the care plan is for
4644* [CareTeam](careteam.html): Who care team is for
4645* [ChargeItem](chargeitem.html): Individual service was done for/to
4646* [Claim](claim.html): Patient receiving the products or services
4647* [ClaimResponse](claimresponse.html): The subject of care
4648* [ClinicalImpression](clinicalimpression.html): Patient assessed
4649* [Communication](communication.html): Focus of message
4650* [CommunicationRequest](communicationrequest.html): Focus of message
4651* [Composition](composition.html): Who and/or what the composition is about
4652* [Condition](condition.html): Who has the condition?
4653* [Consent](consent.html): Who the consent applies to
4654* [Contract](contract.html): The identity of the subject of the contract (if a patient)
4655* [Coverage](coverage.html): Retrieve coverages for a patient
4656* [CoverageEligibilityRequest](coverageeligibilityrequest.html): The reference to the patient
4657* [CoverageEligibilityResponse](coverageeligibilityresponse.html): The reference to the patient
4658* [DetectedIssue](detectedissue.html): Associated patient
4659* [DeviceRequest](devicerequest.html): Individual the service is ordered for
4660* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
4661* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
4662* [DocumentReference](documentreference.html): Who/what is the subject of the document
4663* [Encounter](encounter.html): The patient present at the encounter
4664* [EnrollmentRequest](enrollmentrequest.html): The party to be enrolled
4665* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
4666* [ExplanationOfBenefit](explanationofbenefit.html): The reference to the patient
4667* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
4668* [Flag](flag.html): The identity of a subject to list flags for
4669* [Goal](goal.html): Who this goal is intended for
4670* [GuidanceResponse](guidanceresponse.html): The identity of a patient to search for guidance response results
4671* [ImagingSelection](imagingselection.html): Who the study is about
4672* [ImagingStudy](imagingstudy.html): Who the study is about
4673* [Immunization](immunization.html): The patient for the vaccination record
4674* [ImmunizationEvaluation](immunizationevaluation.html): The patient being evaluated
4675* [ImmunizationRecommendation](immunizationrecommendation.html): Who this profile is for
4676* [Invoice](invoice.html): Recipient(s) of goods and services
4677* [List](list.html): If all resources have the same subject
4678* [MeasureReport](measurereport.html): The identity of a patient to search for individual measure report results for
4679* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
4680* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
4681* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
4682* [MedicationStatement](medicationstatement.html): Returns statements for a specific patient.
4683* [MolecularSequence](molecularsequence.html): The subject that the sequence is about
4684* [NutritionIntake](nutritionintake.html): Returns statements for a specific patient.
4685* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
4686* [Observation](observation.html): The subject that the observation is about (if patient)
4687* [Person](person.html): The Person links to this Patient
4688* [Procedure](procedure.html): Search by subject - a patient
4689* [Provenance](provenance.html): Where the activity involved patient data
4690* [QuestionnaireResponse](questionnaireresponse.html): The patient that is the subject of the questionnaire response
4691* [RelatedPerson](relatedperson.html): The patient this related person is related to
4692* [RequestOrchestration](requestorchestration.html): The identity of a patient to search for request orchestrations
4693* [ResearchSubject](researchsubject.html): Who or what is part of study
4694* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
4695* [ServiceRequest](servicerequest.html): Search by subject - a patient
4696* [Specimen](specimen.html): The patient the specimen comes from
4697* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
4698* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
4699* [Task](task.html): Search by patient
4700* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
4701</b><br>
4702   * Type: <b>reference</b><br>
4703   * Path: <b>Account.subject.where(resolve() is Patient) | AdverseEvent.subject.where(resolve() is Patient) | AllergyIntolerance.patient | Appointment.participant.actor.where(resolve() is Patient) | Appointment.subject.where(resolve() is Patient) | AppointmentResponse.actor.where(resolve() is Patient) | AuditEvent.patient | Basic.subject.where(resolve() is Patient) | BodyStructure.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ChargeItem.subject.where(resolve() is Patient) | Claim.patient | ClaimResponse.patient | ClinicalImpression.subject.where(resolve() is Patient) | Communication.subject.where(resolve() is Patient) | CommunicationRequest.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | Contract.subject.where(resolve() is Patient) | Coverage.beneficiary | CoverageEligibilityRequest.patient | CoverageEligibilityResponse.patient | DetectedIssue.subject.where(resolve() is Patient) | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EnrollmentRequest.candidate | EpisodeOfCare.patient | ExplanationOfBenefit.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | GuidanceResponse.subject.where(resolve() is Patient) | ImagingSelection.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | ImmunizationEvaluation.patient | ImmunizationRecommendation.patient | Invoice.subject.where(resolve() is Patient) | List.subject.where(resolve() is Patient) | MeasureReport.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationStatement.subject.where(resolve() is Patient) | MolecularSequence.subject.where(resolve() is Patient) | NutritionIntake.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Person.link.target.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | Provenance.patient | QuestionnaireResponse.subject.where(resolve() is Patient) | RelatedPerson.patient | RequestOrchestration.subject.where(resolve() is Patient) | ResearchSubject.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | Specimen.subject.where(resolve() is Patient) | SupplyDelivery.patient | SupplyRequest.deliverFor | Task.for.where(resolve() is Patient) | VisionPrescription.patient</b><br>
4704   * </p>
4705   */
4706  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
4707
4708/**
4709   * Constant for fluent queries to be used to add include statements. Specifies
4710   * the path value of "<b>Encounter:patient</b>".
4711   */
4712  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Encounter:patient").toLocked();
4713
4714 /**
4715   * Search parameter: <b>type</b>
4716   * <p>
4717   * Description: <b>Multiple Resources: 
4718
4719* [Account](account.html): E.g. patient, expense, depreciation
4720* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
4721* [Composition](composition.html): Kind of composition (LOINC if possible)
4722* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
4723* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
4724* [Encounter](encounter.html): Specific type of encounter
4725* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
4726* [Invoice](invoice.html): Type of Invoice
4727* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
4728* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
4729* [Specimen](specimen.html): The specimen type
4730</b><br>
4731   * Type: <b>token</b><br>
4732   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
4733   * </p>
4734   */
4735  @SearchParamDefinition(name="type", path="Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type", description="Multiple Resources: \r\n\r\n* [Account](account.html): E.g. patient, expense, depreciation\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n* [Invoice](invoice.html): Type of Invoice\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type\r\n* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence\r\n* [Specimen](specimen.html): The specimen type\r\n", type="token" )
4736  public static final String SP_TYPE = "type";
4737 /**
4738   * <b>Fluent Client</b> search parameter constant for <b>type</b>
4739   * <p>
4740   * Description: <b>Multiple Resources: 
4741
4742* [Account](account.html): E.g. patient, expense, depreciation
4743* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
4744* [Composition](composition.html): Kind of composition (LOINC if possible)
4745* [Coverage](coverage.html): The kind of coverage (health plan, auto, Workers Compensation)
4746* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
4747* [Encounter](encounter.html): Specific type of encounter
4748* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
4749* [Invoice](invoice.html): Type of Invoice
4750* [MedicationDispense](medicationdispense.html): Returns dispenses of a specific type
4751* [MolecularSequence](molecularsequence.html): Amino Acid Sequence/ DNA Sequence / RNA Sequence
4752* [Specimen](specimen.html): The specimen type
4753</b><br>
4754   * Type: <b>token</b><br>
4755   * Path: <b>Account.type | AllergyIntolerance.type | Composition.type | Coverage.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type | Invoice.type | MedicationDispense.type | MolecularSequence.type | Specimen.type</b><br>
4756   * </p>
4757   */
4758  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
4759
4760
4761}
4762