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