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