001package org.hl7.fhir.dstu3.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Mon, Apr 17, 2017 17:38-0400 for FHIR v3.0.1
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import ca.uhn.fhir.model.api.annotation.ResourceDef;
038import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
039import ca.uhn.fhir.model.api.annotation.Child;
040import ca.uhn.fhir.model.api.annotation.ChildOrder;
041import ca.uhn.fhir.model.api.annotation.Description;
042import ca.uhn.fhir.model.api.annotation.Block;
043import org.hl7.fhir.instance.model.api.*;
044import org.hl7.fhir.exceptions.FHIRException;
045/**
046 * Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.
047 */
048@ResourceDef(name="AdverseEvent", profile="http://hl7.org/fhir/Profile/AdverseEvent")
049public class AdverseEvent extends DomainResource {
050
051    public enum AdverseEventCategory {
052        /**
053         * null
054         */
055        AE, 
056        /**
057         * null
058         */
059        PAE, 
060        /**
061         * added to help the parsers with the generic types
062         */
063        NULL;
064        public static AdverseEventCategory fromCode(String codeString) throws FHIRException {
065            if (codeString == null || "".equals(codeString))
066                return null;
067        if ("AE".equals(codeString))
068          return AE;
069        if ("PAE".equals(codeString))
070          return PAE;
071        if (Configuration.isAcceptInvalidEnums())
072          return null;
073        else
074          throw new FHIRException("Unknown AdverseEventCategory code '"+codeString+"'");
075        }
076        public String toCode() {
077          switch (this) {
078            case AE: return "AE";
079            case PAE: return "PAE";
080            default: return "?";
081          }
082        }
083        public String getSystem() {
084          switch (this) {
085            case AE: return "http://hl7.org/fhir/adverse-event-category";
086            case PAE: return "http://hl7.org/fhir/adverse-event-category";
087            default: return "?";
088          }
089        }
090        public String getDefinition() {
091          switch (this) {
092            case AE: return "";
093            case PAE: return "";
094            default: return "?";
095          }
096        }
097        public String getDisplay() {
098          switch (this) {
099            case AE: return "Adverse Event";
100            case PAE: return "Potential Adverse Event";
101            default: return "?";
102          }
103        }
104    }
105
106  public static class AdverseEventCategoryEnumFactory implements EnumFactory<AdverseEventCategory> {
107    public AdverseEventCategory fromCode(String codeString) throws IllegalArgumentException {
108      if (codeString == null || "".equals(codeString))
109            if (codeString == null || "".equals(codeString))
110                return null;
111        if ("AE".equals(codeString))
112          return AdverseEventCategory.AE;
113        if ("PAE".equals(codeString))
114          return AdverseEventCategory.PAE;
115        throw new IllegalArgumentException("Unknown AdverseEventCategory code '"+codeString+"'");
116        }
117        public Enumeration<AdverseEventCategory> fromType(Base code) throws FHIRException {
118          if (code == null)
119            return null;
120          if (code.isEmpty())
121            return new Enumeration<AdverseEventCategory>(this);
122          String codeString = ((PrimitiveType) code).asStringValue();
123          if (codeString == null || "".equals(codeString))
124            return null;
125        if ("AE".equals(codeString))
126          return new Enumeration<AdverseEventCategory>(this, AdverseEventCategory.AE);
127        if ("PAE".equals(codeString))
128          return new Enumeration<AdverseEventCategory>(this, AdverseEventCategory.PAE);
129        throw new FHIRException("Unknown AdverseEventCategory code '"+codeString+"'");
130        }
131    public String toCode(AdverseEventCategory code) {
132      if (code == AdverseEventCategory.AE)
133        return "AE";
134      if (code == AdverseEventCategory.PAE)
135        return "PAE";
136      return "?";
137      }
138    public String toSystem(AdverseEventCategory code) {
139      return code.getSystem();
140      }
141    }
142
143    public enum AdverseEventCausality {
144        /**
145         * null
146         */
147        CAUSALITY1, 
148        /**
149         * null
150         */
151        CAUSALITY2, 
152        /**
153         * added to help the parsers with the generic types
154         */
155        NULL;
156        public static AdverseEventCausality fromCode(String codeString) throws FHIRException {
157            if (codeString == null || "".equals(codeString))
158                return null;
159        if ("causality1".equals(codeString))
160          return CAUSALITY1;
161        if ("causality2".equals(codeString))
162          return CAUSALITY2;
163        if (Configuration.isAcceptInvalidEnums())
164          return null;
165        else
166          throw new FHIRException("Unknown AdverseEventCausality code '"+codeString+"'");
167        }
168        public String toCode() {
169          switch (this) {
170            case CAUSALITY1: return "causality1";
171            case CAUSALITY2: return "causality2";
172            default: return "?";
173          }
174        }
175        public String getSystem() {
176          switch (this) {
177            case CAUSALITY1: return "http://hl7.org/fhir/adverse-event-causality";
178            case CAUSALITY2: return "http://hl7.org/fhir/adverse-event-causality";
179            default: return "?";
180          }
181        }
182        public String getDefinition() {
183          switch (this) {
184            case CAUSALITY1: return "";
185            case CAUSALITY2: return "";
186            default: return "?";
187          }
188        }
189        public String getDisplay() {
190          switch (this) {
191            case CAUSALITY1: return "causality1 placeholder";
192            case CAUSALITY2: return "causality2 placeholder";
193            default: return "?";
194          }
195        }
196    }
197
198  public static class AdverseEventCausalityEnumFactory implements EnumFactory<AdverseEventCausality> {
199    public AdverseEventCausality fromCode(String codeString) throws IllegalArgumentException {
200      if (codeString == null || "".equals(codeString))
201            if (codeString == null || "".equals(codeString))
202                return null;
203        if ("causality1".equals(codeString))
204          return AdverseEventCausality.CAUSALITY1;
205        if ("causality2".equals(codeString))
206          return AdverseEventCausality.CAUSALITY2;
207        throw new IllegalArgumentException("Unknown AdverseEventCausality code '"+codeString+"'");
208        }
209        public Enumeration<AdverseEventCausality> fromType(Base code) throws FHIRException {
210          if (code == null)
211            return null;
212          if (code.isEmpty())
213            return new Enumeration<AdverseEventCausality>(this);
214          String codeString = ((PrimitiveType) code).asStringValue();
215          if (codeString == null || "".equals(codeString))
216            return null;
217        if ("causality1".equals(codeString))
218          return new Enumeration<AdverseEventCausality>(this, AdverseEventCausality.CAUSALITY1);
219        if ("causality2".equals(codeString))
220          return new Enumeration<AdverseEventCausality>(this, AdverseEventCausality.CAUSALITY2);
221        throw new FHIRException("Unknown AdverseEventCausality code '"+codeString+"'");
222        }
223    public String toCode(AdverseEventCausality code) {
224      if (code == AdverseEventCausality.CAUSALITY1)
225        return "causality1";
226      if (code == AdverseEventCausality.CAUSALITY2)
227        return "causality2";
228      return "?";
229      }
230    public String toSystem(AdverseEventCausality code) {
231      return code.getSystem();
232      }
233    }
234
235    @Block()
236    public static class AdverseEventSuspectEntityComponent extends BackboneElement implements IBaseBackboneElement {
237        /**
238         * Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.
239         */
240        @Child(name = "instance", type = {Substance.class, Medication.class, MedicationAdministration.class, MedicationStatement.class, Device.class}, order=1, min=1, max=1, modifier=false, summary=true)
241        @Description(shortDefinition="Refers to the specific entity that caused the adverse event", formalDefinition="Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device." )
242        protected Reference instance;
243
244        /**
245         * The actual object that is the target of the reference (Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.)
246         */
247        protected Resource instanceTarget;
248
249        /**
250         * causality1 | causality2.
251         */
252        @Child(name = "causality", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true)
253        @Description(shortDefinition="causality1 | causality2", formalDefinition="causality1 | causality2." )
254        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-causality")
255        protected Enumeration<AdverseEventCausality> causality;
256
257        /**
258         * assess1 | assess2.
259         */
260        @Child(name = "causalityAssessment", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
261        @Description(shortDefinition="assess1 | assess2", formalDefinition="assess1 | assess2." )
262        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-causality-assess")
263        protected CodeableConcept causalityAssessment;
264
265        /**
266         * AdverseEvent.suspectEntity.causalityProductRelatedness.
267         */
268        @Child(name = "causalityProductRelatedness", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true)
269        @Description(shortDefinition="AdverseEvent.suspectEntity.causalityProductRelatedness", formalDefinition="AdverseEvent.suspectEntity.causalityProductRelatedness." )
270        protected StringType causalityProductRelatedness;
271
272        /**
273         * method1 | method2.
274         */
275        @Child(name = "causalityMethod", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true)
276        @Description(shortDefinition="method1 | method2", formalDefinition="method1 | method2." )
277        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-causality-method")
278        protected CodeableConcept causalityMethod;
279
280        /**
281         * AdverseEvent.suspectEntity.causalityAuthor.
282         */
283        @Child(name = "causalityAuthor", type = {Practitioner.class, PractitionerRole.class}, order=6, min=0, max=1, modifier=false, summary=true)
284        @Description(shortDefinition="AdverseEvent.suspectEntity.causalityAuthor", formalDefinition="AdverseEvent.suspectEntity.causalityAuthor." )
285        protected Reference causalityAuthor;
286
287        /**
288         * The actual object that is the target of the reference (AdverseEvent.suspectEntity.causalityAuthor.)
289         */
290        protected Resource causalityAuthorTarget;
291
292        /**
293         * result1 | result2.
294         */
295        @Child(name = "causalityResult", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
296        @Description(shortDefinition="result1 | result2", formalDefinition="result1 | result2." )
297        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-causality-result")
298        protected CodeableConcept causalityResult;
299
300        private static final long serialVersionUID = -815429592L;
301
302    /**
303     * Constructor
304     */
305      public AdverseEventSuspectEntityComponent() {
306        super();
307      }
308
309    /**
310     * Constructor
311     */
312      public AdverseEventSuspectEntityComponent(Reference instance) {
313        super();
314        this.instance = instance;
315      }
316
317        /**
318         * @return {@link #instance} (Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.)
319         */
320        public Reference getInstance() { 
321          if (this.instance == null)
322            if (Configuration.errorOnAutoCreate())
323              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.instance");
324            else if (Configuration.doAutoCreate())
325              this.instance = new Reference(); // cc
326          return this.instance;
327        }
328
329        public boolean hasInstance() { 
330          return this.instance != null && !this.instance.isEmpty();
331        }
332
333        /**
334         * @param value {@link #instance} (Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.)
335         */
336        public AdverseEventSuspectEntityComponent setInstance(Reference value) { 
337          this.instance = value;
338          return this;
339        }
340
341        /**
342         * @return {@link #instance} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.)
343         */
344        public Resource getInstanceTarget() { 
345          return this.instanceTarget;
346        }
347
348        /**
349         * @param value {@link #instance} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.)
350         */
351        public AdverseEventSuspectEntityComponent setInstanceTarget(Resource value) { 
352          this.instanceTarget = value;
353          return this;
354        }
355
356        /**
357         * @return {@link #causality} (causality1 | causality2.). This is the underlying object with id, value and extensions. The accessor "getCausality" gives direct access to the value
358         */
359        public Enumeration<AdverseEventCausality> getCausalityElement() { 
360          if (this.causality == null)
361            if (Configuration.errorOnAutoCreate())
362              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causality");
363            else if (Configuration.doAutoCreate())
364              this.causality = new Enumeration<AdverseEventCausality>(new AdverseEventCausalityEnumFactory()); // bb
365          return this.causality;
366        }
367
368        public boolean hasCausalityElement() { 
369          return this.causality != null && !this.causality.isEmpty();
370        }
371
372        public boolean hasCausality() { 
373          return this.causality != null && !this.causality.isEmpty();
374        }
375
376        /**
377         * @param value {@link #causality} (causality1 | causality2.). This is the underlying object with id, value and extensions. The accessor "getCausality" gives direct access to the value
378         */
379        public AdverseEventSuspectEntityComponent setCausalityElement(Enumeration<AdverseEventCausality> value) { 
380          this.causality = value;
381          return this;
382        }
383
384        /**
385         * @return causality1 | causality2.
386         */
387        public AdverseEventCausality getCausality() { 
388          return this.causality == null ? null : this.causality.getValue();
389        }
390
391        /**
392         * @param value causality1 | causality2.
393         */
394        public AdverseEventSuspectEntityComponent setCausality(AdverseEventCausality value) { 
395          if (value == null)
396            this.causality = null;
397          else {
398            if (this.causality == null)
399              this.causality = new Enumeration<AdverseEventCausality>(new AdverseEventCausalityEnumFactory());
400            this.causality.setValue(value);
401          }
402          return this;
403        }
404
405        /**
406         * @return {@link #causalityAssessment} (assess1 | assess2.)
407         */
408        public CodeableConcept getCausalityAssessment() { 
409          if (this.causalityAssessment == null)
410            if (Configuration.errorOnAutoCreate())
411              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causalityAssessment");
412            else if (Configuration.doAutoCreate())
413              this.causalityAssessment = new CodeableConcept(); // cc
414          return this.causalityAssessment;
415        }
416
417        public boolean hasCausalityAssessment() { 
418          return this.causalityAssessment != null && !this.causalityAssessment.isEmpty();
419        }
420
421        /**
422         * @param value {@link #causalityAssessment} (assess1 | assess2.)
423         */
424        public AdverseEventSuspectEntityComponent setCausalityAssessment(CodeableConcept value) { 
425          this.causalityAssessment = value;
426          return this;
427        }
428
429        /**
430         * @return {@link #causalityProductRelatedness} (AdverseEvent.suspectEntity.causalityProductRelatedness.). This is the underlying object with id, value and extensions. The accessor "getCausalityProductRelatedness" gives direct access to the value
431         */
432        public StringType getCausalityProductRelatednessElement() { 
433          if (this.causalityProductRelatedness == null)
434            if (Configuration.errorOnAutoCreate())
435              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causalityProductRelatedness");
436            else if (Configuration.doAutoCreate())
437              this.causalityProductRelatedness = new StringType(); // bb
438          return this.causalityProductRelatedness;
439        }
440
441        public boolean hasCausalityProductRelatednessElement() { 
442          return this.causalityProductRelatedness != null && !this.causalityProductRelatedness.isEmpty();
443        }
444
445        public boolean hasCausalityProductRelatedness() { 
446          return this.causalityProductRelatedness != null && !this.causalityProductRelatedness.isEmpty();
447        }
448
449        /**
450         * @param value {@link #causalityProductRelatedness} (AdverseEvent.suspectEntity.causalityProductRelatedness.). This is the underlying object with id, value and extensions. The accessor "getCausalityProductRelatedness" gives direct access to the value
451         */
452        public AdverseEventSuspectEntityComponent setCausalityProductRelatednessElement(StringType value) { 
453          this.causalityProductRelatedness = value;
454          return this;
455        }
456
457        /**
458         * @return AdverseEvent.suspectEntity.causalityProductRelatedness.
459         */
460        public String getCausalityProductRelatedness() { 
461          return this.causalityProductRelatedness == null ? null : this.causalityProductRelatedness.getValue();
462        }
463
464        /**
465         * @param value AdverseEvent.suspectEntity.causalityProductRelatedness.
466         */
467        public AdverseEventSuspectEntityComponent setCausalityProductRelatedness(String value) { 
468          if (Utilities.noString(value))
469            this.causalityProductRelatedness = null;
470          else {
471            if (this.causalityProductRelatedness == null)
472              this.causalityProductRelatedness = new StringType();
473            this.causalityProductRelatedness.setValue(value);
474          }
475          return this;
476        }
477
478        /**
479         * @return {@link #causalityMethod} (method1 | method2.)
480         */
481        public CodeableConcept getCausalityMethod() { 
482          if (this.causalityMethod == null)
483            if (Configuration.errorOnAutoCreate())
484              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causalityMethod");
485            else if (Configuration.doAutoCreate())
486              this.causalityMethod = new CodeableConcept(); // cc
487          return this.causalityMethod;
488        }
489
490        public boolean hasCausalityMethod() { 
491          return this.causalityMethod != null && !this.causalityMethod.isEmpty();
492        }
493
494        /**
495         * @param value {@link #causalityMethod} (method1 | method2.)
496         */
497        public AdverseEventSuspectEntityComponent setCausalityMethod(CodeableConcept value) { 
498          this.causalityMethod = value;
499          return this;
500        }
501
502        /**
503         * @return {@link #causalityAuthor} (AdverseEvent.suspectEntity.causalityAuthor.)
504         */
505        public Reference getCausalityAuthor() { 
506          if (this.causalityAuthor == null)
507            if (Configuration.errorOnAutoCreate())
508              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causalityAuthor");
509            else if (Configuration.doAutoCreate())
510              this.causalityAuthor = new Reference(); // cc
511          return this.causalityAuthor;
512        }
513
514        public boolean hasCausalityAuthor() { 
515          return this.causalityAuthor != null && !this.causalityAuthor.isEmpty();
516        }
517
518        /**
519         * @param value {@link #causalityAuthor} (AdverseEvent.suspectEntity.causalityAuthor.)
520         */
521        public AdverseEventSuspectEntityComponent setCausalityAuthor(Reference value) { 
522          this.causalityAuthor = value;
523          return this;
524        }
525
526        /**
527         * @return {@link #causalityAuthor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (AdverseEvent.suspectEntity.causalityAuthor.)
528         */
529        public Resource getCausalityAuthorTarget() { 
530          return this.causalityAuthorTarget;
531        }
532
533        /**
534         * @param value {@link #causalityAuthor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (AdverseEvent.suspectEntity.causalityAuthor.)
535         */
536        public AdverseEventSuspectEntityComponent setCausalityAuthorTarget(Resource value) { 
537          this.causalityAuthorTarget = value;
538          return this;
539        }
540
541        /**
542         * @return {@link #causalityResult} (result1 | result2.)
543         */
544        public CodeableConcept getCausalityResult() { 
545          if (this.causalityResult == null)
546            if (Configuration.errorOnAutoCreate())
547              throw new Error("Attempt to auto-create AdverseEventSuspectEntityComponent.causalityResult");
548            else if (Configuration.doAutoCreate())
549              this.causalityResult = new CodeableConcept(); // cc
550          return this.causalityResult;
551        }
552
553        public boolean hasCausalityResult() { 
554          return this.causalityResult != null && !this.causalityResult.isEmpty();
555        }
556
557        /**
558         * @param value {@link #causalityResult} (result1 | result2.)
559         */
560        public AdverseEventSuspectEntityComponent setCausalityResult(CodeableConcept value) { 
561          this.causalityResult = value;
562          return this;
563        }
564
565        protected void listChildren(List<Property> childrenList) {
566          super.listChildren(childrenList);
567          childrenList.add(new Property("instance", "Reference(Substance|Medication|MedicationAdministration|MedicationStatement|Device)", "Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.", 0, java.lang.Integer.MAX_VALUE, instance));
568          childrenList.add(new Property("causality", "code", "causality1 | causality2.", 0, java.lang.Integer.MAX_VALUE, causality));
569          childrenList.add(new Property("causalityAssessment", "CodeableConcept", "assess1 | assess2.", 0, java.lang.Integer.MAX_VALUE, causalityAssessment));
570          childrenList.add(new Property("causalityProductRelatedness", "string", "AdverseEvent.suspectEntity.causalityProductRelatedness.", 0, java.lang.Integer.MAX_VALUE, causalityProductRelatedness));
571          childrenList.add(new Property("causalityMethod", "CodeableConcept", "method1 | method2.", 0, java.lang.Integer.MAX_VALUE, causalityMethod));
572          childrenList.add(new Property("causalityAuthor", "Reference(Practitioner|PractitionerRole)", "AdverseEvent.suspectEntity.causalityAuthor.", 0, java.lang.Integer.MAX_VALUE, causalityAuthor));
573          childrenList.add(new Property("causalityResult", "CodeableConcept", "result1 | result2.", 0, java.lang.Integer.MAX_VALUE, causalityResult));
574        }
575
576      @Override
577      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
578        switch (hash) {
579        case 555127957: /*instance*/ return this.instance == null ? new Base[0] : new Base[] {this.instance}; // Reference
580        case -1446450521: /*causality*/ return this.causality == null ? new Base[0] : new Base[] {this.causality}; // Enumeration<AdverseEventCausality>
581        case 830609609: /*causalityAssessment*/ return this.causalityAssessment == null ? new Base[0] : new Base[] {this.causalityAssessment}; // CodeableConcept
582        case -1983069286: /*causalityProductRelatedness*/ return this.causalityProductRelatedness == null ? new Base[0] : new Base[] {this.causalityProductRelatedness}; // StringType
583        case -1320366488: /*causalityMethod*/ return this.causalityMethod == null ? new Base[0] : new Base[] {this.causalityMethod}; // CodeableConcept
584        case -1649139950: /*causalityAuthor*/ return this.causalityAuthor == null ? new Base[0] : new Base[] {this.causalityAuthor}; // Reference
585        case -1177238108: /*causalityResult*/ return this.causalityResult == null ? new Base[0] : new Base[] {this.causalityResult}; // CodeableConcept
586        default: return super.getProperty(hash, name, checkValid);
587        }
588
589      }
590
591      @Override
592      public Base setProperty(int hash, String name, Base value) throws FHIRException {
593        switch (hash) {
594        case 555127957: // instance
595          this.instance = castToReference(value); // Reference
596          return value;
597        case -1446450521: // causality
598          value = new AdverseEventCausalityEnumFactory().fromType(castToCode(value));
599          this.causality = (Enumeration) value; // Enumeration<AdverseEventCausality>
600          return value;
601        case 830609609: // causalityAssessment
602          this.causalityAssessment = castToCodeableConcept(value); // CodeableConcept
603          return value;
604        case -1983069286: // causalityProductRelatedness
605          this.causalityProductRelatedness = castToString(value); // StringType
606          return value;
607        case -1320366488: // causalityMethod
608          this.causalityMethod = castToCodeableConcept(value); // CodeableConcept
609          return value;
610        case -1649139950: // causalityAuthor
611          this.causalityAuthor = castToReference(value); // Reference
612          return value;
613        case -1177238108: // causalityResult
614          this.causalityResult = castToCodeableConcept(value); // CodeableConcept
615          return value;
616        default: return super.setProperty(hash, name, value);
617        }
618
619      }
620
621      @Override
622      public Base setProperty(String name, Base value) throws FHIRException {
623        if (name.equals("instance")) {
624          this.instance = castToReference(value); // Reference
625        } else if (name.equals("causality")) {
626          value = new AdverseEventCausalityEnumFactory().fromType(castToCode(value));
627          this.causality = (Enumeration) value; // Enumeration<AdverseEventCausality>
628        } else if (name.equals("causalityAssessment")) {
629          this.causalityAssessment = castToCodeableConcept(value); // CodeableConcept
630        } else if (name.equals("causalityProductRelatedness")) {
631          this.causalityProductRelatedness = castToString(value); // StringType
632        } else if (name.equals("causalityMethod")) {
633          this.causalityMethod = castToCodeableConcept(value); // CodeableConcept
634        } else if (name.equals("causalityAuthor")) {
635          this.causalityAuthor = castToReference(value); // Reference
636        } else if (name.equals("causalityResult")) {
637          this.causalityResult = castToCodeableConcept(value); // CodeableConcept
638        } else
639          return super.setProperty(name, value);
640        return value;
641      }
642
643      @Override
644      public Base makeProperty(int hash, String name) throws FHIRException {
645        switch (hash) {
646        case 555127957:  return getInstance(); 
647        case -1446450521:  return getCausalityElement();
648        case 830609609:  return getCausalityAssessment(); 
649        case -1983069286:  return getCausalityProductRelatednessElement();
650        case -1320366488:  return getCausalityMethod(); 
651        case -1649139950:  return getCausalityAuthor(); 
652        case -1177238108:  return getCausalityResult(); 
653        default: return super.makeProperty(hash, name);
654        }
655
656      }
657
658      @Override
659      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
660        switch (hash) {
661        case 555127957: /*instance*/ return new String[] {"Reference"};
662        case -1446450521: /*causality*/ return new String[] {"code"};
663        case 830609609: /*causalityAssessment*/ return new String[] {"CodeableConcept"};
664        case -1983069286: /*causalityProductRelatedness*/ return new String[] {"string"};
665        case -1320366488: /*causalityMethod*/ return new String[] {"CodeableConcept"};
666        case -1649139950: /*causalityAuthor*/ return new String[] {"Reference"};
667        case -1177238108: /*causalityResult*/ return new String[] {"CodeableConcept"};
668        default: return super.getTypesForProperty(hash, name);
669        }
670
671      }
672
673      @Override
674      public Base addChild(String name) throws FHIRException {
675        if (name.equals("instance")) {
676          this.instance = new Reference();
677          return this.instance;
678        }
679        else if (name.equals("causality")) {
680          throw new FHIRException("Cannot call addChild on a primitive type AdverseEvent.causality");
681        }
682        else if (name.equals("causalityAssessment")) {
683          this.causalityAssessment = new CodeableConcept();
684          return this.causalityAssessment;
685        }
686        else if (name.equals("causalityProductRelatedness")) {
687          throw new FHIRException("Cannot call addChild on a primitive type AdverseEvent.causalityProductRelatedness");
688        }
689        else if (name.equals("causalityMethod")) {
690          this.causalityMethod = new CodeableConcept();
691          return this.causalityMethod;
692        }
693        else if (name.equals("causalityAuthor")) {
694          this.causalityAuthor = new Reference();
695          return this.causalityAuthor;
696        }
697        else if (name.equals("causalityResult")) {
698          this.causalityResult = new CodeableConcept();
699          return this.causalityResult;
700        }
701        else
702          return super.addChild(name);
703      }
704
705      public AdverseEventSuspectEntityComponent copy() {
706        AdverseEventSuspectEntityComponent dst = new AdverseEventSuspectEntityComponent();
707        copyValues(dst);
708        dst.instance = instance == null ? null : instance.copy();
709        dst.causality = causality == null ? null : causality.copy();
710        dst.causalityAssessment = causalityAssessment == null ? null : causalityAssessment.copy();
711        dst.causalityProductRelatedness = causalityProductRelatedness == null ? null : causalityProductRelatedness.copy();
712        dst.causalityMethod = causalityMethod == null ? null : causalityMethod.copy();
713        dst.causalityAuthor = causalityAuthor == null ? null : causalityAuthor.copy();
714        dst.causalityResult = causalityResult == null ? null : causalityResult.copy();
715        return dst;
716      }
717
718      @Override
719      public boolean equalsDeep(Base other) {
720        if (!super.equalsDeep(other))
721          return false;
722        if (!(other instanceof AdverseEventSuspectEntityComponent))
723          return false;
724        AdverseEventSuspectEntityComponent o = (AdverseEventSuspectEntityComponent) other;
725        return compareDeep(instance, o.instance, true) && compareDeep(causality, o.causality, true) && compareDeep(causalityAssessment, o.causalityAssessment, true)
726           && compareDeep(causalityProductRelatedness, o.causalityProductRelatedness, true) && compareDeep(causalityMethod, o.causalityMethod, true)
727           && compareDeep(causalityAuthor, o.causalityAuthor, true) && compareDeep(causalityResult, o.causalityResult, true)
728          ;
729      }
730
731      @Override
732      public boolean equalsShallow(Base other) {
733        if (!super.equalsShallow(other))
734          return false;
735        if (!(other instanceof AdverseEventSuspectEntityComponent))
736          return false;
737        AdverseEventSuspectEntityComponent o = (AdverseEventSuspectEntityComponent) other;
738        return compareValues(causality, o.causality, true) && compareValues(causalityProductRelatedness, o.causalityProductRelatedness, true)
739          ;
740      }
741
742      public boolean isEmpty() {
743        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(instance, causality, causalityAssessment
744          , causalityProductRelatedness, causalityMethod, causalityAuthor, causalityResult);
745      }
746
747  public String fhirType() {
748    return "AdverseEvent.suspectEntity";
749
750  }
751
752  }
753
754    /**
755     * The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate.
756     */
757    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
758    @Description(shortDefinition="Business identifier for the event", formalDefinition="The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate." )
759    protected Identifier identifier;
760
761    /**
762     * The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.
763     */
764    @Child(name = "category", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true)
765    @Description(shortDefinition="AE | PAE \rAn adverse event is an event that caused harm to a patient,  an adverse reaction is a something that is a subject-specific event that is a result of an exposure to a medication, food, device or environmental substance, a potential adverse event is something that occurred and that could have caused harm to a patient but did not", formalDefinition="The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject." )
766    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-category")
767    protected Enumeration<AdverseEventCategory> category;
768
769    /**
770     * This element defines the specific type of event that occurred or that was prevented from occurring.
771     */
772    @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
773    @Description(shortDefinition="actual | potential", formalDefinition="This element defines the specific type of event that occurred or that was prevented from occurring." )
774    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-type")
775    protected CodeableConcept type;
776
777    /**
778     * This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.
779     */
780    @Child(name = "subject", type = {Patient.class, ResearchSubject.class, Medication.class, Device.class}, order=3, min=0, max=1, modifier=false, summary=true)
781    @Description(shortDefinition="Subject or group impacted by event", formalDefinition="This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented." )
782    protected Reference subject;
783
784    /**
785     * The actual object that is the target of the reference (This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.)
786     */
787    protected Resource subjectTarget;
788
789    /**
790     * The date (and perhaps time) when the adverse event occurred.
791     */
792    @Child(name = "date", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
793    @Description(shortDefinition="When the event occurred", formalDefinition="The date (and perhaps time) when the adverse event occurred." )
794    protected DateTimeType date;
795
796    /**
797     * Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).
798     */
799    @Child(name = "reaction", type = {Condition.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
800    @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical)." )
801    protected List<Reference> reaction;
802    /**
803     * The actual objects that are the target of the reference (Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).)
804     */
805    protected List<Condition> reactionTarget;
806
807
808    /**
809     * The information about where the adverse event occurred.
810     */
811    @Child(name = "location", type = {Location.class}, order=6, min=0, max=1, modifier=false, summary=true)
812    @Description(shortDefinition="Location where adverse event occurred", formalDefinition="The information about where the adverse event occurred." )
813    protected Reference location;
814
815    /**
816     * The actual object that is the target of the reference (The information about where the adverse event occurred.)
817     */
818    protected Location locationTarget;
819
820    /**
821     * Describes the seriousness or severity of the adverse event.
822     */
823    @Child(name = "seriousness", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true)
824    @Description(shortDefinition="Mild | Moderate | Severe", formalDefinition="Describes the seriousness or severity of the adverse event." )
825    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-seriousness")
826    protected CodeableConcept seriousness;
827
828    /**
829     * Describes the type of outcome from the adverse event.
830     */
831    @Child(name = "outcome", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true)
832    @Description(shortDefinition="resolved | recovering | ongoing | resolvedWithSequelae | fatal | unknown", formalDefinition="Describes the type of outcome from the adverse event." )
833    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/adverse-event-outcome")
834    protected CodeableConcept outcome;
835
836    /**
837     * Information on who recorded the adverse event.  May be the patient or a practitioner.
838     */
839    @Child(name = "recorder", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=9, min=0, max=1, modifier=false, summary=true)
840    @Description(shortDefinition="Who recorded the adverse event", formalDefinition="Information on who recorded the adverse event.  May be the patient or a practitioner." )
841    protected Reference recorder;
842
843    /**
844     * The actual object that is the target of the reference (Information on who recorded the adverse event.  May be the patient or a practitioner.)
845     */
846    protected Resource recorderTarget;
847
848    /**
849     * Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).
850     */
851    @Child(name = "eventParticipant", type = {Practitioner.class, Device.class}, order=10, min=0, max=1, modifier=false, summary=true)
852    @Description(shortDefinition="Who  was involved in the adverse event or the potential adverse event", formalDefinition="Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness)." )
853    protected Reference eventParticipant;
854
855    /**
856     * The actual object that is the target of the reference (Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).)
857     */
858    protected Resource eventParticipantTarget;
859
860    /**
861     * Describes the adverse event in text.
862     */
863    @Child(name = "description", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true)
864    @Description(shortDefinition="Description of the adverse event", formalDefinition="Describes the adverse event in text." )
865    protected StringType description;
866
867    /**
868     * Describes the entity that is suspected to have caused the adverse event.
869     */
870    @Child(name = "suspectEntity", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
871    @Description(shortDefinition="The suspected agent causing the adverse event", formalDefinition="Describes the entity that is suspected to have caused the adverse event." )
872    protected List<AdverseEventSuspectEntityComponent> suspectEntity;
873
874    /**
875     * AdverseEvent.subjectMedicalHistory.
876     */
877    @Child(name = "subjectMedicalHistory", type = {Condition.class, Observation.class, AllergyIntolerance.class, FamilyMemberHistory.class, Immunization.class, Procedure.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
878    @Description(shortDefinition="AdverseEvent.subjectMedicalHistory", formalDefinition="AdverseEvent.subjectMedicalHistory." )
879    protected List<Reference> subjectMedicalHistory;
880    /**
881     * The actual objects that are the target of the reference (AdverseEvent.subjectMedicalHistory.)
882     */
883    protected List<Resource> subjectMedicalHistoryTarget;
884
885
886    /**
887     * AdverseEvent.referenceDocument.
888     */
889    @Child(name = "referenceDocument", type = {DocumentReference.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
890    @Description(shortDefinition="AdverseEvent.referenceDocument", formalDefinition="AdverseEvent.referenceDocument." )
891    protected List<Reference> referenceDocument;
892    /**
893     * The actual objects that are the target of the reference (AdverseEvent.referenceDocument.)
894     */
895    protected List<DocumentReference> referenceDocumentTarget;
896
897
898    /**
899     * AdverseEvent.study.
900     */
901    @Child(name = "study", type = {ResearchStudy.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
902    @Description(shortDefinition="AdverseEvent.study", formalDefinition="AdverseEvent.study." )
903    protected List<Reference> study;
904    /**
905     * The actual objects that are the target of the reference (AdverseEvent.study.)
906     */
907    protected List<ResearchStudy> studyTarget;
908
909
910    private static final long serialVersionUID = 156251238L;
911
912  /**
913   * Constructor
914   */
915    public AdverseEvent() {
916      super();
917    }
918
919    /**
920     * @return {@link #identifier} (The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate.)
921     */
922    public Identifier getIdentifier() { 
923      if (this.identifier == null)
924        if (Configuration.errorOnAutoCreate())
925          throw new Error("Attempt to auto-create AdverseEvent.identifier");
926        else if (Configuration.doAutoCreate())
927          this.identifier = new Identifier(); // cc
928      return this.identifier;
929    }
930
931    public boolean hasIdentifier() { 
932      return this.identifier != null && !this.identifier.isEmpty();
933    }
934
935    /**
936     * @param value {@link #identifier} (The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate.)
937     */
938    public AdverseEvent setIdentifier(Identifier value) { 
939      this.identifier = value;
940      return this;
941    }
942
943    /**
944     * @return {@link #category} (The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
945     */
946    public Enumeration<AdverseEventCategory> getCategoryElement() { 
947      if (this.category == null)
948        if (Configuration.errorOnAutoCreate())
949          throw new Error("Attempt to auto-create AdverseEvent.category");
950        else if (Configuration.doAutoCreate())
951          this.category = new Enumeration<AdverseEventCategory>(new AdverseEventCategoryEnumFactory()); // bb
952      return this.category;
953    }
954
955    public boolean hasCategoryElement() { 
956      return this.category != null && !this.category.isEmpty();
957    }
958
959    public boolean hasCategory() { 
960      return this.category != null && !this.category.isEmpty();
961    }
962
963    /**
964     * @param value {@link #category} (The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value
965     */
966    public AdverseEvent setCategoryElement(Enumeration<AdverseEventCategory> value) { 
967      this.category = value;
968      return this;
969    }
970
971    /**
972     * @return The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.
973     */
974    public AdverseEventCategory getCategory() { 
975      return this.category == null ? null : this.category.getValue();
976    }
977
978    /**
979     * @param value The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.
980     */
981    public AdverseEvent setCategory(AdverseEventCategory value) { 
982      if (value == null)
983        this.category = null;
984      else {
985        if (this.category == null)
986          this.category = new Enumeration<AdverseEventCategory>(new AdverseEventCategoryEnumFactory());
987        this.category.setValue(value);
988      }
989      return this;
990    }
991
992    /**
993     * @return {@link #type} (This element defines the specific type of event that occurred or that was prevented from occurring.)
994     */
995    public CodeableConcept getType() { 
996      if (this.type == null)
997        if (Configuration.errorOnAutoCreate())
998          throw new Error("Attempt to auto-create AdverseEvent.type");
999        else if (Configuration.doAutoCreate())
1000          this.type = new CodeableConcept(); // cc
1001      return this.type;
1002    }
1003
1004    public boolean hasType() { 
1005      return this.type != null && !this.type.isEmpty();
1006    }
1007
1008    /**
1009     * @param value {@link #type} (This element defines the specific type of event that occurred or that was prevented from occurring.)
1010     */
1011    public AdverseEvent setType(CodeableConcept value) { 
1012      this.type = value;
1013      return this;
1014    }
1015
1016    /**
1017     * @return {@link #subject} (This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.)
1018     */
1019    public Reference getSubject() { 
1020      if (this.subject == null)
1021        if (Configuration.errorOnAutoCreate())
1022          throw new Error("Attempt to auto-create AdverseEvent.subject");
1023        else if (Configuration.doAutoCreate())
1024          this.subject = new Reference(); // cc
1025      return this.subject;
1026    }
1027
1028    public boolean hasSubject() { 
1029      return this.subject != null && !this.subject.isEmpty();
1030    }
1031
1032    /**
1033     * @param value {@link #subject} (This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.)
1034     */
1035    public AdverseEvent setSubject(Reference value) { 
1036      this.subject = value;
1037      return this;
1038    }
1039
1040    /**
1041     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.)
1042     */
1043    public Resource getSubjectTarget() { 
1044      return this.subjectTarget;
1045    }
1046
1047    /**
1048     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.)
1049     */
1050    public AdverseEvent setSubjectTarget(Resource value) { 
1051      this.subjectTarget = value;
1052      return this;
1053    }
1054
1055    /**
1056     * @return {@link #date} (The date (and perhaps time) when the adverse event occurred.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1057     */
1058    public DateTimeType getDateElement() { 
1059      if (this.date == null)
1060        if (Configuration.errorOnAutoCreate())
1061          throw new Error("Attempt to auto-create AdverseEvent.date");
1062        else if (Configuration.doAutoCreate())
1063          this.date = new DateTimeType(); // bb
1064      return this.date;
1065    }
1066
1067    public boolean hasDateElement() { 
1068      return this.date != null && !this.date.isEmpty();
1069    }
1070
1071    public boolean hasDate() { 
1072      return this.date != null && !this.date.isEmpty();
1073    }
1074
1075    /**
1076     * @param value {@link #date} (The date (and perhaps time) when the adverse event occurred.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
1077     */
1078    public AdverseEvent setDateElement(DateTimeType value) { 
1079      this.date = value;
1080      return this;
1081    }
1082
1083    /**
1084     * @return The date (and perhaps time) when the adverse event occurred.
1085     */
1086    public Date getDate() { 
1087      return this.date == null ? null : this.date.getValue();
1088    }
1089
1090    /**
1091     * @param value The date (and perhaps time) when the adverse event occurred.
1092     */
1093    public AdverseEvent setDate(Date value) { 
1094      if (value == null)
1095        this.date = null;
1096      else {
1097        if (this.date == null)
1098          this.date = new DateTimeType();
1099        this.date.setValue(value);
1100      }
1101      return this;
1102    }
1103
1104    /**
1105     * @return {@link #reaction} (Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).)
1106     */
1107    public List<Reference> getReaction() { 
1108      if (this.reaction == null)
1109        this.reaction = new ArrayList<Reference>();
1110      return this.reaction;
1111    }
1112
1113    /**
1114     * @return Returns a reference to <code>this</code> for easy method chaining
1115     */
1116    public AdverseEvent setReaction(List<Reference> theReaction) { 
1117      this.reaction = theReaction;
1118      return this;
1119    }
1120
1121    public boolean hasReaction() { 
1122      if (this.reaction == null)
1123        return false;
1124      for (Reference item : this.reaction)
1125        if (!item.isEmpty())
1126          return true;
1127      return false;
1128    }
1129
1130    public Reference addReaction() { //3
1131      Reference t = new Reference();
1132      if (this.reaction == null)
1133        this.reaction = new ArrayList<Reference>();
1134      this.reaction.add(t);
1135      return t;
1136    }
1137
1138    public AdverseEvent addReaction(Reference t) { //3
1139      if (t == null)
1140        return this;
1141      if (this.reaction == null)
1142        this.reaction = new ArrayList<Reference>();
1143      this.reaction.add(t);
1144      return this;
1145    }
1146
1147    /**
1148     * @return The first repetition of repeating field {@link #reaction}, creating it if it does not already exist
1149     */
1150    public Reference getReactionFirstRep() { 
1151      if (getReaction().isEmpty()) {
1152        addReaction();
1153      }
1154      return getReaction().get(0);
1155    }
1156
1157    /**
1158     * @deprecated Use Reference#setResource(IBaseResource) instead
1159     */
1160    @Deprecated
1161    public List<Condition> getReactionTarget() { 
1162      if (this.reactionTarget == null)
1163        this.reactionTarget = new ArrayList<Condition>();
1164      return this.reactionTarget;
1165    }
1166
1167    /**
1168     * @deprecated Use Reference#setResource(IBaseResource) instead
1169     */
1170    @Deprecated
1171    public Condition addReactionTarget() { 
1172      Condition r = new Condition();
1173      if (this.reactionTarget == null)
1174        this.reactionTarget = new ArrayList<Condition>();
1175      this.reactionTarget.add(r);
1176      return r;
1177    }
1178
1179    /**
1180     * @return {@link #location} (The information about where the adverse event occurred.)
1181     */
1182    public Reference getLocation() { 
1183      if (this.location == null)
1184        if (Configuration.errorOnAutoCreate())
1185          throw new Error("Attempt to auto-create AdverseEvent.location");
1186        else if (Configuration.doAutoCreate())
1187          this.location = new Reference(); // cc
1188      return this.location;
1189    }
1190
1191    public boolean hasLocation() { 
1192      return this.location != null && !this.location.isEmpty();
1193    }
1194
1195    /**
1196     * @param value {@link #location} (The information about where the adverse event occurred.)
1197     */
1198    public AdverseEvent setLocation(Reference value) { 
1199      this.location = value;
1200      return this;
1201    }
1202
1203    /**
1204     * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The information about where the adverse event occurred.)
1205     */
1206    public Location getLocationTarget() { 
1207      if (this.locationTarget == null)
1208        if (Configuration.errorOnAutoCreate())
1209          throw new Error("Attempt to auto-create AdverseEvent.location");
1210        else if (Configuration.doAutoCreate())
1211          this.locationTarget = new Location(); // aa
1212      return this.locationTarget;
1213    }
1214
1215    /**
1216     * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The information about where the adverse event occurred.)
1217     */
1218    public AdverseEvent setLocationTarget(Location value) { 
1219      this.locationTarget = value;
1220      return this;
1221    }
1222
1223    /**
1224     * @return {@link #seriousness} (Describes the seriousness or severity of the adverse event.)
1225     */
1226    public CodeableConcept getSeriousness() { 
1227      if (this.seriousness == null)
1228        if (Configuration.errorOnAutoCreate())
1229          throw new Error("Attempt to auto-create AdverseEvent.seriousness");
1230        else if (Configuration.doAutoCreate())
1231          this.seriousness = new CodeableConcept(); // cc
1232      return this.seriousness;
1233    }
1234
1235    public boolean hasSeriousness() { 
1236      return this.seriousness != null && !this.seriousness.isEmpty();
1237    }
1238
1239    /**
1240     * @param value {@link #seriousness} (Describes the seriousness or severity of the adverse event.)
1241     */
1242    public AdverseEvent setSeriousness(CodeableConcept value) { 
1243      this.seriousness = value;
1244      return this;
1245    }
1246
1247    /**
1248     * @return {@link #outcome} (Describes the type of outcome from the adverse event.)
1249     */
1250    public CodeableConcept getOutcome() { 
1251      if (this.outcome == null)
1252        if (Configuration.errorOnAutoCreate())
1253          throw new Error("Attempt to auto-create AdverseEvent.outcome");
1254        else if (Configuration.doAutoCreate())
1255          this.outcome = new CodeableConcept(); // cc
1256      return this.outcome;
1257    }
1258
1259    public boolean hasOutcome() { 
1260      return this.outcome != null && !this.outcome.isEmpty();
1261    }
1262
1263    /**
1264     * @param value {@link #outcome} (Describes the type of outcome from the adverse event.)
1265     */
1266    public AdverseEvent setOutcome(CodeableConcept value) { 
1267      this.outcome = value;
1268      return this;
1269    }
1270
1271    /**
1272     * @return {@link #recorder} (Information on who recorded the adverse event.  May be the patient or a practitioner.)
1273     */
1274    public Reference getRecorder() { 
1275      if (this.recorder == null)
1276        if (Configuration.errorOnAutoCreate())
1277          throw new Error("Attempt to auto-create AdverseEvent.recorder");
1278        else if (Configuration.doAutoCreate())
1279          this.recorder = new Reference(); // cc
1280      return this.recorder;
1281    }
1282
1283    public boolean hasRecorder() { 
1284      return this.recorder != null && !this.recorder.isEmpty();
1285    }
1286
1287    /**
1288     * @param value {@link #recorder} (Information on who recorded the adverse event.  May be the patient or a practitioner.)
1289     */
1290    public AdverseEvent setRecorder(Reference value) { 
1291      this.recorder = value;
1292      return this;
1293    }
1294
1295    /**
1296     * @return {@link #recorder} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information on who recorded the adverse event.  May be the patient or a practitioner.)
1297     */
1298    public Resource getRecorderTarget() { 
1299      return this.recorderTarget;
1300    }
1301
1302    /**
1303     * @param value {@link #recorder} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information on who recorded the adverse event.  May be the patient or a practitioner.)
1304     */
1305    public AdverseEvent setRecorderTarget(Resource value) { 
1306      this.recorderTarget = value;
1307      return this;
1308    }
1309
1310    /**
1311     * @return {@link #eventParticipant} (Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).)
1312     */
1313    public Reference getEventParticipant() { 
1314      if (this.eventParticipant == null)
1315        if (Configuration.errorOnAutoCreate())
1316          throw new Error("Attempt to auto-create AdverseEvent.eventParticipant");
1317        else if (Configuration.doAutoCreate())
1318          this.eventParticipant = new Reference(); // cc
1319      return this.eventParticipant;
1320    }
1321
1322    public boolean hasEventParticipant() { 
1323      return this.eventParticipant != null && !this.eventParticipant.isEmpty();
1324    }
1325
1326    /**
1327     * @param value {@link #eventParticipant} (Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).)
1328     */
1329    public AdverseEvent setEventParticipant(Reference value) { 
1330      this.eventParticipant = value;
1331      return this;
1332    }
1333
1334    /**
1335     * @return {@link #eventParticipant} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).)
1336     */
1337    public Resource getEventParticipantTarget() { 
1338      return this.eventParticipantTarget;
1339    }
1340
1341    /**
1342     * @param value {@link #eventParticipant} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).)
1343     */
1344    public AdverseEvent setEventParticipantTarget(Resource value) { 
1345      this.eventParticipantTarget = value;
1346      return this;
1347    }
1348
1349    /**
1350     * @return {@link #description} (Describes the adverse event in text.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1351     */
1352    public StringType getDescriptionElement() { 
1353      if (this.description == null)
1354        if (Configuration.errorOnAutoCreate())
1355          throw new Error("Attempt to auto-create AdverseEvent.description");
1356        else if (Configuration.doAutoCreate())
1357          this.description = new StringType(); // bb
1358      return this.description;
1359    }
1360
1361    public boolean hasDescriptionElement() { 
1362      return this.description != null && !this.description.isEmpty();
1363    }
1364
1365    public boolean hasDescription() { 
1366      return this.description != null && !this.description.isEmpty();
1367    }
1368
1369    /**
1370     * @param value {@link #description} (Describes the adverse event in text.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1371     */
1372    public AdverseEvent setDescriptionElement(StringType value) { 
1373      this.description = value;
1374      return this;
1375    }
1376
1377    /**
1378     * @return Describes the adverse event in text.
1379     */
1380    public String getDescription() { 
1381      return this.description == null ? null : this.description.getValue();
1382    }
1383
1384    /**
1385     * @param value Describes the adverse event in text.
1386     */
1387    public AdverseEvent setDescription(String value) { 
1388      if (Utilities.noString(value))
1389        this.description = null;
1390      else {
1391        if (this.description == null)
1392          this.description = new StringType();
1393        this.description.setValue(value);
1394      }
1395      return this;
1396    }
1397
1398    /**
1399     * @return {@link #suspectEntity} (Describes the entity that is suspected to have caused the adverse event.)
1400     */
1401    public List<AdverseEventSuspectEntityComponent> getSuspectEntity() { 
1402      if (this.suspectEntity == null)
1403        this.suspectEntity = new ArrayList<AdverseEventSuspectEntityComponent>();
1404      return this.suspectEntity;
1405    }
1406
1407    /**
1408     * @return Returns a reference to <code>this</code> for easy method chaining
1409     */
1410    public AdverseEvent setSuspectEntity(List<AdverseEventSuspectEntityComponent> theSuspectEntity) { 
1411      this.suspectEntity = theSuspectEntity;
1412      return this;
1413    }
1414
1415    public boolean hasSuspectEntity() { 
1416      if (this.suspectEntity == null)
1417        return false;
1418      for (AdverseEventSuspectEntityComponent item : this.suspectEntity)
1419        if (!item.isEmpty())
1420          return true;
1421      return false;
1422    }
1423
1424    public AdverseEventSuspectEntityComponent addSuspectEntity() { //3
1425      AdverseEventSuspectEntityComponent t = new AdverseEventSuspectEntityComponent();
1426      if (this.suspectEntity == null)
1427        this.suspectEntity = new ArrayList<AdverseEventSuspectEntityComponent>();
1428      this.suspectEntity.add(t);
1429      return t;
1430    }
1431
1432    public AdverseEvent addSuspectEntity(AdverseEventSuspectEntityComponent t) { //3
1433      if (t == null)
1434        return this;
1435      if (this.suspectEntity == null)
1436        this.suspectEntity = new ArrayList<AdverseEventSuspectEntityComponent>();
1437      this.suspectEntity.add(t);
1438      return this;
1439    }
1440
1441    /**
1442     * @return The first repetition of repeating field {@link #suspectEntity}, creating it if it does not already exist
1443     */
1444    public AdverseEventSuspectEntityComponent getSuspectEntityFirstRep() { 
1445      if (getSuspectEntity().isEmpty()) {
1446        addSuspectEntity();
1447      }
1448      return getSuspectEntity().get(0);
1449    }
1450
1451    /**
1452     * @return {@link #subjectMedicalHistory} (AdverseEvent.subjectMedicalHistory.)
1453     */
1454    public List<Reference> getSubjectMedicalHistory() { 
1455      if (this.subjectMedicalHistory == null)
1456        this.subjectMedicalHistory = new ArrayList<Reference>();
1457      return this.subjectMedicalHistory;
1458    }
1459
1460    /**
1461     * @return Returns a reference to <code>this</code> for easy method chaining
1462     */
1463    public AdverseEvent setSubjectMedicalHistory(List<Reference> theSubjectMedicalHistory) { 
1464      this.subjectMedicalHistory = theSubjectMedicalHistory;
1465      return this;
1466    }
1467
1468    public boolean hasSubjectMedicalHistory() { 
1469      if (this.subjectMedicalHistory == null)
1470        return false;
1471      for (Reference item : this.subjectMedicalHistory)
1472        if (!item.isEmpty())
1473          return true;
1474      return false;
1475    }
1476
1477    public Reference addSubjectMedicalHistory() { //3
1478      Reference t = new Reference();
1479      if (this.subjectMedicalHistory == null)
1480        this.subjectMedicalHistory = new ArrayList<Reference>();
1481      this.subjectMedicalHistory.add(t);
1482      return t;
1483    }
1484
1485    public AdverseEvent addSubjectMedicalHistory(Reference t) { //3
1486      if (t == null)
1487        return this;
1488      if (this.subjectMedicalHistory == null)
1489        this.subjectMedicalHistory = new ArrayList<Reference>();
1490      this.subjectMedicalHistory.add(t);
1491      return this;
1492    }
1493
1494    /**
1495     * @return The first repetition of repeating field {@link #subjectMedicalHistory}, creating it if it does not already exist
1496     */
1497    public Reference getSubjectMedicalHistoryFirstRep() { 
1498      if (getSubjectMedicalHistory().isEmpty()) {
1499        addSubjectMedicalHistory();
1500      }
1501      return getSubjectMedicalHistory().get(0);
1502    }
1503
1504    /**
1505     * @deprecated Use Reference#setResource(IBaseResource) instead
1506     */
1507    @Deprecated
1508    public List<Resource> getSubjectMedicalHistoryTarget() { 
1509      if (this.subjectMedicalHistoryTarget == null)
1510        this.subjectMedicalHistoryTarget = new ArrayList<Resource>();
1511      return this.subjectMedicalHistoryTarget;
1512    }
1513
1514    /**
1515     * @return {@link #referenceDocument} (AdverseEvent.referenceDocument.)
1516     */
1517    public List<Reference> getReferenceDocument() { 
1518      if (this.referenceDocument == null)
1519        this.referenceDocument = new ArrayList<Reference>();
1520      return this.referenceDocument;
1521    }
1522
1523    /**
1524     * @return Returns a reference to <code>this</code> for easy method chaining
1525     */
1526    public AdverseEvent setReferenceDocument(List<Reference> theReferenceDocument) { 
1527      this.referenceDocument = theReferenceDocument;
1528      return this;
1529    }
1530
1531    public boolean hasReferenceDocument() { 
1532      if (this.referenceDocument == null)
1533        return false;
1534      for (Reference item : this.referenceDocument)
1535        if (!item.isEmpty())
1536          return true;
1537      return false;
1538    }
1539
1540    public Reference addReferenceDocument() { //3
1541      Reference t = new Reference();
1542      if (this.referenceDocument == null)
1543        this.referenceDocument = new ArrayList<Reference>();
1544      this.referenceDocument.add(t);
1545      return t;
1546    }
1547
1548    public AdverseEvent addReferenceDocument(Reference t) { //3
1549      if (t == null)
1550        return this;
1551      if (this.referenceDocument == null)
1552        this.referenceDocument = new ArrayList<Reference>();
1553      this.referenceDocument.add(t);
1554      return this;
1555    }
1556
1557    /**
1558     * @return The first repetition of repeating field {@link #referenceDocument}, creating it if it does not already exist
1559     */
1560    public Reference getReferenceDocumentFirstRep() { 
1561      if (getReferenceDocument().isEmpty()) {
1562        addReferenceDocument();
1563      }
1564      return getReferenceDocument().get(0);
1565    }
1566
1567    /**
1568     * @deprecated Use Reference#setResource(IBaseResource) instead
1569     */
1570    @Deprecated
1571    public List<DocumentReference> getReferenceDocumentTarget() { 
1572      if (this.referenceDocumentTarget == null)
1573        this.referenceDocumentTarget = new ArrayList<DocumentReference>();
1574      return this.referenceDocumentTarget;
1575    }
1576
1577    /**
1578     * @deprecated Use Reference#setResource(IBaseResource) instead
1579     */
1580    @Deprecated
1581    public DocumentReference addReferenceDocumentTarget() { 
1582      DocumentReference r = new DocumentReference();
1583      if (this.referenceDocumentTarget == null)
1584        this.referenceDocumentTarget = new ArrayList<DocumentReference>();
1585      this.referenceDocumentTarget.add(r);
1586      return r;
1587    }
1588
1589    /**
1590     * @return {@link #study} (AdverseEvent.study.)
1591     */
1592    public List<Reference> getStudy() { 
1593      if (this.study == null)
1594        this.study = new ArrayList<Reference>();
1595      return this.study;
1596    }
1597
1598    /**
1599     * @return Returns a reference to <code>this</code> for easy method chaining
1600     */
1601    public AdverseEvent setStudy(List<Reference> theStudy) { 
1602      this.study = theStudy;
1603      return this;
1604    }
1605
1606    public boolean hasStudy() { 
1607      if (this.study == null)
1608        return false;
1609      for (Reference item : this.study)
1610        if (!item.isEmpty())
1611          return true;
1612      return false;
1613    }
1614
1615    public Reference addStudy() { //3
1616      Reference t = new Reference();
1617      if (this.study == null)
1618        this.study = new ArrayList<Reference>();
1619      this.study.add(t);
1620      return t;
1621    }
1622
1623    public AdverseEvent addStudy(Reference t) { //3
1624      if (t == null)
1625        return this;
1626      if (this.study == null)
1627        this.study = new ArrayList<Reference>();
1628      this.study.add(t);
1629      return this;
1630    }
1631
1632    /**
1633     * @return The first repetition of repeating field {@link #study}, creating it if it does not already exist
1634     */
1635    public Reference getStudyFirstRep() { 
1636      if (getStudy().isEmpty()) {
1637        addStudy();
1638      }
1639      return getStudy().get(0);
1640    }
1641
1642    /**
1643     * @deprecated Use Reference#setResource(IBaseResource) instead
1644     */
1645    @Deprecated
1646    public List<ResearchStudy> getStudyTarget() { 
1647      if (this.studyTarget == null)
1648        this.studyTarget = new ArrayList<ResearchStudy>();
1649      return this.studyTarget;
1650    }
1651
1652    /**
1653     * @deprecated Use Reference#setResource(IBaseResource) instead
1654     */
1655    @Deprecated
1656    public ResearchStudy addStudyTarget() { 
1657      ResearchStudy r = new ResearchStudy();
1658      if (this.studyTarget == null)
1659        this.studyTarget = new ArrayList<ResearchStudy>();
1660      this.studyTarget.add(r);
1661      return r;
1662    }
1663
1664      protected void listChildren(List<Property> childrenList) {
1665        super.listChildren(childrenList);
1666        childrenList.add(new Property("identifier", "Identifier", "The identifier(s) of this adverse event that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itsefl is not appropriate.", 0, java.lang.Integer.MAX_VALUE, identifier));
1667        childrenList.add(new Property("category", "code", "The type of event which is important to characterize what occurred and caused harm to the subject, or had the potential to cause harm to the subject.", 0, java.lang.Integer.MAX_VALUE, category));
1668        childrenList.add(new Property("type", "CodeableConcept", "This element defines the specific type of event that occurred or that was prevented from occurring.", 0, java.lang.Integer.MAX_VALUE, type));
1669        childrenList.add(new Property("subject", "Reference(Patient|ResearchSubject|Medication|Device)", "This subject or group impacted by the event.  With a prospective adverse event, there will be no subject as the adverse event was prevented.", 0, java.lang.Integer.MAX_VALUE, subject));
1670        childrenList.add(new Property("date", "dateTime", "The date (and perhaps time) when the adverse event occurred.", 0, java.lang.Integer.MAX_VALUE, date));
1671        childrenList.add(new Property("reaction", "Reference(Condition)", "Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).", 0, java.lang.Integer.MAX_VALUE, reaction));
1672        childrenList.add(new Property("location", "Reference(Location)", "The information about where the adverse event occurred.", 0, java.lang.Integer.MAX_VALUE, location));
1673        childrenList.add(new Property("seriousness", "CodeableConcept", "Describes the seriousness or severity of the adverse event.", 0, java.lang.Integer.MAX_VALUE, seriousness));
1674        childrenList.add(new Property("outcome", "CodeableConcept", "Describes the type of outcome from the adverse event.", 0, java.lang.Integer.MAX_VALUE, outcome));
1675        childrenList.add(new Property("recorder", "Reference(Patient|Practitioner|RelatedPerson)", "Information on who recorded the adverse event.  May be the patient or a practitioner.", 0, java.lang.Integer.MAX_VALUE, recorder));
1676        childrenList.add(new Property("eventParticipant", "Reference(Practitioner|Device)", "Parties that may or should contribute or have contributed information to the Act. Such information includes information leading to the decision to perform the Act and how to perform the Act (e.g. consultant), information that the Act itself seeks to reveal (e.g. informant of clinical history), or information about what Act was performed (e.g. informant witness).", 0, java.lang.Integer.MAX_VALUE, eventParticipant));
1677        childrenList.add(new Property("description", "string", "Describes the adverse event in text.", 0, java.lang.Integer.MAX_VALUE, description));
1678        childrenList.add(new Property("suspectEntity", "", "Describes the entity that is suspected to have caused the adverse event.", 0, java.lang.Integer.MAX_VALUE, suspectEntity));
1679        childrenList.add(new Property("subjectMedicalHistory", "Reference(Condition|Observation|AllergyIntolerance|FamilyMemberHistory|Immunization|Procedure)", "AdverseEvent.subjectMedicalHistory.", 0, java.lang.Integer.MAX_VALUE, subjectMedicalHistory));
1680        childrenList.add(new Property("referenceDocument", "Reference(DocumentReference)", "AdverseEvent.referenceDocument.", 0, java.lang.Integer.MAX_VALUE, referenceDocument));
1681        childrenList.add(new Property("study", "Reference(ResearchStudy)", "AdverseEvent.study.", 0, java.lang.Integer.MAX_VALUE, study));
1682      }
1683
1684      @Override
1685      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1686        switch (hash) {
1687        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1688        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration<AdverseEventCategory>
1689        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
1690        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1691        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
1692        case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // Reference
1693        case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference
1694        case -1551003909: /*seriousness*/ return this.seriousness == null ? new Base[0] : new Base[] {this.seriousness}; // CodeableConcept
1695        case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
1696        case -799233858: /*recorder*/ return this.recorder == null ? new Base[0] : new Base[] {this.recorder}; // Reference
1697        case 270753849: /*eventParticipant*/ return this.eventParticipant == null ? new Base[0] : new Base[] {this.eventParticipant}; // Reference
1698        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1699        case -1957422662: /*suspectEntity*/ return this.suspectEntity == null ? new Base[0] : this.suspectEntity.toArray(new Base[this.suspectEntity.size()]); // AdverseEventSuspectEntityComponent
1700        case -1685245681: /*subjectMedicalHistory*/ return this.subjectMedicalHistory == null ? new Base[0] : this.subjectMedicalHistory.toArray(new Base[this.subjectMedicalHistory.size()]); // Reference
1701        case 1013971334: /*referenceDocument*/ return this.referenceDocument == null ? new Base[0] : this.referenceDocument.toArray(new Base[this.referenceDocument.size()]); // Reference
1702        case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // Reference
1703        default: return super.getProperty(hash, name, checkValid);
1704        }
1705
1706      }
1707
1708      @Override
1709      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1710        switch (hash) {
1711        case -1618432855: // identifier
1712          this.identifier = castToIdentifier(value); // Identifier
1713          return value;
1714        case 50511102: // category
1715          value = new AdverseEventCategoryEnumFactory().fromType(castToCode(value));
1716          this.category = (Enumeration) value; // Enumeration<AdverseEventCategory>
1717          return value;
1718        case 3575610: // type
1719          this.type = castToCodeableConcept(value); // CodeableConcept
1720          return value;
1721        case -1867885268: // subject
1722          this.subject = castToReference(value); // Reference
1723          return value;
1724        case 3076014: // date
1725          this.date = castToDateTime(value); // DateTimeType
1726          return value;
1727        case -867509719: // reaction
1728          this.getReaction().add(castToReference(value)); // Reference
1729          return value;
1730        case 1901043637: // location
1731          this.location = castToReference(value); // Reference
1732          return value;
1733        case -1551003909: // seriousness
1734          this.seriousness = castToCodeableConcept(value); // CodeableConcept
1735          return value;
1736        case -1106507950: // outcome
1737          this.outcome = castToCodeableConcept(value); // CodeableConcept
1738          return value;
1739        case -799233858: // recorder
1740          this.recorder = castToReference(value); // Reference
1741          return value;
1742        case 270753849: // eventParticipant
1743          this.eventParticipant = castToReference(value); // Reference
1744          return value;
1745        case -1724546052: // description
1746          this.description = castToString(value); // StringType
1747          return value;
1748        case -1957422662: // suspectEntity
1749          this.getSuspectEntity().add((AdverseEventSuspectEntityComponent) value); // AdverseEventSuspectEntityComponent
1750          return value;
1751        case -1685245681: // subjectMedicalHistory
1752          this.getSubjectMedicalHistory().add(castToReference(value)); // Reference
1753          return value;
1754        case 1013971334: // referenceDocument
1755          this.getReferenceDocument().add(castToReference(value)); // Reference
1756          return value;
1757        case 109776329: // study
1758          this.getStudy().add(castToReference(value)); // Reference
1759          return value;
1760        default: return super.setProperty(hash, name, value);
1761        }
1762
1763      }
1764
1765      @Override
1766      public Base setProperty(String name, Base value) throws FHIRException {
1767        if (name.equals("identifier")) {
1768          this.identifier = castToIdentifier(value); // Identifier
1769        } else if (name.equals("category")) {
1770          value = new AdverseEventCategoryEnumFactory().fromType(castToCode(value));
1771          this.category = (Enumeration) value; // Enumeration<AdverseEventCategory>
1772        } else if (name.equals("type")) {
1773          this.type = castToCodeableConcept(value); // CodeableConcept
1774        } else if (name.equals("subject")) {
1775          this.subject = castToReference(value); // Reference
1776        } else if (name.equals("date")) {
1777          this.date = castToDateTime(value); // DateTimeType
1778        } else if (name.equals("reaction")) {
1779          this.getReaction().add(castToReference(value));
1780        } else if (name.equals("location")) {
1781          this.location = castToReference(value); // Reference
1782        } else if (name.equals("seriousness")) {
1783          this.seriousness = castToCodeableConcept(value); // CodeableConcept
1784        } else if (name.equals("outcome")) {
1785          this.outcome = castToCodeableConcept(value); // CodeableConcept
1786        } else if (name.equals("recorder")) {
1787          this.recorder = castToReference(value); // Reference
1788        } else if (name.equals("eventParticipant")) {
1789          this.eventParticipant = castToReference(value); // Reference
1790        } else if (name.equals("description")) {
1791          this.description = castToString(value); // StringType
1792        } else if (name.equals("suspectEntity")) {
1793          this.getSuspectEntity().add((AdverseEventSuspectEntityComponent) value);
1794        } else if (name.equals("subjectMedicalHistory")) {
1795          this.getSubjectMedicalHistory().add(castToReference(value));
1796        } else if (name.equals("referenceDocument")) {
1797          this.getReferenceDocument().add(castToReference(value));
1798        } else if (name.equals("study")) {
1799          this.getStudy().add(castToReference(value));
1800        } else
1801          return super.setProperty(name, value);
1802        return value;
1803      }
1804
1805      @Override
1806      public Base makeProperty(int hash, String name) throws FHIRException {
1807        switch (hash) {
1808        case -1618432855:  return getIdentifier(); 
1809        case 50511102:  return getCategoryElement();
1810        case 3575610:  return getType(); 
1811        case -1867885268:  return getSubject(); 
1812        case 3076014:  return getDateElement();
1813        case -867509719:  return addReaction(); 
1814        case 1901043637:  return getLocation(); 
1815        case -1551003909:  return getSeriousness(); 
1816        case -1106507950:  return getOutcome(); 
1817        case -799233858:  return getRecorder(); 
1818        case 270753849:  return getEventParticipant(); 
1819        case -1724546052:  return getDescriptionElement();
1820        case -1957422662:  return addSuspectEntity(); 
1821        case -1685245681:  return addSubjectMedicalHistory(); 
1822        case 1013971334:  return addReferenceDocument(); 
1823        case 109776329:  return addStudy(); 
1824        default: return super.makeProperty(hash, name);
1825        }
1826
1827      }
1828
1829      @Override
1830      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1831        switch (hash) {
1832        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1833        case 50511102: /*category*/ return new String[] {"code"};
1834        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
1835        case -1867885268: /*subject*/ return new String[] {"Reference"};
1836        case 3076014: /*date*/ return new String[] {"dateTime"};
1837        case -867509719: /*reaction*/ return new String[] {"Reference"};
1838        case 1901043637: /*location*/ return new String[] {"Reference"};
1839        case -1551003909: /*seriousness*/ return new String[] {"CodeableConcept"};
1840        case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
1841        case -799233858: /*recorder*/ return new String[] {"Reference"};
1842        case 270753849: /*eventParticipant*/ return new String[] {"Reference"};
1843        case -1724546052: /*description*/ return new String[] {"string"};
1844        case -1957422662: /*suspectEntity*/ return new String[] {};
1845        case -1685245681: /*subjectMedicalHistory*/ return new String[] {"Reference"};
1846        case 1013971334: /*referenceDocument*/ return new String[] {"Reference"};
1847        case 109776329: /*study*/ return new String[] {"Reference"};
1848        default: return super.getTypesForProperty(hash, name);
1849        }
1850
1851      }
1852
1853      @Override
1854      public Base addChild(String name) throws FHIRException {
1855        if (name.equals("identifier")) {
1856          this.identifier = new Identifier();
1857          return this.identifier;
1858        }
1859        else if (name.equals("category")) {
1860          throw new FHIRException("Cannot call addChild on a primitive type AdverseEvent.category");
1861        }
1862        else if (name.equals("type")) {
1863          this.type = new CodeableConcept();
1864          return this.type;
1865        }
1866        else if (name.equals("subject")) {
1867          this.subject = new Reference();
1868          return this.subject;
1869        }
1870        else if (name.equals("date")) {
1871          throw new FHIRException("Cannot call addChild on a primitive type AdverseEvent.date");
1872        }
1873        else if (name.equals("reaction")) {
1874          return addReaction();
1875        }
1876        else if (name.equals("location")) {
1877          this.location = new Reference();
1878          return this.location;
1879        }
1880        else if (name.equals("seriousness")) {
1881          this.seriousness = new CodeableConcept();
1882          return this.seriousness;
1883        }
1884        else if (name.equals("outcome")) {
1885          this.outcome = new CodeableConcept();
1886          return this.outcome;
1887        }
1888        else if (name.equals("recorder")) {
1889          this.recorder = new Reference();
1890          return this.recorder;
1891        }
1892        else if (name.equals("eventParticipant")) {
1893          this.eventParticipant = new Reference();
1894          return this.eventParticipant;
1895        }
1896        else if (name.equals("description")) {
1897          throw new FHIRException("Cannot call addChild on a primitive type AdverseEvent.description");
1898        }
1899        else if (name.equals("suspectEntity")) {
1900          return addSuspectEntity();
1901        }
1902        else if (name.equals("subjectMedicalHistory")) {
1903          return addSubjectMedicalHistory();
1904        }
1905        else if (name.equals("referenceDocument")) {
1906          return addReferenceDocument();
1907        }
1908        else if (name.equals("study")) {
1909          return addStudy();
1910        }
1911        else
1912          return super.addChild(name);
1913      }
1914
1915  public String fhirType() {
1916    return "AdverseEvent";
1917
1918  }
1919
1920      public AdverseEvent copy() {
1921        AdverseEvent dst = new AdverseEvent();
1922        copyValues(dst);
1923        dst.identifier = identifier == null ? null : identifier.copy();
1924        dst.category = category == null ? null : category.copy();
1925        dst.type = type == null ? null : type.copy();
1926        dst.subject = subject == null ? null : subject.copy();
1927        dst.date = date == null ? null : date.copy();
1928        if (reaction != null) {
1929          dst.reaction = new ArrayList<Reference>();
1930          for (Reference i : reaction)
1931            dst.reaction.add(i.copy());
1932        };
1933        dst.location = location == null ? null : location.copy();
1934        dst.seriousness = seriousness == null ? null : seriousness.copy();
1935        dst.outcome = outcome == null ? null : outcome.copy();
1936        dst.recorder = recorder == null ? null : recorder.copy();
1937        dst.eventParticipant = eventParticipant == null ? null : eventParticipant.copy();
1938        dst.description = description == null ? null : description.copy();
1939        if (suspectEntity != null) {
1940          dst.suspectEntity = new ArrayList<AdverseEventSuspectEntityComponent>();
1941          for (AdverseEventSuspectEntityComponent i : suspectEntity)
1942            dst.suspectEntity.add(i.copy());
1943        };
1944        if (subjectMedicalHistory != null) {
1945          dst.subjectMedicalHistory = new ArrayList<Reference>();
1946          for (Reference i : subjectMedicalHistory)
1947            dst.subjectMedicalHistory.add(i.copy());
1948        };
1949        if (referenceDocument != null) {
1950          dst.referenceDocument = new ArrayList<Reference>();
1951          for (Reference i : referenceDocument)
1952            dst.referenceDocument.add(i.copy());
1953        };
1954        if (study != null) {
1955          dst.study = new ArrayList<Reference>();
1956          for (Reference i : study)
1957            dst.study.add(i.copy());
1958        };
1959        return dst;
1960      }
1961
1962      protected AdverseEvent typedCopy() {
1963        return copy();
1964      }
1965
1966      @Override
1967      public boolean equalsDeep(Base other) {
1968        if (!super.equalsDeep(other))
1969          return false;
1970        if (!(other instanceof AdverseEvent))
1971          return false;
1972        AdverseEvent o = (AdverseEvent) other;
1973        return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(type, o.type, true)
1974           && compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(reaction, o.reaction, true)
1975           && compareDeep(location, o.location, true) && compareDeep(seriousness, o.seriousness, true) && compareDeep(outcome, o.outcome, true)
1976           && compareDeep(recorder, o.recorder, true) && compareDeep(eventParticipant, o.eventParticipant, true)
1977           && compareDeep(description, o.description, true) && compareDeep(suspectEntity, o.suspectEntity, true)
1978           && compareDeep(subjectMedicalHistory, o.subjectMedicalHistory, true) && compareDeep(referenceDocument, o.referenceDocument, true)
1979           && compareDeep(study, o.study, true);
1980      }
1981
1982      @Override
1983      public boolean equalsShallow(Base other) {
1984        if (!super.equalsShallow(other))
1985          return false;
1986        if (!(other instanceof AdverseEvent))
1987          return false;
1988        AdverseEvent o = (AdverseEvent) other;
1989        return compareValues(category, o.category, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true)
1990          ;
1991      }
1992
1993      public boolean isEmpty() {
1994        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, category, type
1995          , subject, date, reaction, location, seriousness, outcome, recorder, eventParticipant
1996          , description, suspectEntity, subjectMedicalHistory, referenceDocument, study);
1997      }
1998
1999  @Override
2000  public ResourceType getResourceType() {
2001    return ResourceType.AdverseEvent;
2002   }
2003
2004 /**
2005   * Search parameter: <b>date</b>
2006   * <p>
2007   * Description: <b>When the event occurred</b><br>
2008   * Type: <b>date</b><br>
2009   * Path: <b>AdverseEvent.date</b><br>
2010   * </p>
2011   */
2012  @SearchParamDefinition(name="date", path="AdverseEvent.date", description="When the event occurred", type="date" )
2013  public static final String SP_DATE = "date";
2014 /**
2015   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2016   * <p>
2017   * Description: <b>When the event occurred</b><br>
2018   * Type: <b>date</b><br>
2019   * Path: <b>AdverseEvent.date</b><br>
2020   * </p>
2021   */
2022  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2023
2024 /**
2025   * Search parameter: <b>recorder</b>
2026   * <p>
2027   * Description: <b>Who recorded the adverse event</b><br>
2028   * Type: <b>reference</b><br>
2029   * Path: <b>AdverseEvent.recorder</b><br>
2030   * </p>
2031   */
2032  @SearchParamDefinition(name="recorder", path="AdverseEvent.recorder", description="Who recorded the adverse event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Patient.class, Practitioner.class, RelatedPerson.class } )
2033  public static final String SP_RECORDER = "recorder";
2034 /**
2035   * <b>Fluent Client</b> search parameter constant for <b>recorder</b>
2036   * <p>
2037   * Description: <b>Who recorded the adverse event</b><br>
2038   * Type: <b>reference</b><br>
2039   * Path: <b>AdverseEvent.recorder</b><br>
2040   * </p>
2041   */
2042  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECORDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECORDER);
2043
2044/**
2045   * Constant for fluent queries to be used to add include statements. Specifies
2046   * the path value of "<b>AdverseEvent:recorder</b>".
2047   */
2048  public static final ca.uhn.fhir.model.api.Include INCLUDE_RECORDER = new ca.uhn.fhir.model.api.Include("AdverseEvent:recorder").toLocked();
2049
2050 /**
2051   * Search parameter: <b>study</b>
2052   * <p>
2053   * Description: <b>AdverseEvent.study</b><br>
2054   * Type: <b>reference</b><br>
2055   * Path: <b>AdverseEvent.study</b><br>
2056   * </p>
2057   */
2058  @SearchParamDefinition(name="study", path="AdverseEvent.study", description="AdverseEvent.study", type="reference", target={ResearchStudy.class } )
2059  public static final String SP_STUDY = "study";
2060 /**
2061   * <b>Fluent Client</b> search parameter constant for <b>study</b>
2062   * <p>
2063   * Description: <b>AdverseEvent.study</b><br>
2064   * Type: <b>reference</b><br>
2065   * Path: <b>AdverseEvent.study</b><br>
2066   * </p>
2067   */
2068  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam STUDY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_STUDY);
2069
2070/**
2071   * Constant for fluent queries to be used to add include statements. Specifies
2072   * the path value of "<b>AdverseEvent:study</b>".
2073   */
2074  public static final ca.uhn.fhir.model.api.Include INCLUDE_STUDY = new ca.uhn.fhir.model.api.Include("AdverseEvent:study").toLocked();
2075
2076 /**
2077   * Search parameter: <b>reaction</b>
2078   * <p>
2079   * Description: <b>Adverse Reaction Events linked to exposure to substance</b><br>
2080   * Type: <b>reference</b><br>
2081   * Path: <b>AdverseEvent.reaction</b><br>
2082   * </p>
2083   */
2084  @SearchParamDefinition(name="reaction", path="AdverseEvent.reaction", description="Adverse Reaction Events linked to exposure to substance", type="reference", target={Condition.class } )
2085  public static final String SP_REACTION = "reaction";
2086 /**
2087   * <b>Fluent Client</b> search parameter constant for <b>reaction</b>
2088   * <p>
2089   * Description: <b>Adverse Reaction Events linked to exposure to substance</b><br>
2090   * Type: <b>reference</b><br>
2091   * Path: <b>AdverseEvent.reaction</b><br>
2092   * </p>
2093   */
2094  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REACTION);
2095
2096/**
2097   * Constant for fluent queries to be used to add include statements. Specifies
2098   * the path value of "<b>AdverseEvent:reaction</b>".
2099   */
2100  public static final ca.uhn.fhir.model.api.Include INCLUDE_REACTION = new ca.uhn.fhir.model.api.Include("AdverseEvent:reaction").toLocked();
2101
2102 /**
2103   * Search parameter: <b>seriousness</b>
2104   * <p>
2105   * Description: <b>Mild | Moderate | Severe</b><br>
2106   * Type: <b>token</b><br>
2107   * Path: <b>AdverseEvent.seriousness</b><br>
2108   * </p>
2109   */
2110  @SearchParamDefinition(name="seriousness", path="AdverseEvent.seriousness", description="Mild | Moderate | Severe", type="token" )
2111  public static final String SP_SERIOUSNESS = "seriousness";
2112 /**
2113   * <b>Fluent Client</b> search parameter constant for <b>seriousness</b>
2114   * <p>
2115   * Description: <b>Mild | Moderate | Severe</b><br>
2116   * Type: <b>token</b><br>
2117   * Path: <b>AdverseEvent.seriousness</b><br>
2118   * </p>
2119   */
2120  public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERIOUSNESS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERIOUSNESS);
2121
2122 /**
2123   * Search parameter: <b>subject</b>
2124   * <p>
2125   * Description: <b>Subject or group impacted by event</b><br>
2126   * Type: <b>reference</b><br>
2127   * Path: <b>AdverseEvent.subject</b><br>
2128   * </p>
2129   */
2130  @SearchParamDefinition(name="subject", path="AdverseEvent.subject", description="Subject or group impacted by event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Device.class, Medication.class, Patient.class, ResearchSubject.class } )
2131  public static final String SP_SUBJECT = "subject";
2132 /**
2133   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2134   * <p>
2135   * Description: <b>Subject or group impacted by event</b><br>
2136   * Type: <b>reference</b><br>
2137   * Path: <b>AdverseEvent.subject</b><br>
2138   * </p>
2139   */
2140  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2141
2142/**
2143   * Constant for fluent queries to be used to add include statements. Specifies
2144   * the path value of "<b>AdverseEvent:subject</b>".
2145   */
2146  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("AdverseEvent:subject").toLocked();
2147
2148 /**
2149   * Search parameter: <b>substance</b>
2150   * <p>
2151   * Description: <b>Refers to the specific entity that caused the adverse event</b><br>
2152   * Type: <b>reference</b><br>
2153   * Path: <b>AdverseEvent.suspectEntity.instance</b><br>
2154   * </p>
2155   */
2156  @SearchParamDefinition(name="substance", path="AdverseEvent.suspectEntity.instance", description="Refers to the specific entity that caused the adverse event", type="reference", target={Device.class, Medication.class, MedicationAdministration.class, MedicationStatement.class, Substance.class } )
2157  public static final String SP_SUBSTANCE = "substance";
2158 /**
2159   * <b>Fluent Client</b> search parameter constant for <b>substance</b>
2160   * <p>
2161   * Description: <b>Refers to the specific entity that caused the adverse event</b><br>
2162   * Type: <b>reference</b><br>
2163   * Path: <b>AdverseEvent.suspectEntity.instance</b><br>
2164   * </p>
2165   */
2166  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSTANCE);
2167
2168/**
2169   * Constant for fluent queries to be used to add include statements. Specifies
2170   * the path value of "<b>AdverseEvent:substance</b>".
2171   */
2172  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSTANCE = new ca.uhn.fhir.model.api.Include("AdverseEvent:substance").toLocked();
2173
2174 /**
2175   * Search parameter: <b>location</b>
2176   * <p>
2177   * Description: <b>Location where adverse event occurred</b><br>
2178   * Type: <b>reference</b><br>
2179   * Path: <b>AdverseEvent.location</b><br>
2180   * </p>
2181   */
2182  @SearchParamDefinition(name="location", path="AdverseEvent.location", description="Location where adverse event occurred", type="reference", target={Location.class } )
2183  public static final String SP_LOCATION = "location";
2184 /**
2185   * <b>Fluent Client</b> search parameter constant for <b>location</b>
2186   * <p>
2187   * Description: <b>Location where adverse event occurred</b><br>
2188   * Type: <b>reference</b><br>
2189   * Path: <b>AdverseEvent.location</b><br>
2190   * </p>
2191   */
2192  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION);
2193
2194/**
2195   * Constant for fluent queries to be used to add include statements. Specifies
2196   * the path value of "<b>AdverseEvent:location</b>".
2197   */
2198  public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("AdverseEvent:location").toLocked();
2199
2200 /**
2201   * Search parameter: <b>category</b>
2202   * <p>
2203   * Description: <b>AE | PAE 
2204An adverse event is an event that caused harm to a patient,  an adverse reaction is a something that is a subject-specific event that is a result of an exposure to a medication, food, device or environmental substance, a potential adverse event is something that occurred and that could have caused harm to a patient but did not</b><br>
2205   * Type: <b>token</b><br>
2206   * Path: <b>AdverseEvent.category</b><br>
2207   * </p>
2208   */
2209  @SearchParamDefinition(name="category", path="AdverseEvent.category", description="AE | PAE \rAn adverse event is an event that caused harm to a patient,  an adverse reaction is a something that is a subject-specific event that is a result of an exposure to a medication, food, device or environmental substance, a potential adverse event is something that occurred and that could have caused harm to a patient but did not", type="token" )
2210  public static final String SP_CATEGORY = "category";
2211 /**
2212   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2213   * <p>
2214   * Description: <b>AE | PAE 
2215An adverse event is an event that caused harm to a patient,  an adverse reaction is a something that is a subject-specific event that is a result of an exposure to a medication, food, device or environmental substance, a potential adverse event is something that occurred and that could have caused harm to a patient but did not</b><br>
2216   * Type: <b>token</b><br>
2217   * Path: <b>AdverseEvent.category</b><br>
2218   * </p>
2219   */
2220  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2221
2222 /**
2223   * Search parameter: <b>type</b>
2224   * <p>
2225   * Description: <b>actual | potential</b><br>
2226   * Type: <b>token</b><br>
2227   * Path: <b>AdverseEvent.type</b><br>
2228   * </p>
2229   */
2230  @SearchParamDefinition(name="type", path="AdverseEvent.type", description="actual | potential", type="token" )
2231  public static final String SP_TYPE = "type";
2232 /**
2233   * <b>Fluent Client</b> search parameter constant for <b>type</b>
2234   * <p>
2235   * Description: <b>actual | potential</b><br>
2236   * Type: <b>token</b><br>
2237   * Path: <b>AdverseEvent.type</b><br>
2238   * </p>
2239   */
2240  public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE);
2241
2242
2243}
2244