001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.
050 */
051@ResourceDef(name="Group", profile="http://hl7.org/fhir/StructureDefinition/Group")
052public class Group extends DomainResource {
053
054    public enum GroupType {
055        /**
056         * Group contains "person" Patient resources.
057         */
058        PERSON, 
059        /**
060         * Group contains "animal" Patient resources.
061         */
062        ANIMAL, 
063        /**
064         * Group contains healthcare practitioner resources (Practitioner or PractitionerRole).
065         */
066        PRACTITIONER, 
067        /**
068         * Group contains Device resources.
069         */
070        DEVICE, 
071        /**
072         * Group contains Medication resources.
073         */
074        MEDICATION, 
075        /**
076         * Group contains Substance resources.
077         */
078        SUBSTANCE, 
079        /**
080         * added to help the parsers with the generic types
081         */
082        NULL;
083        public static GroupType fromCode(String codeString) throws FHIRException {
084            if (codeString == null || "".equals(codeString))
085                return null;
086        if ("person".equals(codeString))
087          return PERSON;
088        if ("animal".equals(codeString))
089          return ANIMAL;
090        if ("practitioner".equals(codeString))
091          return PRACTITIONER;
092        if ("device".equals(codeString))
093          return DEVICE;
094        if ("medication".equals(codeString))
095          return MEDICATION;
096        if ("substance".equals(codeString))
097          return SUBSTANCE;
098        if (Configuration.isAcceptInvalidEnums())
099          return null;
100        else
101          throw new FHIRException("Unknown GroupType code '"+codeString+"'");
102        }
103        public String toCode() {
104          switch (this) {
105            case PERSON: return "person";
106            case ANIMAL: return "animal";
107            case PRACTITIONER: return "practitioner";
108            case DEVICE: return "device";
109            case MEDICATION: return "medication";
110            case SUBSTANCE: return "substance";
111            default: return "?";
112          }
113        }
114        public String getSystem() {
115          switch (this) {
116            case PERSON: return "http://hl7.org/fhir/group-type";
117            case ANIMAL: return "http://hl7.org/fhir/group-type";
118            case PRACTITIONER: return "http://hl7.org/fhir/group-type";
119            case DEVICE: return "http://hl7.org/fhir/group-type";
120            case MEDICATION: return "http://hl7.org/fhir/group-type";
121            case SUBSTANCE: return "http://hl7.org/fhir/group-type";
122            default: return "?";
123          }
124        }
125        public String getDefinition() {
126          switch (this) {
127            case PERSON: return "Group contains \"person\" Patient resources.";
128            case ANIMAL: return "Group contains \"animal\" Patient resources.";
129            case PRACTITIONER: return "Group contains healthcare practitioner resources (Practitioner or PractitionerRole).";
130            case DEVICE: return "Group contains Device resources.";
131            case MEDICATION: return "Group contains Medication resources.";
132            case SUBSTANCE: return "Group contains Substance resources.";
133            default: return "?";
134          }
135        }
136        public String getDisplay() {
137          switch (this) {
138            case PERSON: return "Person";
139            case ANIMAL: return "Animal";
140            case PRACTITIONER: return "Practitioner";
141            case DEVICE: return "Device";
142            case MEDICATION: return "Medication";
143            case SUBSTANCE: return "Substance";
144            default: return "?";
145          }
146        }
147    }
148
149  public static class GroupTypeEnumFactory implements EnumFactory<GroupType> {
150    public GroupType fromCode(String codeString) throws IllegalArgumentException {
151      if (codeString == null || "".equals(codeString))
152            if (codeString == null || "".equals(codeString))
153                return null;
154        if ("person".equals(codeString))
155          return GroupType.PERSON;
156        if ("animal".equals(codeString))
157          return GroupType.ANIMAL;
158        if ("practitioner".equals(codeString))
159          return GroupType.PRACTITIONER;
160        if ("device".equals(codeString))
161          return GroupType.DEVICE;
162        if ("medication".equals(codeString))
163          return GroupType.MEDICATION;
164        if ("substance".equals(codeString))
165          return GroupType.SUBSTANCE;
166        throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'");
167        }
168        public Enumeration<GroupType> fromType(Base code) throws FHIRException {
169          if (code == null)
170            return null;
171          if (code.isEmpty())
172            return new Enumeration<GroupType>(this);
173          String codeString = ((PrimitiveType) code).asStringValue();
174          if (codeString == null || "".equals(codeString))
175            return null;
176        if ("person".equals(codeString))
177          return new Enumeration<GroupType>(this, GroupType.PERSON);
178        if ("animal".equals(codeString))
179          return new Enumeration<GroupType>(this, GroupType.ANIMAL);
180        if ("practitioner".equals(codeString))
181          return new Enumeration<GroupType>(this, GroupType.PRACTITIONER);
182        if ("device".equals(codeString))
183          return new Enumeration<GroupType>(this, GroupType.DEVICE);
184        if ("medication".equals(codeString))
185          return new Enumeration<GroupType>(this, GroupType.MEDICATION);
186        if ("substance".equals(codeString))
187          return new Enumeration<GroupType>(this, GroupType.SUBSTANCE);
188        throw new FHIRException("Unknown GroupType code '"+codeString+"'");
189        }
190    public String toCode(GroupType code) {
191      if (code == GroupType.PERSON)
192        return "person";
193      if (code == GroupType.ANIMAL)
194        return "animal";
195      if (code == GroupType.PRACTITIONER)
196        return "practitioner";
197      if (code == GroupType.DEVICE)
198        return "device";
199      if (code == GroupType.MEDICATION)
200        return "medication";
201      if (code == GroupType.SUBSTANCE)
202        return "substance";
203      return "?";
204      }
205    public String toSystem(GroupType code) {
206      return code.getSystem();
207      }
208    }
209
210    @Block()
211    public static class GroupCharacteristicComponent extends BackboneElement implements IBaseBackboneElement {
212        /**
213         * A code that identifies the kind of trait being asserted.
214         */
215        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
216        @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." )
217        protected CodeableConcept code;
218
219        /**
220         * The value of the trait that holds (or does not hold - see 'exclude') for members of the group.
221         */
222        @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class, Reference.class}, order=2, min=1, max=1, modifier=false, summary=false)
223        @Description(shortDefinition="Value held by characteristic", formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group." )
224        protected Type value;
225
226        /**
227         * If true, indicates the characteristic is one that is NOT held by members of the group.
228         */
229        @Child(name = "exclude", type = {BooleanType.class}, order=3, min=1, max=1, modifier=false, summary=false)
230        @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." )
231        protected BooleanType exclude;
232
233        /**
234         * The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.
235         */
236        @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
237        @Description(shortDefinition="Period over which characteristic is tested", formalDefinition="The period over which the characteristic is tested; e.g. the patient had an operation during the month of June." )
238        protected Period period;
239
240        private static final long serialVersionUID = -1000688967L;
241
242    /**
243     * Constructor
244     */
245      public GroupCharacteristicComponent() {
246        super();
247      }
248
249    /**
250     * Constructor
251     */
252      public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) {
253        super();
254        this.code = code;
255        this.value = value;
256        this.exclude = exclude;
257      }
258
259        /**
260         * @return {@link #code} (A code that identifies the kind of trait being asserted.)
261         */
262        public CodeableConcept getCode() { 
263          if (this.code == null)
264            if (Configuration.errorOnAutoCreate())
265              throw new Error("Attempt to auto-create GroupCharacteristicComponent.code");
266            else if (Configuration.doAutoCreate())
267              this.code = new CodeableConcept(); // cc
268          return this.code;
269        }
270
271        public boolean hasCode() { 
272          return this.code != null && !this.code.isEmpty();
273        }
274
275        /**
276         * @param value {@link #code} (A code that identifies the kind of trait being asserted.)
277         */
278        public GroupCharacteristicComponent setCode(CodeableConcept value) { 
279          this.code = value;
280          return this;
281        }
282
283        /**
284         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
285         */
286        public Type getValue() { 
287          return this.value;
288        }
289
290        /**
291         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
292         */
293        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
294          if (this.value == null)
295            this.value = new CodeableConcept();
296          if (!(this.value instanceof CodeableConcept))
297            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
298          return (CodeableConcept) this.value;
299        }
300
301        public boolean hasValueCodeableConcept() { 
302          return this != null && this.value instanceof CodeableConcept;
303        }
304
305        /**
306         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
307         */
308        public BooleanType getValueBooleanType() throws FHIRException { 
309          if (this.value == null)
310            this.value = new BooleanType();
311          if (!(this.value instanceof BooleanType))
312            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
313          return (BooleanType) this.value;
314        }
315
316        public boolean hasValueBooleanType() { 
317          return this != null && this.value instanceof BooleanType;
318        }
319
320        /**
321         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
322         */
323        public Quantity getValueQuantity() throws FHIRException { 
324          if (this.value == null)
325            this.value = new Quantity();
326          if (!(this.value instanceof Quantity))
327            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
328          return (Quantity) this.value;
329        }
330
331        public boolean hasValueQuantity() { 
332          return this != null && this.value instanceof Quantity;
333        }
334
335        /**
336         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
337         */
338        public Range getValueRange() throws FHIRException { 
339          if (this.value == null)
340            this.value = new Range();
341          if (!(this.value instanceof Range))
342            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
343          return (Range) this.value;
344        }
345
346        public boolean hasValueRange() { 
347          return this != null && this.value instanceof Range;
348        }
349
350        /**
351         * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
352         */
353        public Reference getValueReference() throws FHIRException { 
354          if (this.value == null)
355            this.value = new Reference();
356          if (!(this.value instanceof Reference))
357            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
358          return (Reference) this.value;
359        }
360
361        public boolean hasValueReference() { 
362          return this != null && this.value instanceof Reference;
363        }
364
365        public boolean hasValue() { 
366          return this.value != null && !this.value.isEmpty();
367        }
368
369        /**
370         * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.)
371         */
372        public GroupCharacteristicComponent setValue(Type value) { 
373          if (value != null && !(value instanceof CodeableConcept || value instanceof BooleanType || value instanceof Quantity || value instanceof Range || value instanceof Reference))
374            throw new Error("Not the right type for Group.characteristic.value[x]: "+value.fhirType());
375          this.value = value;
376          return this;
377        }
378
379        /**
380         * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value
381         */
382        public BooleanType getExcludeElement() { 
383          if (this.exclude == null)
384            if (Configuration.errorOnAutoCreate())
385              throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude");
386            else if (Configuration.doAutoCreate())
387              this.exclude = new BooleanType(); // bb
388          return this.exclude;
389        }
390
391        public boolean hasExcludeElement() { 
392          return this.exclude != null && !this.exclude.isEmpty();
393        }
394
395        public boolean hasExclude() { 
396          return this.exclude != null && !this.exclude.isEmpty();
397        }
398
399        /**
400         * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value
401         */
402        public GroupCharacteristicComponent setExcludeElement(BooleanType value) { 
403          this.exclude = value;
404          return this;
405        }
406
407        /**
408         * @return If true, indicates the characteristic is one that is NOT held by members of the group.
409         */
410        public boolean getExclude() { 
411          return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue();
412        }
413
414        /**
415         * @param value If true, indicates the characteristic is one that is NOT held by members of the group.
416         */
417        public GroupCharacteristicComponent setExclude(boolean value) { 
418            if (this.exclude == null)
419              this.exclude = new BooleanType();
420            this.exclude.setValue(value);
421          return this;
422        }
423
424        /**
425         * @return {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.)
426         */
427        public Period getPeriod() { 
428          if (this.period == null)
429            if (Configuration.errorOnAutoCreate())
430              throw new Error("Attempt to auto-create GroupCharacteristicComponent.period");
431            else if (Configuration.doAutoCreate())
432              this.period = new Period(); // cc
433          return this.period;
434        }
435
436        public boolean hasPeriod() { 
437          return this.period != null && !this.period.isEmpty();
438        }
439
440        /**
441         * @param value {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.)
442         */
443        public GroupCharacteristicComponent setPeriod(Period value) { 
444          this.period = value;
445          return this;
446        }
447
448        protected void listChildren(List<Property> children) {
449          super.listChildren(children);
450          children.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, 1, code));
451          children.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value));
452          children.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, 1, exclude));
453          children.add(new Property("period", "Period", "The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.", 0, 1, period));
454        }
455
456        @Override
457        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
458          switch (_hash) {
459          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, 1, code);
460          case -1410166417: /*value[x]*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
461          case 111972721: /*value*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
462          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
463          case 733421943: /*valueBoolean*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
464          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
465          case 2030761548: /*valueRange*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
466          case 1755241690: /*valueReference*/  return new Property("value[x]", "CodeableConcept|boolean|Quantity|Range|Reference", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, 1, value);
467          case -1321148966: /*exclude*/  return new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, 1, exclude);
468          case -991726143: /*period*/  return new Property("period", "Period", "The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.", 0, 1, period);
469          default: return super.getNamedProperty(_hash, _name, _checkValid);
470          }
471
472        }
473
474      @Override
475      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
476        switch (hash) {
477        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
478        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
479        case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // BooleanType
480        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
481        default: return super.getProperty(hash, name, checkValid);
482        }
483
484      }
485
486      @Override
487      public Base setProperty(int hash, String name, Base value) throws FHIRException {
488        switch (hash) {
489        case 3059181: // code
490          this.code = castToCodeableConcept(value); // CodeableConcept
491          return value;
492        case 111972721: // value
493          this.value = castToType(value); // Type
494          return value;
495        case -1321148966: // exclude
496          this.exclude = castToBoolean(value); // BooleanType
497          return value;
498        case -991726143: // period
499          this.period = castToPeriod(value); // Period
500          return value;
501        default: return super.setProperty(hash, name, value);
502        }
503
504      }
505
506      @Override
507      public Base setProperty(String name, Base value) throws FHIRException {
508        if (name.equals("code")) {
509          this.code = castToCodeableConcept(value); // CodeableConcept
510        } else if (name.equals("value[x]")) {
511          this.value = castToType(value); // Type
512        } else if (name.equals("exclude")) {
513          this.exclude = castToBoolean(value); // BooleanType
514        } else if (name.equals("period")) {
515          this.period = castToPeriod(value); // Period
516        } else
517          return super.setProperty(name, value);
518        return value;
519      }
520
521      @Override
522      public Base makeProperty(int hash, String name) throws FHIRException {
523        switch (hash) {
524        case 3059181:  return getCode(); 
525        case -1410166417:  return getValue(); 
526        case 111972721:  return getValue(); 
527        case -1321148966:  return getExcludeElement();
528        case -991726143:  return getPeriod(); 
529        default: return super.makeProperty(hash, name);
530        }
531
532      }
533
534      @Override
535      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
536        switch (hash) {
537        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
538        case 111972721: /*value*/ return new String[] {"CodeableConcept", "boolean", "Quantity", "Range", "Reference"};
539        case -1321148966: /*exclude*/ return new String[] {"boolean"};
540        case -991726143: /*period*/ return new String[] {"Period"};
541        default: return super.getTypesForProperty(hash, name);
542        }
543
544      }
545
546      @Override
547      public Base addChild(String name) throws FHIRException {
548        if (name.equals("code")) {
549          this.code = new CodeableConcept();
550          return this.code;
551        }
552        else if (name.equals("valueCodeableConcept")) {
553          this.value = new CodeableConcept();
554          return this.value;
555        }
556        else if (name.equals("valueBoolean")) {
557          this.value = new BooleanType();
558          return this.value;
559        }
560        else if (name.equals("valueQuantity")) {
561          this.value = new Quantity();
562          return this.value;
563        }
564        else if (name.equals("valueRange")) {
565          this.value = new Range();
566          return this.value;
567        }
568        else if (name.equals("valueReference")) {
569          this.value = new Reference();
570          return this.value;
571        }
572        else if (name.equals("exclude")) {
573          throw new FHIRException("Cannot call addChild on a primitive type Group.exclude");
574        }
575        else if (name.equals("period")) {
576          this.period = new Period();
577          return this.period;
578        }
579        else
580          return super.addChild(name);
581      }
582
583      public GroupCharacteristicComponent copy() {
584        GroupCharacteristicComponent dst = new GroupCharacteristicComponent();
585        copyValues(dst);
586        return dst;
587      }
588
589      public void copyValues(GroupCharacteristicComponent dst) {
590        super.copyValues(dst);
591        dst.code = code == null ? null : code.copy();
592        dst.value = value == null ? null : value.copy();
593        dst.exclude = exclude == null ? null : exclude.copy();
594        dst.period = period == null ? null : period.copy();
595      }
596
597      @Override
598      public boolean equalsDeep(Base other_) {
599        if (!super.equalsDeep(other_))
600          return false;
601        if (!(other_ instanceof GroupCharacteristicComponent))
602          return false;
603        GroupCharacteristicComponent o = (GroupCharacteristicComponent) other_;
604        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true)
605           && compareDeep(period, o.period, true);
606      }
607
608      @Override
609      public boolean equalsShallow(Base other_) {
610        if (!super.equalsShallow(other_))
611          return false;
612        if (!(other_ instanceof GroupCharacteristicComponent))
613          return false;
614        GroupCharacteristicComponent o = (GroupCharacteristicComponent) other_;
615        return compareValues(exclude, o.exclude, true);
616      }
617
618      public boolean isEmpty() {
619        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value, exclude, period
620          );
621      }
622
623  public String fhirType() {
624    return "Group.characteristic";
625
626  }
627
628  }
629
630    @Block()
631    public static class GroupMemberComponent extends BackboneElement implements IBaseBackboneElement {
632        /**
633         * A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.
634         */
635        @Child(name = "entity", type = {Patient.class, Practitioner.class, PractitionerRole.class, Device.class, Medication.class, Substance.class, Group.class}, order=1, min=1, max=1, modifier=false, summary=false)
636        @Description(shortDefinition="Reference to the group member", formalDefinition="A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same." )
637        protected Reference entity;
638
639        /**
640         * The actual object that is the target of the reference (A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.)
641         */
642        protected Resource entityTarget;
643
644        /**
645         * The period that the member was in the group, if known.
646         */
647        @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false)
648        @Description(shortDefinition="Period member belonged to the group", formalDefinition="The period that the member was in the group, if known." )
649        protected Period period;
650
651        /**
652         * A flag to indicate that the member is no longer in the group, but previously may have been a member.
653         */
654        @Child(name = "inactive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
655        @Description(shortDefinition="If member is no longer in group", formalDefinition="A flag to indicate that the member is no longer in the group, but previously may have been a member." )
656        protected BooleanType inactive;
657
658        private static final long serialVersionUID = -333869055L;
659
660    /**
661     * Constructor
662     */
663      public GroupMemberComponent() {
664        super();
665      }
666
667    /**
668     * Constructor
669     */
670      public GroupMemberComponent(Reference entity) {
671        super();
672        this.entity = entity;
673      }
674
675        /**
676         * @return {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.)
677         */
678        public Reference getEntity() { 
679          if (this.entity == null)
680            if (Configuration.errorOnAutoCreate())
681              throw new Error("Attempt to auto-create GroupMemberComponent.entity");
682            else if (Configuration.doAutoCreate())
683              this.entity = new Reference(); // cc
684          return this.entity;
685        }
686
687        public boolean hasEntity() { 
688          return this.entity != null && !this.entity.isEmpty();
689        }
690
691        /**
692         * @param value {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.)
693         */
694        public GroupMemberComponent setEntity(Reference value) { 
695          this.entity = value;
696          return this;
697        }
698
699        /**
700         * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.)
701         */
702        public Resource getEntityTarget() { 
703          return this.entityTarget;
704        }
705
706        /**
707         * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.)
708         */
709        public GroupMemberComponent setEntityTarget(Resource value) { 
710          this.entityTarget = value;
711          return this;
712        }
713
714        /**
715         * @return {@link #period} (The period that the member was in the group, if known.)
716         */
717        public Period getPeriod() { 
718          if (this.period == null)
719            if (Configuration.errorOnAutoCreate())
720              throw new Error("Attempt to auto-create GroupMemberComponent.period");
721            else if (Configuration.doAutoCreate())
722              this.period = new Period(); // cc
723          return this.period;
724        }
725
726        public boolean hasPeriod() { 
727          return this.period != null && !this.period.isEmpty();
728        }
729
730        /**
731         * @param value {@link #period} (The period that the member was in the group, if known.)
732         */
733        public GroupMemberComponent setPeriod(Period value) { 
734          this.period = value;
735          return this;
736        }
737
738        /**
739         * @return {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value
740         */
741        public BooleanType getInactiveElement() { 
742          if (this.inactive == null)
743            if (Configuration.errorOnAutoCreate())
744              throw new Error("Attempt to auto-create GroupMemberComponent.inactive");
745            else if (Configuration.doAutoCreate())
746              this.inactive = new BooleanType(); // bb
747          return this.inactive;
748        }
749
750        public boolean hasInactiveElement() { 
751          return this.inactive != null && !this.inactive.isEmpty();
752        }
753
754        public boolean hasInactive() { 
755          return this.inactive != null && !this.inactive.isEmpty();
756        }
757
758        /**
759         * @param value {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value
760         */
761        public GroupMemberComponent setInactiveElement(BooleanType value) { 
762          this.inactive = value;
763          return this;
764        }
765
766        /**
767         * @return A flag to indicate that the member is no longer in the group, but previously may have been a member.
768         */
769        public boolean getInactive() { 
770          return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue();
771        }
772
773        /**
774         * @param value A flag to indicate that the member is no longer in the group, but previously may have been a member.
775         */
776        public GroupMemberComponent setInactive(boolean value) { 
777            if (this.inactive == null)
778              this.inactive = new BooleanType();
779            this.inactive.setValue(value);
780          return this;
781        }
782
783        protected void listChildren(List<Property> children) {
784          super.listChildren(children);
785          children.add(new Property("entity", "Reference(Patient|Practitioner|PractitionerRole|Device|Medication|Substance|Group)", "A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.", 0, 1, entity));
786          children.add(new Property("period", "Period", "The period that the member was in the group, if known.", 0, 1, period));
787          children.add(new Property("inactive", "boolean", "A flag to indicate that the member is no longer in the group, but previously may have been a member.", 0, 1, inactive));
788        }
789
790        @Override
791        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
792          switch (_hash) {
793          case -1298275357: /*entity*/  return new Property("entity", "Reference(Patient|Practitioner|PractitionerRole|Device|Medication|Substance|Group)", "A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.", 0, 1, entity);
794          case -991726143: /*period*/  return new Property("period", "Period", "The period that the member was in the group, if known.", 0, 1, period);
795          case 24665195: /*inactive*/  return new Property("inactive", "boolean", "A flag to indicate that the member is no longer in the group, but previously may have been a member.", 0, 1, inactive);
796          default: return super.getNamedProperty(_hash, _name, _checkValid);
797          }
798
799        }
800
801      @Override
802      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
803        switch (hash) {
804        case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Reference
805        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
806        case 24665195: /*inactive*/ return this.inactive == null ? new Base[0] : new Base[] {this.inactive}; // BooleanType
807        default: return super.getProperty(hash, name, checkValid);
808        }
809
810      }
811
812      @Override
813      public Base setProperty(int hash, String name, Base value) throws FHIRException {
814        switch (hash) {
815        case -1298275357: // entity
816          this.entity = castToReference(value); // Reference
817          return value;
818        case -991726143: // period
819          this.period = castToPeriod(value); // Period
820          return value;
821        case 24665195: // inactive
822          this.inactive = castToBoolean(value); // BooleanType
823          return value;
824        default: return super.setProperty(hash, name, value);
825        }
826
827      }
828
829      @Override
830      public Base setProperty(String name, Base value) throws FHIRException {
831        if (name.equals("entity")) {
832          this.entity = castToReference(value); // Reference
833        } else if (name.equals("period")) {
834          this.period = castToPeriod(value); // Period
835        } else if (name.equals("inactive")) {
836          this.inactive = castToBoolean(value); // BooleanType
837        } else
838          return super.setProperty(name, value);
839        return value;
840      }
841
842      @Override
843      public Base makeProperty(int hash, String name) throws FHIRException {
844        switch (hash) {
845        case -1298275357:  return getEntity(); 
846        case -991726143:  return getPeriod(); 
847        case 24665195:  return getInactiveElement();
848        default: return super.makeProperty(hash, name);
849        }
850
851      }
852
853      @Override
854      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
855        switch (hash) {
856        case -1298275357: /*entity*/ return new String[] {"Reference"};
857        case -991726143: /*period*/ return new String[] {"Period"};
858        case 24665195: /*inactive*/ return new String[] {"boolean"};
859        default: return super.getTypesForProperty(hash, name);
860        }
861
862      }
863
864      @Override
865      public Base addChild(String name) throws FHIRException {
866        if (name.equals("entity")) {
867          this.entity = new Reference();
868          return this.entity;
869        }
870        else if (name.equals("period")) {
871          this.period = new Period();
872          return this.period;
873        }
874        else if (name.equals("inactive")) {
875          throw new FHIRException("Cannot call addChild on a primitive type Group.inactive");
876        }
877        else
878          return super.addChild(name);
879      }
880
881      public GroupMemberComponent copy() {
882        GroupMemberComponent dst = new GroupMemberComponent();
883        copyValues(dst);
884        return dst;
885      }
886
887      public void copyValues(GroupMemberComponent dst) {
888        super.copyValues(dst);
889        dst.entity = entity == null ? null : entity.copy();
890        dst.period = period == null ? null : period.copy();
891        dst.inactive = inactive == null ? null : inactive.copy();
892      }
893
894      @Override
895      public boolean equalsDeep(Base other_) {
896        if (!super.equalsDeep(other_))
897          return false;
898        if (!(other_ instanceof GroupMemberComponent))
899          return false;
900        GroupMemberComponent o = (GroupMemberComponent) other_;
901        return compareDeep(entity, o.entity, true) && compareDeep(period, o.period, true) && compareDeep(inactive, o.inactive, true)
902          ;
903      }
904
905      @Override
906      public boolean equalsShallow(Base other_) {
907        if (!super.equalsShallow(other_))
908          return false;
909        if (!(other_ instanceof GroupMemberComponent))
910          return false;
911        GroupMemberComponent o = (GroupMemberComponent) other_;
912        return compareValues(inactive, o.inactive, true);
913      }
914
915      public boolean isEmpty() {
916        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(entity, period, inactive
917          );
918      }
919
920  public String fhirType() {
921    return "Group.member";
922
923  }
924
925  }
926
927    /**
928     * A unique business identifier for this group.
929     */
930    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
931    @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." )
932    protected List<Identifier> identifier;
933
934    /**
935     * Indicates whether the record for the group is available for use or is merely being retained for historical purposes.
936     */
937    @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true)
938    @Description(shortDefinition="Whether this group's record is in active use", formalDefinition="Indicates whether the record for the group is available for use or is merely being retained for historical purposes." )
939    protected BooleanType active;
940
941    /**
942     * Identifies the broad classification of the kind of resources the group includes.
943     */
944    @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true)
945    @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." )
946    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/group-type")
947    protected Enumeration<GroupType> type;
948
949    /**
950     * If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.
951     */
952    @Child(name = "actual", type = {BooleanType.class}, order=3, min=1, max=1, modifier=false, summary=true)
953    @Description(shortDefinition="Descriptive or actual", formalDefinition="If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals." )
954    protected BooleanType actual;
955
956    /**
957     * Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.
958     */
959    @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true)
960    @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc." )
961    protected CodeableConcept code;
962
963    /**
964     * A label assigned to the group for human identification and communication.
965     */
966    @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
967    @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." )
968    protected StringType name;
969
970    /**
971     * A count of the number of resource instances that are part of the group.
972     */
973    @Child(name = "quantity", type = {UnsignedIntType.class}, order=6, min=0, max=1, modifier=false, summary=true)
974    @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." )
975    protected UnsignedIntType quantity;
976
977    /**
978     * Entity responsible for defining and maintaining Group characteristics and/or registered members.
979     */
980    @Child(name = "managingEntity", type = {Organization.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class}, order=7, min=0, max=1, modifier=false, summary=true)
981    @Description(shortDefinition="Entity that is the custodian of the Group's definition", formalDefinition="Entity responsible for defining and maintaining Group characteristics and/or registered members." )
982    protected Reference managingEntity;
983
984    /**
985     * The actual object that is the target of the reference (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
986     */
987    protected Resource managingEntityTarget;
988
989    /**
990     * Identifies traits whose presence r absence is shared by members of the group.
991     */
992    @Child(name = "characteristic", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
993    @Description(shortDefinition="Include / Exclude group members by Trait", formalDefinition="Identifies traits whose presence r absence is shared by members of the group." )
994    protected List<GroupCharacteristicComponent> characteristic;
995
996    /**
997     * Identifies the resource instances that are members of the group.
998     */
999    @Child(name = "member", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1000    @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." )
1001    protected List<GroupMemberComponent> member;
1002
1003    private static final long serialVersionUID = -550945963L;
1004
1005  /**
1006   * Constructor
1007   */
1008    public Group() {
1009      super();
1010    }
1011
1012  /**
1013   * Constructor
1014   */
1015    public Group(Enumeration<GroupType> type, BooleanType actual) {
1016      super();
1017      this.type = type;
1018      this.actual = actual;
1019    }
1020
1021    /**
1022     * @return {@link #identifier} (A unique business identifier for this group.)
1023     */
1024    public List<Identifier> getIdentifier() { 
1025      if (this.identifier == null)
1026        this.identifier = new ArrayList<Identifier>();
1027      return this.identifier;
1028    }
1029
1030    /**
1031     * @return Returns a reference to <code>this</code> for easy method chaining
1032     */
1033    public Group setIdentifier(List<Identifier> theIdentifier) { 
1034      this.identifier = theIdentifier;
1035      return this;
1036    }
1037
1038    public boolean hasIdentifier() { 
1039      if (this.identifier == null)
1040        return false;
1041      for (Identifier item : this.identifier)
1042        if (!item.isEmpty())
1043          return true;
1044      return false;
1045    }
1046
1047    public Identifier addIdentifier() { //3
1048      Identifier t = new Identifier();
1049      if (this.identifier == null)
1050        this.identifier = new ArrayList<Identifier>();
1051      this.identifier.add(t);
1052      return t;
1053    }
1054
1055    public Group addIdentifier(Identifier t) { //3
1056      if (t == null)
1057        return this;
1058      if (this.identifier == null)
1059        this.identifier = new ArrayList<Identifier>();
1060      this.identifier.add(t);
1061      return this;
1062    }
1063
1064    /**
1065     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
1066     */
1067    public Identifier getIdentifierFirstRep() { 
1068      if (getIdentifier().isEmpty()) {
1069        addIdentifier();
1070      }
1071      return getIdentifier().get(0);
1072    }
1073
1074    /**
1075     * @return {@link #active} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1076     */
1077    public BooleanType getActiveElement() { 
1078      if (this.active == null)
1079        if (Configuration.errorOnAutoCreate())
1080          throw new Error("Attempt to auto-create Group.active");
1081        else if (Configuration.doAutoCreate())
1082          this.active = new BooleanType(); // bb
1083      return this.active;
1084    }
1085
1086    public boolean hasActiveElement() { 
1087      return this.active != null && !this.active.isEmpty();
1088    }
1089
1090    public boolean hasActive() { 
1091      return this.active != null && !this.active.isEmpty();
1092    }
1093
1094    /**
1095     * @param value {@link #active} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value
1096     */
1097    public Group setActiveElement(BooleanType value) { 
1098      this.active = value;
1099      return this;
1100    }
1101
1102    /**
1103     * @return Indicates whether the record for the group is available for use or is merely being retained for historical purposes.
1104     */
1105    public boolean getActive() { 
1106      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1107    }
1108
1109    /**
1110     * @param value Indicates whether the record for the group is available for use or is merely being retained for historical purposes.
1111     */
1112    public Group setActive(boolean value) { 
1113        if (this.active == null)
1114          this.active = new BooleanType();
1115        this.active.setValue(value);
1116      return this;
1117    }
1118
1119    /**
1120     * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1121     */
1122    public Enumeration<GroupType> getTypeElement() { 
1123      if (this.type == null)
1124        if (Configuration.errorOnAutoCreate())
1125          throw new Error("Attempt to auto-create Group.type");
1126        else if (Configuration.doAutoCreate())
1127          this.type = new Enumeration<GroupType>(new GroupTypeEnumFactory()); // bb
1128      return this.type;
1129    }
1130
1131    public boolean hasTypeElement() { 
1132      return this.type != null && !this.type.isEmpty();
1133    }
1134
1135    public boolean hasType() { 
1136      return this.type != null && !this.type.isEmpty();
1137    }
1138
1139    /**
1140     * @param value {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1141     */
1142    public Group setTypeElement(Enumeration<GroupType> value) { 
1143      this.type = value;
1144      return this;
1145    }
1146
1147    /**
1148     * @return Identifies the broad classification of the kind of resources the group includes.
1149     */
1150    public GroupType getType() { 
1151      return this.type == null ? null : this.type.getValue();
1152    }
1153
1154    /**
1155     * @param value Identifies the broad classification of the kind of resources the group includes.
1156     */
1157    public Group setType(GroupType value) { 
1158        if (this.type == null)
1159          this.type = new Enumeration<GroupType>(new GroupTypeEnumFactory());
1160        this.type.setValue(value);
1161      return this;
1162    }
1163
1164    /**
1165     * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1166     */
1167    public BooleanType getActualElement() { 
1168      if (this.actual == null)
1169        if (Configuration.errorOnAutoCreate())
1170          throw new Error("Attempt to auto-create Group.actual");
1171        else if (Configuration.doAutoCreate())
1172          this.actual = new BooleanType(); // bb
1173      return this.actual;
1174    }
1175
1176    public boolean hasActualElement() { 
1177      return this.actual != null && !this.actual.isEmpty();
1178    }
1179
1180    public boolean hasActual() { 
1181      return this.actual != null && !this.actual.isEmpty();
1182    }
1183
1184    /**
1185     * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value
1186     */
1187    public Group setActualElement(BooleanType value) { 
1188      this.actual = value;
1189      return this;
1190    }
1191
1192    /**
1193     * @return If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.
1194     */
1195    public boolean getActual() { 
1196      return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
1197    }
1198
1199    /**
1200     * @param value If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.
1201     */
1202    public Group setActual(boolean value) { 
1203        if (this.actual == null)
1204          this.actual = new BooleanType();
1205        this.actual.setValue(value);
1206      return this;
1207    }
1208
1209    /**
1210     * @return {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.)
1211     */
1212    public CodeableConcept getCode() { 
1213      if (this.code == null)
1214        if (Configuration.errorOnAutoCreate())
1215          throw new Error("Attempt to auto-create Group.code");
1216        else if (Configuration.doAutoCreate())
1217          this.code = new CodeableConcept(); // cc
1218      return this.code;
1219    }
1220
1221    public boolean hasCode() { 
1222      return this.code != null && !this.code.isEmpty();
1223    }
1224
1225    /**
1226     * @param value {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.)
1227     */
1228    public Group setCode(CodeableConcept value) { 
1229      this.code = value;
1230      return this;
1231    }
1232
1233    /**
1234     * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1235     */
1236    public StringType getNameElement() { 
1237      if (this.name == null)
1238        if (Configuration.errorOnAutoCreate())
1239          throw new Error("Attempt to auto-create Group.name");
1240        else if (Configuration.doAutoCreate())
1241          this.name = new StringType(); // bb
1242      return this.name;
1243    }
1244
1245    public boolean hasNameElement() { 
1246      return this.name != null && !this.name.isEmpty();
1247    }
1248
1249    public boolean hasName() { 
1250      return this.name != null && !this.name.isEmpty();
1251    }
1252
1253    /**
1254     * @param value {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1255     */
1256    public Group setNameElement(StringType value) { 
1257      this.name = value;
1258      return this;
1259    }
1260
1261    /**
1262     * @return A label assigned to the group for human identification and communication.
1263     */
1264    public String getName() { 
1265      return this.name == null ? null : this.name.getValue();
1266    }
1267
1268    /**
1269     * @param value A label assigned to the group for human identification and communication.
1270     */
1271    public Group setName(String value) { 
1272      if (Utilities.noString(value))
1273        this.name = null;
1274      else {
1275        if (this.name == null)
1276          this.name = new StringType();
1277        this.name.setValue(value);
1278      }
1279      return this;
1280    }
1281
1282    /**
1283     * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
1284     */
1285    public UnsignedIntType getQuantityElement() { 
1286      if (this.quantity == null)
1287        if (Configuration.errorOnAutoCreate())
1288          throw new Error("Attempt to auto-create Group.quantity");
1289        else if (Configuration.doAutoCreate())
1290          this.quantity = new UnsignedIntType(); // bb
1291      return this.quantity;
1292    }
1293
1294    public boolean hasQuantityElement() { 
1295      return this.quantity != null && !this.quantity.isEmpty();
1296    }
1297
1298    public boolean hasQuantity() { 
1299      return this.quantity != null && !this.quantity.isEmpty();
1300    }
1301
1302    /**
1303     * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value
1304     */
1305    public Group setQuantityElement(UnsignedIntType value) { 
1306      this.quantity = value;
1307      return this;
1308    }
1309
1310    /**
1311     * @return A count of the number of resource instances that are part of the group.
1312     */
1313    public int getQuantity() { 
1314      return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue();
1315    }
1316
1317    /**
1318     * @param value A count of the number of resource instances that are part of the group.
1319     */
1320    public Group setQuantity(int value) { 
1321        if (this.quantity == null)
1322          this.quantity = new UnsignedIntType();
1323        this.quantity.setValue(value);
1324      return this;
1325    }
1326
1327    /**
1328     * @return {@link #managingEntity} (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1329     */
1330    public Reference getManagingEntity() { 
1331      if (this.managingEntity == null)
1332        if (Configuration.errorOnAutoCreate())
1333          throw new Error("Attempt to auto-create Group.managingEntity");
1334        else if (Configuration.doAutoCreate())
1335          this.managingEntity = new Reference(); // cc
1336      return this.managingEntity;
1337    }
1338
1339    public boolean hasManagingEntity() { 
1340      return this.managingEntity != null && !this.managingEntity.isEmpty();
1341    }
1342
1343    /**
1344     * @param value {@link #managingEntity} (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1345     */
1346    public Group setManagingEntity(Reference value) { 
1347      this.managingEntity = value;
1348      return this;
1349    }
1350
1351    /**
1352     * @return {@link #managingEntity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1353     */
1354    public Resource getManagingEntityTarget() { 
1355      return this.managingEntityTarget;
1356    }
1357
1358    /**
1359     * @param value {@link #managingEntity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1360     */
1361    public Group setManagingEntityTarget(Resource value) { 
1362      this.managingEntityTarget = value;
1363      return this;
1364    }
1365
1366    /**
1367     * @return {@link #characteristic} (Identifies traits whose presence r absence is shared by members of the group.)
1368     */
1369    public List<GroupCharacteristicComponent> getCharacteristic() { 
1370      if (this.characteristic == null)
1371        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1372      return this.characteristic;
1373    }
1374
1375    /**
1376     * @return Returns a reference to <code>this</code> for easy method chaining
1377     */
1378    public Group setCharacteristic(List<GroupCharacteristicComponent> theCharacteristic) { 
1379      this.characteristic = theCharacteristic;
1380      return this;
1381    }
1382
1383    public boolean hasCharacteristic() { 
1384      if (this.characteristic == null)
1385        return false;
1386      for (GroupCharacteristicComponent item : this.characteristic)
1387        if (!item.isEmpty())
1388          return true;
1389      return false;
1390    }
1391
1392    public GroupCharacteristicComponent addCharacteristic() { //3
1393      GroupCharacteristicComponent t = new GroupCharacteristicComponent();
1394      if (this.characteristic == null)
1395        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1396      this.characteristic.add(t);
1397      return t;
1398    }
1399
1400    public Group addCharacteristic(GroupCharacteristicComponent t) { //3
1401      if (t == null)
1402        return this;
1403      if (this.characteristic == null)
1404        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1405      this.characteristic.add(t);
1406      return this;
1407    }
1408
1409    /**
1410     * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist
1411     */
1412    public GroupCharacteristicComponent getCharacteristicFirstRep() { 
1413      if (getCharacteristic().isEmpty()) {
1414        addCharacteristic();
1415      }
1416      return getCharacteristic().get(0);
1417    }
1418
1419    /**
1420     * @return {@link #member} (Identifies the resource instances that are members of the group.)
1421     */
1422    public List<GroupMemberComponent> getMember() { 
1423      if (this.member == null)
1424        this.member = new ArrayList<GroupMemberComponent>();
1425      return this.member;
1426    }
1427
1428    /**
1429     * @return Returns a reference to <code>this</code> for easy method chaining
1430     */
1431    public Group setMember(List<GroupMemberComponent> theMember) { 
1432      this.member = theMember;
1433      return this;
1434    }
1435
1436    public boolean hasMember() { 
1437      if (this.member == null)
1438        return false;
1439      for (GroupMemberComponent item : this.member)
1440        if (!item.isEmpty())
1441          return true;
1442      return false;
1443    }
1444
1445    public GroupMemberComponent addMember() { //3
1446      GroupMemberComponent t = new GroupMemberComponent();
1447      if (this.member == null)
1448        this.member = new ArrayList<GroupMemberComponent>();
1449      this.member.add(t);
1450      return t;
1451    }
1452
1453    public Group addMember(GroupMemberComponent t) { //3
1454      if (t == null)
1455        return this;
1456      if (this.member == null)
1457        this.member = new ArrayList<GroupMemberComponent>();
1458      this.member.add(t);
1459      return this;
1460    }
1461
1462    /**
1463     * @return The first repetition of repeating field {@link #member}, creating it if it does not already exist
1464     */
1465    public GroupMemberComponent getMemberFirstRep() { 
1466      if (getMember().isEmpty()) {
1467        addMember();
1468      }
1469      return getMember().get(0);
1470    }
1471
1472      protected void listChildren(List<Property> children) {
1473        super.listChildren(children);
1474        children.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier));
1475        children.add(new Property("active", "boolean", "Indicates whether the record for the group is available for use or is merely being retained for historical purposes.", 0, 1, active));
1476        children.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, 1, type));
1477        children.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.", 0, 1, actual));
1478        children.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.", 0, 1, code));
1479        children.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, 1, name));
1480        children.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, 1, quantity));
1481        children.add(new Property("managingEntity", "Reference(Organization|RelatedPerson|Practitioner|PractitionerRole)", "Entity responsible for defining and maintaining Group characteristics and/or registered members.", 0, 1, managingEntity));
1482        children.add(new Property("characteristic", "", "Identifies traits whose presence r absence is shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic));
1483        children.add(new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member));
1484      }
1485
1486      @Override
1487      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1488        switch (_hash) {
1489        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier);
1490        case -1422950650: /*active*/  return new Property("active", "boolean", "Indicates whether the record for the group is available for use or is merely being retained for historical purposes.", 0, 1, active);
1491        case 3575610: /*type*/  return new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, 1, type);
1492        case -1422939762: /*actual*/  return new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.", 0, 1, actual);
1493        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.", 0, 1, code);
1494        case 3373707: /*name*/  return new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, 1, name);
1495        case -1285004149: /*quantity*/  return new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, 1, quantity);
1496        case -988474523: /*managingEntity*/  return new Property("managingEntity", "Reference(Organization|RelatedPerson|Practitioner|PractitionerRole)", "Entity responsible for defining and maintaining Group characteristics and/or registered members.", 0, 1, managingEntity);
1497        case 366313883: /*characteristic*/  return new Property("characteristic", "", "Identifies traits whose presence r absence is shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic);
1498        case -1077769574: /*member*/  return new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member);
1499        default: return super.getNamedProperty(_hash, _name, _checkValid);
1500        }
1501
1502      }
1503
1504      @Override
1505      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1506        switch (hash) {
1507        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1508        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
1509        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<GroupType>
1510        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
1511        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1512        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1513        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // UnsignedIntType
1514        case -988474523: /*managingEntity*/ return this.managingEntity == null ? new Base[0] : new Base[] {this.managingEntity}; // Reference
1515        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // GroupCharacteristicComponent
1516        case -1077769574: /*member*/ return this.member == null ? new Base[0] : this.member.toArray(new Base[this.member.size()]); // GroupMemberComponent
1517        default: return super.getProperty(hash, name, checkValid);
1518        }
1519
1520      }
1521
1522      @Override
1523      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1524        switch (hash) {
1525        case -1618432855: // identifier
1526          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1527          return value;
1528        case -1422950650: // active
1529          this.active = castToBoolean(value); // BooleanType
1530          return value;
1531        case 3575610: // type
1532          value = new GroupTypeEnumFactory().fromType(castToCode(value));
1533          this.type = (Enumeration) value; // Enumeration<GroupType>
1534          return value;
1535        case -1422939762: // actual
1536          this.actual = castToBoolean(value); // BooleanType
1537          return value;
1538        case 3059181: // code
1539          this.code = castToCodeableConcept(value); // CodeableConcept
1540          return value;
1541        case 3373707: // name
1542          this.name = castToString(value); // StringType
1543          return value;
1544        case -1285004149: // quantity
1545          this.quantity = castToUnsignedInt(value); // UnsignedIntType
1546          return value;
1547        case -988474523: // managingEntity
1548          this.managingEntity = castToReference(value); // Reference
1549          return value;
1550        case 366313883: // characteristic
1551          this.getCharacteristic().add((GroupCharacteristicComponent) value); // GroupCharacteristicComponent
1552          return value;
1553        case -1077769574: // member
1554          this.getMember().add((GroupMemberComponent) value); // GroupMemberComponent
1555          return value;
1556        default: return super.setProperty(hash, name, value);
1557        }
1558
1559      }
1560
1561      @Override
1562      public Base setProperty(String name, Base value) throws FHIRException {
1563        if (name.equals("identifier")) {
1564          this.getIdentifier().add(castToIdentifier(value));
1565        } else if (name.equals("active")) {
1566          this.active = castToBoolean(value); // BooleanType
1567        } else if (name.equals("type")) {
1568          value = new GroupTypeEnumFactory().fromType(castToCode(value));
1569          this.type = (Enumeration) value; // Enumeration<GroupType>
1570        } else if (name.equals("actual")) {
1571          this.actual = castToBoolean(value); // BooleanType
1572        } else if (name.equals("code")) {
1573          this.code = castToCodeableConcept(value); // CodeableConcept
1574        } else if (name.equals("name")) {
1575          this.name = castToString(value); // StringType
1576        } else if (name.equals("quantity")) {
1577          this.quantity = castToUnsignedInt(value); // UnsignedIntType
1578        } else if (name.equals("managingEntity")) {
1579          this.managingEntity = castToReference(value); // Reference
1580        } else if (name.equals("characteristic")) {
1581          this.getCharacteristic().add((GroupCharacteristicComponent) value);
1582        } else if (name.equals("member")) {
1583          this.getMember().add((GroupMemberComponent) value);
1584        } else
1585          return super.setProperty(name, value);
1586        return value;
1587      }
1588
1589      @Override
1590      public Base makeProperty(int hash, String name) throws FHIRException {
1591        switch (hash) {
1592        case -1618432855:  return addIdentifier(); 
1593        case -1422950650:  return getActiveElement();
1594        case 3575610:  return getTypeElement();
1595        case -1422939762:  return getActualElement();
1596        case 3059181:  return getCode(); 
1597        case 3373707:  return getNameElement();
1598        case -1285004149:  return getQuantityElement();
1599        case -988474523:  return getManagingEntity(); 
1600        case 366313883:  return addCharacteristic(); 
1601        case -1077769574:  return addMember(); 
1602        default: return super.makeProperty(hash, name);
1603        }
1604
1605      }
1606
1607      @Override
1608      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1609        switch (hash) {
1610        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1611        case -1422950650: /*active*/ return new String[] {"boolean"};
1612        case 3575610: /*type*/ return new String[] {"code"};
1613        case -1422939762: /*actual*/ return new String[] {"boolean"};
1614        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1615        case 3373707: /*name*/ return new String[] {"string"};
1616        case -1285004149: /*quantity*/ return new String[] {"unsignedInt"};
1617        case -988474523: /*managingEntity*/ return new String[] {"Reference"};
1618        case 366313883: /*characteristic*/ return new String[] {};
1619        case -1077769574: /*member*/ return new String[] {};
1620        default: return super.getTypesForProperty(hash, name);
1621        }
1622
1623      }
1624
1625      @Override
1626      public Base addChild(String name) throws FHIRException {
1627        if (name.equals("identifier")) {
1628          return addIdentifier();
1629        }
1630        else if (name.equals("active")) {
1631          throw new FHIRException("Cannot call addChild on a primitive type Group.active");
1632        }
1633        else if (name.equals("type")) {
1634          throw new FHIRException("Cannot call addChild on a primitive type Group.type");
1635        }
1636        else if (name.equals("actual")) {
1637          throw new FHIRException("Cannot call addChild on a primitive type Group.actual");
1638        }
1639        else if (name.equals("code")) {
1640          this.code = new CodeableConcept();
1641          return this.code;
1642        }
1643        else if (name.equals("name")) {
1644          throw new FHIRException("Cannot call addChild on a primitive type Group.name");
1645        }
1646        else if (name.equals("quantity")) {
1647          throw new FHIRException("Cannot call addChild on a primitive type Group.quantity");
1648        }
1649        else if (name.equals("managingEntity")) {
1650          this.managingEntity = new Reference();
1651          return this.managingEntity;
1652        }
1653        else if (name.equals("characteristic")) {
1654          return addCharacteristic();
1655        }
1656        else if (name.equals("member")) {
1657          return addMember();
1658        }
1659        else
1660          return super.addChild(name);
1661      }
1662
1663  public String fhirType() {
1664    return "Group";
1665
1666  }
1667
1668      public Group copy() {
1669        Group dst = new Group();
1670        copyValues(dst);
1671        return dst;
1672      }
1673
1674      public void copyValues(Group dst) {
1675        super.copyValues(dst);
1676        if (identifier != null) {
1677          dst.identifier = new ArrayList<Identifier>();
1678          for (Identifier i : identifier)
1679            dst.identifier.add(i.copy());
1680        };
1681        dst.active = active == null ? null : active.copy();
1682        dst.type = type == null ? null : type.copy();
1683        dst.actual = actual == null ? null : actual.copy();
1684        dst.code = code == null ? null : code.copy();
1685        dst.name = name == null ? null : name.copy();
1686        dst.quantity = quantity == null ? null : quantity.copy();
1687        dst.managingEntity = managingEntity == null ? null : managingEntity.copy();
1688        if (characteristic != null) {
1689          dst.characteristic = new ArrayList<GroupCharacteristicComponent>();
1690          for (GroupCharacteristicComponent i : characteristic)
1691            dst.characteristic.add(i.copy());
1692        };
1693        if (member != null) {
1694          dst.member = new ArrayList<GroupMemberComponent>();
1695          for (GroupMemberComponent i : member)
1696            dst.member.add(i.copy());
1697        };
1698      }
1699
1700      protected Group typedCopy() {
1701        return copy();
1702      }
1703
1704      @Override
1705      public boolean equalsDeep(Base other_) {
1706        if (!super.equalsDeep(other_))
1707          return false;
1708        if (!(other_ instanceof Group))
1709          return false;
1710        Group o = (Group) other_;
1711        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(type, o.type, true)
1712           && compareDeep(actual, o.actual, true) && compareDeep(code, o.code, true) && compareDeep(name, o.name, true)
1713           && compareDeep(quantity, o.quantity, true) && compareDeep(managingEntity, o.managingEntity, true)
1714           && compareDeep(characteristic, o.characteristic, true) && compareDeep(member, o.member, true);
1715      }
1716
1717      @Override
1718      public boolean equalsShallow(Base other_) {
1719        if (!super.equalsShallow(other_))
1720          return false;
1721        if (!(other_ instanceof Group))
1722          return false;
1723        Group o = (Group) other_;
1724        return compareValues(active, o.active, true) && compareValues(type, o.type, true) && compareValues(actual, o.actual, true)
1725           && compareValues(name, o.name, true) && compareValues(quantity, o.quantity, true);
1726      }
1727
1728      public boolean isEmpty() {
1729        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, type
1730          , actual, code, name, quantity, managingEntity, characteristic, member);
1731      }
1732
1733  @Override
1734  public ResourceType getResourceType() {
1735    return ResourceType.Group;
1736   }
1737
1738 /**
1739   * Search parameter: <b>actual</b>
1740   * <p>
1741   * Description: <b>Descriptive or actual</b><br>
1742   * Type: <b>token</b><br>
1743   * Path: <b>Group.actual</b><br>
1744   * </p>
1745   */
1746  @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" )
1747  public static final String SP_ACTUAL = "actual";
1748 /**
1749   * <b>Fluent Client</b> search parameter constant for <b>actual</b>
1750   * <p>
1751   * Description: <b>Descriptive or actual</b><br>
1752   * Type: <b>token</b><br>
1753   * Path: <b>Group.actual</b><br>
1754   * </p>
1755   */
1756  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTUAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTUAL);
1757
1758 /**
1759   * Search parameter: <b>identifier</b>
1760   * <p>
1761   * Description: <b>Unique id</b><br>
1762   * Type: <b>token</b><br>
1763   * Path: <b>Group.identifier</b><br>
1764   * </p>
1765   */
1766  @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" )
1767  public static final String SP_IDENTIFIER = "identifier";
1768 /**
1769   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1770   * <p>
1771   * Description: <b>Unique id</b><br>
1772   * Type: <b>token</b><br>
1773   * Path: <b>Group.identifier</b><br>
1774   * </p>
1775   */
1776  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1777
1778 /**
1779   * Search parameter: <b>characteristic-value</b>
1780   * <p>
1781   * Description: <b>A composite of both characteristic and value</b><br>
1782   * Type: <b>composite</b><br>
1783   * Path: <b></b><br>
1784   * </p>
1785   */
1786  @SearchParamDefinition(name="characteristic-value", path="Group.characteristic", description="A composite of both characteristic and value", type="composite", compositeOf={"characteristic", "value"} )
1787  public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value";
1788 /**
1789   * <b>Fluent Client</b> search parameter constant for <b>characteristic-value</b>
1790   * <p>
1791   * Description: <b>A composite of both characteristic and value</b><br>
1792   * Type: <b>composite</b><br>
1793   * Path: <b></b><br>
1794   * </p>
1795   */
1796  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CHARACTERISTIC_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CHARACTERISTIC_VALUE);
1797
1798 /**
1799   * Search parameter: <b>managing-entity</b>
1800   * <p>
1801   * Description: <b>Entity that is the custodian of the Group's definition</b><br>
1802   * Type: <b>reference</b><br>
1803   * Path: <b>Group.managingEntity</b><br>
1804   * </p>
1805   */
1806  @SearchParamDefinition(name="managing-entity", path="Group.managingEntity", description="Entity that is the custodian of the Group's definition", type="reference", target={Organization.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
1807  public static final String SP_MANAGING_ENTITY = "managing-entity";
1808 /**
1809   * <b>Fluent Client</b> search parameter constant for <b>managing-entity</b>
1810   * <p>
1811   * Description: <b>Entity that is the custodian of the Group's definition</b><br>
1812   * Type: <b>reference</b><br>
1813   * Path: <b>Group.managingEntity</b><br>
1814   * </p>
1815   */
1816  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANAGING_ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANAGING_ENTITY);
1817
1818/**
1819   * Constant for fluent queries to be used to add include statements. Specifies
1820   * the path value of "<b>Group:managing-entity</b>".
1821   */
1822  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANAGING_ENTITY = new ca.uhn.fhir.model.api.Include("Group:managing-entity").toLocked();
1823
1824 /**
1825   * Search parameter: <b>code</b>
1826   * <p>
1827   * Description: <b>The kind of resources contained</b><br>
1828   * Type: <b>token</b><br>
1829   * Path: <b>Group.code</b><br>
1830   * </p>
1831   */
1832  @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" )
1833  public static final String SP_CODE = "code";
1834 /**
1835   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1836   * <p>
1837   * Description: <b>The kind of resources contained</b><br>
1838   * Type: <b>token</b><br>
1839   * Path: <b>Group.code</b><br>
1840   * </p>
1841   */
1842  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1843
1844 /**
1845   * Search parameter: <b>member</b>
1846   * <p>
1847   * Description: <b>Reference to the group member</b><br>
1848   * Type: <b>reference</b><br>
1849   * Path: <b>Group.member.entity</b><br>
1850   * </p>
1851   */
1852  @SearchParamDefinition(name="member", path="Group.member.entity", description="Reference to the group member", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Group.class, Medication.class, Patient.class, Practitioner.class, PractitionerRole.class, Substance.class } )
1853  public static final String SP_MEMBER = "member";
1854 /**
1855   * <b>Fluent Client</b> search parameter constant for <b>member</b>
1856   * <p>
1857   * Description: <b>Reference to the group member</b><br>
1858   * Type: <b>reference</b><br>
1859   * Path: <b>Group.member.entity</b><br>
1860   * </p>
1861   */
1862  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEMBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEMBER);
1863
1864/**
1865   * Constant for fluent queries to be used to add include statements. Specifies
1866   * the path value of "<b>Group:member</b>".
1867   */
1868  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEMBER = new ca.uhn.fhir.model.api.Include("Group:member").toLocked();
1869
1870 /**
1871   * Search parameter: <b>exclude</b>
1872   * <p>
1873   * Description: <b>Group includes or excludes</b><br>
1874   * Type: <b>token</b><br>
1875   * Path: <b>Group.characteristic.exclude</b><br>
1876   * </p>
1877   */
1878  @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" )
1879  public static final String SP_EXCLUDE = "exclude";
1880 /**
1881   * <b>Fluent Client</b> search parameter constant for <b>exclude</b>
1882   * <p>
1883   * Description: <b>Group includes or excludes</b><br>
1884   * Type: <b>token</b><br>
1885   * Path: <b>Group.characteristic.exclude</b><br>
1886   * </p>
1887   */
1888  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXCLUDE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXCLUDE);
1889
1890 /**
1891   * Search parameter: <b>type</b>
1892   * <p>
1893   * Description: <b>The type of resources the group contains</b><br>
1894   * Type: <b>token</b><br>
1895   * Path: <b>Group.type</b><br>
1896   * </p>
1897   */
1898  @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" )
1899  public static final String SP_TYPE = "type";
1900 /**
1901   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1902   * <p>
1903   * Description: <b>The type of resources the group contains</b><br>
1904   * Type: <b>token</b><br>
1905   * Path: <b>Group.type</b><br>
1906   * </p>
1907   */
1908  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1909
1910 /**
1911   * Search parameter: <b>value</b>
1912   * <p>
1913   * Description: <b>Value held by characteristic</b><br>
1914   * Type: <b>token</b><br>
1915   * Path: <b>Group.characteristic.value[x]</b><br>
1916   * </p>
1917   */
1918  @SearchParamDefinition(name="value", path="(Group.characteristic.value as CodeableConcept) | (Group.characteristic.value as boolean)", description="Value held by characteristic", type="token" )
1919  public static final String SP_VALUE = "value";
1920 /**
1921   * <b>Fluent Client</b> search parameter constant for <b>value</b>
1922   * <p>
1923   * Description: <b>Value held by characteristic</b><br>
1924   * Type: <b>token</b><br>
1925   * Path: <b>Group.characteristic.value[x]</b><br>
1926   * </p>
1927   */
1928  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE);
1929
1930 /**
1931   * Search parameter: <b>characteristic</b>
1932   * <p>
1933   * Description: <b>Kind of characteristic</b><br>
1934   * Type: <b>token</b><br>
1935   * Path: <b>Group.characteristic.code</b><br>
1936   * </p>
1937   */
1938  @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" )
1939  public static final String SP_CHARACTERISTIC = "characteristic";
1940 /**
1941   * <b>Fluent Client</b> search parameter constant for <b>characteristic</b>
1942   * <p>
1943   * Description: <b>Kind of characteristic</b><br>
1944   * Type: <b>token</b><br>
1945   * Path: <b>Group.characteristic.code</b><br>
1946   * </p>
1947   */
1948  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC);
1949
1950
1951}