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