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