001package org.hl7.fhir.r4.model;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
053import java.util.ArrayList;
054import java.util.List;
055
056import org.hl7.fhir.exceptions.FHIRException;
057import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
058import org.hl7.fhir.utilities.Utilities;
059
060import ca.uhn.fhir.model.api.annotation.Block;
061import ca.uhn.fhir.model.api.annotation.Child;
062import ca.uhn.fhir.model.api.annotation.Description;
063import ca.uhn.fhir.model.api.annotation.ResourceDef;
064import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
065/**
066 * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.
067 */
068@ResourceDef(name="CareTeam", profile="http://hl7.org/fhir/StructureDefinition/CareTeam")
069public class CareTeam extends DomainResource {
070
071    public enum CareTeamStatus {
072        /**
073         * The care team has been drafted and proposed, but not yet participating in the coordination and delivery of patient care.
074         */
075        PROPOSED, 
076        /**
077         * The care team is currently participating in the coordination and delivery of care.
078         */
079        ACTIVE, 
080        /**
081         * The care team is temporarily on hold or suspended and not participating in the coordination and delivery of care.
082         */
083        SUSPENDED, 
084        /**
085         * The care team was, but is no longer, participating in the coordination and delivery of care.
086         */
087        INACTIVE, 
088        /**
089         * The care team should have never existed.
090         */
091        ENTEREDINERROR, 
092        /**
093         * added to help the parsers with the generic types
094         */
095        NULL;
096        public static CareTeamStatus fromCode(String codeString) throws FHIRException {
097            if (codeString == null || "".equals(codeString))
098                return null;
099        if ("proposed".equals(codeString))
100          return PROPOSED;
101        if ("active".equals(codeString))
102          return ACTIVE;
103        if ("suspended".equals(codeString))
104          return SUSPENDED;
105        if ("inactive".equals(codeString))
106          return INACTIVE;
107        if ("entered-in-error".equals(codeString))
108          return ENTEREDINERROR;
109        if (Configuration.isAcceptInvalidEnums())
110          return null;
111        else
112          throw new FHIRException("Unknown CareTeamStatus code '"+codeString+"'");
113        }
114        public String toCode() {
115          switch (this) {
116            case PROPOSED: return "proposed";
117            case ACTIVE: return "active";
118            case SUSPENDED: return "suspended";
119            case INACTIVE: return "inactive";
120            case ENTEREDINERROR: return "entered-in-error";
121            default: return "?";
122          }
123        }
124        public String getSystem() {
125          switch (this) {
126            case PROPOSED: return "http://hl7.org/fhir/care-team-status";
127            case ACTIVE: return "http://hl7.org/fhir/care-team-status";
128            case SUSPENDED: return "http://hl7.org/fhir/care-team-status";
129            case INACTIVE: return "http://hl7.org/fhir/care-team-status";
130            case ENTEREDINERROR: return "http://hl7.org/fhir/care-team-status";
131            default: return "?";
132          }
133        }
134        public String getDefinition() {
135          switch (this) {
136            case PROPOSED: return "The care team has been drafted and proposed, but not yet participating in the coordination and delivery of patient care.";
137            case ACTIVE: return "The care team is currently participating in the coordination and delivery of care.";
138            case SUSPENDED: return "The care team is temporarily on hold or suspended and not participating in the coordination and delivery of care.";
139            case INACTIVE: return "The care team was, but is no longer, participating in the coordination and delivery of care.";
140            case ENTEREDINERROR: return "The care team should have never existed.";
141            default: return "?";
142          }
143        }
144        public String getDisplay() {
145          switch (this) {
146            case PROPOSED: return "Proposed";
147            case ACTIVE: return "Active";
148            case SUSPENDED: return "Suspended";
149            case INACTIVE: return "Inactive";
150            case ENTEREDINERROR: return "Entered in Error";
151            default: return "?";
152          }
153        }
154    }
155
156  public static class CareTeamStatusEnumFactory implements EnumFactory<CareTeamStatus> {
157    public CareTeamStatus fromCode(String codeString) throws IllegalArgumentException {
158      if (codeString == null || "".equals(codeString))
159            if (codeString == null || "".equals(codeString))
160                return null;
161        if ("proposed".equals(codeString))
162          return CareTeamStatus.PROPOSED;
163        if ("active".equals(codeString))
164          return CareTeamStatus.ACTIVE;
165        if ("suspended".equals(codeString))
166          return CareTeamStatus.SUSPENDED;
167        if ("inactive".equals(codeString))
168          return CareTeamStatus.INACTIVE;
169        if ("entered-in-error".equals(codeString))
170          return CareTeamStatus.ENTEREDINERROR;
171        throw new IllegalArgumentException("Unknown CareTeamStatus code '"+codeString+"'");
172        }
173        public Enumeration<CareTeamStatus> fromType(Base code) throws FHIRException {
174          if (code == null)
175            return null;
176          if (code.isEmpty())
177            return new Enumeration<CareTeamStatus>(this);
178          String codeString = ((PrimitiveType) code).asStringValue();
179          if (codeString == null || "".equals(codeString))
180            return null;
181        if ("proposed".equals(codeString))
182          return new Enumeration<CareTeamStatus>(this, CareTeamStatus.PROPOSED);
183        if ("active".equals(codeString))
184          return new Enumeration<CareTeamStatus>(this, CareTeamStatus.ACTIVE);
185        if ("suspended".equals(codeString))
186          return new Enumeration<CareTeamStatus>(this, CareTeamStatus.SUSPENDED);
187        if ("inactive".equals(codeString))
188          return new Enumeration<CareTeamStatus>(this, CareTeamStatus.INACTIVE);
189        if ("entered-in-error".equals(codeString))
190          return new Enumeration<CareTeamStatus>(this, CareTeamStatus.ENTEREDINERROR);
191        throw new FHIRException("Unknown CareTeamStatus code '"+codeString+"'");
192        }
193    public String toCode(CareTeamStatus code) {
194      if (code == CareTeamStatus.PROPOSED)
195        return "proposed";
196      if (code == CareTeamStatus.ACTIVE)
197        return "active";
198      if (code == CareTeamStatus.SUSPENDED)
199        return "suspended";
200      if (code == CareTeamStatus.INACTIVE)
201        return "inactive";
202      if (code == CareTeamStatus.ENTEREDINERROR)
203        return "entered-in-error";
204      return "?";
205      }
206    public String toSystem(CareTeamStatus code) {
207      return code.getSystem();
208      }
209    }
210
211    @Block()
212    public static class CareTeamParticipantComponent extends BackboneElement implements IBaseBackboneElement {
213        /**
214         * Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counselor", "Caregiver", etc.
215         */
216        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
217        @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care team, such as \"Primary care physician\", \"Trained social worker counselor\", \"Caregiver\", etc." )
218        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participant-role")
219        protected List<CodeableConcept> role;
220
221        /**
222         * The specific person or organization who is participating/expected to participate in the care team.
223         */
224        @Child(name = "member", type = {Practitioner.class, PractitionerRole.class, RelatedPerson.class, Patient.class, Organization.class, CareTeam.class}, order=2, min=0, max=1, modifier=false, summary=true)
225        @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care team." )
226        protected Reference member;
227
228        /**
229         * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care team.)
230         */
231        protected Resource memberTarget;
232
233        /**
234         * The organization of the practitioner.
235         */
236        @Child(name = "onBehalfOf", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
237        @Description(shortDefinition="Organization of the practitioner", formalDefinition="The organization of the practitioner." )
238        protected Reference onBehalfOf;
239
240        /**
241         * The actual object that is the target of the reference (The organization of the practitioner.)
242         */
243        protected Organization onBehalfOfTarget;
244
245        /**
246         * Indicates when the specific member or organization did (or is intended to) come into effect and end.
247         */
248        @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
249        @Description(shortDefinition="Time period of participant", formalDefinition="Indicates when the specific member or organization did (or is intended to) come into effect and end." )
250        protected Period period;
251
252        private static final long serialVersionUID = -575634410L;
253
254    /**
255     * Constructor
256     */
257      public CareTeamParticipantComponent() {
258        super();
259      }
260
261        /**
262         * @return {@link #role} (Indicates specific responsibility of an individual within the care team, such as "Primary care physician", "Trained social worker counselor", "Caregiver", etc.)
263         */
264        public List<CodeableConcept> getRole() { 
265          if (this.role == null)
266            this.role = new ArrayList<CodeableConcept>();
267          return this.role;
268        }
269
270        /**
271         * @return Returns a reference to <code>this</code> for easy method chaining
272         */
273        public CareTeamParticipantComponent setRole(List<CodeableConcept> theRole) { 
274          this.role = theRole;
275          return this;
276        }
277
278        public boolean hasRole() { 
279          if (this.role == null)
280            return false;
281          for (CodeableConcept item : this.role)
282            if (!item.isEmpty())
283              return true;
284          return false;
285        }
286
287        public CodeableConcept addRole() { //3
288          CodeableConcept t = new CodeableConcept();
289          if (this.role == null)
290            this.role = new ArrayList<CodeableConcept>();
291          this.role.add(t);
292          return t;
293        }
294
295        public CareTeamParticipantComponent addRole(CodeableConcept t) { //3
296          if (t == null)
297            return this;
298          if (this.role == null)
299            this.role = new ArrayList<CodeableConcept>();
300          this.role.add(t);
301          return this;
302        }
303
304        /**
305         * @return The first repetition of repeating field {@link #role}, creating it if it does not already exist
306         */
307        public CodeableConcept getRoleFirstRep() { 
308          if (getRole().isEmpty()) {
309            addRole();
310          }
311          return getRole().get(0);
312        }
313
314        /**
315         * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care team.)
316         */
317        public Reference getMember() { 
318          if (this.member == null)
319            if (Configuration.errorOnAutoCreate())
320              throw new Error("Attempt to auto-create CareTeamParticipantComponent.member");
321            else if (Configuration.doAutoCreate())
322              this.member = new Reference(); // cc
323          return this.member;
324        }
325
326        public boolean hasMember() { 
327          return this.member != null && !this.member.isEmpty();
328        }
329
330        /**
331         * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care team.)
332         */
333        public CareTeamParticipantComponent setMember(Reference value) { 
334          this.member = value;
335          return this;
336        }
337
338        /**
339         * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care team.)
340         */
341        public Resource getMemberTarget() { 
342          return this.memberTarget;
343        }
344
345        /**
346         * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care team.)
347         */
348        public CareTeamParticipantComponent setMemberTarget(Resource value) { 
349          this.memberTarget = value;
350          return this;
351        }
352
353        /**
354         * @return {@link #onBehalfOf} (The organization of the practitioner.)
355         */
356        public Reference getOnBehalfOf() { 
357          if (this.onBehalfOf == null)
358            if (Configuration.errorOnAutoCreate())
359              throw new Error("Attempt to auto-create CareTeamParticipantComponent.onBehalfOf");
360            else if (Configuration.doAutoCreate())
361              this.onBehalfOf = new Reference(); // cc
362          return this.onBehalfOf;
363        }
364
365        public boolean hasOnBehalfOf() { 
366          return this.onBehalfOf != null && !this.onBehalfOf.isEmpty();
367        }
368
369        /**
370         * @param value {@link #onBehalfOf} (The organization of the practitioner.)
371         */
372        public CareTeamParticipantComponent setOnBehalfOf(Reference value) { 
373          this.onBehalfOf = value;
374          return this;
375        }
376
377        /**
378         * @return {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization of the practitioner.)
379         */
380        public Organization getOnBehalfOfTarget() { 
381          if (this.onBehalfOfTarget == null)
382            if (Configuration.errorOnAutoCreate())
383              throw new Error("Attempt to auto-create CareTeamParticipantComponent.onBehalfOf");
384            else if (Configuration.doAutoCreate())
385              this.onBehalfOfTarget = new Organization(); // aa
386          return this.onBehalfOfTarget;
387        }
388
389        /**
390         * @param value {@link #onBehalfOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization of the practitioner.)
391         */
392        public CareTeamParticipantComponent setOnBehalfOfTarget(Organization value) { 
393          this.onBehalfOfTarget = value;
394          return this;
395        }
396
397        /**
398         * @return {@link #period} (Indicates when the specific member or organization did (or is intended to) come into effect and end.)
399         */
400        public Period getPeriod() { 
401          if (this.period == null)
402            if (Configuration.errorOnAutoCreate())
403              throw new Error("Attempt to auto-create CareTeamParticipantComponent.period");
404            else if (Configuration.doAutoCreate())
405              this.period = new Period(); // cc
406          return this.period;
407        }
408
409        public boolean hasPeriod() { 
410          return this.period != null && !this.period.isEmpty();
411        }
412
413        /**
414         * @param value {@link #period} (Indicates when the specific member or organization did (or is intended to) come into effect and end.)
415         */
416        public CareTeamParticipantComponent setPeriod(Period value) { 
417          this.period = value;
418          return this;
419        }
420
421        protected void listChildren(List<Property> children) {
422          super.listChildren(children);
423          children.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care team, such as \"Primary care physician\", \"Trained social worker counselor\", \"Caregiver\", etc.", 0, java.lang.Integer.MAX_VALUE, role));
424          children.add(new Property("member", "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Organization|CareTeam)", "The specific person or organization who is participating/expected to participate in the care team.", 0, 1, member));
425          children.add(new Property("onBehalfOf", "Reference(Organization)", "The organization of the practitioner.", 0, 1, onBehalfOf));
426          children.add(new Property("period", "Period", "Indicates when the specific member or organization did (or is intended to) come into effect and end.", 0, 1, period));
427        }
428
429        @Override
430        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
431          switch (_hash) {
432          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care team, such as \"Primary care physician\", \"Trained social worker counselor\", \"Caregiver\", etc.", 0, java.lang.Integer.MAX_VALUE, role);
433          case -1077769574: /*member*/  return new Property("member", "Reference(Practitioner|PractitionerRole|RelatedPerson|Patient|Organization|CareTeam)", "The specific person or organization who is participating/expected to participate in the care team.", 0, 1, member);
434          case -14402964: /*onBehalfOf*/  return new Property("onBehalfOf", "Reference(Organization)", "The organization of the practitioner.", 0, 1, onBehalfOf);
435          case -991726143: /*period*/  return new Property("period", "Period", "Indicates when the specific member or organization did (or is intended to) come into effect and end.", 0, 1, period);
436          default: return super.getNamedProperty(_hash, _name, _checkValid);
437          }
438
439        }
440
441      @Override
442      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
443        switch (hash) {
444        case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept
445        case -1077769574: /*member*/ return this.member == null ? new Base[0] : new Base[] {this.member}; // Reference
446        case -14402964: /*onBehalfOf*/ return this.onBehalfOf == null ? new Base[0] : new Base[] {this.onBehalfOf}; // Reference
447        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
448        default: return super.getProperty(hash, name, checkValid);
449        }
450
451      }
452
453      @Override
454      public Base setProperty(int hash, String name, Base value) throws FHIRException {
455        switch (hash) {
456        case 3506294: // role
457          this.getRole().add(castToCodeableConcept(value)); // CodeableConcept
458          return value;
459        case -1077769574: // member
460          this.member = castToReference(value); // Reference
461          return value;
462        case -14402964: // onBehalfOf
463          this.onBehalfOf = castToReference(value); // Reference
464          return value;
465        case -991726143: // period
466          this.period = castToPeriod(value); // Period
467          return value;
468        default: return super.setProperty(hash, name, value);
469        }
470
471      }
472
473      @Override
474      public Base setProperty(String name, Base value) throws FHIRException {
475        if (name.equals("role")) {
476          this.getRole().add(castToCodeableConcept(value));
477        } else if (name.equals("member")) {
478          this.member = castToReference(value); // Reference
479        } else if (name.equals("onBehalfOf")) {
480          this.onBehalfOf = castToReference(value); // Reference
481        } else if (name.equals("period")) {
482          this.period = castToPeriod(value); // Period
483        } else
484          return super.setProperty(name, value);
485        return value;
486      }
487
488      @Override
489      public Base makeProperty(int hash, String name) throws FHIRException {
490        switch (hash) {
491        case 3506294:  return addRole(); 
492        case -1077769574:  return getMember(); 
493        case -14402964:  return getOnBehalfOf(); 
494        case -991726143:  return getPeriod(); 
495        default: return super.makeProperty(hash, name);
496        }
497
498      }
499
500      @Override
501      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
502        switch (hash) {
503        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
504        case -1077769574: /*member*/ return new String[] {"Reference"};
505        case -14402964: /*onBehalfOf*/ return new String[] {"Reference"};
506        case -991726143: /*period*/ return new String[] {"Period"};
507        default: return super.getTypesForProperty(hash, name);
508        }
509
510      }
511
512      @Override
513      public Base addChild(String name) throws FHIRException {
514        if (name.equals("role")) {
515          return addRole();
516        }
517        else if (name.equals("member")) {
518          this.member = new Reference();
519          return this.member;
520        }
521        else if (name.equals("onBehalfOf")) {
522          this.onBehalfOf = new Reference();
523          return this.onBehalfOf;
524        }
525        else if (name.equals("period")) {
526          this.period = new Period();
527          return this.period;
528        }
529        else
530          return super.addChild(name);
531      }
532
533      public CareTeamParticipantComponent copy() {
534        CareTeamParticipantComponent dst = new CareTeamParticipantComponent();
535        copyValues(dst);
536        if (role != null) {
537          dst.role = new ArrayList<CodeableConcept>();
538          for (CodeableConcept i : role)
539            dst.role.add(i.copy());
540        };
541        dst.member = member == null ? null : member.copy();
542        dst.onBehalfOf = onBehalfOf == null ? null : onBehalfOf.copy();
543        dst.period = period == null ? null : period.copy();
544        return dst;
545      }
546
547      @Override
548      public boolean equalsDeep(Base other_) {
549        if (!super.equalsDeep(other_))
550          return false;
551        if (!(other_ instanceof CareTeamParticipantComponent))
552          return false;
553        CareTeamParticipantComponent o = (CareTeamParticipantComponent) other_;
554        return compareDeep(role, o.role, true) && compareDeep(member, o.member, true) && compareDeep(onBehalfOf, o.onBehalfOf, true)
555           && compareDeep(period, o.period, true);
556      }
557
558      @Override
559      public boolean equalsShallow(Base other_) {
560        if (!super.equalsShallow(other_))
561          return false;
562        if (!(other_ instanceof CareTeamParticipantComponent))
563          return false;
564        CareTeamParticipantComponent o = (CareTeamParticipantComponent) other_;
565        return true;
566      }
567
568      public boolean isEmpty() {
569        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, member, onBehalfOf
570          , period);
571      }
572
573  public String fhirType() {
574    return "CareTeam.participant";
575
576  }
577
578  }
579
580    /**
581     * Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
582     */
583    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
584    @Description(shortDefinition="External Ids for this team", formalDefinition="Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
585    protected List<Identifier> identifier;
586
587    /**
588     * Indicates the current state of the care team.
589     */
590    @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true)
591    @Description(shortDefinition="proposed | active | suspended | inactive | entered-in-error", formalDefinition="Indicates the current state of the care team." )
592    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-team-status")
593    protected Enumeration<CareTeamStatus> status;
594
595    /**
596     * Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.
597     */
598    @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
599    @Description(shortDefinition="Type of team", formalDefinition="Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team." )
600    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-team-category")
601    protected List<CodeableConcept> category;
602
603    /**
604     * A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.
605     */
606    @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true)
607    @Description(shortDefinition="Name of the team, such as crisis assessment team", formalDefinition="A label for human use intended to distinguish like teams.  E.g. the \"red\" vs. \"green\" trauma teams." )
608    protected StringType name;
609
610    /**
611     * Identifies the patient or group whose intended care is handled by the team.
612     */
613    @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=0, max=1, modifier=false, summary=true)
614    @Description(shortDefinition="Who care team is for", formalDefinition="Identifies the patient or group whose intended care is handled by the team." )
615    protected Reference subject;
616
617    /**
618     * The actual object that is the target of the reference (Identifies the patient or group whose intended care is handled by the team.)
619     */
620    protected Resource subjectTarget;
621
622    /**
623     * The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.
624     */
625    @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true)
626    @Description(shortDefinition="Encounter created as part of", formalDefinition="The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated." )
627    protected Reference encounter;
628
629    /**
630     * The actual object that is the target of the reference (The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.)
631     */
632    protected Encounter encounterTarget;
633
634    /**
635     * Indicates when the team did (or is intended to) come into effect and end.
636     */
637    @Child(name = "period", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true)
638    @Description(shortDefinition="Time period team covers", formalDefinition="Indicates when the team did (or is intended to) come into effect and end." )
639    protected Period period;
640
641    /**
642     * Identifies all people and organizations who are expected to be involved in the care team.
643     */
644    @Child(name = "participant", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
645    @Description(shortDefinition="Members of the team", formalDefinition="Identifies all people and organizations who are expected to be involved in the care team." )
646    protected List<CareTeamParticipantComponent> participant;
647
648    /**
649     * Describes why the care team exists.
650     */
651    @Child(name = "reasonCode", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
652    @Description(shortDefinition="Why the care team exists", formalDefinition="Describes why the care team exists." )
653    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
654    protected List<CodeableConcept> reasonCode;
655
656    /**
657     * Condition(s) that this care team addresses.
658     */
659    @Child(name = "reasonReference", type = {Condition.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
660    @Description(shortDefinition="Why the care team exists", formalDefinition="Condition(s) that this care team addresses." )
661    protected List<Reference> reasonReference;
662    /**
663     * The actual objects that are the target of the reference (Condition(s) that this care team addresses.)
664     */
665    protected List<Condition> reasonReferenceTarget;
666
667
668    /**
669     * The organization responsible for the care team.
670     */
671    @Child(name = "managingOrganization", type = {Organization.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
672    @Description(shortDefinition="Organization responsible for the care team", formalDefinition="The organization responsible for the care team." )
673    protected List<Reference> managingOrganization;
674    /**
675     * The actual objects that are the target of the reference (The organization responsible for the care team.)
676     */
677    protected List<Organization> managingOrganizationTarget;
678
679
680    /**
681     * A central contact detail for the care team (that applies to all members).
682     */
683    @Child(name = "telecom", type = {ContactPoint.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
684    @Description(shortDefinition="A contact detail for the care team (that applies to all members)", formalDefinition="A central contact detail for the care team (that applies to all members)." )
685    protected List<ContactPoint> telecom;
686
687    /**
688     * Comments made about the CareTeam.
689     */
690    @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
691    @Description(shortDefinition="Comments made about the CareTeam", formalDefinition="Comments made about the CareTeam." )
692    protected List<Annotation> note;
693
694    private static final long serialVersionUID = 1793069286L;
695
696  /**
697   * Constructor
698   */
699    public CareTeam() {
700      super();
701    }
702
703    /**
704     * @return {@link #identifier} (Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
705     */
706    public List<Identifier> getIdentifier() { 
707      if (this.identifier == null)
708        this.identifier = new ArrayList<Identifier>();
709      return this.identifier;
710    }
711
712    /**
713     * @return Returns a reference to <code>this</code> for easy method chaining
714     */
715    public CareTeam setIdentifier(List<Identifier> theIdentifier) { 
716      this.identifier = theIdentifier;
717      return this;
718    }
719
720    public boolean hasIdentifier() { 
721      if (this.identifier == null)
722        return false;
723      for (Identifier item : this.identifier)
724        if (!item.isEmpty())
725          return true;
726      return false;
727    }
728
729    public Identifier addIdentifier() { //3
730      Identifier t = new Identifier();
731      if (this.identifier == null)
732        this.identifier = new ArrayList<Identifier>();
733      this.identifier.add(t);
734      return t;
735    }
736
737    public CareTeam addIdentifier(Identifier t) { //3
738      if (t == null)
739        return this;
740      if (this.identifier == null)
741        this.identifier = new ArrayList<Identifier>();
742      this.identifier.add(t);
743      return this;
744    }
745
746    /**
747     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
748     */
749    public Identifier getIdentifierFirstRep() { 
750      if (getIdentifier().isEmpty()) {
751        addIdentifier();
752      }
753      return getIdentifier().get(0);
754    }
755
756    /**
757     * @return {@link #status} (Indicates the current state of the care team.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
758     */
759    public Enumeration<CareTeamStatus> getStatusElement() { 
760      if (this.status == null)
761        if (Configuration.errorOnAutoCreate())
762          throw new Error("Attempt to auto-create CareTeam.status");
763        else if (Configuration.doAutoCreate())
764          this.status = new Enumeration<CareTeamStatus>(new CareTeamStatusEnumFactory()); // bb
765      return this.status;
766    }
767
768    public boolean hasStatusElement() { 
769      return this.status != null && !this.status.isEmpty();
770    }
771
772    public boolean hasStatus() { 
773      return this.status != null && !this.status.isEmpty();
774    }
775
776    /**
777     * @param value {@link #status} (Indicates the current state of the care team.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
778     */
779    public CareTeam setStatusElement(Enumeration<CareTeamStatus> value) { 
780      this.status = value;
781      return this;
782    }
783
784    /**
785     * @return Indicates the current state of the care team.
786     */
787    public CareTeamStatus getStatus() { 
788      return this.status == null ? null : this.status.getValue();
789    }
790
791    /**
792     * @param value Indicates the current state of the care team.
793     */
794    public CareTeam setStatus(CareTeamStatus value) { 
795      if (value == null)
796        this.status = null;
797      else {
798        if (this.status == null)
799          this.status = new Enumeration<CareTeamStatus>(new CareTeamStatusEnumFactory());
800        this.status.setValue(value);
801      }
802      return this;
803    }
804
805    /**
806     * @return {@link #category} (Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.)
807     */
808    public List<CodeableConcept> getCategory() { 
809      if (this.category == null)
810        this.category = new ArrayList<CodeableConcept>();
811      return this.category;
812    }
813
814    /**
815     * @return Returns a reference to <code>this</code> for easy method chaining
816     */
817    public CareTeam setCategory(List<CodeableConcept> theCategory) { 
818      this.category = theCategory;
819      return this;
820    }
821
822    public boolean hasCategory() { 
823      if (this.category == null)
824        return false;
825      for (CodeableConcept item : this.category)
826        if (!item.isEmpty())
827          return true;
828      return false;
829    }
830
831    public CodeableConcept addCategory() { //3
832      CodeableConcept t = new CodeableConcept();
833      if (this.category == null)
834        this.category = new ArrayList<CodeableConcept>();
835      this.category.add(t);
836      return t;
837    }
838
839    public CareTeam addCategory(CodeableConcept t) { //3
840      if (t == null)
841        return this;
842      if (this.category == null)
843        this.category = new ArrayList<CodeableConcept>();
844      this.category.add(t);
845      return this;
846    }
847
848    /**
849     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
850     */
851    public CodeableConcept getCategoryFirstRep() { 
852      if (getCategory().isEmpty()) {
853        addCategory();
854      }
855      return getCategory().get(0);
856    }
857
858    /**
859     * @return {@link #name} (A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
860     */
861    public StringType getNameElement() { 
862      if (this.name == null)
863        if (Configuration.errorOnAutoCreate())
864          throw new Error("Attempt to auto-create CareTeam.name");
865        else if (Configuration.doAutoCreate())
866          this.name = new StringType(); // bb
867      return this.name;
868    }
869
870    public boolean hasNameElement() { 
871      return this.name != null && !this.name.isEmpty();
872    }
873
874    public boolean hasName() { 
875      return this.name != null && !this.name.isEmpty();
876    }
877
878    /**
879     * @param value {@link #name} (A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
880     */
881    public CareTeam setNameElement(StringType value) { 
882      this.name = value;
883      return this;
884    }
885
886    /**
887     * @return A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.
888     */
889    public String getName() { 
890      return this.name == null ? null : this.name.getValue();
891    }
892
893    /**
894     * @param value A label for human use intended to distinguish like teams.  E.g. the "red" vs. "green" trauma teams.
895     */
896    public CareTeam setName(String value) { 
897      if (Utilities.noString(value))
898        this.name = null;
899      else {
900        if (this.name == null)
901          this.name = new StringType();
902        this.name.setValue(value);
903      }
904      return this;
905    }
906
907    /**
908     * @return {@link #subject} (Identifies the patient or group whose intended care is handled by the team.)
909     */
910    public Reference getSubject() { 
911      if (this.subject == null)
912        if (Configuration.errorOnAutoCreate())
913          throw new Error("Attempt to auto-create CareTeam.subject");
914        else if (Configuration.doAutoCreate())
915          this.subject = new Reference(); // cc
916      return this.subject;
917    }
918
919    public boolean hasSubject() { 
920      return this.subject != null && !this.subject.isEmpty();
921    }
922
923    /**
924     * @param value {@link #subject} (Identifies the patient or group whose intended care is handled by the team.)
925     */
926    public CareTeam setSubject(Reference value) { 
927      this.subject = value;
928      return this;
929    }
930
931    /**
932     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is handled by the team.)
933     */
934    public Resource getSubjectTarget() { 
935      return this.subjectTarget;
936    }
937
938    /**
939     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is handled by the team.)
940     */
941    public CareTeam setSubjectTarget(Resource value) { 
942      this.subjectTarget = value;
943      return this;
944    }
945
946    /**
947     * @return {@link #encounter} (The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.)
948     */
949    public Reference getEncounter() { 
950      if (this.encounter == null)
951        if (Configuration.errorOnAutoCreate())
952          throw new Error("Attempt to auto-create CareTeam.encounter");
953        else if (Configuration.doAutoCreate())
954          this.encounter = new Reference(); // cc
955      return this.encounter;
956    }
957
958    public boolean hasEncounter() { 
959      return this.encounter != null && !this.encounter.isEmpty();
960    }
961
962    /**
963     * @param value {@link #encounter} (The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.)
964     */
965    public CareTeam setEncounter(Reference value) { 
966      this.encounter = value;
967      return this;
968    }
969
970    /**
971     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.)
972     */
973    public Encounter getEncounterTarget() { 
974      if (this.encounterTarget == null)
975        if (Configuration.errorOnAutoCreate())
976          throw new Error("Attempt to auto-create CareTeam.encounter");
977        else if (Configuration.doAutoCreate())
978          this.encounterTarget = new Encounter(); // aa
979      return this.encounterTarget;
980    }
981
982    /**
983     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.)
984     */
985    public CareTeam setEncounterTarget(Encounter value) { 
986      this.encounterTarget = value;
987      return this;
988    }
989
990    /**
991     * @return {@link #period} (Indicates when the team did (or is intended to) come into effect and end.)
992     */
993    public Period getPeriod() { 
994      if (this.period == null)
995        if (Configuration.errorOnAutoCreate())
996          throw new Error("Attempt to auto-create CareTeam.period");
997        else if (Configuration.doAutoCreate())
998          this.period = new Period(); // cc
999      return this.period;
1000    }
1001
1002    public boolean hasPeriod() { 
1003      return this.period != null && !this.period.isEmpty();
1004    }
1005
1006    /**
1007     * @param value {@link #period} (Indicates when the team did (or is intended to) come into effect and end.)
1008     */
1009    public CareTeam setPeriod(Period value) { 
1010      this.period = value;
1011      return this;
1012    }
1013
1014    /**
1015     * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care team.)
1016     */
1017    public List<CareTeamParticipantComponent> getParticipant() { 
1018      if (this.participant == null)
1019        this.participant = new ArrayList<CareTeamParticipantComponent>();
1020      return this.participant;
1021    }
1022
1023    /**
1024     * @return Returns a reference to <code>this</code> for easy method chaining
1025     */
1026    public CareTeam setParticipant(List<CareTeamParticipantComponent> theParticipant) { 
1027      this.participant = theParticipant;
1028      return this;
1029    }
1030
1031    public boolean hasParticipant() { 
1032      if (this.participant == null)
1033        return false;
1034      for (CareTeamParticipantComponent item : this.participant)
1035        if (!item.isEmpty())
1036          return true;
1037      return false;
1038    }
1039
1040    public CareTeamParticipantComponent addParticipant() { //3
1041      CareTeamParticipantComponent t = new CareTeamParticipantComponent();
1042      if (this.participant == null)
1043        this.participant = new ArrayList<CareTeamParticipantComponent>();
1044      this.participant.add(t);
1045      return t;
1046    }
1047
1048    public CareTeam addParticipant(CareTeamParticipantComponent t) { //3
1049      if (t == null)
1050        return this;
1051      if (this.participant == null)
1052        this.participant = new ArrayList<CareTeamParticipantComponent>();
1053      this.participant.add(t);
1054      return this;
1055    }
1056
1057    /**
1058     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist
1059     */
1060    public CareTeamParticipantComponent getParticipantFirstRep() { 
1061      if (getParticipant().isEmpty()) {
1062        addParticipant();
1063      }
1064      return getParticipant().get(0);
1065    }
1066
1067    /**
1068     * @return {@link #reasonCode} (Describes why the care team exists.)
1069     */
1070    public List<CodeableConcept> getReasonCode() { 
1071      if (this.reasonCode == null)
1072        this.reasonCode = new ArrayList<CodeableConcept>();
1073      return this.reasonCode;
1074    }
1075
1076    /**
1077     * @return Returns a reference to <code>this</code> for easy method chaining
1078     */
1079    public CareTeam setReasonCode(List<CodeableConcept> theReasonCode) { 
1080      this.reasonCode = theReasonCode;
1081      return this;
1082    }
1083
1084    public boolean hasReasonCode() { 
1085      if (this.reasonCode == null)
1086        return false;
1087      for (CodeableConcept item : this.reasonCode)
1088        if (!item.isEmpty())
1089          return true;
1090      return false;
1091    }
1092
1093    public CodeableConcept addReasonCode() { //3
1094      CodeableConcept t = new CodeableConcept();
1095      if (this.reasonCode == null)
1096        this.reasonCode = new ArrayList<CodeableConcept>();
1097      this.reasonCode.add(t);
1098      return t;
1099    }
1100
1101    public CareTeam addReasonCode(CodeableConcept t) { //3
1102      if (t == null)
1103        return this;
1104      if (this.reasonCode == null)
1105        this.reasonCode = new ArrayList<CodeableConcept>();
1106      this.reasonCode.add(t);
1107      return this;
1108    }
1109
1110    /**
1111     * @return The first repetition of repeating field {@link #reasonCode}, creating it if it does not already exist
1112     */
1113    public CodeableConcept getReasonCodeFirstRep() { 
1114      if (getReasonCode().isEmpty()) {
1115        addReasonCode();
1116      }
1117      return getReasonCode().get(0);
1118    }
1119
1120    /**
1121     * @return {@link #reasonReference} (Condition(s) that this care team addresses.)
1122     */
1123    public List<Reference> getReasonReference() { 
1124      if (this.reasonReference == null)
1125        this.reasonReference = new ArrayList<Reference>();
1126      return this.reasonReference;
1127    }
1128
1129    /**
1130     * @return Returns a reference to <code>this</code> for easy method chaining
1131     */
1132    public CareTeam setReasonReference(List<Reference> theReasonReference) { 
1133      this.reasonReference = theReasonReference;
1134      return this;
1135    }
1136
1137    public boolean hasReasonReference() { 
1138      if (this.reasonReference == null)
1139        return false;
1140      for (Reference item : this.reasonReference)
1141        if (!item.isEmpty())
1142          return true;
1143      return false;
1144    }
1145
1146    public Reference addReasonReference() { //3
1147      Reference t = new Reference();
1148      if (this.reasonReference == null)
1149        this.reasonReference = new ArrayList<Reference>();
1150      this.reasonReference.add(t);
1151      return t;
1152    }
1153
1154    public CareTeam addReasonReference(Reference t) { //3
1155      if (t == null)
1156        return this;
1157      if (this.reasonReference == null)
1158        this.reasonReference = new ArrayList<Reference>();
1159      this.reasonReference.add(t);
1160      return this;
1161    }
1162
1163    /**
1164     * @return The first repetition of repeating field {@link #reasonReference}, creating it if it does not already exist
1165     */
1166    public Reference getReasonReferenceFirstRep() { 
1167      if (getReasonReference().isEmpty()) {
1168        addReasonReference();
1169      }
1170      return getReasonReference().get(0);
1171    }
1172
1173    /**
1174     * @deprecated Use Reference#setResource(IBaseResource) instead
1175     */
1176    @Deprecated
1177    public List<Condition> getReasonReferenceTarget() { 
1178      if (this.reasonReferenceTarget == null)
1179        this.reasonReferenceTarget = new ArrayList<Condition>();
1180      return this.reasonReferenceTarget;
1181    }
1182
1183    /**
1184     * @deprecated Use Reference#setResource(IBaseResource) instead
1185     */
1186    @Deprecated
1187    public Condition addReasonReferenceTarget() { 
1188      Condition r = new Condition();
1189      if (this.reasonReferenceTarget == null)
1190        this.reasonReferenceTarget = new ArrayList<Condition>();
1191      this.reasonReferenceTarget.add(r);
1192      return r;
1193    }
1194
1195    /**
1196     * @return {@link #managingOrganization} (The organization responsible for the care team.)
1197     */
1198    public List<Reference> getManagingOrganization() { 
1199      if (this.managingOrganization == null)
1200        this.managingOrganization = new ArrayList<Reference>();
1201      return this.managingOrganization;
1202    }
1203
1204    /**
1205     * @return Returns a reference to <code>this</code> for easy method chaining
1206     */
1207    public CareTeam setManagingOrganization(List<Reference> theManagingOrganization) { 
1208      this.managingOrganization = theManagingOrganization;
1209      return this;
1210    }
1211
1212    public boolean hasManagingOrganization() { 
1213      if (this.managingOrganization == null)
1214        return false;
1215      for (Reference item : this.managingOrganization)
1216        if (!item.isEmpty())
1217          return true;
1218      return false;
1219    }
1220
1221    public Reference addManagingOrganization() { //3
1222      Reference t = new Reference();
1223      if (this.managingOrganization == null)
1224        this.managingOrganization = new ArrayList<Reference>();
1225      this.managingOrganization.add(t);
1226      return t;
1227    }
1228
1229    public CareTeam addManagingOrganization(Reference t) { //3
1230      if (t == null)
1231        return this;
1232      if (this.managingOrganization == null)
1233        this.managingOrganization = new ArrayList<Reference>();
1234      this.managingOrganization.add(t);
1235      return this;
1236    }
1237
1238    /**
1239     * @return The first repetition of repeating field {@link #managingOrganization}, creating it if it does not already exist
1240     */
1241    public Reference getManagingOrganizationFirstRep() { 
1242      if (getManagingOrganization().isEmpty()) {
1243        addManagingOrganization();
1244      }
1245      return getManagingOrganization().get(0);
1246    }
1247
1248    /**
1249     * @deprecated Use Reference#setResource(IBaseResource) instead
1250     */
1251    @Deprecated
1252    public List<Organization> getManagingOrganizationTarget() { 
1253      if (this.managingOrganizationTarget == null)
1254        this.managingOrganizationTarget = new ArrayList<Organization>();
1255      return this.managingOrganizationTarget;
1256    }
1257
1258    /**
1259     * @deprecated Use Reference#setResource(IBaseResource) instead
1260     */
1261    @Deprecated
1262    public Organization addManagingOrganizationTarget() { 
1263      Organization r = new Organization();
1264      if (this.managingOrganizationTarget == null)
1265        this.managingOrganizationTarget = new ArrayList<Organization>();
1266      this.managingOrganizationTarget.add(r);
1267      return r;
1268    }
1269
1270    /**
1271     * @return {@link #telecom} (A central contact detail for the care team (that applies to all members).)
1272     */
1273    public List<ContactPoint> getTelecom() { 
1274      if (this.telecom == null)
1275        this.telecom = new ArrayList<ContactPoint>();
1276      return this.telecom;
1277    }
1278
1279    /**
1280     * @return Returns a reference to <code>this</code> for easy method chaining
1281     */
1282    public CareTeam setTelecom(List<ContactPoint> theTelecom) { 
1283      this.telecom = theTelecom;
1284      return this;
1285    }
1286
1287    public boolean hasTelecom() { 
1288      if (this.telecom == null)
1289        return false;
1290      for (ContactPoint item : this.telecom)
1291        if (!item.isEmpty())
1292          return true;
1293      return false;
1294    }
1295
1296    public ContactPoint addTelecom() { //3
1297      ContactPoint t = new ContactPoint();
1298      if (this.telecom == null)
1299        this.telecom = new ArrayList<ContactPoint>();
1300      this.telecom.add(t);
1301      return t;
1302    }
1303
1304    public CareTeam addTelecom(ContactPoint t) { //3
1305      if (t == null)
1306        return this;
1307      if (this.telecom == null)
1308        this.telecom = new ArrayList<ContactPoint>();
1309      this.telecom.add(t);
1310      return this;
1311    }
1312
1313    /**
1314     * @return The first repetition of repeating field {@link #telecom}, creating it if it does not already exist
1315     */
1316    public ContactPoint getTelecomFirstRep() { 
1317      if (getTelecom().isEmpty()) {
1318        addTelecom();
1319      }
1320      return getTelecom().get(0);
1321    }
1322
1323    /**
1324     * @return {@link #note} (Comments made about the CareTeam.)
1325     */
1326    public List<Annotation> getNote() { 
1327      if (this.note == null)
1328        this.note = new ArrayList<Annotation>();
1329      return this.note;
1330    }
1331
1332    /**
1333     * @return Returns a reference to <code>this</code> for easy method chaining
1334     */
1335    public CareTeam setNote(List<Annotation> theNote) { 
1336      this.note = theNote;
1337      return this;
1338    }
1339
1340    public boolean hasNote() { 
1341      if (this.note == null)
1342        return false;
1343      for (Annotation item : this.note)
1344        if (!item.isEmpty())
1345          return true;
1346      return false;
1347    }
1348
1349    public Annotation addNote() { //3
1350      Annotation t = new Annotation();
1351      if (this.note == null)
1352        this.note = new ArrayList<Annotation>();
1353      this.note.add(t);
1354      return t;
1355    }
1356
1357    public CareTeam addNote(Annotation t) { //3
1358      if (t == null)
1359        return this;
1360      if (this.note == null)
1361        this.note = new ArrayList<Annotation>();
1362      this.note.add(t);
1363      return this;
1364    }
1365
1366    /**
1367     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist
1368     */
1369    public Annotation getNoteFirstRep() { 
1370      if (getNote().isEmpty()) {
1371        addNote();
1372      }
1373      return getNote().get(0);
1374    }
1375
1376      protected void listChildren(List<Property> children) {
1377        super.listChildren(children);
1378        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
1379        children.add(new Property("status", "code", "Indicates the current state of the care team.", 0, 1, status));
1380        children.add(new Property("category", "CodeableConcept", "Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.", 0, java.lang.Integer.MAX_VALUE, category));
1381        children.add(new Property("name", "string", "A label for human use intended to distinguish like teams.  E.g. the \"red\" vs. \"green\" trauma teams.", 0, 1, name));
1382        children.add(new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is handled by the team.", 0, 1, subject));
1383        children.add(new Property("encounter", "Reference(Encounter)", "The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.", 0, 1, encounter));
1384        children.add(new Property("period", "Period", "Indicates when the team did (or is intended to) come into effect and end.", 0, 1, period));
1385        children.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care team.", 0, java.lang.Integer.MAX_VALUE, participant));
1386        children.add(new Property("reasonCode", "CodeableConcept", "Describes why the care team exists.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
1387        children.add(new Property("reasonReference", "Reference(Condition)", "Condition(s) that this care team addresses.", 0, java.lang.Integer.MAX_VALUE, reasonReference));
1388        children.add(new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the care team.", 0, java.lang.Integer.MAX_VALUE, managingOrganization));
1389        children.add(new Property("telecom", "ContactPoint", "A central contact detail for the care team (that applies to all members).", 0, java.lang.Integer.MAX_VALUE, telecom));
1390        children.add(new Property("note", "Annotation", "Comments made about the CareTeam.", 0, java.lang.Integer.MAX_VALUE, note));
1391      }
1392
1393      @Override
1394      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1395        switch (_hash) {
1396        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
1397        case -892481550: /*status*/  return new Property("status", "code", "Indicates the current state of the care team.", 0, 1, status);
1398        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.", 0, java.lang.Integer.MAX_VALUE, category);
1399        case 3373707: /*name*/  return new Property("name", "string", "A label for human use intended to distinguish like teams.  E.g. the \"red\" vs. \"green\" trauma teams.", 0, 1, name);
1400        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is handled by the team.", 0, 1, subject);
1401        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.", 0, 1, encounter);
1402        case -991726143: /*period*/  return new Property("period", "Period", "Indicates when the team did (or is intended to) come into effect and end.", 0, 1, period);
1403        case 767422259: /*participant*/  return new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care team.", 0, java.lang.Integer.MAX_VALUE, participant);
1404        case 722137681: /*reasonCode*/  return new Property("reasonCode", "CodeableConcept", "Describes why the care team exists.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
1405        case -1146218137: /*reasonReference*/  return new Property("reasonReference", "Reference(Condition)", "Condition(s) that this care team addresses.", 0, java.lang.Integer.MAX_VALUE, reasonReference);
1406        case -2058947787: /*managingOrganization*/  return new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the care team.", 0, java.lang.Integer.MAX_VALUE, managingOrganization);
1407        case -1429363305: /*telecom*/  return new Property("telecom", "ContactPoint", "A central contact detail for the care team (that applies to all members).", 0, java.lang.Integer.MAX_VALUE, telecom);
1408        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments made about the CareTeam.", 0, java.lang.Integer.MAX_VALUE, note);
1409        default: return super.getNamedProperty(_hash, _name, _checkValid);
1410        }
1411
1412      }
1413
1414      @Override
1415      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1416        switch (hash) {
1417        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1418        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<CareTeamStatus>
1419        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1420        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1421        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1422        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1423        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
1424        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // CareTeamParticipantComponent
1425        case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
1426        case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference
1427        case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : this.managingOrganization.toArray(new Base[this.managingOrganization.size()]); // Reference
1428        case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint
1429        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1430        default: return super.getProperty(hash, name, checkValid);
1431        }
1432
1433      }
1434
1435      @Override
1436      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1437        switch (hash) {
1438        case -1618432855: // identifier
1439          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1440          return value;
1441        case -892481550: // status
1442          value = new CareTeamStatusEnumFactory().fromType(castToCode(value));
1443          this.status = (Enumeration) value; // Enumeration<CareTeamStatus>
1444          return value;
1445        case 50511102: // category
1446          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
1447          return value;
1448        case 3373707: // name
1449          this.name = castToString(value); // StringType
1450          return value;
1451        case -1867885268: // subject
1452          this.subject = castToReference(value); // Reference
1453          return value;
1454        case 1524132147: // encounter
1455          this.encounter = castToReference(value); // Reference
1456          return value;
1457        case -991726143: // period
1458          this.period = castToPeriod(value); // Period
1459          return value;
1460        case 767422259: // participant
1461          this.getParticipant().add((CareTeamParticipantComponent) value); // CareTeamParticipantComponent
1462          return value;
1463        case 722137681: // reasonCode
1464          this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept
1465          return value;
1466        case -1146218137: // reasonReference
1467          this.getReasonReference().add(castToReference(value)); // Reference
1468          return value;
1469        case -2058947787: // managingOrganization
1470          this.getManagingOrganization().add(castToReference(value)); // Reference
1471          return value;
1472        case -1429363305: // telecom
1473          this.getTelecom().add(castToContactPoint(value)); // ContactPoint
1474          return value;
1475        case 3387378: // note
1476          this.getNote().add(castToAnnotation(value)); // Annotation
1477          return value;
1478        default: return super.setProperty(hash, name, value);
1479        }
1480
1481      }
1482
1483      @Override
1484      public Base setProperty(String name, Base value) throws FHIRException {
1485        if (name.equals("identifier")) {
1486          this.getIdentifier().add(castToIdentifier(value));
1487        } else if (name.equals("status")) {
1488          value = new CareTeamStatusEnumFactory().fromType(castToCode(value));
1489          this.status = (Enumeration) value; // Enumeration<CareTeamStatus>
1490        } else if (name.equals("category")) {
1491          this.getCategory().add(castToCodeableConcept(value));
1492        } else if (name.equals("name")) {
1493          this.name = castToString(value); // StringType
1494        } else if (name.equals("subject")) {
1495          this.subject = castToReference(value); // Reference
1496        } else if (name.equals("encounter")) {
1497          this.encounter = castToReference(value); // Reference
1498        } else if (name.equals("period")) {
1499          this.period = castToPeriod(value); // Period
1500        } else if (name.equals("participant")) {
1501          this.getParticipant().add((CareTeamParticipantComponent) value);
1502        } else if (name.equals("reasonCode")) {
1503          this.getReasonCode().add(castToCodeableConcept(value));
1504        } else if (name.equals("reasonReference")) {
1505          this.getReasonReference().add(castToReference(value));
1506        } else if (name.equals("managingOrganization")) {
1507          this.getManagingOrganization().add(castToReference(value));
1508        } else if (name.equals("telecom")) {
1509          this.getTelecom().add(castToContactPoint(value));
1510        } else if (name.equals("note")) {
1511          this.getNote().add(castToAnnotation(value));
1512        } else
1513          return super.setProperty(name, value);
1514        return value;
1515      }
1516
1517      @Override
1518      public Base makeProperty(int hash, String name) throws FHIRException {
1519        switch (hash) {
1520        case -1618432855:  return addIdentifier(); 
1521        case -892481550:  return getStatusElement();
1522        case 50511102:  return addCategory(); 
1523        case 3373707:  return getNameElement();
1524        case -1867885268:  return getSubject(); 
1525        case 1524132147:  return getEncounter(); 
1526        case -991726143:  return getPeriod(); 
1527        case 767422259:  return addParticipant(); 
1528        case 722137681:  return addReasonCode(); 
1529        case -1146218137:  return addReasonReference(); 
1530        case -2058947787:  return addManagingOrganization(); 
1531        case -1429363305:  return addTelecom(); 
1532        case 3387378:  return addNote(); 
1533        default: return super.makeProperty(hash, name);
1534        }
1535
1536      }
1537
1538      @Override
1539      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1540        switch (hash) {
1541        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1542        case -892481550: /*status*/ return new String[] {"code"};
1543        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1544        case 3373707: /*name*/ return new String[] {"string"};
1545        case -1867885268: /*subject*/ return new String[] {"Reference"};
1546        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1547        case -991726143: /*period*/ return new String[] {"Period"};
1548        case 767422259: /*participant*/ return new String[] {};
1549        case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
1550        case -1146218137: /*reasonReference*/ return new String[] {"Reference"};
1551        case -2058947787: /*managingOrganization*/ return new String[] {"Reference"};
1552        case -1429363305: /*telecom*/ return new String[] {"ContactPoint"};
1553        case 3387378: /*note*/ return new String[] {"Annotation"};
1554        default: return super.getTypesForProperty(hash, name);
1555        }
1556
1557      }
1558
1559      @Override
1560      public Base addChild(String name) throws FHIRException {
1561        if (name.equals("identifier")) {
1562          return addIdentifier();
1563        }
1564        else if (name.equals("status")) {
1565          throw new FHIRException("Cannot call addChild on a primitive type CareTeam.status");
1566        }
1567        else if (name.equals("category")) {
1568          return addCategory();
1569        }
1570        else if (name.equals("name")) {
1571          throw new FHIRException("Cannot call addChild on a primitive type CareTeam.name");
1572        }
1573        else if (name.equals("subject")) {
1574          this.subject = new Reference();
1575          return this.subject;
1576        }
1577        else if (name.equals("encounter")) {
1578          this.encounter = new Reference();
1579          return this.encounter;
1580        }
1581        else if (name.equals("period")) {
1582          this.period = new Period();
1583          return this.period;
1584        }
1585        else if (name.equals("participant")) {
1586          return addParticipant();
1587        }
1588        else if (name.equals("reasonCode")) {
1589          return addReasonCode();
1590        }
1591        else if (name.equals("reasonReference")) {
1592          return addReasonReference();
1593        }
1594        else if (name.equals("managingOrganization")) {
1595          return addManagingOrganization();
1596        }
1597        else if (name.equals("telecom")) {
1598          return addTelecom();
1599        }
1600        else if (name.equals("note")) {
1601          return addNote();
1602        }
1603        else
1604          return super.addChild(name);
1605      }
1606
1607  public String fhirType() {
1608    return "CareTeam";
1609
1610  }
1611
1612      public CareTeam copy() {
1613        CareTeam dst = new CareTeam();
1614        copyValues(dst);
1615        if (identifier != null) {
1616          dst.identifier = new ArrayList<Identifier>();
1617          for (Identifier i : identifier)
1618            dst.identifier.add(i.copy());
1619        };
1620        dst.status = status == null ? null : status.copy();
1621        if (category != null) {
1622          dst.category = new ArrayList<CodeableConcept>();
1623          for (CodeableConcept i : category)
1624            dst.category.add(i.copy());
1625        };
1626        dst.name = name == null ? null : name.copy();
1627        dst.subject = subject == null ? null : subject.copy();
1628        dst.encounter = encounter == null ? null : encounter.copy();
1629        dst.period = period == null ? null : period.copy();
1630        if (participant != null) {
1631          dst.participant = new ArrayList<CareTeamParticipantComponent>();
1632          for (CareTeamParticipantComponent i : participant)
1633            dst.participant.add(i.copy());
1634        };
1635        if (reasonCode != null) {
1636          dst.reasonCode = new ArrayList<CodeableConcept>();
1637          for (CodeableConcept i : reasonCode)
1638            dst.reasonCode.add(i.copy());
1639        };
1640        if (reasonReference != null) {
1641          dst.reasonReference = new ArrayList<Reference>();
1642          for (Reference i : reasonReference)
1643            dst.reasonReference.add(i.copy());
1644        };
1645        if (managingOrganization != null) {
1646          dst.managingOrganization = new ArrayList<Reference>();
1647          for (Reference i : managingOrganization)
1648            dst.managingOrganization.add(i.copy());
1649        };
1650        if (telecom != null) {
1651          dst.telecom = new ArrayList<ContactPoint>();
1652          for (ContactPoint i : telecom)
1653            dst.telecom.add(i.copy());
1654        };
1655        if (note != null) {
1656          dst.note = new ArrayList<Annotation>();
1657          for (Annotation i : note)
1658            dst.note.add(i.copy());
1659        };
1660        return dst;
1661      }
1662
1663      protected CareTeam typedCopy() {
1664        return copy();
1665      }
1666
1667      @Override
1668      public boolean equalsDeep(Base other_) {
1669        if (!super.equalsDeep(other_))
1670          return false;
1671        if (!(other_ instanceof CareTeam))
1672          return false;
1673        CareTeam o = (CareTeam) other_;
1674        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true)
1675           && compareDeep(name, o.name, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
1676           && compareDeep(period, o.period, true) && compareDeep(participant, o.participant, true) && compareDeep(reasonCode, o.reasonCode, true)
1677           && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(managingOrganization, o.managingOrganization, true)
1678           && compareDeep(telecom, o.telecom, true) && compareDeep(note, o.note, true);
1679      }
1680
1681      @Override
1682      public boolean equalsShallow(Base other_) {
1683        if (!super.equalsShallow(other_))
1684          return false;
1685        if (!(other_ instanceof CareTeam))
1686          return false;
1687        CareTeam o = (CareTeam) other_;
1688        return compareValues(status, o.status, true) && compareValues(name, o.name, true);
1689      }
1690
1691      public boolean isEmpty() {
1692        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, status, category
1693          , name, subject, encounter, period, participant, reasonCode, reasonReference, managingOrganization
1694          , telecom, note);
1695      }
1696
1697  @Override
1698  public ResourceType getResourceType() {
1699    return ResourceType.CareTeam;
1700   }
1701
1702 /**
1703   * Search parameter: <b>date</b>
1704   * <p>
1705   * Description: <b>Time period team covers</b><br>
1706   * Type: <b>date</b><br>
1707   * Path: <b>CareTeam.period</b><br>
1708   * </p>
1709   */
1710  @SearchParamDefinition(name="date", path="CareTeam.period", description="Time period team covers", type="date" )
1711  public static final String SP_DATE = "date";
1712 /**
1713   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1714   * <p>
1715   * Description: <b>Time period team covers</b><br>
1716   * Type: <b>date</b><br>
1717   * Path: <b>CareTeam.period</b><br>
1718   * </p>
1719   */
1720  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1721
1722 /**
1723   * Search parameter: <b>identifier</b>
1724   * <p>
1725   * Description: <b>External Ids for this team</b><br>
1726   * Type: <b>token</b><br>
1727   * Path: <b>CareTeam.identifier</b><br>
1728   * </p>
1729   */
1730  @SearchParamDefinition(name="identifier", path="CareTeam.identifier", description="External Ids for this team", type="token" )
1731  public static final String SP_IDENTIFIER = "identifier";
1732 /**
1733   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1734   * <p>
1735   * Description: <b>External Ids for this team</b><br>
1736   * Type: <b>token</b><br>
1737   * Path: <b>CareTeam.identifier</b><br>
1738   * </p>
1739   */
1740  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1741
1742 /**
1743   * Search parameter: <b>patient</b>
1744   * <p>
1745   * Description: <b>Who care team is for</b><br>
1746   * Type: <b>reference</b><br>
1747   * Path: <b>CareTeam.subject</b><br>
1748   * </p>
1749   */
1750  @SearchParamDefinition(name="patient", path="CareTeam.subject.where(resolve() is Patient)", description="Who care team is for", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class } )
1751  public static final String SP_PATIENT = "patient";
1752 /**
1753   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1754   * <p>
1755   * Description: <b>Who care team is for</b><br>
1756   * Type: <b>reference</b><br>
1757   * Path: <b>CareTeam.subject</b><br>
1758   * </p>
1759   */
1760  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1761
1762/**
1763   * Constant for fluent queries to be used to add include statements. Specifies
1764   * the path value of "<b>CareTeam:patient</b>".
1765   */
1766  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CareTeam:patient").toLocked();
1767
1768 /**
1769   * Search parameter: <b>subject</b>
1770   * <p>
1771   * Description: <b>Who care team is for</b><br>
1772   * Type: <b>reference</b><br>
1773   * Path: <b>CareTeam.subject</b><br>
1774   * </p>
1775   */
1776  @SearchParamDefinition(name="subject", path="CareTeam.subject", description="Who care team is for", type="reference", target={Group.class, Patient.class } )
1777  public static final String SP_SUBJECT = "subject";
1778 /**
1779   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1780   * <p>
1781   * Description: <b>Who care team is for</b><br>
1782   * Type: <b>reference</b><br>
1783   * Path: <b>CareTeam.subject</b><br>
1784   * </p>
1785   */
1786  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1787
1788/**
1789   * Constant for fluent queries to be used to add include statements. Specifies
1790   * the path value of "<b>CareTeam:subject</b>".
1791   */
1792  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CareTeam:subject").toLocked();
1793
1794 /**
1795   * Search parameter: <b>encounter</b>
1796   * <p>
1797   * Description: <b>Encounter created as part of</b><br>
1798   * Type: <b>reference</b><br>
1799   * Path: <b>CareTeam.encounter</b><br>
1800   * </p>
1801   */
1802  @SearchParamDefinition(name="encounter", path="CareTeam.encounter", description="Encounter created as part of", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
1803  public static final String SP_ENCOUNTER = "encounter";
1804 /**
1805   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
1806   * <p>
1807   * Description: <b>Encounter created as part of</b><br>
1808   * Type: <b>reference</b><br>
1809   * Path: <b>CareTeam.encounter</b><br>
1810   * </p>
1811   */
1812  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
1813
1814/**
1815   * Constant for fluent queries to be used to add include statements. Specifies
1816   * the path value of "<b>CareTeam:encounter</b>".
1817   */
1818  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("CareTeam:encounter").toLocked();
1819
1820 /**
1821   * Search parameter: <b>category</b>
1822   * <p>
1823   * Description: <b>Type of team</b><br>
1824   * Type: <b>token</b><br>
1825   * Path: <b>CareTeam.category</b><br>
1826   * </p>
1827   */
1828  @SearchParamDefinition(name="category", path="CareTeam.category", description="Type of team", type="token" )
1829  public static final String SP_CATEGORY = "category";
1830 /**
1831   * <b>Fluent Client</b> search parameter constant for <b>category</b>
1832   * <p>
1833   * Description: <b>Type of team</b><br>
1834   * Type: <b>token</b><br>
1835   * Path: <b>CareTeam.category</b><br>
1836   * </p>
1837   */
1838  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
1839
1840 /**
1841   * Search parameter: <b>participant</b>
1842   * <p>
1843   * Description: <b>Who is involved</b><br>
1844   * Type: <b>reference</b><br>
1845   * Path: <b>CareTeam.participant.member</b><br>
1846   * </p>
1847   */
1848  @SearchParamDefinition(name="participant", path="CareTeam.participant.member", description="Who is involved", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={CareTeam.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
1849  public static final String SP_PARTICIPANT = "participant";
1850 /**
1851   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
1852   * <p>
1853   * Description: <b>Who is involved</b><br>
1854   * Type: <b>reference</b><br>
1855   * Path: <b>CareTeam.participant.member</b><br>
1856   * </p>
1857   */
1858  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT);
1859
1860/**
1861   * Constant for fluent queries to be used to add include statements. Specifies
1862   * the path value of "<b>CareTeam:participant</b>".
1863   */
1864  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("CareTeam:participant").toLocked();
1865
1866 /**
1867   * Search parameter: <b>status</b>
1868   * <p>
1869   * Description: <b>proposed | active | suspended | inactive | entered-in-error</b><br>
1870   * Type: <b>token</b><br>
1871   * Path: <b>CareTeam.status</b><br>
1872   * </p>
1873   */
1874  @SearchParamDefinition(name="status", path="CareTeam.status", description="proposed | active | suspended | inactive | entered-in-error", type="token" )
1875  public static final String SP_STATUS = "status";
1876 /**
1877   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1878   * <p>
1879   * Description: <b>proposed | active | suspended | inactive | entered-in-error</b><br>
1880   * Type: <b>token</b><br>
1881   * Path: <b>CareTeam.status</b><br>
1882   * </p>
1883   */
1884  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1885
1886
1887}
1888