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 Sat, Nov 5, 2022 10:47+1100 for FHIR v5.0.0-ballot
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 * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.
052 */
053@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance")
054public class AllergyIntolerance extends DomainResource {
055
056    public enum AllergyIntoleranceCategory {
057        /**
058         * Any substance consumed to provide nutritional support for the body.
059         */
060        FOOD, 
061        /**
062         * Substances administered to achieve a physiological effect.
063         */
064        MEDICATION, 
065        /**
066         * Any substances that are encountered in the environment, including any substance not already classified as food, medication, or biologic.
067         */
068        ENVIRONMENT, 
069        /**
070         * A preparation that is synthesized from living organisms or their products, especially a human or animal protein, such as a hormone or antitoxin, that is used as a diagnostic, preventive, or therapeutic agent. Examples of biologic medications include: vaccines; allergenic extracts, which are used for both diagnosis and treatment (for example, allergy shots); gene therapies; cellular therapies.  There are other biologic products, such as tissues, which are not typically associated with allergies.
071         */
072        BIOLOGIC, 
073        /**
074         * added to help the parsers with the generic types
075         */
076        NULL;
077        public static AllergyIntoleranceCategory fromCode(String codeString) throws FHIRException {
078            if (codeString == null || "".equals(codeString))
079                return null;
080        if ("food".equals(codeString))
081          return FOOD;
082        if ("medication".equals(codeString))
083          return MEDICATION;
084        if ("environment".equals(codeString))
085          return ENVIRONMENT;
086        if ("biologic".equals(codeString))
087          return BIOLOGIC;
088        if (Configuration.isAcceptInvalidEnums())
089          return null;
090        else
091          throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
092        }
093        public String toCode() {
094          switch (this) {
095            case FOOD: return "food";
096            case MEDICATION: return "medication";
097            case ENVIRONMENT: return "environment";
098            case BIOLOGIC: return "biologic";
099            case NULL: return null;
100            default: return "?";
101          }
102        }
103        public String getSystem() {
104          switch (this) {
105            case FOOD: return "http://hl7.org/fhir/allergy-intolerance-category";
106            case MEDICATION: return "http://hl7.org/fhir/allergy-intolerance-category";
107            case ENVIRONMENT: return "http://hl7.org/fhir/allergy-intolerance-category";
108            case BIOLOGIC: return "http://hl7.org/fhir/allergy-intolerance-category";
109            case NULL: return null;
110            default: return "?";
111          }
112        }
113        public String getDefinition() {
114          switch (this) {
115            case FOOD: return "Any substance consumed to provide nutritional support for the body.";
116            case MEDICATION: return "Substances administered to achieve a physiological effect.";
117            case ENVIRONMENT: return "Any substances that are encountered in the environment, including any substance not already classified as food, medication, or biologic.";
118            case BIOLOGIC: return "A preparation that is synthesized from living organisms or their products, especially a human or animal protein, such as a hormone or antitoxin, that is used as a diagnostic, preventive, or therapeutic agent. Examples of biologic medications include: vaccines; allergenic extracts, which are used for both diagnosis and treatment (for example, allergy shots); gene therapies; cellular therapies.  There are other biologic products, such as tissues, which are not typically associated with allergies.";
119            case NULL: return null;
120            default: return "?";
121          }
122        }
123        public String getDisplay() {
124          switch (this) {
125            case FOOD: return "Food";
126            case MEDICATION: return "Medication";
127            case ENVIRONMENT: return "Environment";
128            case BIOLOGIC: return "Biologic";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133    }
134
135  public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory<AllergyIntoleranceCategory> {
136    public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException {
137      if (codeString == null || "".equals(codeString))
138            if (codeString == null || "".equals(codeString))
139                return null;
140        if ("food".equals(codeString))
141          return AllergyIntoleranceCategory.FOOD;
142        if ("medication".equals(codeString))
143          return AllergyIntoleranceCategory.MEDICATION;
144        if ("environment".equals(codeString))
145          return AllergyIntoleranceCategory.ENVIRONMENT;
146        if ("biologic".equals(codeString))
147          return AllergyIntoleranceCategory.BIOLOGIC;
148        throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
149        }
150        public Enumeration<AllergyIntoleranceCategory> fromType(Base code) throws FHIRException {
151          if (code == null)
152            return null;
153          if (code.isEmpty())
154            return new Enumeration<AllergyIntoleranceCategory>(this);
155          String codeString = ((PrimitiveType) code).asStringValue();
156          if (codeString == null || "".equals(codeString))
157            return null;
158        if ("food".equals(codeString))
159          return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.FOOD);
160        if ("medication".equals(codeString))
161          return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.MEDICATION);
162        if ("environment".equals(codeString))
163          return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.ENVIRONMENT);
164        if ("biologic".equals(codeString))
165          return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.BIOLOGIC);
166        throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
167        }
168    public String toCode(AllergyIntoleranceCategory code) {
169      if (code == AllergyIntoleranceCategory.FOOD)
170        return "food";
171      if (code == AllergyIntoleranceCategory.MEDICATION)
172        return "medication";
173      if (code == AllergyIntoleranceCategory.ENVIRONMENT)
174        return "environment";
175      if (code == AllergyIntoleranceCategory.BIOLOGIC)
176        return "biologic";
177      return "?";
178      }
179    public String toSystem(AllergyIntoleranceCategory code) {
180      return code.getSystem();
181      }
182    }
183
184    public enum AllergyIntoleranceCriticality {
185        /**
186         * Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure.
187         */
188        LOW, 
189        /**
190         * Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure.
191         */
192        HIGH, 
193        /**
194         * Unable to assess the worst case result of a future exposure.
195         */
196        UNABLETOASSESS, 
197        /**
198         * added to help the parsers with the generic types
199         */
200        NULL;
201        public static AllergyIntoleranceCriticality fromCode(String codeString) throws FHIRException {
202            if (codeString == null || "".equals(codeString))
203                return null;
204        if ("low".equals(codeString))
205          return LOW;
206        if ("high".equals(codeString))
207          return HIGH;
208        if ("unable-to-assess".equals(codeString))
209          return UNABLETOASSESS;
210        if (Configuration.isAcceptInvalidEnums())
211          return null;
212        else
213          throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
214        }
215        public String toCode() {
216          switch (this) {
217            case LOW: return "low";
218            case HIGH: return "high";
219            case UNABLETOASSESS: return "unable-to-assess";
220            case NULL: return null;
221            default: return "?";
222          }
223        }
224        public String getSystem() {
225          switch (this) {
226            case LOW: return "http://hl7.org/fhir/allergy-intolerance-criticality";
227            case HIGH: return "http://hl7.org/fhir/allergy-intolerance-criticality";
228            case UNABLETOASSESS: return "http://hl7.org/fhir/allergy-intolerance-criticality";
229            case NULL: return null;
230            default: return "?";
231          }
232        }
233        public String getDefinition() {
234          switch (this) {
235            case LOW: return "Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure.";
236            case HIGH: return "Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure.";
237            case UNABLETOASSESS: return "Unable to assess the worst case result of a future exposure.";
238            case NULL: return null;
239            default: return "?";
240          }
241        }
242        public String getDisplay() {
243          switch (this) {
244            case LOW: return "Low Risk";
245            case HIGH: return "High Risk";
246            case UNABLETOASSESS: return "Unable to Assess Risk";
247            case NULL: return null;
248            default: return "?";
249          }
250        }
251    }
252
253  public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory<AllergyIntoleranceCriticality> {
254    public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException {
255      if (codeString == null || "".equals(codeString))
256            if (codeString == null || "".equals(codeString))
257                return null;
258        if ("low".equals(codeString))
259          return AllergyIntoleranceCriticality.LOW;
260        if ("high".equals(codeString))
261          return AllergyIntoleranceCriticality.HIGH;
262        if ("unable-to-assess".equals(codeString))
263          return AllergyIntoleranceCriticality.UNABLETOASSESS;
264        throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
265        }
266        public Enumeration<AllergyIntoleranceCriticality> fromType(Base code) throws FHIRException {
267          if (code == null)
268            return null;
269          if (code.isEmpty())
270            return new Enumeration<AllergyIntoleranceCriticality>(this);
271          String codeString = ((PrimitiveType) code).asStringValue();
272          if (codeString == null || "".equals(codeString))
273            return null;
274        if ("low".equals(codeString))
275          return new Enumeration<AllergyIntoleranceCriticality>(this, AllergyIntoleranceCriticality.LOW);
276        if ("high".equals(codeString))
277          return new Enumeration<AllergyIntoleranceCriticality>(this, AllergyIntoleranceCriticality.HIGH);
278        if ("unable-to-assess".equals(codeString))
279          return new Enumeration<AllergyIntoleranceCriticality>(this, AllergyIntoleranceCriticality.UNABLETOASSESS);
280        throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'");
281        }
282    public String toCode(AllergyIntoleranceCriticality code) {
283      if (code == AllergyIntoleranceCriticality.LOW)
284        return "low";
285      if (code == AllergyIntoleranceCriticality.HIGH)
286        return "high";
287      if (code == AllergyIntoleranceCriticality.UNABLETOASSESS)
288        return "unable-to-assess";
289      return "?";
290      }
291    public String toSystem(AllergyIntoleranceCriticality code) {
292      return code.getSystem();
293      }
294    }
295
296    public enum AllergyIntoleranceSeverity {
297        /**
298         * Causes mild physiological effects.
299         */
300        MILD, 
301        /**
302         * Causes moderate physiological effects.
303         */
304        MODERATE, 
305        /**
306         * Causes severe physiological effects.
307         */
308        SEVERE, 
309        /**
310         * added to help the parsers with the generic types
311         */
312        NULL;
313        public static AllergyIntoleranceSeverity fromCode(String codeString) throws FHIRException {
314            if (codeString == null || "".equals(codeString))
315                return null;
316        if ("mild".equals(codeString))
317          return MILD;
318        if ("moderate".equals(codeString))
319          return MODERATE;
320        if ("severe".equals(codeString))
321          return SEVERE;
322        if (Configuration.isAcceptInvalidEnums())
323          return null;
324        else
325          throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'");
326        }
327        public String toCode() {
328          switch (this) {
329            case MILD: return "mild";
330            case MODERATE: return "moderate";
331            case SEVERE: return "severe";
332            case NULL: return null;
333            default: return "?";
334          }
335        }
336        public String getSystem() {
337          switch (this) {
338            case MILD: return "http://hl7.org/fhir/reaction-event-severity";
339            case MODERATE: return "http://hl7.org/fhir/reaction-event-severity";
340            case SEVERE: return "http://hl7.org/fhir/reaction-event-severity";
341            case NULL: return null;
342            default: return "?";
343          }
344        }
345        public String getDefinition() {
346          switch (this) {
347            case MILD: return "Causes mild physiological effects.";
348            case MODERATE: return "Causes moderate physiological effects.";
349            case SEVERE: return "Causes severe physiological effects.";
350            case NULL: return null;
351            default: return "?";
352          }
353        }
354        public String getDisplay() {
355          switch (this) {
356            case MILD: return "Mild";
357            case MODERATE: return "Moderate";
358            case SEVERE: return "Severe";
359            case NULL: return null;
360            default: return "?";
361          }
362        }
363    }
364
365  public static class AllergyIntoleranceSeverityEnumFactory implements EnumFactory<AllergyIntoleranceSeverity> {
366    public AllergyIntoleranceSeverity fromCode(String codeString) throws IllegalArgumentException {
367      if (codeString == null || "".equals(codeString))
368            if (codeString == null || "".equals(codeString))
369                return null;
370        if ("mild".equals(codeString))
371          return AllergyIntoleranceSeverity.MILD;
372        if ("moderate".equals(codeString))
373          return AllergyIntoleranceSeverity.MODERATE;
374        if ("severe".equals(codeString))
375          return AllergyIntoleranceSeverity.SEVERE;
376        throw new IllegalArgumentException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'");
377        }
378        public Enumeration<AllergyIntoleranceSeverity> fromType(Base code) throws FHIRException {
379          if (code == null)
380            return null;
381          if (code.isEmpty())
382            return new Enumeration<AllergyIntoleranceSeverity>(this);
383          String codeString = ((PrimitiveType) code).asStringValue();
384          if (codeString == null || "".equals(codeString))
385            return null;
386        if ("mild".equals(codeString))
387          return new Enumeration<AllergyIntoleranceSeverity>(this, AllergyIntoleranceSeverity.MILD);
388        if ("moderate".equals(codeString))
389          return new Enumeration<AllergyIntoleranceSeverity>(this, AllergyIntoleranceSeverity.MODERATE);
390        if ("severe".equals(codeString))
391          return new Enumeration<AllergyIntoleranceSeverity>(this, AllergyIntoleranceSeverity.SEVERE);
392        throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'");
393        }
394    public String toCode(AllergyIntoleranceSeverity code) {
395      if (code == AllergyIntoleranceSeverity.MILD)
396        return "mild";
397      if (code == AllergyIntoleranceSeverity.MODERATE)
398        return "moderate";
399      if (code == AllergyIntoleranceSeverity.SEVERE)
400        return "severe";
401      return "?";
402      }
403    public String toSystem(AllergyIntoleranceSeverity code) {
404      return code.getSystem();
405      }
406    }
407
408    public enum AllergyIntoleranceType {
409        /**
410         * A propensity for hypersensitive reaction(s) to a substance.  These reactions are most typically type I hypersensitivity, plus other \"allergy-like\" reactions, including pseudoallergy.
411         */
412        ALLERGY, 
413        /**
414         * A propensity for adverse reactions to a substance that is judged to be not allergic or \"allergy-like\".  These reactions are typically (but not necessarily) non-immune.  They are to some degree idiosyncratic and/or patient-specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances).
415         */
416        INTOLERANCE, 
417        /**
418         * added to help the parsers with the generic types
419         */
420        NULL;
421        public static AllergyIntoleranceType fromCode(String codeString) throws FHIRException {
422            if (codeString == null || "".equals(codeString))
423                return null;
424        if ("allergy".equals(codeString))
425          return ALLERGY;
426        if ("intolerance".equals(codeString))
427          return INTOLERANCE;
428        if (Configuration.isAcceptInvalidEnums())
429          return null;
430        else
431          throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'");
432        }
433        public String toCode() {
434          switch (this) {
435            case ALLERGY: return "allergy";
436            case INTOLERANCE: return "intolerance";
437            case NULL: return null;
438            default: return "?";
439          }
440        }
441        public String getSystem() {
442          switch (this) {
443            case ALLERGY: return "http://hl7.org/fhir/allergy-intolerance-type";
444            case INTOLERANCE: return "http://hl7.org/fhir/allergy-intolerance-type";
445            case NULL: return null;
446            default: return "?";
447          }
448        }
449        public String getDefinition() {
450          switch (this) {
451            case ALLERGY: return "A propensity for hypersensitive reaction(s) to a substance.  These reactions are most typically type I hypersensitivity, plus other \"allergy-like\" reactions, including pseudoallergy.";
452            case INTOLERANCE: return "A propensity for adverse reactions to a substance that is judged to be not allergic or \"allergy-like\".  These reactions are typically (but not necessarily) non-immune.  They are to some degree idiosyncratic and/or patient-specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances).";
453            case NULL: return null;
454            default: return "?";
455          }
456        }
457        public String getDisplay() {
458          switch (this) {
459            case ALLERGY: return "Allergy";
460            case INTOLERANCE: return "Intolerance";
461            case NULL: return null;
462            default: return "?";
463          }
464        }
465    }
466
467  public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory<AllergyIntoleranceType> {
468    public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException {
469      if (codeString == null || "".equals(codeString))
470            if (codeString == null || "".equals(codeString))
471                return null;
472        if ("allergy".equals(codeString))
473          return AllergyIntoleranceType.ALLERGY;
474        if ("intolerance".equals(codeString))
475          return AllergyIntoleranceType.INTOLERANCE;
476        throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'");
477        }
478        public Enumeration<AllergyIntoleranceType> fromType(Base code) throws FHIRException {
479          if (code == null)
480            return null;
481          if (code.isEmpty())
482            return new Enumeration<AllergyIntoleranceType>(this);
483          String codeString = ((PrimitiveType) code).asStringValue();
484          if (codeString == null || "".equals(codeString))
485            return null;
486        if ("allergy".equals(codeString))
487          return new Enumeration<AllergyIntoleranceType>(this, AllergyIntoleranceType.ALLERGY);
488        if ("intolerance".equals(codeString))
489          return new Enumeration<AllergyIntoleranceType>(this, AllergyIntoleranceType.INTOLERANCE);
490        throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'");
491        }
492    public String toCode(AllergyIntoleranceType code) {
493      if (code == AllergyIntoleranceType.ALLERGY)
494        return "allergy";
495      if (code == AllergyIntoleranceType.INTOLERANCE)
496        return "intolerance";
497      return "?";
498      }
499    public String toSystem(AllergyIntoleranceType code) {
500      return code.getSystem();
501      }
502    }
503
504    @Block()
505    public static class AllergyIntoleranceParticipantComponent extends BackboneElement implements IBaseBackboneElement {
506        /**
507         * Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance.
508         */
509        @Child(name = "function", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
510        @Description(shortDefinition="Type of involvement", formalDefinition="Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance." )
511        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participation-role-type")
512        protected CodeableConcept function;
513
514        /**
515         * Indicates who or what participated in the activities related to the allergy or intolerance.
516         */
517        @Child(name = "actor", type = {Practitioner.class, PractitionerRole.class, Patient.class, RelatedPerson.class, Device.class, Organization.class, CareTeam.class}, order=2, min=1, max=1, modifier=false, summary=true)
518        @Description(shortDefinition="Who or what participated in the activities related to the allergy or intolerance", formalDefinition="Indicates who or what participated in the activities related to the allergy or intolerance." )
519        protected Reference actor;
520
521        private static final long serialVersionUID = -576943815L;
522
523    /**
524     * Constructor
525     */
526      public AllergyIntoleranceParticipantComponent() {
527        super();
528      }
529
530    /**
531     * Constructor
532     */
533      public AllergyIntoleranceParticipantComponent(Reference actor) {
534        super();
535        this.setActor(actor);
536      }
537
538        /**
539         * @return {@link #function} (Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance.)
540         */
541        public CodeableConcept getFunction() { 
542          if (this.function == null)
543            if (Configuration.errorOnAutoCreate())
544              throw new Error("Attempt to auto-create AllergyIntoleranceParticipantComponent.function");
545            else if (Configuration.doAutoCreate())
546              this.function = new CodeableConcept(); // cc
547          return this.function;
548        }
549
550        public boolean hasFunction() { 
551          return this.function != null && !this.function.isEmpty();
552        }
553
554        /**
555         * @param value {@link #function} (Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance.)
556         */
557        public AllergyIntoleranceParticipantComponent setFunction(CodeableConcept value) { 
558          this.function = value;
559          return this;
560        }
561
562        /**
563         * @return {@link #actor} (Indicates who or what participated in the activities related to the allergy or intolerance.)
564         */
565        public Reference getActor() { 
566          if (this.actor == null)
567            if (Configuration.errorOnAutoCreate())
568              throw new Error("Attempt to auto-create AllergyIntoleranceParticipantComponent.actor");
569            else if (Configuration.doAutoCreate())
570              this.actor = new Reference(); // cc
571          return this.actor;
572        }
573
574        public boolean hasActor() { 
575          return this.actor != null && !this.actor.isEmpty();
576        }
577
578        /**
579         * @param value {@link #actor} (Indicates who or what participated in the activities related to the allergy or intolerance.)
580         */
581        public AllergyIntoleranceParticipantComponent setActor(Reference value) { 
582          this.actor = value;
583          return this;
584        }
585
586        protected void listChildren(List<Property> children) {
587          super.listChildren(children);
588          children.add(new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance.", 0, 1, function));
589          children.add(new Property("actor", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson|Device|Organization|CareTeam)", "Indicates who or what participated in the activities related to the allergy or intolerance.", 0, 1, actor));
590        }
591
592        @Override
593        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
594          switch (_hash) {
595          case 1380938712: /*function*/  return new Property("function", "CodeableConcept", "Distinguishes the type of involvement of the actor in the activities related to the allergy or intolerance.", 0, 1, function);
596          case 92645877: /*actor*/  return new Property("actor", "Reference(Practitioner|PractitionerRole|Patient|RelatedPerson|Device|Organization|CareTeam)", "Indicates who or what participated in the activities related to the allergy or intolerance.", 0, 1, actor);
597          default: return super.getNamedProperty(_hash, _name, _checkValid);
598          }
599
600        }
601
602      @Override
603      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
604        switch (hash) {
605        case 1380938712: /*function*/ return this.function == null ? new Base[0] : new Base[] {this.function}; // CodeableConcept
606        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
607        default: return super.getProperty(hash, name, checkValid);
608        }
609
610      }
611
612      @Override
613      public Base setProperty(int hash, String name, Base value) throws FHIRException {
614        switch (hash) {
615        case 1380938712: // function
616          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
617          return value;
618        case 92645877: // actor
619          this.actor = TypeConvertor.castToReference(value); // Reference
620          return value;
621        default: return super.setProperty(hash, name, value);
622        }
623
624      }
625
626      @Override
627      public Base setProperty(String name, Base value) throws FHIRException {
628        if (name.equals("function")) {
629          this.function = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
630        } else if (name.equals("actor")) {
631          this.actor = TypeConvertor.castToReference(value); // Reference
632        } else
633          return super.setProperty(name, value);
634        return value;
635      }
636
637      @Override
638      public Base makeProperty(int hash, String name) throws FHIRException {
639        switch (hash) {
640        case 1380938712:  return getFunction();
641        case 92645877:  return getActor();
642        default: return super.makeProperty(hash, name);
643        }
644
645      }
646
647      @Override
648      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
649        switch (hash) {
650        case 1380938712: /*function*/ return new String[] {"CodeableConcept"};
651        case 92645877: /*actor*/ return new String[] {"Reference"};
652        default: return super.getTypesForProperty(hash, name);
653        }
654
655      }
656
657      @Override
658      public Base addChild(String name) throws FHIRException {
659        if (name.equals("function")) {
660          this.function = new CodeableConcept();
661          return this.function;
662        }
663        else if (name.equals("actor")) {
664          this.actor = new Reference();
665          return this.actor;
666        }
667        else
668          return super.addChild(name);
669      }
670
671      public AllergyIntoleranceParticipantComponent copy() {
672        AllergyIntoleranceParticipantComponent dst = new AllergyIntoleranceParticipantComponent();
673        copyValues(dst);
674        return dst;
675      }
676
677      public void copyValues(AllergyIntoleranceParticipantComponent dst) {
678        super.copyValues(dst);
679        dst.function = function == null ? null : function.copy();
680        dst.actor = actor == null ? null : actor.copy();
681      }
682
683      @Override
684      public boolean equalsDeep(Base other_) {
685        if (!super.equalsDeep(other_))
686          return false;
687        if (!(other_ instanceof AllergyIntoleranceParticipantComponent))
688          return false;
689        AllergyIntoleranceParticipantComponent o = (AllergyIntoleranceParticipantComponent) other_;
690        return compareDeep(function, o.function, true) && compareDeep(actor, o.actor, true);
691      }
692
693      @Override
694      public boolean equalsShallow(Base other_) {
695        if (!super.equalsShallow(other_))
696          return false;
697        if (!(other_ instanceof AllergyIntoleranceParticipantComponent))
698          return false;
699        AllergyIntoleranceParticipantComponent o = (AllergyIntoleranceParticipantComponent) other_;
700        return true;
701      }
702
703      public boolean isEmpty() {
704        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(function, actor);
705      }
706
707  public String fhirType() {
708    return "AllergyIntolerance.participant";
709
710  }
711
712  }
713
714    @Block()
715    public static class AllergyIntoleranceReactionComponent extends BackboneElement implements IBaseBackboneElement {
716        /**
717         * Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.
718         */
719        @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
720        @Description(shortDefinition="Specific substance or pharmaceutical product considered to be responsible for event", formalDefinition="Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance." )
721        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/substance-code")
722        protected CodeableConcept substance;
723
724        /**
725         * Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.
726         */
727        @Child(name = "manifestation", type = {CodeableReference.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
728        @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the adverse reaction event." )
729        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
730        protected List<CodeableReference> manifestation;
731
732        /**
733         * Text description about the reaction as a whole, including details of the manifestation if required.
734         */
735        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
736        @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the reaction as a whole, including details of the manifestation if required." )
737        protected StringType description;
738
739        /**
740         * Record of the date and/or time of the onset of the Reaction.
741         */
742        @Child(name = "onset", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=false)
743        @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." )
744        protected DateTimeType onset;
745
746        /**
747         * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.
748         */
749        @Child(name = "severity", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
750        @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." )
751        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/reaction-event-severity")
752        protected Enumeration<AllergyIntoleranceSeverity> severity;
753
754        /**
755         * Identification of the route by which the subject was exposed to the substance.
756         */
757        @Child(name = "exposureRoute", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
758        @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." )
759        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/route-codes")
760        protected CodeableConcept exposureRoute;
761
762        /**
763         * Additional text about the adverse reaction event not captured in other fields.
764         */
765        @Child(name = "note", type = {Annotation.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
766        @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the adverse reaction event not captured in other fields." )
767        protected List<Annotation> note;
768
769        private static final long serialVersionUID = 1007789961L;
770
771    /**
772     * Constructor
773     */
774      public AllergyIntoleranceReactionComponent() {
775        super();
776      }
777
778    /**
779     * Constructor
780     */
781      public AllergyIntoleranceReactionComponent(CodeableReference manifestation) {
782        super();
783        this.addManifestation(manifestation);
784      }
785
786        /**
787         * @return {@link #substance} (Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.)
788         */
789        public CodeableConcept getSubstance() { 
790          if (this.substance == null)
791            if (Configuration.errorOnAutoCreate())
792              throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.substance");
793            else if (Configuration.doAutoCreate())
794              this.substance = new CodeableConcept(); // cc
795          return this.substance;
796        }
797
798        public boolean hasSubstance() { 
799          return this.substance != null && !this.substance.isEmpty();
800        }
801
802        /**
803         * @param value {@link #substance} (Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.)
804         */
805        public AllergyIntoleranceReactionComponent setSubstance(CodeableConcept value) { 
806          this.substance = value;
807          return this;
808        }
809
810        /**
811         * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.)
812         */
813        public List<CodeableReference> getManifestation() { 
814          if (this.manifestation == null)
815            this.manifestation = new ArrayList<CodeableReference>();
816          return this.manifestation;
817        }
818
819        /**
820         * @return Returns a reference to <code>this</code> for easy method chaining
821         */
822        public AllergyIntoleranceReactionComponent setManifestation(List<CodeableReference> theManifestation) { 
823          this.manifestation = theManifestation;
824          return this;
825        }
826
827        public boolean hasManifestation() { 
828          if (this.manifestation == null)
829            return false;
830          for (CodeableReference item : this.manifestation)
831            if (!item.isEmpty())
832              return true;
833          return false;
834        }
835
836        public CodeableReference addManifestation() { //3
837          CodeableReference t = new CodeableReference();
838          if (this.manifestation == null)
839            this.manifestation = new ArrayList<CodeableReference>();
840          this.manifestation.add(t);
841          return t;
842        }
843
844        public AllergyIntoleranceReactionComponent addManifestation(CodeableReference t) { //3
845          if (t == null)
846            return this;
847          if (this.manifestation == null)
848            this.manifestation = new ArrayList<CodeableReference>();
849          this.manifestation.add(t);
850          return this;
851        }
852
853        /**
854         * @return The first repetition of repeating field {@link #manifestation}, creating it if it does not already exist {3}
855         */
856        public CodeableReference getManifestationFirstRep() { 
857          if (getManifestation().isEmpty()) {
858            addManifestation();
859          }
860          return getManifestation().get(0);
861        }
862
863        /**
864         * @return {@link #description} (Text description about the reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
865         */
866        public StringType getDescriptionElement() { 
867          if (this.description == null)
868            if (Configuration.errorOnAutoCreate())
869              throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.description");
870            else if (Configuration.doAutoCreate())
871              this.description = new StringType(); // bb
872          return this.description;
873        }
874
875        public boolean hasDescriptionElement() { 
876          return this.description != null && !this.description.isEmpty();
877        }
878
879        public boolean hasDescription() { 
880          return this.description != null && !this.description.isEmpty();
881        }
882
883        /**
884         * @param value {@link #description} (Text description about the reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
885         */
886        public AllergyIntoleranceReactionComponent setDescriptionElement(StringType value) { 
887          this.description = value;
888          return this;
889        }
890
891        /**
892         * @return Text description about the reaction as a whole, including details of the manifestation if required.
893         */
894        public String getDescription() { 
895          return this.description == null ? null : this.description.getValue();
896        }
897
898        /**
899         * @param value Text description about the reaction as a whole, including details of the manifestation if required.
900         */
901        public AllergyIntoleranceReactionComponent setDescription(String value) { 
902          if (Utilities.noString(value))
903            this.description = null;
904          else {
905            if (this.description == null)
906              this.description = new StringType();
907            this.description.setValue(value);
908          }
909          return this;
910        }
911
912        /**
913         * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value
914         */
915        public DateTimeType getOnsetElement() { 
916          if (this.onset == null)
917            if (Configuration.errorOnAutoCreate())
918              throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.onset");
919            else if (Configuration.doAutoCreate())
920              this.onset = new DateTimeType(); // bb
921          return this.onset;
922        }
923
924        public boolean hasOnsetElement() { 
925          return this.onset != null && !this.onset.isEmpty();
926        }
927
928        public boolean hasOnset() { 
929          return this.onset != null && !this.onset.isEmpty();
930        }
931
932        /**
933         * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value
934         */
935        public AllergyIntoleranceReactionComponent setOnsetElement(DateTimeType value) { 
936          this.onset = value;
937          return this;
938        }
939
940        /**
941         * @return Record of the date and/or time of the onset of the Reaction.
942         */
943        public Date getOnset() { 
944          return this.onset == null ? null : this.onset.getValue();
945        }
946
947        /**
948         * @param value Record of the date and/or time of the onset of the Reaction.
949         */
950        public AllergyIntoleranceReactionComponent setOnset(Date value) { 
951          if (value == null)
952            this.onset = null;
953          else {
954            if (this.onset == null)
955              this.onset = new DateTimeType();
956            this.onset.setValue(value);
957          }
958          return this;
959        }
960
961        /**
962         * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value
963         */
964        public Enumeration<AllergyIntoleranceSeverity> getSeverityElement() { 
965          if (this.severity == null)
966            if (Configuration.errorOnAutoCreate())
967              throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.severity");
968            else if (Configuration.doAutoCreate())
969              this.severity = new Enumeration<AllergyIntoleranceSeverity>(new AllergyIntoleranceSeverityEnumFactory()); // bb
970          return this.severity;
971        }
972
973        public boolean hasSeverityElement() { 
974          return this.severity != null && !this.severity.isEmpty();
975        }
976
977        public boolean hasSeverity() { 
978          return this.severity != null && !this.severity.isEmpty();
979        }
980
981        /**
982         * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value
983         */
984        public AllergyIntoleranceReactionComponent setSeverityElement(Enumeration<AllergyIntoleranceSeverity> value) { 
985          this.severity = value;
986          return this;
987        }
988
989        /**
990         * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.
991         */
992        public AllergyIntoleranceSeverity getSeverity() { 
993          return this.severity == null ? null : this.severity.getValue();
994        }
995
996        /**
997         * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.
998         */
999        public AllergyIntoleranceReactionComponent setSeverity(AllergyIntoleranceSeverity value) { 
1000          if (value == null)
1001            this.severity = null;
1002          else {
1003            if (this.severity == null)
1004              this.severity = new Enumeration<AllergyIntoleranceSeverity>(new AllergyIntoleranceSeverityEnumFactory());
1005            this.severity.setValue(value);
1006          }
1007          return this;
1008        }
1009
1010        /**
1011         * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.)
1012         */
1013        public CodeableConcept getExposureRoute() { 
1014          if (this.exposureRoute == null)
1015            if (Configuration.errorOnAutoCreate())
1016              throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.exposureRoute");
1017            else if (Configuration.doAutoCreate())
1018              this.exposureRoute = new CodeableConcept(); // cc
1019          return this.exposureRoute;
1020        }
1021
1022        public boolean hasExposureRoute() { 
1023          return this.exposureRoute != null && !this.exposureRoute.isEmpty();
1024        }
1025
1026        /**
1027         * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.)
1028         */
1029        public AllergyIntoleranceReactionComponent setExposureRoute(CodeableConcept value) { 
1030          this.exposureRoute = value;
1031          return this;
1032        }
1033
1034        /**
1035         * @return {@link #note} (Additional text about the adverse reaction event not captured in other fields.)
1036         */
1037        public List<Annotation> getNote() { 
1038          if (this.note == null)
1039            this.note = new ArrayList<Annotation>();
1040          return this.note;
1041        }
1042
1043        /**
1044         * @return Returns a reference to <code>this</code> for easy method chaining
1045         */
1046        public AllergyIntoleranceReactionComponent setNote(List<Annotation> theNote) { 
1047          this.note = theNote;
1048          return this;
1049        }
1050
1051        public boolean hasNote() { 
1052          if (this.note == null)
1053            return false;
1054          for (Annotation item : this.note)
1055            if (!item.isEmpty())
1056              return true;
1057          return false;
1058        }
1059
1060        public Annotation addNote() { //3
1061          Annotation t = new Annotation();
1062          if (this.note == null)
1063            this.note = new ArrayList<Annotation>();
1064          this.note.add(t);
1065          return t;
1066        }
1067
1068        public AllergyIntoleranceReactionComponent addNote(Annotation t) { //3
1069          if (t == null)
1070            return this;
1071          if (this.note == null)
1072            this.note = new ArrayList<Annotation>();
1073          this.note.add(t);
1074          return this;
1075        }
1076
1077        /**
1078         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1079         */
1080        public Annotation getNoteFirstRep() { 
1081          if (getNote().isEmpty()) {
1082            addNote();
1083          }
1084          return getNote().get(0);
1085        }
1086
1087        protected void listChildren(List<Property> children) {
1088          super.listChildren(children);
1089          children.add(new Property("substance", "CodeableConcept", "Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.", 0, 1, substance));
1090          children.add(new Property("manifestation", "CodeableReference(Observation)", "Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.", 0, java.lang.Integer.MAX_VALUE, manifestation));
1091          children.add(new Property("description", "string", "Text description about the reaction as a whole, including details of the manifestation if required.", 0, 1, description));
1092          children.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, 1, onset));
1093          children.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, 1, severity));
1094          children.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, 1, exposureRoute));
1095          children.add(new Property("note", "Annotation", "Additional text about the adverse reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note));
1096        }
1097
1098        @Override
1099        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1100          switch (_hash) {
1101          case 530040176: /*substance*/  return new Property("substance", "CodeableConcept", "Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.", 0, 1, substance);
1102          case 1115984422: /*manifestation*/  return new Property("manifestation", "CodeableReference(Observation)", "Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.", 0, java.lang.Integer.MAX_VALUE, manifestation);
1103          case -1724546052: /*description*/  return new Property("description", "string", "Text description about the reaction as a whole, including details of the manifestation if required.", 0, 1, description);
1104          case 105901603: /*onset*/  return new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, 1, onset);
1105          case 1478300413: /*severity*/  return new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, 1, severity);
1106          case 421286274: /*exposureRoute*/  return new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, 1, exposureRoute);
1107          case 3387378: /*note*/  return new Property("note", "Annotation", "Additional text about the adverse reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note);
1108          default: return super.getNamedProperty(_hash, _name, _checkValid);
1109          }
1110
1111        }
1112
1113      @Override
1114      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1115        switch (hash) {
1116        case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept
1117        case 1115984422: /*manifestation*/ return this.manifestation == null ? new Base[0] : this.manifestation.toArray(new Base[this.manifestation.size()]); // CodeableReference
1118        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1119        case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType
1120        case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration<AllergyIntoleranceSeverity>
1121        case 421286274: /*exposureRoute*/ return this.exposureRoute == null ? new Base[0] : new Base[] {this.exposureRoute}; // CodeableConcept
1122        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1123        default: return super.getProperty(hash, name, checkValid);
1124        }
1125
1126      }
1127
1128      @Override
1129      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1130        switch (hash) {
1131        case 530040176: // substance
1132          this.substance = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1133          return value;
1134        case 1115984422: // manifestation
1135          this.getManifestation().add(TypeConvertor.castToCodeableReference(value)); // CodeableReference
1136          return value;
1137        case -1724546052: // description
1138          this.description = TypeConvertor.castToString(value); // StringType
1139          return value;
1140        case 105901603: // onset
1141          this.onset = TypeConvertor.castToDateTime(value); // DateTimeType
1142          return value;
1143        case 1478300413: // severity
1144          value = new AllergyIntoleranceSeverityEnumFactory().fromType(TypeConvertor.castToCode(value));
1145          this.severity = (Enumeration) value; // Enumeration<AllergyIntoleranceSeverity>
1146          return value;
1147        case 421286274: // exposureRoute
1148          this.exposureRoute = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1149          return value;
1150        case 3387378: // note
1151          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
1152          return value;
1153        default: return super.setProperty(hash, name, value);
1154        }
1155
1156      }
1157
1158      @Override
1159      public Base setProperty(String name, Base value) throws FHIRException {
1160        if (name.equals("substance")) {
1161          this.substance = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1162        } else if (name.equals("manifestation")) {
1163          this.getManifestation().add(TypeConvertor.castToCodeableReference(value));
1164        } else if (name.equals("description")) {
1165          this.description = TypeConvertor.castToString(value); // StringType
1166        } else if (name.equals("onset")) {
1167          this.onset = TypeConvertor.castToDateTime(value); // DateTimeType
1168        } else if (name.equals("severity")) {
1169          value = new AllergyIntoleranceSeverityEnumFactory().fromType(TypeConvertor.castToCode(value));
1170          this.severity = (Enumeration) value; // Enumeration<AllergyIntoleranceSeverity>
1171        } else if (name.equals("exposureRoute")) {
1172          this.exposureRoute = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1173        } else if (name.equals("note")) {
1174          this.getNote().add(TypeConvertor.castToAnnotation(value));
1175        } else
1176          return super.setProperty(name, value);
1177        return value;
1178      }
1179
1180      @Override
1181      public Base makeProperty(int hash, String name) throws FHIRException {
1182        switch (hash) {
1183        case 530040176:  return getSubstance();
1184        case 1115984422:  return addManifestation(); 
1185        case -1724546052:  return getDescriptionElement();
1186        case 105901603:  return getOnsetElement();
1187        case 1478300413:  return getSeverityElement();
1188        case 421286274:  return getExposureRoute();
1189        case 3387378:  return addNote(); 
1190        default: return super.makeProperty(hash, name);
1191        }
1192
1193      }
1194
1195      @Override
1196      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1197        switch (hash) {
1198        case 530040176: /*substance*/ return new String[] {"CodeableConcept"};
1199        case 1115984422: /*manifestation*/ return new String[] {"CodeableReference"};
1200        case -1724546052: /*description*/ return new String[] {"string"};
1201        case 105901603: /*onset*/ return new String[] {"dateTime"};
1202        case 1478300413: /*severity*/ return new String[] {"code"};
1203        case 421286274: /*exposureRoute*/ return new String[] {"CodeableConcept"};
1204        case 3387378: /*note*/ return new String[] {"Annotation"};
1205        default: return super.getTypesForProperty(hash, name);
1206        }
1207
1208      }
1209
1210      @Override
1211      public Base addChild(String name) throws FHIRException {
1212        if (name.equals("substance")) {
1213          this.substance = new CodeableConcept();
1214          return this.substance;
1215        }
1216        else if (name.equals("manifestation")) {
1217          return addManifestation();
1218        }
1219        else if (name.equals("description")) {
1220          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.reaction.description");
1221        }
1222        else if (name.equals("onset")) {
1223          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.reaction.onset");
1224        }
1225        else if (name.equals("severity")) {
1226          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.reaction.severity");
1227        }
1228        else if (name.equals("exposureRoute")) {
1229          this.exposureRoute = new CodeableConcept();
1230          return this.exposureRoute;
1231        }
1232        else if (name.equals("note")) {
1233          return addNote();
1234        }
1235        else
1236          return super.addChild(name);
1237      }
1238
1239      public AllergyIntoleranceReactionComponent copy() {
1240        AllergyIntoleranceReactionComponent dst = new AllergyIntoleranceReactionComponent();
1241        copyValues(dst);
1242        return dst;
1243      }
1244
1245      public void copyValues(AllergyIntoleranceReactionComponent dst) {
1246        super.copyValues(dst);
1247        dst.substance = substance == null ? null : substance.copy();
1248        if (manifestation != null) {
1249          dst.manifestation = new ArrayList<CodeableReference>();
1250          for (CodeableReference i : manifestation)
1251            dst.manifestation.add(i.copy());
1252        };
1253        dst.description = description == null ? null : description.copy();
1254        dst.onset = onset == null ? null : onset.copy();
1255        dst.severity = severity == null ? null : severity.copy();
1256        dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy();
1257        if (note != null) {
1258          dst.note = new ArrayList<Annotation>();
1259          for (Annotation i : note)
1260            dst.note.add(i.copy());
1261        };
1262      }
1263
1264      @Override
1265      public boolean equalsDeep(Base other_) {
1266        if (!super.equalsDeep(other_))
1267          return false;
1268        if (!(other_ instanceof AllergyIntoleranceReactionComponent))
1269          return false;
1270        AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other_;
1271        return compareDeep(substance, o.substance, true) && compareDeep(manifestation, o.manifestation, true)
1272           && compareDeep(description, o.description, true) && compareDeep(onset, o.onset, true) && compareDeep(severity, o.severity, true)
1273           && compareDeep(exposureRoute, o.exposureRoute, true) && compareDeep(note, o.note, true);
1274      }
1275
1276      @Override
1277      public boolean equalsShallow(Base other_) {
1278        if (!super.equalsShallow(other_))
1279          return false;
1280        if (!(other_ instanceof AllergyIntoleranceReactionComponent))
1281          return false;
1282        AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other_;
1283        return compareValues(description, o.description, true) && compareValues(onset, o.onset, true) && compareValues(severity, o.severity, true)
1284          ;
1285      }
1286
1287      public boolean isEmpty() {
1288        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(substance, manifestation, description
1289          , onset, severity, exposureRoute, note);
1290      }
1291
1292  public String fhirType() {
1293    return "AllergyIntolerance.reaction";
1294
1295  }
1296
1297  }
1298
1299    /**
1300     * Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.
1301     */
1302    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1303    @Description(shortDefinition="External ids for this item", formalDefinition="Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server." )
1304    protected List<Identifier> identifier;
1305
1306    /**
1307     * The clinical status of the allergy or intolerance.
1308     */
1309    @Child(name = "clinicalStatus", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=true, summary=true)
1310    @Description(shortDefinition="active | inactive | resolved", formalDefinition="The clinical status of the allergy or intolerance." )
1311    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergyintolerance-clinical")
1312    protected CodeableConcept clinicalStatus;
1313
1314    /**
1315     * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute.
1316     */
1317    @Child(name = "verificationStatus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=true, summary=true)
1318    @Description(shortDefinition="unconfirmed | presumed | confirmed | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute." )
1319    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergyintolerance-verification")
1320    protected CodeableConcept verificationStatus;
1321
1322    /**
1323     * Identification of the underlying physiological mechanism for the reaction risk.
1324     */
1325    @Child(name = "type", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
1326    @Description(shortDefinition="allergy | intolerance - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the reaction risk." )
1327    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-type")
1328    protected Enumeration<AllergyIntoleranceType> type;
1329
1330    /**
1331     * Category of the identified substance.
1332     */
1333    @Child(name = "category", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1334    @Description(shortDefinition="food | medication | environment | biologic", formalDefinition="Category of the identified substance." )
1335    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-category")
1336    protected List<Enumeration<AllergyIntoleranceCategory>> category;
1337
1338    /**
1339     * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.
1340     */
1341    @Child(name = "criticality", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
1342    @Description(shortDefinition="low | high | unable-to-assess", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance." )
1343    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality")
1344    protected Enumeration<AllergyIntoleranceCriticality> criticality;
1345
1346    /**
1347     * Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g.,  "No known allergy", "No known drug allergies").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.
1348     */
1349    @Child(name = "code", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true)
1350    @Description(shortDefinition="Code that identifies the allergy or intolerance", formalDefinition="Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g.,  \"No known allergy\", \"No known drug allergies\").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance." )
1351    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergyintolerance-code")
1352    protected CodeableConcept code;
1353
1354    /**
1355     * The patient who has the allergy or intolerance.
1356     */
1357    @Child(name = "patient", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true)
1358    @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." )
1359    protected Reference patient;
1360
1361    /**
1362     * The encounter when the allergy or intolerance was asserted.
1363     */
1364    @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1, modifier=false, summary=false)
1365    @Description(shortDefinition="Encounter when the allergy or intolerance was asserted", formalDefinition="The encounter when the allergy or intolerance was asserted." )
1366    protected Reference encounter;
1367
1368    /**
1369     * Estimated or actual date,  date-time, or age when allergy or intolerance was identified.
1370     */
1371    @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
1372    @Description(shortDefinition="When allergy or intolerance was identified", formalDefinition="Estimated or actual date,  date-time, or age when allergy or intolerance was identified." )
1373    protected DataType onset;
1374
1375    /**
1376     * The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.
1377     */
1378    @Child(name = "recordedDate", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
1379    @Description(shortDefinition="Date allergy or intolerance was first recorded", formalDefinition="The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date." )
1380    protected DateTimeType recordedDate;
1381
1382    /**
1383     * Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved.
1384     */
1385    @Child(name = "participant", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
1386    @Description(shortDefinition="Who or what participated in the activities related to the allergy or intolerance and how they were involved", formalDefinition="Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved." )
1387    protected List<AllergyIntoleranceParticipantComponent> participant;
1388
1389    /**
1390     * Represents the date and/or time of the last known occurrence of a reaction event.
1391     */
1392    @Child(name = "lastOccurrence", type = {DateTimeType.class}, order=12, min=0, max=1, modifier=false, summary=false)
1393    @Description(shortDefinition="Date(/time) of last known occurrence of a reaction", formalDefinition="Represents the date and/or time of the last known occurrence of a reaction event." )
1394    protected DateTimeType lastOccurrence;
1395
1396    /**
1397     * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.
1398     */
1399    @Child(name = "note", type = {Annotation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1400    @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." )
1401    protected List<Annotation> note;
1402
1403    /**
1404     * Details about each adverse reaction event linked to exposure to the identified substance.
1405     */
1406    @Child(name = "reaction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1407    @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each adverse reaction event linked to exposure to the identified substance." )
1408    protected List<AllergyIntoleranceReactionComponent> reaction;
1409
1410    private static final long serialVersionUID = -1256090316L;
1411
1412  /**
1413   * Constructor
1414   */
1415    public AllergyIntolerance() {
1416      super();
1417    }
1418
1419  /**
1420   * Constructor
1421   */
1422    public AllergyIntolerance(Reference patient) {
1423      super();
1424      this.setPatient(patient);
1425    }
1426
1427    /**
1428     * @return {@link #identifier} (Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.)
1429     */
1430    public List<Identifier> getIdentifier() { 
1431      if (this.identifier == null)
1432        this.identifier = new ArrayList<Identifier>();
1433      return this.identifier;
1434    }
1435
1436    /**
1437     * @return Returns a reference to <code>this</code> for easy method chaining
1438     */
1439    public AllergyIntolerance setIdentifier(List<Identifier> theIdentifier) { 
1440      this.identifier = theIdentifier;
1441      return this;
1442    }
1443
1444    public boolean hasIdentifier() { 
1445      if (this.identifier == null)
1446        return false;
1447      for (Identifier item : this.identifier)
1448        if (!item.isEmpty())
1449          return true;
1450      return false;
1451    }
1452
1453    public Identifier addIdentifier() { //3
1454      Identifier t = new Identifier();
1455      if (this.identifier == null)
1456        this.identifier = new ArrayList<Identifier>();
1457      this.identifier.add(t);
1458      return t;
1459    }
1460
1461    public AllergyIntolerance addIdentifier(Identifier t) { //3
1462      if (t == null)
1463        return this;
1464      if (this.identifier == null)
1465        this.identifier = new ArrayList<Identifier>();
1466      this.identifier.add(t);
1467      return this;
1468    }
1469
1470    /**
1471     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
1472     */
1473    public Identifier getIdentifierFirstRep() { 
1474      if (getIdentifier().isEmpty()) {
1475        addIdentifier();
1476      }
1477      return getIdentifier().get(0);
1478    }
1479
1480    /**
1481     * @return {@link #clinicalStatus} (The clinical status of the allergy or intolerance.)
1482     */
1483    public CodeableConcept getClinicalStatus() { 
1484      if (this.clinicalStatus == null)
1485        if (Configuration.errorOnAutoCreate())
1486          throw new Error("Attempt to auto-create AllergyIntolerance.clinicalStatus");
1487        else if (Configuration.doAutoCreate())
1488          this.clinicalStatus = new CodeableConcept(); // cc
1489      return this.clinicalStatus;
1490    }
1491
1492    public boolean hasClinicalStatus() { 
1493      return this.clinicalStatus != null && !this.clinicalStatus.isEmpty();
1494    }
1495
1496    /**
1497     * @param value {@link #clinicalStatus} (The clinical status of the allergy or intolerance.)
1498     */
1499    public AllergyIntolerance setClinicalStatus(CodeableConcept value) { 
1500      this.clinicalStatus = value;
1501      return this;
1502    }
1503
1504    /**
1505     * @return {@link #verificationStatus} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute.)
1506     */
1507    public CodeableConcept getVerificationStatus() { 
1508      if (this.verificationStatus == null)
1509        if (Configuration.errorOnAutoCreate())
1510          throw new Error("Attempt to auto-create AllergyIntolerance.verificationStatus");
1511        else if (Configuration.doAutoCreate())
1512          this.verificationStatus = new CodeableConcept(); // cc
1513      return this.verificationStatus;
1514    }
1515
1516    public boolean hasVerificationStatus() { 
1517      return this.verificationStatus != null && !this.verificationStatus.isEmpty();
1518    }
1519
1520    /**
1521     * @param value {@link #verificationStatus} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute.)
1522     */
1523    public AllergyIntolerance setVerificationStatus(CodeableConcept value) { 
1524      this.verificationStatus = value;
1525      return this;
1526    }
1527
1528    /**
1529     * @return {@link #type} (Identification of the underlying physiological mechanism for the reaction risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1530     */
1531    public Enumeration<AllergyIntoleranceType> getTypeElement() { 
1532      if (this.type == null)
1533        if (Configuration.errorOnAutoCreate())
1534          throw new Error("Attempt to auto-create AllergyIntolerance.type");
1535        else if (Configuration.doAutoCreate())
1536          this.type = new Enumeration<AllergyIntoleranceType>(new AllergyIntoleranceTypeEnumFactory()); // bb
1537      return this.type;
1538    }
1539
1540    public boolean hasTypeElement() { 
1541      return this.type != null && !this.type.isEmpty();
1542    }
1543
1544    public boolean hasType() { 
1545      return this.type != null && !this.type.isEmpty();
1546    }
1547
1548    /**
1549     * @param value {@link #type} (Identification of the underlying physiological mechanism for the reaction risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
1550     */
1551    public AllergyIntolerance setTypeElement(Enumeration<AllergyIntoleranceType> value) { 
1552      this.type = value;
1553      return this;
1554    }
1555
1556    /**
1557     * @return Identification of the underlying physiological mechanism for the reaction risk.
1558     */
1559    public AllergyIntoleranceType getType() { 
1560      return this.type == null ? null : this.type.getValue();
1561    }
1562
1563    /**
1564     * @param value Identification of the underlying physiological mechanism for the reaction risk.
1565     */
1566    public AllergyIntolerance setType(AllergyIntoleranceType value) { 
1567      if (value == null)
1568        this.type = null;
1569      else {
1570        if (this.type == null)
1571          this.type = new Enumeration<AllergyIntoleranceType>(new AllergyIntoleranceTypeEnumFactory());
1572        this.type.setValue(value);
1573      }
1574      return this;
1575    }
1576
1577    /**
1578     * @return {@link #category} (Category of the identified substance.)
1579     */
1580    public List<Enumeration<AllergyIntoleranceCategory>> getCategory() { 
1581      if (this.category == null)
1582        this.category = new ArrayList<Enumeration<AllergyIntoleranceCategory>>();
1583      return this.category;
1584    }
1585
1586    /**
1587     * @return Returns a reference to <code>this</code> for easy method chaining
1588     */
1589    public AllergyIntolerance setCategory(List<Enumeration<AllergyIntoleranceCategory>> theCategory) { 
1590      this.category = theCategory;
1591      return this;
1592    }
1593
1594    public boolean hasCategory() { 
1595      if (this.category == null)
1596        return false;
1597      for (Enumeration<AllergyIntoleranceCategory> item : this.category)
1598        if (!item.isEmpty())
1599          return true;
1600      return false;
1601    }
1602
1603    /**
1604     * @return {@link #category} (Category of the identified substance.)
1605     */
1606    public Enumeration<AllergyIntoleranceCategory> addCategoryElement() {//2 
1607      Enumeration<AllergyIntoleranceCategory> t = new Enumeration<AllergyIntoleranceCategory>(new AllergyIntoleranceCategoryEnumFactory());
1608      if (this.category == null)
1609        this.category = new ArrayList<Enumeration<AllergyIntoleranceCategory>>();
1610      this.category.add(t);
1611      return t;
1612    }
1613
1614    /**
1615     * @param value {@link #category} (Category of the identified substance.)
1616     */
1617    public AllergyIntolerance addCategory(AllergyIntoleranceCategory value) { //1
1618      Enumeration<AllergyIntoleranceCategory> t = new Enumeration<AllergyIntoleranceCategory>(new AllergyIntoleranceCategoryEnumFactory());
1619      t.setValue(value);
1620      if (this.category == null)
1621        this.category = new ArrayList<Enumeration<AllergyIntoleranceCategory>>();
1622      this.category.add(t);
1623      return this;
1624    }
1625
1626    /**
1627     * @param value {@link #category} (Category of the identified substance.)
1628     */
1629    public boolean hasCategory(AllergyIntoleranceCategory value) { 
1630      if (this.category == null)
1631        return false;
1632      for (Enumeration<AllergyIntoleranceCategory> v : this.category)
1633        if (v.getValue().equals(value)) // code
1634          return true;
1635      return false;
1636    }
1637
1638    /**
1639     * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value
1640     */
1641    public Enumeration<AllergyIntoleranceCriticality> getCriticalityElement() { 
1642      if (this.criticality == null)
1643        if (Configuration.errorOnAutoCreate())
1644          throw new Error("Attempt to auto-create AllergyIntolerance.criticality");
1645        else if (Configuration.doAutoCreate())
1646          this.criticality = new Enumeration<AllergyIntoleranceCriticality>(new AllergyIntoleranceCriticalityEnumFactory()); // bb
1647      return this.criticality;
1648    }
1649
1650    public boolean hasCriticalityElement() { 
1651      return this.criticality != null && !this.criticality.isEmpty();
1652    }
1653
1654    public boolean hasCriticality() { 
1655      return this.criticality != null && !this.criticality.isEmpty();
1656    }
1657
1658    /**
1659     * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value
1660     */
1661    public AllergyIntolerance setCriticalityElement(Enumeration<AllergyIntoleranceCriticality> value) { 
1662      this.criticality = value;
1663      return this;
1664    }
1665
1666    /**
1667     * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.
1668     */
1669    public AllergyIntoleranceCriticality getCriticality() { 
1670      return this.criticality == null ? null : this.criticality.getValue();
1671    }
1672
1673    /**
1674     * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.
1675     */
1676    public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { 
1677      if (value == null)
1678        this.criticality = null;
1679      else {
1680        if (this.criticality == null)
1681          this.criticality = new Enumeration<AllergyIntoleranceCriticality>(new AllergyIntoleranceCriticalityEnumFactory());
1682        this.criticality.setValue(value);
1683      }
1684      return this;
1685    }
1686
1687    /**
1688     * @return {@link #code} (Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g.,  "No known allergy", "No known drug allergies").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.)
1689     */
1690    public CodeableConcept getCode() { 
1691      if (this.code == null)
1692        if (Configuration.errorOnAutoCreate())
1693          throw new Error("Attempt to auto-create AllergyIntolerance.code");
1694        else if (Configuration.doAutoCreate())
1695          this.code = new CodeableConcept(); // cc
1696      return this.code;
1697    }
1698
1699    public boolean hasCode() { 
1700      return this.code != null && !this.code.isEmpty();
1701    }
1702
1703    /**
1704     * @param value {@link #code} (Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., "Latex"), an allergy or intolerance condition (e.g., "Latex allergy"), or a negated/excluded code for a specific substance or class (e.g., "No latex allergy") or a general or categorical negated statement (e.g.,  "No known allergy", "No known drug allergies").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.)
1705     */
1706    public AllergyIntolerance setCode(CodeableConcept value) { 
1707      this.code = value;
1708      return this;
1709    }
1710
1711    /**
1712     * @return {@link #patient} (The patient who has the allergy or intolerance.)
1713     */
1714    public Reference getPatient() { 
1715      if (this.patient == null)
1716        if (Configuration.errorOnAutoCreate())
1717          throw new Error("Attempt to auto-create AllergyIntolerance.patient");
1718        else if (Configuration.doAutoCreate())
1719          this.patient = new Reference(); // cc
1720      return this.patient;
1721    }
1722
1723    public boolean hasPatient() { 
1724      return this.patient != null && !this.patient.isEmpty();
1725    }
1726
1727    /**
1728     * @param value {@link #patient} (The patient who has the allergy or intolerance.)
1729     */
1730    public AllergyIntolerance setPatient(Reference value) { 
1731      this.patient = value;
1732      return this;
1733    }
1734
1735    /**
1736     * @return {@link #encounter} (The encounter when the allergy or intolerance was asserted.)
1737     */
1738    public Reference getEncounter() { 
1739      if (this.encounter == null)
1740        if (Configuration.errorOnAutoCreate())
1741          throw new Error("Attempt to auto-create AllergyIntolerance.encounter");
1742        else if (Configuration.doAutoCreate())
1743          this.encounter = new Reference(); // cc
1744      return this.encounter;
1745    }
1746
1747    public boolean hasEncounter() { 
1748      return this.encounter != null && !this.encounter.isEmpty();
1749    }
1750
1751    /**
1752     * @param value {@link #encounter} (The encounter when the allergy or intolerance was asserted.)
1753     */
1754    public AllergyIntolerance setEncounter(Reference value) { 
1755      this.encounter = value;
1756      return this;
1757    }
1758
1759    /**
1760     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1761     */
1762    public DataType getOnset() { 
1763      return this.onset;
1764    }
1765
1766    /**
1767     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1768     */
1769    public DateTimeType getOnsetDateTimeType() throws FHIRException { 
1770      if (this.onset == null)
1771        this.onset = new DateTimeType();
1772      if (!(this.onset instanceof DateTimeType))
1773        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered");
1774      return (DateTimeType) this.onset;
1775    }
1776
1777    public boolean hasOnsetDateTimeType() { 
1778      return this != null && this.onset instanceof DateTimeType;
1779    }
1780
1781    /**
1782     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1783     */
1784    public Age getOnsetAge() throws FHIRException { 
1785      if (this.onset == null)
1786        this.onset = new Age();
1787      if (!(this.onset instanceof Age))
1788        throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered");
1789      return (Age) this.onset;
1790    }
1791
1792    public boolean hasOnsetAge() { 
1793      return this != null && this.onset instanceof Age;
1794    }
1795
1796    /**
1797     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1798     */
1799    public Period getOnsetPeriod() throws FHIRException { 
1800      if (this.onset == null)
1801        this.onset = new Period();
1802      if (!(this.onset instanceof Period))
1803        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered");
1804      return (Period) this.onset;
1805    }
1806
1807    public boolean hasOnsetPeriod() { 
1808      return this != null && this.onset instanceof Period;
1809    }
1810
1811    /**
1812     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1813     */
1814    public Range getOnsetRange() throws FHIRException { 
1815      if (this.onset == null)
1816        this.onset = new Range();
1817      if (!(this.onset instanceof Range))
1818        throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered");
1819      return (Range) this.onset;
1820    }
1821
1822    public boolean hasOnsetRange() { 
1823      return this != null && this.onset instanceof Range;
1824    }
1825
1826    /**
1827     * @return {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1828     */
1829    public StringType getOnsetStringType() throws FHIRException { 
1830      if (this.onset == null)
1831        this.onset = new StringType();
1832      if (!(this.onset instanceof StringType))
1833        throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered");
1834      return (StringType) this.onset;
1835    }
1836
1837    public boolean hasOnsetStringType() { 
1838      return this != null && this.onset instanceof StringType;
1839    }
1840
1841    public boolean hasOnset() { 
1842      return this.onset != null && !this.onset.isEmpty();
1843    }
1844
1845    /**
1846     * @param value {@link #onset} (Estimated or actual date,  date-time, or age when allergy or intolerance was identified.)
1847     */
1848    public AllergyIntolerance setOnset(DataType value) { 
1849      if (value != null && !(value instanceof DateTimeType || value instanceof Age || value instanceof Period || value instanceof Range || value instanceof StringType))
1850        throw new Error("Not the right type for AllergyIntolerance.onset[x]: "+value.fhirType());
1851      this.onset = value;
1852      return this;
1853    }
1854
1855    /**
1856     * @return {@link #recordedDate} (The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value
1857     */
1858    public DateTimeType getRecordedDateElement() { 
1859      if (this.recordedDate == null)
1860        if (Configuration.errorOnAutoCreate())
1861          throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate");
1862        else if (Configuration.doAutoCreate())
1863          this.recordedDate = new DateTimeType(); // bb
1864      return this.recordedDate;
1865    }
1866
1867    public boolean hasRecordedDateElement() { 
1868      return this.recordedDate != null && !this.recordedDate.isEmpty();
1869    }
1870
1871    public boolean hasRecordedDate() { 
1872      return this.recordedDate != null && !this.recordedDate.isEmpty();
1873    }
1874
1875    /**
1876     * @param value {@link #recordedDate} (The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value
1877     */
1878    public AllergyIntolerance setRecordedDateElement(DateTimeType value) { 
1879      this.recordedDate = value;
1880      return this;
1881    }
1882
1883    /**
1884     * @return The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.
1885     */
1886    public Date getRecordedDate() { 
1887      return this.recordedDate == null ? null : this.recordedDate.getValue();
1888    }
1889
1890    /**
1891     * @param value The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.
1892     */
1893    public AllergyIntolerance setRecordedDate(Date value) { 
1894      if (value == null)
1895        this.recordedDate = null;
1896      else {
1897        if (this.recordedDate == null)
1898          this.recordedDate = new DateTimeType();
1899        this.recordedDate.setValue(value);
1900      }
1901      return this;
1902    }
1903
1904    /**
1905     * @return {@link #participant} (Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved.)
1906     */
1907    public List<AllergyIntoleranceParticipantComponent> getParticipant() { 
1908      if (this.participant == null)
1909        this.participant = new ArrayList<AllergyIntoleranceParticipantComponent>();
1910      return this.participant;
1911    }
1912
1913    /**
1914     * @return Returns a reference to <code>this</code> for easy method chaining
1915     */
1916    public AllergyIntolerance setParticipant(List<AllergyIntoleranceParticipantComponent> theParticipant) { 
1917      this.participant = theParticipant;
1918      return this;
1919    }
1920
1921    public boolean hasParticipant() { 
1922      if (this.participant == null)
1923        return false;
1924      for (AllergyIntoleranceParticipantComponent item : this.participant)
1925        if (!item.isEmpty())
1926          return true;
1927      return false;
1928    }
1929
1930    public AllergyIntoleranceParticipantComponent addParticipant() { //3
1931      AllergyIntoleranceParticipantComponent t = new AllergyIntoleranceParticipantComponent();
1932      if (this.participant == null)
1933        this.participant = new ArrayList<AllergyIntoleranceParticipantComponent>();
1934      this.participant.add(t);
1935      return t;
1936    }
1937
1938    public AllergyIntolerance addParticipant(AllergyIntoleranceParticipantComponent t) { //3
1939      if (t == null)
1940        return this;
1941      if (this.participant == null)
1942        this.participant = new ArrayList<AllergyIntoleranceParticipantComponent>();
1943      this.participant.add(t);
1944      return this;
1945    }
1946
1947    /**
1948     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist {3}
1949     */
1950    public AllergyIntoleranceParticipantComponent getParticipantFirstRep() { 
1951      if (getParticipant().isEmpty()) {
1952        addParticipant();
1953      }
1954      return getParticipant().get(0);
1955    }
1956
1957    /**
1958     * @return {@link #lastOccurrence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurrence" gives direct access to the value
1959     */
1960    public DateTimeType getLastOccurrenceElement() { 
1961      if (this.lastOccurrence == null)
1962        if (Configuration.errorOnAutoCreate())
1963          throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurrence");
1964        else if (Configuration.doAutoCreate())
1965          this.lastOccurrence = new DateTimeType(); // bb
1966      return this.lastOccurrence;
1967    }
1968
1969    public boolean hasLastOccurrenceElement() { 
1970      return this.lastOccurrence != null && !this.lastOccurrence.isEmpty();
1971    }
1972
1973    public boolean hasLastOccurrence() { 
1974      return this.lastOccurrence != null && !this.lastOccurrence.isEmpty();
1975    }
1976
1977    /**
1978     * @param value {@link #lastOccurrence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurrence" gives direct access to the value
1979     */
1980    public AllergyIntolerance setLastOccurrenceElement(DateTimeType value) { 
1981      this.lastOccurrence = value;
1982      return this;
1983    }
1984
1985    /**
1986     * @return Represents the date and/or time of the last known occurrence of a reaction event.
1987     */
1988    public Date getLastOccurrence() { 
1989      return this.lastOccurrence == null ? null : this.lastOccurrence.getValue();
1990    }
1991
1992    /**
1993     * @param value Represents the date and/or time of the last known occurrence of a reaction event.
1994     */
1995    public AllergyIntolerance setLastOccurrence(Date value) { 
1996      if (value == null)
1997        this.lastOccurrence = null;
1998      else {
1999        if (this.lastOccurrence == null)
2000          this.lastOccurrence = new DateTimeType();
2001        this.lastOccurrence.setValue(value);
2002      }
2003      return this;
2004    }
2005
2006    /**
2007     * @return {@link #note} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.)
2008     */
2009    public List<Annotation> getNote() { 
2010      if (this.note == null)
2011        this.note = new ArrayList<Annotation>();
2012      return this.note;
2013    }
2014
2015    /**
2016     * @return Returns a reference to <code>this</code> for easy method chaining
2017     */
2018    public AllergyIntolerance setNote(List<Annotation> theNote) { 
2019      this.note = theNote;
2020      return this;
2021    }
2022
2023    public boolean hasNote() { 
2024      if (this.note == null)
2025        return false;
2026      for (Annotation item : this.note)
2027        if (!item.isEmpty())
2028          return true;
2029      return false;
2030    }
2031
2032    public Annotation addNote() { //3
2033      Annotation t = new Annotation();
2034      if (this.note == null)
2035        this.note = new ArrayList<Annotation>();
2036      this.note.add(t);
2037      return t;
2038    }
2039
2040    public AllergyIntolerance addNote(Annotation t) { //3
2041      if (t == null)
2042        return this;
2043      if (this.note == null)
2044        this.note = new ArrayList<Annotation>();
2045      this.note.add(t);
2046      return this;
2047    }
2048
2049    /**
2050     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2051     */
2052    public Annotation getNoteFirstRep() { 
2053      if (getNote().isEmpty()) {
2054        addNote();
2055      }
2056      return getNote().get(0);
2057    }
2058
2059    /**
2060     * @return {@link #reaction} (Details about each adverse reaction event linked to exposure to the identified substance.)
2061     */
2062    public List<AllergyIntoleranceReactionComponent> getReaction() { 
2063      if (this.reaction == null)
2064        this.reaction = new ArrayList<AllergyIntoleranceReactionComponent>();
2065      return this.reaction;
2066    }
2067
2068    /**
2069     * @return Returns a reference to <code>this</code> for easy method chaining
2070     */
2071    public AllergyIntolerance setReaction(List<AllergyIntoleranceReactionComponent> theReaction) { 
2072      this.reaction = theReaction;
2073      return this;
2074    }
2075
2076    public boolean hasReaction() { 
2077      if (this.reaction == null)
2078        return false;
2079      for (AllergyIntoleranceReactionComponent item : this.reaction)
2080        if (!item.isEmpty())
2081          return true;
2082      return false;
2083    }
2084
2085    public AllergyIntoleranceReactionComponent addReaction() { //3
2086      AllergyIntoleranceReactionComponent t = new AllergyIntoleranceReactionComponent();
2087      if (this.reaction == null)
2088        this.reaction = new ArrayList<AllergyIntoleranceReactionComponent>();
2089      this.reaction.add(t);
2090      return t;
2091    }
2092
2093    public AllergyIntolerance addReaction(AllergyIntoleranceReactionComponent t) { //3
2094      if (t == null)
2095        return this;
2096      if (this.reaction == null)
2097        this.reaction = new ArrayList<AllergyIntoleranceReactionComponent>();
2098      this.reaction.add(t);
2099      return this;
2100    }
2101
2102    /**
2103     * @return The first repetition of repeating field {@link #reaction}, creating it if it does not already exist {3}
2104     */
2105    public AllergyIntoleranceReactionComponent getReactionFirstRep() { 
2106      if (getReaction().isEmpty()) {
2107        addReaction();
2108      }
2109      return getReaction().get(0);
2110    }
2111
2112      protected void listChildren(List<Property> children) {
2113        super.listChildren(children);
2114        children.add(new Property("identifier", "Identifier", "Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier));
2115        children.add(new Property("clinicalStatus", "CodeableConcept", "The clinical status of the allergy or intolerance.", 0, 1, clinicalStatus));
2116        children.add(new Property("verificationStatus", "CodeableConcept", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute.", 0, 1, verificationStatus));
2117        children.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the reaction risk.", 0, 1, type));
2118        children.add(new Property("category", "code", "Category of the identified substance.", 0, java.lang.Integer.MAX_VALUE, category));
2119        children.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.", 0, 1, criticality));
2120        children.add(new Property("code", "CodeableConcept", "Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g.,  \"No known allergy\", \"No known drug allergies\").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.", 0, 1, code));
2121        children.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, 1, patient));
2122        children.add(new Property("encounter", "Reference(Encounter)", "The encounter when the allergy or intolerance was asserted.", 0, 1, encounter));
2123        children.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset));
2124        children.add(new Property("recordedDate", "dateTime", "The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.", 0, 1, recordedDate));
2125        children.add(new Property("participant", "", "Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved.", 0, java.lang.Integer.MAX_VALUE, participant));
2126        children.add(new Property("lastOccurrence", "dateTime", "Represents the date and/or time of the last known occurrence of a reaction event.", 0, 1, lastOccurrence));
2127        children.add(new Property("note", "Annotation", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note));
2128        children.add(new Property("reaction", "", "Details about each adverse reaction event linked to exposure to the identified substance.", 0, java.lang.Integer.MAX_VALUE, reaction));
2129      }
2130
2131      @Override
2132      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2133        switch (_hash) {
2134        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.", 0, java.lang.Integer.MAX_VALUE, identifier);
2135        case -462853915: /*clinicalStatus*/  return new Property("clinicalStatus", "CodeableConcept", "The clinical status of the allergy or intolerance.", 0, 1, clinicalStatus);
2136        case -842509843: /*verificationStatus*/  return new Property("verificationStatus", "CodeableConcept", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).  The verification status pertains to the allergy or intolerance, itself, not to any specific AllergyIntolerance attribute.", 0, 1, verificationStatus);
2137        case 3575610: /*type*/  return new Property("type", "code", "Identification of the underlying physiological mechanism for the reaction risk.", 0, 1, type);
2138        case 50511102: /*category*/  return new Property("category", "code", "Category of the identified substance.", 0, java.lang.Integer.MAX_VALUE, category);
2139        case -1608054609: /*criticality*/  return new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.", 0, 1, criticality);
2140        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g.,  \"No known allergy\", \"No known drug allergies\").  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.", 0, 1, code);
2141        case -791418107: /*patient*/  return new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, 1, patient);
2142        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The encounter when the allergy or intolerance was asserted.", 0, 1, encounter);
2143        case -1886216323: /*onset[x]*/  return new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2144        case 105901603: /*onset*/  return new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2145        case -1701663010: /*onsetDateTime*/  return new Property("onset[x]", "dateTime", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2146        case -1886241828: /*onsetAge*/  return new Property("onset[x]", "Age", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2147        case -1545082428: /*onsetPeriod*/  return new Property("onset[x]", "Period", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2148        case -186664742: /*onsetRange*/  return new Property("onset[x]", "Range", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2149        case -1445342188: /*onsetString*/  return new Property("onset[x]", "string", "Estimated or actual date,  date-time, or age when allergy or intolerance was identified.", 0, 1, onset);
2150        case -1952893826: /*recordedDate*/  return new Property("recordedDate", "dateTime", "The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.", 0, 1, recordedDate);
2151        case 767422259: /*participant*/  return new Property("participant", "", "Indicates who or what participated in the activities related to the allergy or intolerance and how they were involved.", 0, java.lang.Integer.MAX_VALUE, participant);
2152        case 1896977671: /*lastOccurrence*/  return new Property("lastOccurrence", "dateTime", "Represents the date and/or time of the last known occurrence of a reaction event.", 0, 1, lastOccurrence);
2153        case 3387378: /*note*/  return new Property("note", "Annotation", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note);
2154        case -867509719: /*reaction*/  return new Property("reaction", "", "Details about each adverse reaction event linked to exposure to the identified substance.", 0, java.lang.Integer.MAX_VALUE, reaction);
2155        default: return super.getNamedProperty(_hash, _name, _checkValid);
2156        }
2157
2158      }
2159
2160      @Override
2161      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2162        switch (hash) {
2163        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
2164        case -462853915: /*clinicalStatus*/ return this.clinicalStatus == null ? new Base[0] : new Base[] {this.clinicalStatus}; // CodeableConcept
2165        case -842509843: /*verificationStatus*/ return this.verificationStatus == null ? new Base[0] : new Base[] {this.verificationStatus}; // CodeableConcept
2166        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<AllergyIntoleranceType>
2167        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // Enumeration<AllergyIntoleranceCategory>
2168        case -1608054609: /*criticality*/ return this.criticality == null ? new Base[0] : new Base[] {this.criticality}; // Enumeration<AllergyIntoleranceCriticality>
2169        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
2170        case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference
2171        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
2172        case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DataType
2173        case -1952893826: /*recordedDate*/ return this.recordedDate == null ? new Base[0] : new Base[] {this.recordedDate}; // DateTimeType
2174        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // AllergyIntoleranceParticipantComponent
2175        case 1896977671: /*lastOccurrence*/ return this.lastOccurrence == null ? new Base[0] : new Base[] {this.lastOccurrence}; // DateTimeType
2176        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
2177        case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // AllergyIntoleranceReactionComponent
2178        default: return super.getProperty(hash, name, checkValid);
2179        }
2180
2181      }
2182
2183      @Override
2184      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2185        switch (hash) {
2186        case -1618432855: // identifier
2187          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
2188          return value;
2189        case -462853915: // clinicalStatus
2190          this.clinicalStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2191          return value;
2192        case -842509843: // verificationStatus
2193          this.verificationStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2194          return value;
2195        case 3575610: // type
2196          value = new AllergyIntoleranceTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2197          this.type = (Enumeration) value; // Enumeration<AllergyIntoleranceType>
2198          return value;
2199        case 50511102: // category
2200          value = new AllergyIntoleranceCategoryEnumFactory().fromType(TypeConvertor.castToCode(value));
2201          this.getCategory().add((Enumeration) value); // Enumeration<AllergyIntoleranceCategory>
2202          return value;
2203        case -1608054609: // criticality
2204          value = new AllergyIntoleranceCriticalityEnumFactory().fromType(TypeConvertor.castToCode(value));
2205          this.criticality = (Enumeration) value; // Enumeration<AllergyIntoleranceCriticality>
2206          return value;
2207        case 3059181: // code
2208          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2209          return value;
2210        case -791418107: // patient
2211          this.patient = TypeConvertor.castToReference(value); // Reference
2212          return value;
2213        case 1524132147: // encounter
2214          this.encounter = TypeConvertor.castToReference(value); // Reference
2215          return value;
2216        case 105901603: // onset
2217          this.onset = TypeConvertor.castToType(value); // DataType
2218          return value;
2219        case -1952893826: // recordedDate
2220          this.recordedDate = TypeConvertor.castToDateTime(value); // DateTimeType
2221          return value;
2222        case 767422259: // participant
2223          this.getParticipant().add((AllergyIntoleranceParticipantComponent) value); // AllergyIntoleranceParticipantComponent
2224          return value;
2225        case 1896977671: // lastOccurrence
2226          this.lastOccurrence = TypeConvertor.castToDateTime(value); // DateTimeType
2227          return value;
2228        case 3387378: // note
2229          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2230          return value;
2231        case -867509719: // reaction
2232          this.getReaction().add((AllergyIntoleranceReactionComponent) value); // AllergyIntoleranceReactionComponent
2233          return value;
2234        default: return super.setProperty(hash, name, value);
2235        }
2236
2237      }
2238
2239      @Override
2240      public Base setProperty(String name, Base value) throws FHIRException {
2241        if (name.equals("identifier")) {
2242          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2243        } else if (name.equals("clinicalStatus")) {
2244          this.clinicalStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2245        } else if (name.equals("verificationStatus")) {
2246          this.verificationStatus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2247        } else if (name.equals("type")) {
2248          value = new AllergyIntoleranceTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
2249          this.type = (Enumeration) value; // Enumeration<AllergyIntoleranceType>
2250        } else if (name.equals("category")) {
2251          value = new AllergyIntoleranceCategoryEnumFactory().fromType(TypeConvertor.castToCode(value));
2252          this.getCategory().add((Enumeration) value);
2253        } else if (name.equals("criticality")) {
2254          value = new AllergyIntoleranceCriticalityEnumFactory().fromType(TypeConvertor.castToCode(value));
2255          this.criticality = (Enumeration) value; // Enumeration<AllergyIntoleranceCriticality>
2256        } else if (name.equals("code")) {
2257          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2258        } else if (name.equals("patient")) {
2259          this.patient = TypeConvertor.castToReference(value); // Reference
2260        } else if (name.equals("encounter")) {
2261          this.encounter = TypeConvertor.castToReference(value); // Reference
2262        } else if (name.equals("onset[x]")) {
2263          this.onset = TypeConvertor.castToType(value); // DataType
2264        } else if (name.equals("recordedDate")) {
2265          this.recordedDate = TypeConvertor.castToDateTime(value); // DateTimeType
2266        } else if (name.equals("participant")) {
2267          this.getParticipant().add((AllergyIntoleranceParticipantComponent) value);
2268        } else if (name.equals("lastOccurrence")) {
2269          this.lastOccurrence = TypeConvertor.castToDateTime(value); // DateTimeType
2270        } else if (name.equals("note")) {
2271          this.getNote().add(TypeConvertor.castToAnnotation(value));
2272        } else if (name.equals("reaction")) {
2273          this.getReaction().add((AllergyIntoleranceReactionComponent) value);
2274        } else
2275          return super.setProperty(name, value);
2276        return value;
2277      }
2278
2279      @Override
2280      public Base makeProperty(int hash, String name) throws FHIRException {
2281        switch (hash) {
2282        case -1618432855:  return addIdentifier(); 
2283        case -462853915:  return getClinicalStatus();
2284        case -842509843:  return getVerificationStatus();
2285        case 3575610:  return getTypeElement();
2286        case 50511102:  return addCategoryElement();
2287        case -1608054609:  return getCriticalityElement();
2288        case 3059181:  return getCode();
2289        case -791418107:  return getPatient();
2290        case 1524132147:  return getEncounter();
2291        case -1886216323:  return getOnset();
2292        case 105901603:  return getOnset();
2293        case -1952893826:  return getRecordedDateElement();
2294        case 767422259:  return addParticipant(); 
2295        case 1896977671:  return getLastOccurrenceElement();
2296        case 3387378:  return addNote(); 
2297        case -867509719:  return addReaction(); 
2298        default: return super.makeProperty(hash, name);
2299        }
2300
2301      }
2302
2303      @Override
2304      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2305        switch (hash) {
2306        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2307        case -462853915: /*clinicalStatus*/ return new String[] {"CodeableConcept"};
2308        case -842509843: /*verificationStatus*/ return new String[] {"CodeableConcept"};
2309        case 3575610: /*type*/ return new String[] {"code"};
2310        case 50511102: /*category*/ return new String[] {"code"};
2311        case -1608054609: /*criticality*/ return new String[] {"code"};
2312        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2313        case -791418107: /*patient*/ return new String[] {"Reference"};
2314        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2315        case 105901603: /*onset*/ return new String[] {"dateTime", "Age", "Period", "Range", "string"};
2316        case -1952893826: /*recordedDate*/ return new String[] {"dateTime"};
2317        case 767422259: /*participant*/ return new String[] {};
2318        case 1896977671: /*lastOccurrence*/ return new String[] {"dateTime"};
2319        case 3387378: /*note*/ return new String[] {"Annotation"};
2320        case -867509719: /*reaction*/ return new String[] {};
2321        default: return super.getTypesForProperty(hash, name);
2322        }
2323
2324      }
2325
2326      @Override
2327      public Base addChild(String name) throws FHIRException {
2328        if (name.equals("identifier")) {
2329          return addIdentifier();
2330        }
2331        else if (name.equals("clinicalStatus")) {
2332          this.clinicalStatus = new CodeableConcept();
2333          return this.clinicalStatus;
2334        }
2335        else if (name.equals("verificationStatus")) {
2336          this.verificationStatus = new CodeableConcept();
2337          return this.verificationStatus;
2338        }
2339        else if (name.equals("type")) {
2340          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.type");
2341        }
2342        else if (name.equals("category")) {
2343          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.category");
2344        }
2345        else if (name.equals("criticality")) {
2346          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.criticality");
2347        }
2348        else if (name.equals("code")) {
2349          this.code = new CodeableConcept();
2350          return this.code;
2351        }
2352        else if (name.equals("patient")) {
2353          this.patient = new Reference();
2354          return this.patient;
2355        }
2356        else if (name.equals("encounter")) {
2357          this.encounter = new Reference();
2358          return this.encounter;
2359        }
2360        else if (name.equals("onsetDateTime")) {
2361          this.onset = new DateTimeType();
2362          return this.onset;
2363        }
2364        else if (name.equals("onsetAge")) {
2365          this.onset = new Age();
2366          return this.onset;
2367        }
2368        else if (name.equals("onsetPeriod")) {
2369          this.onset = new Period();
2370          return this.onset;
2371        }
2372        else if (name.equals("onsetRange")) {
2373          this.onset = new Range();
2374          return this.onset;
2375        }
2376        else if (name.equals("onsetString")) {
2377          this.onset = new StringType();
2378          return this.onset;
2379        }
2380        else if (name.equals("recordedDate")) {
2381          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.recordedDate");
2382        }
2383        else if (name.equals("participant")) {
2384          return addParticipant();
2385        }
2386        else if (name.equals("lastOccurrence")) {
2387          throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.lastOccurrence");
2388        }
2389        else if (name.equals("note")) {
2390          return addNote();
2391        }
2392        else if (name.equals("reaction")) {
2393          return addReaction();
2394        }
2395        else
2396          return super.addChild(name);
2397      }
2398
2399  public String fhirType() {
2400    return "AllergyIntolerance";
2401
2402  }
2403
2404      public AllergyIntolerance copy() {
2405        AllergyIntolerance dst = new AllergyIntolerance();
2406        copyValues(dst);
2407        return dst;
2408      }
2409
2410      public void copyValues(AllergyIntolerance dst) {
2411        super.copyValues(dst);
2412        if (identifier != null) {
2413          dst.identifier = new ArrayList<Identifier>();
2414          for (Identifier i : identifier)
2415            dst.identifier.add(i.copy());
2416        };
2417        dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy();
2418        dst.verificationStatus = verificationStatus == null ? null : verificationStatus.copy();
2419        dst.type = type == null ? null : type.copy();
2420        if (category != null) {
2421          dst.category = new ArrayList<Enumeration<AllergyIntoleranceCategory>>();
2422          for (Enumeration<AllergyIntoleranceCategory> i : category)
2423            dst.category.add(i.copy());
2424        };
2425        dst.criticality = criticality == null ? null : criticality.copy();
2426        dst.code = code == null ? null : code.copy();
2427        dst.patient = patient == null ? null : patient.copy();
2428        dst.encounter = encounter == null ? null : encounter.copy();
2429        dst.onset = onset == null ? null : onset.copy();
2430        dst.recordedDate = recordedDate == null ? null : recordedDate.copy();
2431        if (participant != null) {
2432          dst.participant = new ArrayList<AllergyIntoleranceParticipantComponent>();
2433          for (AllergyIntoleranceParticipantComponent i : participant)
2434            dst.participant.add(i.copy());
2435        };
2436        dst.lastOccurrence = lastOccurrence == null ? null : lastOccurrence.copy();
2437        if (note != null) {
2438          dst.note = new ArrayList<Annotation>();
2439          for (Annotation i : note)
2440            dst.note.add(i.copy());
2441        };
2442        if (reaction != null) {
2443          dst.reaction = new ArrayList<AllergyIntoleranceReactionComponent>();
2444          for (AllergyIntoleranceReactionComponent i : reaction)
2445            dst.reaction.add(i.copy());
2446        };
2447      }
2448
2449      protected AllergyIntolerance typedCopy() {
2450        return copy();
2451      }
2452
2453      @Override
2454      public boolean equalsDeep(Base other_) {
2455        if (!super.equalsDeep(other_))
2456          return false;
2457        if (!(other_ instanceof AllergyIntolerance))
2458          return false;
2459        AllergyIntolerance o = (AllergyIntolerance) other_;
2460        return compareDeep(identifier, o.identifier, true) && compareDeep(clinicalStatus, o.clinicalStatus, true)
2461           && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(type, o.type, true)
2462           && compareDeep(category, o.category, true) && compareDeep(criticality, o.criticality, true) && compareDeep(code, o.code, true)
2463           && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(onset, o.onset, true)
2464           && compareDeep(recordedDate, o.recordedDate, true) && compareDeep(participant, o.participant, true)
2465           && compareDeep(lastOccurrence, o.lastOccurrence, true) && compareDeep(note, o.note, true) && compareDeep(reaction, o.reaction, true)
2466          ;
2467      }
2468
2469      @Override
2470      public boolean equalsShallow(Base other_) {
2471        if (!super.equalsShallow(other_))
2472          return false;
2473        if (!(other_ instanceof AllergyIntolerance))
2474          return false;
2475        AllergyIntolerance o = (AllergyIntolerance) other_;
2476        return compareValues(type, o.type, true) && compareValues(category, o.category, true) && compareValues(criticality, o.criticality, true)
2477           && compareValues(recordedDate, o.recordedDate, true) && compareValues(lastOccurrence, o.lastOccurrence, true)
2478          ;
2479      }
2480
2481      public boolean isEmpty() {
2482        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, clinicalStatus
2483          , verificationStatus, type, category, criticality, code, patient, encounter, onset
2484          , recordedDate, participant, lastOccurrence, note, reaction);
2485      }
2486
2487  @Override
2488  public ResourceType getResourceType() {
2489    return ResourceType.AllergyIntolerance;
2490   }
2491
2492 /**
2493   * Search parameter: <b>category</b>
2494   * <p>
2495   * Description: <b>food | medication | environment | biologic</b><br>
2496   * Type: <b>token</b><br>
2497   * Path: <b>AllergyIntolerance.category</b><br>
2498   * </p>
2499   */
2500  @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment | biologic", type="token" )
2501  public static final String SP_CATEGORY = "category";
2502 /**
2503   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2504   * <p>
2505   * Description: <b>food | medication | environment | biologic</b><br>
2506   * Type: <b>token</b><br>
2507   * Path: <b>AllergyIntolerance.category</b><br>
2508   * </p>
2509   */
2510  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2511
2512 /**
2513   * Search parameter: <b>clinical-status</b>
2514   * <p>
2515   * Description: <b>active | inactive | resolved</b><br>
2516   * Type: <b>token</b><br>
2517   * Path: <b>AllergyIntolerance.clinicalStatus</b><br>
2518   * </p>
2519   */
2520  @SearchParamDefinition(name="clinical-status", path="AllergyIntolerance.clinicalStatus", description="active | inactive | resolved", type="token" )
2521  public static final String SP_CLINICAL_STATUS = "clinical-status";
2522 /**
2523   * <b>Fluent Client</b> search parameter constant for <b>clinical-status</b>
2524   * <p>
2525   * Description: <b>active | inactive | resolved</b><br>
2526   * Type: <b>token</b><br>
2527   * Path: <b>AllergyIntolerance.clinicalStatus</b><br>
2528   * </p>
2529   */
2530  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLINICAL_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLINICAL_STATUS);
2531
2532 /**
2533   * Search parameter: <b>criticality</b>
2534   * <p>
2535   * Description: <b>low | high | unable-to-assess</b><br>
2536   * Type: <b>token</b><br>
2537   * Path: <b>AllergyIntolerance.criticality</b><br>
2538   * </p>
2539   */
2540  @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unable-to-assess", type="token" )
2541  public static final String SP_CRITICALITY = "criticality";
2542 /**
2543   * <b>Fluent Client</b> search parameter constant for <b>criticality</b>
2544   * <p>
2545   * Description: <b>low | high | unable-to-assess</b><br>
2546   * Type: <b>token</b><br>
2547   * Path: <b>AllergyIntolerance.criticality</b><br>
2548   * </p>
2549   */
2550  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CRITICALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CRITICALITY);
2551
2552 /**
2553   * Search parameter: <b>last-date</b>
2554   * <p>
2555   * Description: <b>Date(/time) of last known occurrence of a reaction</b><br>
2556   * Type: <b>date</b><br>
2557   * Path: <b>AllergyIntolerance.lastOccurrence</b><br>
2558   * </p>
2559   */
2560  @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurrence", description="Date(/time) of last known occurrence of a reaction", type="date" )
2561  public static final String SP_LAST_DATE = "last-date";
2562 /**
2563   * <b>Fluent Client</b> search parameter constant for <b>last-date</b>
2564   * <p>
2565   * Description: <b>Date(/time) of last known occurrence of a reaction</b><br>
2566   * Type: <b>date</b><br>
2567   * Path: <b>AllergyIntolerance.lastOccurrence</b><br>
2568   * </p>
2569   */
2570  public static final ca.uhn.fhir.rest.gclient.DateClientParam LAST_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LAST_DATE);
2571
2572 /**
2573   * Search parameter: <b>manifestation-code</b>
2574   * <p>
2575   * Description: <b>Clinical symptoms/signs associated with the Event</b><br>
2576   * Type: <b>token</b><br>
2577   * Path: <b>AllergyIntolerance.reaction.manifestation.concept</b><br>
2578   * </p>
2579   */
2580  @SearchParamDefinition(name="manifestation-code", path="AllergyIntolerance.reaction.manifestation.concept", description="Clinical symptoms/signs associated with the Event", type="token" )
2581  public static final String SP_MANIFESTATION_CODE = "manifestation-code";
2582 /**
2583   * <b>Fluent Client</b> search parameter constant for <b>manifestation-code</b>
2584   * <p>
2585   * Description: <b>Clinical symptoms/signs associated with the Event</b><br>
2586   * Type: <b>token</b><br>
2587   * Path: <b>AllergyIntolerance.reaction.manifestation.concept</b><br>
2588   * </p>
2589   */
2590  public static final ca.uhn.fhir.rest.gclient.TokenClientParam MANIFESTATION_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MANIFESTATION_CODE);
2591
2592 /**
2593   * Search parameter: <b>manifestation-reference</b>
2594   * <p>
2595   * Description: <b>Clinical symptoms/signs associated with the Event</b><br>
2596   * Type: <b>reference</b><br>
2597   * Path: <b>AllergyIntolerance.reaction.manifestation.reference</b><br>
2598   * </p>
2599   */
2600  @SearchParamDefinition(name="manifestation-reference", path="AllergyIntolerance.reaction.manifestation.reference", description="Clinical symptoms/signs associated with the Event", type="reference" )
2601  public static final String SP_MANIFESTATION_REFERENCE = "manifestation-reference";
2602 /**
2603   * <b>Fluent Client</b> search parameter constant for <b>manifestation-reference</b>
2604   * <p>
2605   * Description: <b>Clinical symptoms/signs associated with the Event</b><br>
2606   * Type: <b>reference</b><br>
2607   * Path: <b>AllergyIntolerance.reaction.manifestation.reference</b><br>
2608   * </p>
2609   */
2610  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANIFESTATION_REFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANIFESTATION_REFERENCE);
2611
2612/**
2613   * Constant for fluent queries to be used to add include statements. Specifies
2614   * the path value of "<b>AllergyIntolerance:manifestation-reference</b>".
2615   */
2616  public static final ca.uhn.fhir.model.api.Include INCLUDE_MANIFESTATION_REFERENCE = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:manifestation-reference").toLocked();
2617
2618 /**
2619   * Search parameter: <b>participant</b>
2620   * <p>
2621   * Description: <b>Who or what participated in the activities related to the allergy or intolerance</b><br>
2622   * Type: <b>reference</b><br>
2623   * Path: <b>AllergyIntolerance.participant.actor</b><br>
2624   * </p>
2625   */
2626  @SearchParamDefinition(name="participant", path="AllergyIntolerance.participant.actor", description="Who or what participated in the activities related to the allergy or intolerance", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for RelatedPerson") }, target={CareTeam.class, Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
2627  public static final String SP_PARTICIPANT = "participant";
2628 /**
2629   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
2630   * <p>
2631   * Description: <b>Who or what participated in the activities related to the allergy or intolerance</b><br>
2632   * Type: <b>reference</b><br>
2633   * Path: <b>AllergyIntolerance.participant.actor</b><br>
2634   * </p>
2635   */
2636  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT);
2637
2638/**
2639   * Constant for fluent queries to be used to add include statements. Specifies
2640   * the path value of "<b>AllergyIntolerance:participant</b>".
2641   */
2642  public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:participant").toLocked();
2643
2644 /**
2645   * Search parameter: <b>route</b>
2646   * <p>
2647   * Description: <b>How the subject was exposed to the substance</b><br>
2648   * Type: <b>token</b><br>
2649   * Path: <b>AllergyIntolerance.reaction.exposureRoute</b><br>
2650   * </p>
2651   */
2652  @SearchParamDefinition(name="route", path="AllergyIntolerance.reaction.exposureRoute", description="How the subject was exposed to the substance", type="token" )
2653  public static final String SP_ROUTE = "route";
2654 /**
2655   * <b>Fluent Client</b> search parameter constant for <b>route</b>
2656   * <p>
2657   * Description: <b>How the subject was exposed to the substance</b><br>
2658   * Type: <b>token</b><br>
2659   * Path: <b>AllergyIntolerance.reaction.exposureRoute</b><br>
2660   * </p>
2661   */
2662  public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROUTE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROUTE);
2663
2664 /**
2665   * Search parameter: <b>severity</b>
2666   * <p>
2667   * Description: <b>mild | moderate | severe (of event as a whole)</b><br>
2668   * Type: <b>token</b><br>
2669   * Path: <b>AllergyIntolerance.reaction.severity</b><br>
2670   * </p>
2671   */
2672  @SearchParamDefinition(name="severity", path="AllergyIntolerance.reaction.severity", description="mild | moderate | severe (of event as a whole)", type="token" )
2673  public static final String SP_SEVERITY = "severity";
2674 /**
2675   * <b>Fluent Client</b> search parameter constant for <b>severity</b>
2676   * <p>
2677   * Description: <b>mild | moderate | severe (of event as a whole)</b><br>
2678   * Type: <b>token</b><br>
2679   * Path: <b>AllergyIntolerance.reaction.severity</b><br>
2680   * </p>
2681   */
2682  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEVERITY);
2683
2684 /**
2685   * Search parameter: <b>verification-status</b>
2686   * <p>
2687   * Description: <b>unconfirmed | presumed | confirmed | refuted | entered-in-error</b><br>
2688   * Type: <b>token</b><br>
2689   * Path: <b>AllergyIntolerance.verificationStatus</b><br>
2690   * </p>
2691   */
2692  @SearchParamDefinition(name="verification-status", path="AllergyIntolerance.verificationStatus", description="unconfirmed | presumed | confirmed | refuted | entered-in-error", type="token" )
2693  public static final String SP_VERIFICATION_STATUS = "verification-status";
2694 /**
2695   * <b>Fluent Client</b> search parameter constant for <b>verification-status</b>
2696   * <p>
2697   * Description: <b>unconfirmed | presumed | confirmed | refuted | entered-in-error</b><br>
2698   * Type: <b>token</b><br>
2699   * Path: <b>AllergyIntolerance.verificationStatus</b><br>
2700   * </p>
2701   */
2702  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERIFICATION_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERIFICATION_STATUS);
2703
2704 /**
2705   * Search parameter: <b>code</b>
2706   * <p>
2707   * Description: <b>Multiple Resources: 
2708
2709* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2710* [Condition](condition.html): Code for the condition
2711* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2712* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2713* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2714* [List](list.html): What the purpose of this list is
2715* [Medication](medication.html): Returns medications for a specific code
2716* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2717* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2718* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2719* [MedicationUsage](medicationusage.html): Return statements of this medication code
2720* [Observation](observation.html): The code of the observation type
2721* [Procedure](procedure.html): A code to identify a  procedure
2722</b><br>
2723   * Type: <b>token</b><br>
2724   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code</b><br>
2725   * </p>
2726   */
2727  @SearchParamDefinition(name="code", path="AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance\r\n* [Condition](condition.html): Code for the condition\r\n* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered\r\n* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code\r\n* [List](list.html): What the purpose of this list is\r\n* [Medication](medication.html): Returns medications for a specific code\r\n* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code\r\n* [MedicationUsage](medicationusage.html): Return statements of this medication code\r\n* [Observation](observation.html): The code of the observation type\r\n* [Procedure](procedure.html): A code to identify a  procedure\r\n", type="token" )
2728  public static final String SP_CODE = "code";
2729 /**
2730   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2731   * <p>
2732   * Description: <b>Multiple Resources: 
2733
2734* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2735* [Condition](condition.html): Code for the condition
2736* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2737* [DiagnosticReport](diagnosticreport.html): The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
2738* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2739* [List](list.html): What the purpose of this list is
2740* [Medication](medication.html): Returns medications for a specific code
2741* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2742* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2743* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2744* [MedicationUsage](medicationusage.html): Return statements of this medication code
2745* [Observation](observation.html): The code of the observation type
2746* [Procedure](procedure.html): A code to identify a  procedure
2747</b><br>
2748   * Type: <b>token</b><br>
2749   * Path: <b>AllergyIntolerance.code | AllergyIntolerance.reaction.substance | Condition.code | DeviceRequest.code.concept | DiagnosticReport.code | FamilyMemberHistory.condition.code | List.code | Medication.code | MedicationAdministration.medication.concept | MedicationDispense.medication.concept | MedicationRequest.medication.concept | MedicationUsage.medication.concept | Observation.code | Procedure.code</b><br>
2750   * </p>
2751   */
2752  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2753
2754 /**
2755   * Search parameter: <b>date</b>
2756   * <p>
2757   * Description: <b>Multiple Resources: 
2758
2759* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2760* [CarePlan](careplan.html): Time period plan covers
2761* [CareTeam](careteam.html): A date within the coverage time period.
2762* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2763* [Composition](composition.html): Composition editing time
2764* [Consent](consent.html): When consent was agreed to
2765* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2766* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2767* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2768* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2769* [Flag](flag.html): Time period when flag is active
2770* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2771* [List](list.html): When the list was prepared
2772* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2773* [Procedure](procedure.html): When the procedure occurred or is occurring
2774* [RiskAssessment](riskassessment.html): When was assessment made?
2775* [SupplyRequest](supplyrequest.html): When the request was made
2776</b><br>
2777   * Type: <b>date</b><br>
2778   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2779   * </p>
2780   */
2781  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded\r\n* [CarePlan](careplan.html): Time period plan covers\r\n* [CareTeam](careteam.html): A date within the coverage time period.\r\n* [ClinicalImpression](clinicalimpression.html): When the assessment was documented\r\n* [Composition](composition.html): Composition editing time\r\n* [Consent](consent.html): When consent was agreed to\r\n* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report\r\n* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted\r\n* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period\r\n* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated\r\n* [Flag](flag.html): Time period when flag is active\r\n* [Immunization](immunization.html): Vaccination  (non)-Administration Date\r\n* [List](list.html): When the list was prepared\r\n* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period\r\n* [Procedure](procedure.html): When the procedure occurred or is occurring\r\n* [RiskAssessment](riskassessment.html): When was assessment made?\r\n* [SupplyRequest](supplyrequest.html): When the request was made\r\n", type="date" )
2782  public static final String SP_DATE = "date";
2783 /**
2784   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2785   * <p>
2786   * Description: <b>Multiple Resources: 
2787
2788* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2789* [CarePlan](careplan.html): Time period plan covers
2790* [CareTeam](careteam.html): A date within the coverage time period.
2791* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2792* [Composition](composition.html): Composition editing time
2793* [Consent](consent.html): When consent was agreed to
2794* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2795* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2796* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2797* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2798* [Flag](flag.html): Time period when flag is active
2799* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2800* [List](list.html): When the list was prepared
2801* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2802* [Procedure](procedure.html): When the procedure occurred or is occurring
2803* [RiskAssessment](riskassessment.html): When was assessment made?
2804* [SupplyRequest](supplyrequest.html): When the request was made
2805</b><br>
2806   * Type: <b>date</b><br>
2807   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effective | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective | Procedure.occurrence | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2808   * </p>
2809   */
2810  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2811
2812 /**
2813   * Search parameter: <b>identifier</b>
2814   * <p>
2815   * Description: <b>Multiple Resources: 
2816
2817* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2818* [CarePlan](careplan.html): External Ids for this plan
2819* [CareTeam](careteam.html): External Ids for this team
2820* [Composition](composition.html): Version-independent identifier for the Composition
2821* [Condition](condition.html): A unique identifier of the condition record
2822* [Consent](consent.html): Identifier for this record (external references)
2823* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2824* [DeviceRequest](devicerequest.html): Business identifier for request/order
2825* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2826* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2827* [DocumentReference](documentreference.html): Identifier of the attachment binary
2828* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2829* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2830* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2831* [Goal](goal.html): External Ids for this goal
2832* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2833* [Immunization](immunization.html): Business identifier
2834* [List](list.html): Business identifier
2835* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2836* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2837* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2838* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2839* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2840* [Observation](observation.html): The unique id for a particular observation
2841* [Procedure](procedure.html): A unique identifier for a procedure
2842* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2843* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2844* [SupplyDelivery](supplydelivery.html): External identifier
2845* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2846* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2847</b><br>
2848   * Type: <b>token</b><br>
2849   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2850   * </p>
2851   */
2852  @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): External ids for this item\r\n* [CarePlan](careplan.html): External Ids for this plan\r\n* [CareTeam](careteam.html): External Ids for this team\r\n* [Composition](composition.html): Version-independent identifier for the Composition\r\n* [Condition](condition.html): A unique identifier of the condition record\r\n* [Consent](consent.html): Identifier for this record (external references)\r\n* [DetectedIssue](detectedissue.html): Unique id for the detected issue\r\n* [DeviceRequest](devicerequest.html): Business identifier for request/order\r\n* [DiagnosticReport](diagnosticreport.html): An identifier for the report\r\n* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents\r\n* [DocumentReference](documentreference.html): Identifier of the attachment binary\r\n* [Encounter](encounter.html): Identifier(s) by which this encounter is known\r\n* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare\r\n* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier\r\n* [Goal](goal.html): External Ids for this goal\r\n* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID\r\n* [Immunization](immunization.html): Business identifier\r\n* [List](list.html): Business identifier\r\n* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier\r\n* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier\r\n* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier\r\n* [MedicationUsage](medicationusage.html): Return statements with this external identifier\r\n* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier\r\n* [Observation](observation.html): The unique id for a particular observation\r\n* [Procedure](procedure.html): A unique identifier for a procedure\r\n* [RiskAssessment](riskassessment.html): Unique identifier for the assessment\r\n* [ServiceRequest](servicerequest.html): Identifiers assigned to this order\r\n* [SupplyDelivery](supplydelivery.html): External identifier\r\n* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest\r\n* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier\r\n", type="token" )
2853  public static final String SP_IDENTIFIER = "identifier";
2854 /**
2855   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2856   * <p>
2857   * Description: <b>Multiple Resources: 
2858
2859* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2860* [CarePlan](careplan.html): External Ids for this plan
2861* [CareTeam](careteam.html): External Ids for this team
2862* [Composition](composition.html): Version-independent identifier for the Composition
2863* [Condition](condition.html): A unique identifier of the condition record
2864* [Consent](consent.html): Identifier for this record (external references)
2865* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2866* [DeviceRequest](devicerequest.html): Business identifier for request/order
2867* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2868* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2869* [DocumentReference](documentreference.html): Identifier of the attachment binary
2870* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2871* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2872* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2873* [Goal](goal.html): External Ids for this goal
2874* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2875* [Immunization](immunization.html): Business identifier
2876* [List](list.html): Business identifier
2877* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2878* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2879* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2880* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2881* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2882* [Observation](observation.html): The unique id for a particular observation
2883* [Procedure](procedure.html): A unique identifier for a procedure
2884* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2885* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2886* [SupplyDelivery](supplydelivery.html): External identifier
2887* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2888* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2889</b><br>
2890   * Type: <b>token</b><br>
2891   * Path: <b>AllergyIntolerance.identifier | CarePlan.identifier | CareTeam.identifier | Composition.identifier | Condition.identifier | Consent.identifier | DetectedIssue.identifier | DeviceRequest.identifier | DiagnosticReport.identifier | DocumentManifest.masterIdentifier | DocumentManifest.identifier | DocumentReference.identifier | Encounter.identifier | EpisodeOfCare.identifier | FamilyMemberHistory.identifier | Goal.identifier | ImagingStudy.identifier | Immunization.identifier | List.identifier | MedicationAdministration.identifier | MedicationDispense.identifier | MedicationRequest.identifier | MedicationUsage.identifier | NutritionOrder.identifier | Observation.identifier | Procedure.identifier | RiskAssessment.identifier | ServiceRequest.identifier | SupplyDelivery.identifier | SupplyRequest.identifier | VisionPrescription.identifier</b><br>
2892   * </p>
2893   */
2894  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2895
2896 /**
2897   * Search parameter: <b>patient</b>
2898   * <p>
2899   * Description: <b>Multiple Resources: 
2900
2901* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2902* [CarePlan](careplan.html): Who the care plan is for
2903* [CareTeam](careteam.html): Who care team is for
2904* [ClinicalImpression](clinicalimpression.html): Patient assessed
2905* [Composition](composition.html): Who and/or what the composition is about
2906* [Condition](condition.html): Who has the condition?
2907* [Consent](consent.html): Who the consent applies to
2908* [DetectedIssue](detectedissue.html): Associated patient
2909* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2910* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2911* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2912* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2913* [DocumentReference](documentreference.html): Who/what is the subject of the document
2914* [Encounter](encounter.html): The patient present at the encounter
2915* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2916* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2917* [Flag](flag.html): The identity of a subject to list flags for
2918* [Goal](goal.html): Who this goal is intended for
2919* [ImagingStudy](imagingstudy.html): Who the study is about
2920* [Immunization](immunization.html): The patient for the vaccination record
2921* [List](list.html): If all resources have the same subject
2922* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2923* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2924* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2925* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2926* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2927* [Observation](observation.html): The subject that the observation is about (if patient)
2928* [Procedure](procedure.html): Search by subject - a patient
2929* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2930* [ServiceRequest](servicerequest.html): Search by subject - a patient
2931* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2932* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2933</b><br>
2934   * Type: <b>reference</b><br>
2935   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2936   * </p>
2937   */
2938  @SearchParamDefinition(name="patient", path="AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for\r\n* [CarePlan](careplan.html): Who the care plan is for\r\n* [CareTeam](careteam.html): Who care team is for\r\n* [ClinicalImpression](clinicalimpression.html): Patient assessed\r\n* [Composition](composition.html): Who and/or what the composition is about\r\n* [Condition](condition.html): Who has the condition?\r\n* [Consent](consent.html): Who the consent applies to\r\n* [DetectedIssue](detectedissue.html): Associated patient\r\n* [DeviceRequest](devicerequest.html): Individual the service is ordered for\r\n* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device\r\n* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient\r\n* [DocumentManifest](documentmanifest.html): The subject of the set of documents\r\n* [DocumentReference](documentreference.html): Who/what is the subject of the document\r\n* [Encounter](encounter.html): The patient present at the encounter\r\n* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care\r\n* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for\r\n* [Flag](flag.html): The identity of a subject to list flags for\r\n* [Goal](goal.html): Who this goal is intended for\r\n* [ImagingStudy](imagingstudy.html): Who the study is about\r\n* [Immunization](immunization.html): The patient for the vaccination record\r\n* [List](list.html): If all resources have the same subject\r\n* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for\r\n* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for\r\n* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient\r\n* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.\r\n* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement\r\n* [Observation](observation.html): The subject that the observation is about (if patient)\r\n* [Procedure](procedure.html): Search by subject - a patient\r\n* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?\r\n* [ServiceRequest](servicerequest.html): Search by subject - a patient\r\n* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Base FHIR compartment definition for Patient") }, target={BiologicallyDerivedProduct.class, Device.class, Group.class, Location.class, Medication.class, NutritionProduct.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Substance.class } )
2939  public static final String SP_PATIENT = "patient";
2940 /**
2941   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2942   * <p>
2943   * Description: <b>Multiple Resources: 
2944
2945* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2946* [CarePlan](careplan.html): Who the care plan is for
2947* [CareTeam](careteam.html): Who care team is for
2948* [ClinicalImpression](clinicalimpression.html): Patient assessed
2949* [Composition](composition.html): Who and/or what the composition is about
2950* [Condition](condition.html): Who has the condition?
2951* [Consent](consent.html): Who the consent applies to
2952* [DetectedIssue](detectedissue.html): Associated patient
2953* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2954* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2955* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2956* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2957* [DocumentReference](documentreference.html): Who/what is the subject of the document
2958* [Encounter](encounter.html): The patient present at the encounter
2959* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2960* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2961* [Flag](flag.html): The identity of a subject to list flags for
2962* [Goal](goal.html): Who this goal is intended for
2963* [ImagingStudy](imagingstudy.html): Who the study is about
2964* [Immunization](immunization.html): The patient for the vaccination record
2965* [List](list.html): If all resources have the same subject
2966* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2967* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2968* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2969* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2970* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2971* [Observation](observation.html): The subject that the observation is about (if patient)
2972* [Procedure](procedure.html): Search by subject - a patient
2973* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2974* [ServiceRequest](servicerequest.html): Search by subject - a patient
2975* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2976* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2977</b><br>
2978   * Type: <b>reference</b><br>
2979   * Path: <b>AllergyIntolerance.patient | CarePlan.subject.where(resolve() is Patient) | CareTeam.subject.where(resolve() is Patient) | ClinicalImpression.subject.where(resolve() is Patient) | Composition.subject.where(resolve() is Patient) | Condition.subject.where(resolve() is Patient) | Consent.subject.where(resolve() is Patient) | DetectedIssue.subject | DeviceRequest.subject.where(resolve() is Patient) | DeviceUsage.patient | DiagnosticReport.subject.where(resolve() is Patient) | DocumentManifest.subject.where(resolve() is Patient) | DocumentReference.subject.where(resolve() is Patient) | Encounter.subject.where(resolve() is Patient) | EpisodeOfCare.patient | FamilyMemberHistory.patient | Flag.subject.where(resolve() is Patient) | Goal.subject.where(resolve() is Patient) | ImagingStudy.subject.where(resolve() is Patient) | Immunization.patient | List.subject.where(resolve() is Patient) | MedicationAdministration.subject.where(resolve() is Patient) | MedicationDispense.subject.where(resolve() is Patient) | MedicationRequest.subject.where(resolve() is Patient) | MedicationUsage.subject.where(resolve() is Patient) | NutritionOrder.subject.where(resolve() is Patient) | Observation.subject.where(resolve() is Patient) | Procedure.subject.where(resolve() is Patient) | RiskAssessment.subject.where(resolve() is Patient) | ServiceRequest.subject.where(resolve() is Patient) | SupplyDelivery.patient | VisionPrescription.patient</b><br>
2980   * </p>
2981   */
2982  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2983
2984/**
2985   * Constant for fluent queries to be used to add include statements. Specifies
2986   * the path value of "<b>AllergyIntolerance:patient</b>".
2987   */
2988  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:patient").toLocked();
2989
2990 /**
2991   * Search parameter: <b>type</b>
2992   * <p>
2993   * Description: <b>Multiple Resources: 
2994
2995* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
2996* [Composition](composition.html): Kind of composition (LOINC if possible)
2997* [DocumentManifest](documentmanifest.html): Kind of document set
2998* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
2999* [Encounter](encounter.html): Specific type of encounter
3000* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3001</b><br>
3002   * Type: <b>token</b><br>
3003   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
3004   * </p>
3005   */
3006  @SearchParamDefinition(name="type", path="AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type", description="Multiple Resources: \r\n\r\n* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)\r\n* [Composition](composition.html): Kind of composition (LOINC if possible)\r\n* [DocumentManifest](documentmanifest.html): Kind of document set\r\n* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)\r\n* [Encounter](encounter.html): Specific type of encounter\r\n* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management\r\n", type="token" )
3007  public static final String SP_TYPE = "type";
3008 /**
3009   * <b>Fluent Client</b> search parameter constant for <b>type</b>
3010   * <p>
3011   * Description: <b>Multiple Resources: 
3012
3013* [AllergyIntolerance](allergyintolerance.html): allergy | intolerance - Underlying mechanism (if known)
3014* [Composition](composition.html): Kind of composition (LOINC if possible)
3015* [DocumentManifest](documentmanifest.html): Kind of document set
3016* [DocumentReference](documentreference.html): Kind of document (LOINC if possible)
3017* [Encounter](encounter.html): Specific type of encounter
3018* [EpisodeOfCare](episodeofcare.html): Type/class  - e.g. specialist referral, disease management
3019</b><br>
3020   * Type: <b>token</b><br>
3021   * Path: <b>AllergyIntolerance.type | Composition.type | DocumentManifest.type | DocumentReference.type | Encounter.type | EpisodeOfCare.type</b><br>
3022   * </p>
3023   */
3024  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
3025
3026
3027}
3028