001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * 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=true)
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=true)
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=true)
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, Practitioner.class, PractitionerRole.class, Device.class, Group.class, RelatedPerson.class, Specimen.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|Practitioner|PractitionerRole|Device|Group|RelatedPerson|Specimen)", "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|Practitioner|PractitionerRole|Device|Group|RelatedPerson|Specimen)", "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     * Explanation of what the group represents and how it is intended to be used.
958     */
959    @Child(name = "description", type = {MarkdownType.class}, order=6, min=0, max=1, modifier=false, summary=false)
960    @Description(shortDefinition="Natural language description of the group", formalDefinition="Explanation of what the group represents and how it is intended to be used." )
961    protected MarkdownType description;
962
963    /**
964     * A count of the number of resource instances that are part of the group.
965     */
966    @Child(name = "quantity", type = {UnsignedIntType.class}, order=7, min=0, max=1, modifier=false, summary=true)
967    @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." )
968    protected UnsignedIntType quantity;
969
970    /**
971     * Entity responsible for defining and maintaining Group characteristics and/or registered members.
972     */
973    @Child(name = "managingEntity", type = {Organization.class, RelatedPerson.class, Practitioner.class, PractitionerRole.class}, order=8, min=0, max=1, modifier=false, summary=true)
974    @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." )
975    protected Reference managingEntity;
976
977    /**
978     * Identifies traits whose presence r absence is shared by members of the group.
979     */
980    @Child(name = "characteristic", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
981    @Description(shortDefinition="Include / Exclude group members by Trait", formalDefinition="Identifies traits whose presence r absence is shared by members of the group." )
982    protected List<GroupCharacteristicComponent> characteristic;
983
984    /**
985     * Identifies the resource instances that are members of the group.
986     */
987    @Child(name = "member", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
988    @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." )
989    protected List<GroupMemberComponent> member;
990
991    private static final long serialVersionUID = -1476844328L;
992
993  /**
994   * Constructor
995   */
996    public Group() {
997      super();
998    }
999
1000  /**
1001   * Constructor
1002   */
1003    public Group(GroupType type, boolean actual) {
1004      super();
1005      this.setType(type);
1006      this.setActual(actual);
1007    }
1008
1009    /**
1010     * @return {@link #identifier} (A unique business identifier for this group.)
1011     */
1012    public List<Identifier> getIdentifier() { 
1013      if (this.identifier == null)
1014        this.identifier = new ArrayList<Identifier>();
1015      return this.identifier;
1016    }
1017
1018    /**
1019     * @return Returns a reference to <code>this</code> for easy method chaining
1020     */
1021    public Group setIdentifier(List<Identifier> theIdentifier) { 
1022      this.identifier = theIdentifier;
1023      return this;
1024    }
1025
1026    public boolean hasIdentifier() { 
1027      if (this.identifier == null)
1028        return false;
1029      for (Identifier item : this.identifier)
1030        if (!item.isEmpty())
1031          return true;
1032      return false;
1033    }
1034
1035    public Identifier addIdentifier() { //3
1036      Identifier t = new Identifier();
1037      if (this.identifier == null)
1038        this.identifier = new ArrayList<Identifier>();
1039      this.identifier.add(t);
1040      return t;
1041    }
1042
1043    public Group addIdentifier(Identifier t) { //3
1044      if (t == null)
1045        return this;
1046      if (this.identifier == null)
1047        this.identifier = new ArrayList<Identifier>();
1048      this.identifier.add(t);
1049      return this;
1050    }
1051
1052    /**
1053     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1054     */
1055    public Identifier getIdentifierFirstRep() { 
1056      if (getIdentifier().isEmpty()) {
1057        addIdentifier();
1058      }
1059      return getIdentifier().get(0);
1060    }
1061
1062    /**
1063     * @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
1064     */
1065    public BooleanType getActiveElement() { 
1066      if (this.active == null)
1067        if (Configuration.errorOnAutoCreate())
1068          throw new Error("Attempt to auto-create Group.active");
1069        else if (Configuration.doAutoCreate())
1070          this.active = new BooleanType(); // bb
1071      return this.active;
1072    }
1073
1074    public boolean hasActiveElement() { 
1075      return this.active != null && !this.active.isEmpty();
1076    }
1077
1078    public boolean hasActive() { 
1079      return this.active != null && !this.active.isEmpty();
1080    }
1081
1082    /**
1083     * @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
1084     */
1085    public Group setActiveElement(BooleanType value) { 
1086      this.active = value;
1087      return this;
1088    }
1089
1090    /**
1091     * @return Indicates whether the record for the group is available for use or is merely being retained for historical purposes.
1092     */
1093    public boolean getActive() { 
1094      return this.active == null || this.active.isEmpty() ? false : this.active.getValue();
1095    }
1096
1097    /**
1098     * @param value Indicates whether the record for the group is available for use or is merely being retained for historical purposes.
1099     */
1100    public Group setActive(boolean value) { 
1101        if (this.active == null)
1102          this.active = new BooleanType();
1103        this.active.setValue(value);
1104      return this;
1105    }
1106
1107    /**
1108     * @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
1109     */
1110    public Enumeration<GroupType> getTypeElement() { 
1111      if (this.type == null)
1112        if (Configuration.errorOnAutoCreate())
1113          throw new Error("Attempt to auto-create Group.type");
1114        else if (Configuration.doAutoCreate())
1115          this.type = new Enumeration<GroupType>(new GroupTypeEnumFactory()); // bb
1116      return this.type;
1117    }
1118
1119    public boolean hasTypeElement() { 
1120      return this.type != null && !this.type.isEmpty();
1121    }
1122
1123    public boolean hasType() { 
1124      return this.type != null && !this.type.isEmpty();
1125    }
1126
1127    /**
1128     * @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
1129     */
1130    public Group setTypeElement(Enumeration<GroupType> value) { 
1131      this.type = value;
1132      return this;
1133    }
1134
1135    /**
1136     * @return Identifies the broad classification of the kind of resources the group includes.
1137     */
1138    public GroupType getType() { 
1139      return this.type == null ? null : this.type.getValue();
1140    }
1141
1142    /**
1143     * @param value Identifies the broad classification of the kind of resources the group includes.
1144     */
1145    public Group setType(GroupType value) { 
1146        if (this.type == null)
1147          this.type = new Enumeration<GroupType>(new GroupTypeEnumFactory());
1148        this.type.setValue(value);
1149      return this;
1150    }
1151
1152    /**
1153     * @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
1154     */
1155    public BooleanType getActualElement() { 
1156      if (this.actual == null)
1157        if (Configuration.errorOnAutoCreate())
1158          throw new Error("Attempt to auto-create Group.actual");
1159        else if (Configuration.doAutoCreate())
1160          this.actual = new BooleanType(); // bb
1161      return this.actual;
1162    }
1163
1164    public boolean hasActualElement() { 
1165      return this.actual != null && !this.actual.isEmpty();
1166    }
1167
1168    public boolean hasActual() { 
1169      return this.actual != null && !this.actual.isEmpty();
1170    }
1171
1172    /**
1173     * @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
1174     */
1175    public Group setActualElement(BooleanType value) { 
1176      this.actual = value;
1177      return this;
1178    }
1179
1180    /**
1181     * @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.
1182     */
1183    public boolean getActual() { 
1184      return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue();
1185    }
1186
1187    /**
1188     * @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.
1189     */
1190    public Group setActual(boolean value) { 
1191        if (this.actual == null)
1192          this.actual = new BooleanType();
1193        this.actual.setValue(value);
1194      return this;
1195    }
1196
1197    /**
1198     * @return {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.)
1199     */
1200    public CodeableConcept getCode() { 
1201      if (this.code == null)
1202        if (Configuration.errorOnAutoCreate())
1203          throw new Error("Attempt to auto-create Group.code");
1204        else if (Configuration.doAutoCreate())
1205          this.code = new CodeableConcept(); // cc
1206      return this.code;
1207    }
1208
1209    public boolean hasCode() { 
1210      return this.code != null && !this.code.isEmpty();
1211    }
1212
1213    /**
1214     * @param value {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.)
1215     */
1216    public Group setCode(CodeableConcept value) { 
1217      this.code = value;
1218      return this;
1219    }
1220
1221    /**
1222     * @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
1223     */
1224    public StringType getNameElement() { 
1225      if (this.name == null)
1226        if (Configuration.errorOnAutoCreate())
1227          throw new Error("Attempt to auto-create Group.name");
1228        else if (Configuration.doAutoCreate())
1229          this.name = new StringType(); // bb
1230      return this.name;
1231    }
1232
1233    public boolean hasNameElement() { 
1234      return this.name != null && !this.name.isEmpty();
1235    }
1236
1237    public boolean hasName() { 
1238      return this.name != null && !this.name.isEmpty();
1239    }
1240
1241    /**
1242     * @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
1243     */
1244    public Group setNameElement(StringType value) { 
1245      this.name = value;
1246      return this;
1247    }
1248
1249    /**
1250     * @return A label assigned to the group for human identification and communication.
1251     */
1252    public String getName() { 
1253      return this.name == null ? null : this.name.getValue();
1254    }
1255
1256    /**
1257     * @param value A label assigned to the group for human identification and communication.
1258     */
1259    public Group setName(String value) { 
1260      if (Utilities.noString(value))
1261        this.name = null;
1262      else {
1263        if (this.name == null)
1264          this.name = new StringType();
1265        this.name.setValue(value);
1266      }
1267      return this;
1268    }
1269
1270    /**
1271     * @return {@link #description} (Explanation of what the group represents and how it is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1272     */
1273    public MarkdownType getDescriptionElement() { 
1274      if (this.description == null)
1275        if (Configuration.errorOnAutoCreate())
1276          throw new Error("Attempt to auto-create Group.description");
1277        else if (Configuration.doAutoCreate())
1278          this.description = new MarkdownType(); // bb
1279      return this.description;
1280    }
1281
1282    public boolean hasDescriptionElement() { 
1283      return this.description != null && !this.description.isEmpty();
1284    }
1285
1286    public boolean hasDescription() { 
1287      return this.description != null && !this.description.isEmpty();
1288    }
1289
1290    /**
1291     * @param value {@link #description} (Explanation of what the group represents and how it is intended to be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1292     */
1293    public Group setDescriptionElement(MarkdownType value) { 
1294      this.description = value;
1295      return this;
1296    }
1297
1298    /**
1299     * @return Explanation of what the group represents and how it is intended to be used.
1300     */
1301    public String getDescription() { 
1302      return this.description == null ? null : this.description.getValue();
1303    }
1304
1305    /**
1306     * @param value Explanation of what the group represents and how it is intended to be used.
1307     */
1308    public Group setDescription(String value) { 
1309      if (value == null)
1310        this.description = null;
1311      else {
1312        if (this.description == null)
1313          this.description = new MarkdownType();
1314        this.description.setValue(value);
1315      }
1316      return this;
1317    }
1318
1319    /**
1320     * @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
1321     */
1322    public UnsignedIntType getQuantityElement() { 
1323      if (this.quantity == null)
1324        if (Configuration.errorOnAutoCreate())
1325          throw new Error("Attempt to auto-create Group.quantity");
1326        else if (Configuration.doAutoCreate())
1327          this.quantity = new UnsignedIntType(); // bb
1328      return this.quantity;
1329    }
1330
1331    public boolean hasQuantityElement() { 
1332      return this.quantity != null && !this.quantity.isEmpty();
1333    }
1334
1335    public boolean hasQuantity() { 
1336      return this.quantity != null && !this.quantity.isEmpty();
1337    }
1338
1339    /**
1340     * @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
1341     */
1342    public Group setQuantityElement(UnsignedIntType value) { 
1343      this.quantity = value;
1344      return this;
1345    }
1346
1347    /**
1348     * @return A count of the number of resource instances that are part of the group.
1349     */
1350    public int getQuantity() { 
1351      return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue();
1352    }
1353
1354    /**
1355     * @param value A count of the number of resource instances that are part of the group.
1356     */
1357    public Group setQuantity(int value) { 
1358        if (this.quantity == null)
1359          this.quantity = new UnsignedIntType();
1360        this.quantity.setValue(value);
1361      return this;
1362    }
1363
1364    /**
1365     * @return {@link #managingEntity} (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1366     */
1367    public Reference getManagingEntity() { 
1368      if (this.managingEntity == null)
1369        if (Configuration.errorOnAutoCreate())
1370          throw new Error("Attempt to auto-create Group.managingEntity");
1371        else if (Configuration.doAutoCreate())
1372          this.managingEntity = new Reference(); // cc
1373      return this.managingEntity;
1374    }
1375
1376    public boolean hasManagingEntity() { 
1377      return this.managingEntity != null && !this.managingEntity.isEmpty();
1378    }
1379
1380    /**
1381     * @param value {@link #managingEntity} (Entity responsible for defining and maintaining Group characteristics and/or registered members.)
1382     */
1383    public Group setManagingEntity(Reference value) { 
1384      this.managingEntity = value;
1385      return this;
1386    }
1387
1388    /**
1389     * @return {@link #characteristic} (Identifies traits whose presence r absence is shared by members of the group.)
1390     */
1391    public List<GroupCharacteristicComponent> getCharacteristic() { 
1392      if (this.characteristic == null)
1393        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1394      return this.characteristic;
1395    }
1396
1397    /**
1398     * @return Returns a reference to <code>this</code> for easy method chaining
1399     */
1400    public Group setCharacteristic(List<GroupCharacteristicComponent> theCharacteristic) { 
1401      this.characteristic = theCharacteristic;
1402      return this;
1403    }
1404
1405    public boolean hasCharacteristic() { 
1406      if (this.characteristic == null)
1407        return false;
1408      for (GroupCharacteristicComponent item : this.characteristic)
1409        if (!item.isEmpty())
1410          return true;
1411      return false;
1412    }
1413
1414    public GroupCharacteristicComponent addCharacteristic() { //3
1415      GroupCharacteristicComponent t = new GroupCharacteristicComponent();
1416      if (this.characteristic == null)
1417        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1418      this.characteristic.add(t);
1419      return t;
1420    }
1421
1422    public Group addCharacteristic(GroupCharacteristicComponent t) { //3
1423      if (t == null)
1424        return this;
1425      if (this.characteristic == null)
1426        this.characteristic = new ArrayList<GroupCharacteristicComponent>();
1427      this.characteristic.add(t);
1428      return this;
1429    }
1430
1431    /**
1432     * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist {3}
1433     */
1434    public GroupCharacteristicComponent getCharacteristicFirstRep() { 
1435      if (getCharacteristic().isEmpty()) {
1436        addCharacteristic();
1437      }
1438      return getCharacteristic().get(0);
1439    }
1440
1441    /**
1442     * @return {@link #member} (Identifies the resource instances that are members of the group.)
1443     */
1444    public List<GroupMemberComponent> getMember() { 
1445      if (this.member == null)
1446        this.member = new ArrayList<GroupMemberComponent>();
1447      return this.member;
1448    }
1449
1450    /**
1451     * @return Returns a reference to <code>this</code> for easy method chaining
1452     */
1453    public Group setMember(List<GroupMemberComponent> theMember) { 
1454      this.member = theMember;
1455      return this;
1456    }
1457
1458    public boolean hasMember() { 
1459      if (this.member == null)
1460        return false;
1461      for (GroupMemberComponent item : this.member)
1462        if (!item.isEmpty())
1463          return true;
1464      return false;
1465    }
1466
1467    public GroupMemberComponent addMember() { //3
1468      GroupMemberComponent t = new GroupMemberComponent();
1469      if (this.member == null)
1470        this.member = new ArrayList<GroupMemberComponent>();
1471      this.member.add(t);
1472      return t;
1473    }
1474
1475    public Group addMember(GroupMemberComponent t) { //3
1476      if (t == null)
1477        return this;
1478      if (this.member == null)
1479        this.member = new ArrayList<GroupMemberComponent>();
1480      this.member.add(t);
1481      return this;
1482    }
1483
1484    /**
1485     * @return The first repetition of repeating field {@link #member}, creating it if it does not already exist {3}
1486     */
1487    public GroupMemberComponent getMemberFirstRep() { 
1488      if (getMember().isEmpty()) {
1489        addMember();
1490      }
1491      return getMember().get(0);
1492    }
1493
1494      protected void listChildren(List<Property> children) {
1495        super.listChildren(children);
1496        children.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier));
1497        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));
1498        children.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, 1, type));
1499        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));
1500        children.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.", 0, 1, code));
1501        children.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, 1, name));
1502        children.add(new Property("description", "markdown", "Explanation of what the group represents and how it is intended to be used.", 0, 1, description));
1503        children.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, 1, quantity));
1504        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));
1505        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));
1506        children.add(new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member));
1507      }
1508
1509      @Override
1510      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1511        switch (_hash) {
1512        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier);
1513        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);
1514        case 3575610: /*type*/  return new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, 1, type);
1515        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);
1516        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);
1517        case 3373707: /*name*/  return new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, 1, name);
1518        case -1724546052: /*description*/  return new Property("description", "markdown", "Explanation of what the group represents and how it is intended to be used.", 0, 1, description);
1519        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);
1520        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);
1521        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);
1522        case -1077769574: /*member*/  return new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member);
1523        default: return super.getNamedProperty(_hash, _name, _checkValid);
1524        }
1525
1526      }
1527
1528      @Override
1529      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1530        switch (hash) {
1531        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1532        case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType
1533        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<GroupType>
1534        case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType
1535        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1536        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
1537        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
1538        case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // UnsignedIntType
1539        case -988474523: /*managingEntity*/ return this.managingEntity == null ? new Base[0] : new Base[] {this.managingEntity}; // Reference
1540        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // GroupCharacteristicComponent
1541        case -1077769574: /*member*/ return this.member == null ? new Base[0] : this.member.toArray(new Base[this.member.size()]); // GroupMemberComponent
1542        default: return super.getProperty(hash, name, checkValid);
1543        }
1544
1545      }
1546
1547      @Override
1548      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1549        switch (hash) {
1550        case -1618432855: // identifier
1551          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1552          return value;
1553        case -1422950650: // active
1554          this.active = TypeConvertor.castToBoolean(value); // BooleanType
1555          return value;
1556        case 3575610: // type
1557          value = new GroupTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1558          this.type = (Enumeration) value; // Enumeration<GroupType>
1559          return value;
1560        case -1422939762: // actual
1561          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1562          return value;
1563        case 3059181: // code
1564          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1565          return value;
1566        case 3373707: // name
1567          this.name = TypeConvertor.castToString(value); // StringType
1568          return value;
1569        case -1724546052: // description
1570          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1571          return value;
1572        case -1285004149: // quantity
1573          this.quantity = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1574          return value;
1575        case -988474523: // managingEntity
1576          this.managingEntity = TypeConvertor.castToReference(value); // Reference
1577          return value;
1578        case 366313883: // characteristic
1579          this.getCharacteristic().add((GroupCharacteristicComponent) value); // GroupCharacteristicComponent
1580          return value;
1581        case -1077769574: // member
1582          this.getMember().add((GroupMemberComponent) value); // GroupMemberComponent
1583          return value;
1584        default: return super.setProperty(hash, name, value);
1585        }
1586
1587      }
1588
1589      @Override
1590      public Base setProperty(String name, Base value) throws FHIRException {
1591        if (name.equals("identifier")) {
1592          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
1593        } else if (name.equals("active")) {
1594          this.active = TypeConvertor.castToBoolean(value); // BooleanType
1595        } else if (name.equals("type")) {
1596          value = new GroupTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1597          this.type = (Enumeration) value; // Enumeration<GroupType>
1598        } else if (name.equals("actual")) {
1599          this.actual = TypeConvertor.castToBoolean(value); // BooleanType
1600        } else if (name.equals("code")) {
1601          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1602        } else if (name.equals("name")) {
1603          this.name = TypeConvertor.castToString(value); // StringType
1604        } else if (name.equals("description")) {
1605          this.description = TypeConvertor.castToMarkdown(value); // MarkdownType
1606        } else if (name.equals("quantity")) {
1607          this.quantity = TypeConvertor.castToUnsignedInt(value); // UnsignedIntType
1608        } else if (name.equals("managingEntity")) {
1609          this.managingEntity = TypeConvertor.castToReference(value); // Reference
1610        } else if (name.equals("characteristic")) {
1611          this.getCharacteristic().add((GroupCharacteristicComponent) value);
1612        } else if (name.equals("member")) {
1613          this.getMember().add((GroupMemberComponent) value);
1614        } else
1615          return super.setProperty(name, value);
1616        return value;
1617      }
1618
1619      @Override
1620      public Base makeProperty(int hash, String name) throws FHIRException {
1621        switch (hash) {
1622        case -1618432855:  return addIdentifier(); 
1623        case -1422950650:  return getActiveElement();
1624        case 3575610:  return getTypeElement();
1625        case -1422939762:  return getActualElement();
1626        case 3059181:  return getCode();
1627        case 3373707:  return getNameElement();
1628        case -1724546052:  return getDescriptionElement();
1629        case -1285004149:  return getQuantityElement();
1630        case -988474523:  return getManagingEntity();
1631        case 366313883:  return addCharacteristic(); 
1632        case -1077769574:  return addMember(); 
1633        default: return super.makeProperty(hash, name);
1634        }
1635
1636      }
1637
1638      @Override
1639      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1640        switch (hash) {
1641        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1642        case -1422950650: /*active*/ return new String[] {"boolean"};
1643        case 3575610: /*type*/ return new String[] {"code"};
1644        case -1422939762: /*actual*/ return new String[] {"boolean"};
1645        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1646        case 3373707: /*name*/ return new String[] {"string"};
1647        case -1724546052: /*description*/ return new String[] {"markdown"};
1648        case -1285004149: /*quantity*/ return new String[] {"unsignedInt"};
1649        case -988474523: /*managingEntity*/ return new String[] {"Reference"};
1650        case 366313883: /*characteristic*/ return new String[] {};
1651        case -1077769574: /*member*/ return new String[] {};
1652        default: return super.getTypesForProperty(hash, name);
1653        }
1654
1655      }
1656
1657      @Override
1658      public Base addChild(String name) throws FHIRException {
1659        if (name.equals("identifier")) {
1660          return addIdentifier();
1661        }
1662        else if (name.equals("active")) {
1663          throw new FHIRException("Cannot call addChild on a primitive type Group.active");
1664        }
1665        else if (name.equals("type")) {
1666          throw new FHIRException("Cannot call addChild on a primitive type Group.type");
1667        }
1668        else if (name.equals("actual")) {
1669          throw new FHIRException("Cannot call addChild on a primitive type Group.actual");
1670        }
1671        else if (name.equals("code")) {
1672          this.code = new CodeableConcept();
1673          return this.code;
1674        }
1675        else if (name.equals("name")) {
1676          throw new FHIRException("Cannot call addChild on a primitive type Group.name");
1677        }
1678        else if (name.equals("description")) {
1679          throw new FHIRException("Cannot call addChild on a primitive type Group.description");
1680        }
1681        else if (name.equals("quantity")) {
1682          throw new FHIRException("Cannot call addChild on a primitive type Group.quantity");
1683        }
1684        else if (name.equals("managingEntity")) {
1685          this.managingEntity = new Reference();
1686          return this.managingEntity;
1687        }
1688        else if (name.equals("characteristic")) {
1689          return addCharacteristic();
1690        }
1691        else if (name.equals("member")) {
1692          return addMember();
1693        }
1694        else
1695          return super.addChild(name);
1696      }
1697
1698  public String fhirType() {
1699    return "Group";
1700
1701  }
1702
1703      public Group copy() {
1704        Group dst = new Group();
1705        copyValues(dst);
1706        return dst;
1707      }
1708
1709      public void copyValues(Group dst) {
1710        super.copyValues(dst);
1711        if (identifier != null) {
1712          dst.identifier = new ArrayList<Identifier>();
1713          for (Identifier i : identifier)
1714            dst.identifier.add(i.copy());
1715        };
1716        dst.active = active == null ? null : active.copy();
1717        dst.type = type == null ? null : type.copy();
1718        dst.actual = actual == null ? null : actual.copy();
1719        dst.code = code == null ? null : code.copy();
1720        dst.name = name == null ? null : name.copy();
1721        dst.description = description == null ? null : description.copy();
1722        dst.quantity = quantity == null ? null : quantity.copy();
1723        dst.managingEntity = managingEntity == null ? null : managingEntity.copy();
1724        if (characteristic != null) {
1725          dst.characteristic = new ArrayList<GroupCharacteristicComponent>();
1726          for (GroupCharacteristicComponent i : characteristic)
1727            dst.characteristic.add(i.copy());
1728        };
1729        if (member != null) {
1730          dst.member = new ArrayList<GroupMemberComponent>();
1731          for (GroupMemberComponent i : member)
1732            dst.member.add(i.copy());
1733        };
1734      }
1735
1736      protected Group typedCopy() {
1737        return copy();
1738      }
1739
1740      @Override
1741      public boolean equalsDeep(Base other_) {
1742        if (!super.equalsDeep(other_))
1743          return false;
1744        if (!(other_ instanceof Group))
1745          return false;
1746        Group o = (Group) other_;
1747        return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(type, o.type, true)
1748           && compareDeep(actual, o.actual, true) && compareDeep(code, o.code, true) && compareDeep(name, o.name, true)
1749           && compareDeep(description, o.description, true) && compareDeep(quantity, o.quantity, true) && compareDeep(managingEntity, o.managingEntity, true)
1750           && compareDeep(characteristic, o.characteristic, true) && compareDeep(member, o.member, true);
1751      }
1752
1753      @Override
1754      public boolean equalsShallow(Base other_) {
1755        if (!super.equalsShallow(other_))
1756          return false;
1757        if (!(other_ instanceof Group))
1758          return false;
1759        Group o = (Group) other_;
1760        return compareValues(active, o.active, true) && compareValues(type, o.type, true) && compareValues(actual, o.actual, true)
1761           && compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(quantity, o.quantity, true)
1762          ;
1763      }
1764
1765      public boolean isEmpty() {
1766        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, active, type
1767          , actual, code, name, description, quantity, managingEntity, characteristic, member
1768          );
1769      }
1770
1771  @Override
1772  public ResourceType getResourceType() {
1773    return ResourceType.Group;
1774   }
1775
1776 /**
1777   * Search parameter: <b>actual</b>
1778   * <p>
1779   * Description: <b>Descriptive or actual</b><br>
1780   * Type: <b>token</b><br>
1781   * Path: <b>Group.actual</b><br>
1782   * </p>
1783   */
1784  @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" )
1785  public static final String SP_ACTUAL = "actual";
1786 /**
1787   * <b>Fluent Client</b> search parameter constant for <b>actual</b>
1788   * <p>
1789   * Description: <b>Descriptive or actual</b><br>
1790   * Type: <b>token</b><br>
1791   * Path: <b>Group.actual</b><br>
1792   * </p>
1793   */
1794  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTUAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTUAL);
1795
1796 /**
1797   * Search parameter: <b>characteristic-value</b>
1798   * <p>
1799   * Description: <b>A composite of both characteristic and value</b><br>
1800   * Type: <b>composite</b><br>
1801   * Path: <b>Group.characteristic</b><br>
1802   * </p>
1803   */
1804  @SearchParamDefinition(name="characteristic-value", path="Group.characteristic", description="A composite of both characteristic and value", type="composite", compositeOf={"characteristic", "value"} )
1805  public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value";
1806 /**
1807   * <b>Fluent Client</b> search parameter constant for <b>characteristic-value</b>
1808   * <p>
1809   * Description: <b>A composite of both characteristic and value</b><br>
1810   * Type: <b>composite</b><br>
1811   * Path: <b>Group.characteristic</b><br>
1812   * </p>
1813   */
1814  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);
1815
1816 /**
1817   * Search parameter: <b>characteristic</b>
1818   * <p>
1819   * Description: <b>Kind of characteristic</b><br>
1820   * Type: <b>token</b><br>
1821   * Path: <b>Group.characteristic.code</b><br>
1822   * </p>
1823   */
1824  @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" )
1825  public static final String SP_CHARACTERISTIC = "characteristic";
1826 /**
1827   * <b>Fluent Client</b> search parameter constant for <b>characteristic</b>
1828   * <p>
1829   * Description: <b>Kind of characteristic</b><br>
1830   * Type: <b>token</b><br>
1831   * Path: <b>Group.characteristic.code</b><br>
1832   * </p>
1833   */
1834  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC);
1835
1836 /**
1837   * Search parameter: <b>code</b>
1838   * <p>
1839   * Description: <b>The kind of resources contained</b><br>
1840   * Type: <b>token</b><br>
1841   * Path: <b>Group.code</b><br>
1842   * </p>
1843   */
1844  @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" )
1845  public static final String SP_CODE = "code";
1846 /**
1847   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1848   * <p>
1849   * Description: <b>The kind of resources contained</b><br>
1850   * Type: <b>token</b><br>
1851   * Path: <b>Group.code</b><br>
1852   * </p>
1853   */
1854  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1855
1856 /**
1857   * Search parameter: <b>exclude</b>
1858   * <p>
1859   * Description: <b>Group includes or excludes</b><br>
1860   * Type: <b>token</b><br>
1861   * Path: <b>Group.characteristic.exclude</b><br>
1862   * </p>
1863   */
1864  @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" )
1865  public static final String SP_EXCLUDE = "exclude";
1866 /**
1867   * <b>Fluent Client</b> search parameter constant for <b>exclude</b>
1868   * <p>
1869   * Description: <b>Group includes or excludes</b><br>
1870   * Type: <b>token</b><br>
1871   * Path: <b>Group.characteristic.exclude</b><br>
1872   * </p>
1873   */
1874  public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXCLUDE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXCLUDE);
1875
1876 /**
1877   * Search parameter: <b>identifier</b>
1878   * <p>
1879   * Description: <b>Unique id</b><br>
1880   * Type: <b>token</b><br>
1881   * Path: <b>Group.identifier</b><br>
1882   * </p>
1883   */
1884  @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" )
1885  public static final String SP_IDENTIFIER = "identifier";
1886 /**
1887   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
1888   * <p>
1889   * Description: <b>Unique id</b><br>
1890   * Type: <b>token</b><br>
1891   * Path: <b>Group.identifier</b><br>
1892   * </p>
1893   */
1894  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
1895
1896 /**
1897   * Search parameter: <b>managing-entity</b>
1898   * <p>
1899   * Description: <b>Entity that is the custodian of the Group's definition</b><br>
1900   * Type: <b>reference</b><br>
1901   * Path: <b>Group.managingEntity</b><br>
1902   * </p>
1903   */
1904  @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 } )
1905  public static final String SP_MANAGING_ENTITY = "managing-entity";
1906 /**
1907   * <b>Fluent Client</b> search parameter constant for <b>managing-entity</b>
1908   * <p>
1909   * Description: <b>Entity that is the custodian of the Group's definition</b><br>
1910   * Type: <b>reference</b><br>
1911   * Path: <b>Group.managingEntity</b><br>
1912   * </p>
1913   */
1914  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANAGING_ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANAGING_ENTITY);
1915
1916/**
1917   * Constant for fluent queries to be used to add include statements. Specifies
1918   * the path value of "<b>Group:managing-entity</b>".
1919   */
1920  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANAGING_ENTITY = new ca.uhn.fhir.model.api.Include("Group:managing-entity").toLocked();
1921
1922 /**
1923   * Search parameter: <b>member</b>
1924   * <p>
1925   * Description: <b>Reference to the group member</b><br>
1926   * Type: <b>reference</b><br>
1927   * Path: <b>Group.member.entity</b><br>
1928   * </p>
1929   */
1930  @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, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class, Specimen.class } )
1931  public static final String SP_MEMBER = "member";
1932 /**
1933   * <b>Fluent Client</b> search parameter constant for <b>member</b>
1934   * <p>
1935   * Description: <b>Reference to the group member</b><br>
1936   * Type: <b>reference</b><br>
1937   * Path: <b>Group.member.entity</b><br>
1938   * </p>
1939   */
1940  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEMBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEMBER);
1941
1942/**
1943   * Constant for fluent queries to be used to add include statements. Specifies
1944   * the path value of "<b>Group:member</b>".
1945   */
1946  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEMBER = new ca.uhn.fhir.model.api.Include("Group:member").toLocked();
1947
1948 /**
1949   * Search parameter: <b>type</b>
1950   * <p>
1951   * Description: <b>The type of resources the group contains</b><br>
1952   * Type: <b>token</b><br>
1953   * Path: <b>Group.type</b><br>
1954   * </p>
1955   */
1956  @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" )
1957  public static final String SP_TYPE = "type";
1958 /**
1959   * <b>Fluent Client</b> search parameter constant for <b>type</b>
1960   * <p>
1961   * Description: <b>The type of resources the group contains</b><br>
1962   * Type: <b>token</b><br>
1963   * Path: <b>Group.type</b><br>
1964   * </p>
1965   */
1966  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
1967
1968 /**
1969   * Search parameter: <b>value</b>
1970   * <p>
1971   * Description: <b>Value held by characteristic</b><br>
1972   * Type: <b>token</b><br>
1973   * Path: <b>(Group.characteristic.value as CodeableConcept) | (Group.characteristic.value as boolean)</b><br>
1974   * </p>
1975   */
1976  @SearchParamDefinition(name="value", path="(Group.characteristic.value as CodeableConcept) | (Group.characteristic.value as boolean)", description="Value held by characteristic", type="token" )
1977  public static final String SP_VALUE = "value";
1978 /**
1979   * <b>Fluent Client</b> search parameter constant for <b>value</b>
1980   * <p>
1981   * Description: <b>Value held by characteristic</b><br>
1982   * Type: <b>token</b><br>
1983   * Path: <b>(Group.characteristic.value as CodeableConcept) | (Group.characteristic.value as boolean)</b><br>
1984   * </p>
1985   */
1986  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE);
1987
1988
1989}
1990