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