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