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