001package org.hl7.fhir.r5.model;
002
003
004/*
005  Copyright (c) 2011+, HL7, Inc.
006  All rights reserved.
007  
008  Redistribution and use in source and binary forms, with or without modification, \
009  are permitted provided that the following conditions are met:
010  
011   * Redistributions of source code must retain the above copyright notice, this \
012     list of conditions and the following disclaimer.
013   * Redistributions in binary form must reproduce the above copyright notice, \
014     this list of conditions and the following disclaimer in the documentation \
015     and/or other materials provided with the distribution.
016   * Neither the name of HL7 nor the names of its contributors may be used to 
017     endorse or promote products derived from this software without specific 
018     prior written permission.
019  
020  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
021  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
022  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
023  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
024  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
025  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
026  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
027  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
028  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
029  POSSIBILITY OF SUCH DAMAGE.
030  */
031
032// Generated on Fri, Jul 15, 2022 11:20+1000 for FHIR v5.0.0-snapshot2
033
034import java.util.ArrayList;
035import java.util.Date;
036import java.util.List;
037import org.hl7.fhir.utilities.Utilities;
038import org.hl7.fhir.r5.model.Enumerations.*;
039import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.ICompositeType;
042import ca.uhn.fhir.model.api.annotation.ResourceDef;
043import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
044import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.ChildOrder;
047import ca.uhn.fhir.model.api.annotation.Description;
048import ca.uhn.fhir.model.api.annotation.Block;
049
050/**
051 * The EvidenceReport Resource is a specialized container for a collection of resources and codeable concepts, adapted to support compositions of Evidence, EvidenceVariable, and Citation resources and related concepts.
052 */
053@ResourceDef(name="EvidenceReport", profile="http://hl7.org/fhir/StructureDefinition/EvidenceReport")
054public class EvidenceReport extends MetadataResource {
055
056    public enum ReportRelationshipType {
057        /**
058         * This document replaces or supersedes the target document.
059         */
060        REPLACES, 
061        /**
062         * This document notes corrections or changes to replace or supersede parts of the target document.
063         */
064        AMENDS, 
065        /**
066         * This document adds additional information to the target document.
067         */
068        APPENDS, 
069        /**
070         * This document was generated by transforming the target document (eg format or language conversion).
071         */
072        TRANSFORMS, 
073        /**
074         * This document was.
075         */
076        REPLACEDWITH, 
077        /**
078         * This document was.
079         */
080        AMENDEDWITH, 
081        /**
082         * This document was.
083         */
084        APPENDEDWITH, 
085        /**
086         * This document was.
087         */
088        TRANSFORMEDWITH, 
089        /**
090         * added to help the parsers with the generic types
091         */
092        NULL;
093        public static ReportRelationshipType fromCode(String codeString) throws FHIRException {
094            if (codeString == null || "".equals(codeString))
095                return null;
096        if ("replaces".equals(codeString))
097          return REPLACES;
098        if ("amends".equals(codeString))
099          return AMENDS;
100        if ("appends".equals(codeString))
101          return APPENDS;
102        if ("transforms".equals(codeString))
103          return TRANSFORMS;
104        if ("replacedWith".equals(codeString))
105          return REPLACEDWITH;
106        if ("amendedWith".equals(codeString))
107          return AMENDEDWITH;
108        if ("appendedWith".equals(codeString))
109          return APPENDEDWITH;
110        if ("transformedWith".equals(codeString))
111          return TRANSFORMEDWITH;
112        if (Configuration.isAcceptInvalidEnums())
113          return null;
114        else
115          throw new FHIRException("Unknown ReportRelationshipType code '"+codeString+"'");
116        }
117        public String toCode() {
118          switch (this) {
119            case REPLACES: return "replaces";
120            case AMENDS: return "amends";
121            case APPENDS: return "appends";
122            case TRANSFORMS: return "transforms";
123            case REPLACEDWITH: return "replacedWith";
124            case AMENDEDWITH: return "amendedWith";
125            case APPENDEDWITH: return "appendedWith";
126            case TRANSFORMEDWITH: return "transformedWith";
127            case NULL: return null;
128            default: return "?";
129          }
130        }
131        public String getSystem() {
132          switch (this) {
133            case REPLACES: return "http://hl7.org/fhir/report-relation-type";
134            case AMENDS: return "http://hl7.org/fhir/report-relation-type";
135            case APPENDS: return "http://hl7.org/fhir/report-relation-type";
136            case TRANSFORMS: return "http://hl7.org/fhir/report-relation-type";
137            case REPLACEDWITH: return "http://hl7.org/fhir/report-relation-type";
138            case AMENDEDWITH: return "http://hl7.org/fhir/report-relation-type";
139            case APPENDEDWITH: return "http://hl7.org/fhir/report-relation-type";
140            case TRANSFORMEDWITH: return "http://hl7.org/fhir/report-relation-type";
141            case NULL: return null;
142            default: return "?";
143          }
144        }
145        public String getDefinition() {
146          switch (this) {
147            case REPLACES: return "This document replaces or supersedes the target document.";
148            case AMENDS: return "This document notes corrections or changes to replace or supersede parts of the target document.";
149            case APPENDS: return "This document adds additional information to the target document.";
150            case TRANSFORMS: return "This document was generated by transforming the target document (eg format or language conversion).";
151            case REPLACEDWITH: return "This document was.";
152            case AMENDEDWITH: return "This document was.";
153            case APPENDEDWITH: return "This document was.";
154            case TRANSFORMEDWITH: return "This document was.";
155            case NULL: return null;
156            default: return "?";
157          }
158        }
159        public String getDisplay() {
160          switch (this) {
161            case REPLACES: return "Replaces";
162            case AMENDS: return "Amends";
163            case APPENDS: return "Appends";
164            case TRANSFORMS: return "Transforms";
165            case REPLACEDWITH: return "Replaced With";
166            case AMENDEDWITH: return "Amended With";
167            case APPENDEDWITH: return "Appended With";
168            case TRANSFORMEDWITH: return "Transformed With";
169            case NULL: return null;
170            default: return "?";
171          }
172        }
173    }
174
175  public static class ReportRelationshipTypeEnumFactory implements EnumFactory<ReportRelationshipType> {
176    public ReportRelationshipType fromCode(String codeString) throws IllegalArgumentException {
177      if (codeString == null || "".equals(codeString))
178            if (codeString == null || "".equals(codeString))
179                return null;
180        if ("replaces".equals(codeString))
181          return ReportRelationshipType.REPLACES;
182        if ("amends".equals(codeString))
183          return ReportRelationshipType.AMENDS;
184        if ("appends".equals(codeString))
185          return ReportRelationshipType.APPENDS;
186        if ("transforms".equals(codeString))
187          return ReportRelationshipType.TRANSFORMS;
188        if ("replacedWith".equals(codeString))
189          return ReportRelationshipType.REPLACEDWITH;
190        if ("amendedWith".equals(codeString))
191          return ReportRelationshipType.AMENDEDWITH;
192        if ("appendedWith".equals(codeString))
193          return ReportRelationshipType.APPENDEDWITH;
194        if ("transformedWith".equals(codeString))
195          return ReportRelationshipType.TRANSFORMEDWITH;
196        throw new IllegalArgumentException("Unknown ReportRelationshipType code '"+codeString+"'");
197        }
198        public Enumeration<ReportRelationshipType> fromType(Base code) throws FHIRException {
199          if (code == null)
200            return null;
201          if (code.isEmpty())
202            return new Enumeration<ReportRelationshipType>(this);
203          String codeString = ((PrimitiveType) code).asStringValue();
204          if (codeString == null || "".equals(codeString))
205            return null;
206        if ("replaces".equals(codeString))
207          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.REPLACES);
208        if ("amends".equals(codeString))
209          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.AMENDS);
210        if ("appends".equals(codeString))
211          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.APPENDS);
212        if ("transforms".equals(codeString))
213          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.TRANSFORMS);
214        if ("replacedWith".equals(codeString))
215          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.REPLACEDWITH);
216        if ("amendedWith".equals(codeString))
217          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.AMENDEDWITH);
218        if ("appendedWith".equals(codeString))
219          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.APPENDEDWITH);
220        if ("transformedWith".equals(codeString))
221          return new Enumeration<ReportRelationshipType>(this, ReportRelationshipType.TRANSFORMEDWITH);
222        throw new FHIRException("Unknown ReportRelationshipType code '"+codeString+"'");
223        }
224    public String toCode(ReportRelationshipType code) {
225      if (code == ReportRelationshipType.REPLACES)
226        return "replaces";
227      if (code == ReportRelationshipType.AMENDS)
228        return "amends";
229      if (code == ReportRelationshipType.APPENDS)
230        return "appends";
231      if (code == ReportRelationshipType.TRANSFORMS)
232        return "transforms";
233      if (code == ReportRelationshipType.REPLACEDWITH)
234        return "replacedWith";
235      if (code == ReportRelationshipType.AMENDEDWITH)
236        return "amendedWith";
237      if (code == ReportRelationshipType.APPENDEDWITH)
238        return "appendedWith";
239      if (code == ReportRelationshipType.TRANSFORMEDWITH)
240        return "transformedWith";
241      return "?";
242      }
243    public String toSystem(ReportRelationshipType code) {
244      return code.getSystem();
245      }
246    }
247
248    @Block()
249    public static class EvidenceReportSubjectComponent extends BackboneElement implements IBaseBackboneElement {
250        /**
251         * Characteristic.
252         */
253        @Child(name = "characteristic", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
254        @Description(shortDefinition="Characteristic", formalDefinition="Characteristic." )
255        protected List<EvidenceReportSubjectCharacteristicComponent> characteristic;
256
257        /**
258         * Used for general notes and annotations not coded elsewhere.
259         */
260        @Child(name = "note", type = {Annotation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
261        @Description(shortDefinition="Footnotes and/or explanatory notes", formalDefinition="Used for general notes and annotations not coded elsewhere." )
262        protected List<Annotation> note;
263
264        private static final long serialVersionUID = -734040873L;
265
266    /**
267     * Constructor
268     */
269      public EvidenceReportSubjectComponent() {
270        super();
271      }
272
273        /**
274         * @return {@link #characteristic} (Characteristic.)
275         */
276        public List<EvidenceReportSubjectCharacteristicComponent> getCharacteristic() { 
277          if (this.characteristic == null)
278            this.characteristic = new ArrayList<EvidenceReportSubjectCharacteristicComponent>();
279          return this.characteristic;
280        }
281
282        /**
283         * @return Returns a reference to <code>this</code> for easy method chaining
284         */
285        public EvidenceReportSubjectComponent setCharacteristic(List<EvidenceReportSubjectCharacteristicComponent> theCharacteristic) { 
286          this.characteristic = theCharacteristic;
287          return this;
288        }
289
290        public boolean hasCharacteristic() { 
291          if (this.characteristic == null)
292            return false;
293          for (EvidenceReportSubjectCharacteristicComponent item : this.characteristic)
294            if (!item.isEmpty())
295              return true;
296          return false;
297        }
298
299        public EvidenceReportSubjectCharacteristicComponent addCharacteristic() { //3
300          EvidenceReportSubjectCharacteristicComponent t = new EvidenceReportSubjectCharacteristicComponent();
301          if (this.characteristic == null)
302            this.characteristic = new ArrayList<EvidenceReportSubjectCharacteristicComponent>();
303          this.characteristic.add(t);
304          return t;
305        }
306
307        public EvidenceReportSubjectComponent addCharacteristic(EvidenceReportSubjectCharacteristicComponent t) { //3
308          if (t == null)
309            return this;
310          if (this.characteristic == null)
311            this.characteristic = new ArrayList<EvidenceReportSubjectCharacteristicComponent>();
312          this.characteristic.add(t);
313          return this;
314        }
315
316        /**
317         * @return The first repetition of repeating field {@link #characteristic}, creating it if it does not already exist {3}
318         */
319        public EvidenceReportSubjectCharacteristicComponent getCharacteristicFirstRep() { 
320          if (getCharacteristic().isEmpty()) {
321            addCharacteristic();
322          }
323          return getCharacteristic().get(0);
324        }
325
326        /**
327         * @return {@link #note} (Used for general notes and annotations not coded elsewhere.)
328         */
329        public List<Annotation> getNote() { 
330          if (this.note == null)
331            this.note = new ArrayList<Annotation>();
332          return this.note;
333        }
334
335        /**
336         * @return Returns a reference to <code>this</code> for easy method chaining
337         */
338        public EvidenceReportSubjectComponent setNote(List<Annotation> theNote) { 
339          this.note = theNote;
340          return this;
341        }
342
343        public boolean hasNote() { 
344          if (this.note == null)
345            return false;
346          for (Annotation item : this.note)
347            if (!item.isEmpty())
348              return true;
349          return false;
350        }
351
352        public Annotation addNote() { //3
353          Annotation t = new Annotation();
354          if (this.note == null)
355            this.note = new ArrayList<Annotation>();
356          this.note.add(t);
357          return t;
358        }
359
360        public EvidenceReportSubjectComponent addNote(Annotation t) { //3
361          if (t == null)
362            return this;
363          if (this.note == null)
364            this.note = new ArrayList<Annotation>();
365          this.note.add(t);
366          return this;
367        }
368
369        /**
370         * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
371         */
372        public Annotation getNoteFirstRep() { 
373          if (getNote().isEmpty()) {
374            addNote();
375          }
376          return getNote().get(0);
377        }
378
379        protected void listChildren(List<Property> children) {
380          super.listChildren(children);
381          children.add(new Property("characteristic", "", "Characteristic.", 0, java.lang.Integer.MAX_VALUE, characteristic));
382          children.add(new Property("note", "Annotation", "Used for general notes and annotations not coded elsewhere.", 0, java.lang.Integer.MAX_VALUE, note));
383        }
384
385        @Override
386        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
387          switch (_hash) {
388          case 366313883: /*characteristic*/  return new Property("characteristic", "", "Characteristic.", 0, java.lang.Integer.MAX_VALUE, characteristic);
389          case 3387378: /*note*/  return new Property("note", "Annotation", "Used for general notes and annotations not coded elsewhere.", 0, java.lang.Integer.MAX_VALUE, note);
390          default: return super.getNamedProperty(_hash, _name, _checkValid);
391          }
392
393        }
394
395      @Override
396      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
397        switch (hash) {
398        case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // EvidenceReportSubjectCharacteristicComponent
399        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
400        default: return super.getProperty(hash, name, checkValid);
401        }
402
403      }
404
405      @Override
406      public Base setProperty(int hash, String name, Base value) throws FHIRException {
407        switch (hash) {
408        case 366313883: // characteristic
409          this.getCharacteristic().add((EvidenceReportSubjectCharacteristicComponent) value); // EvidenceReportSubjectCharacteristicComponent
410          return value;
411        case 3387378: // note
412          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
413          return value;
414        default: return super.setProperty(hash, name, value);
415        }
416
417      }
418
419      @Override
420      public Base setProperty(String name, Base value) throws FHIRException {
421        if (name.equals("characteristic")) {
422          this.getCharacteristic().add((EvidenceReportSubjectCharacteristicComponent) value);
423        } else if (name.equals("note")) {
424          this.getNote().add(TypeConvertor.castToAnnotation(value));
425        } else
426          return super.setProperty(name, value);
427        return value;
428      }
429
430      @Override
431      public Base makeProperty(int hash, String name) throws FHIRException {
432        switch (hash) {
433        case 366313883:  return addCharacteristic(); 
434        case 3387378:  return addNote(); 
435        default: return super.makeProperty(hash, name);
436        }
437
438      }
439
440      @Override
441      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
442        switch (hash) {
443        case 366313883: /*characteristic*/ return new String[] {};
444        case 3387378: /*note*/ return new String[] {"Annotation"};
445        default: return super.getTypesForProperty(hash, name);
446        }
447
448      }
449
450      @Override
451      public Base addChild(String name) throws FHIRException {
452        if (name.equals("characteristic")) {
453          return addCharacteristic();
454        }
455        else if (name.equals("note")) {
456          return addNote();
457        }
458        else
459          return super.addChild(name);
460      }
461
462      public EvidenceReportSubjectComponent copy() {
463        EvidenceReportSubjectComponent dst = new EvidenceReportSubjectComponent();
464        copyValues(dst);
465        return dst;
466      }
467
468      public void copyValues(EvidenceReportSubjectComponent dst) {
469        super.copyValues(dst);
470        if (characteristic != null) {
471          dst.characteristic = new ArrayList<EvidenceReportSubjectCharacteristicComponent>();
472          for (EvidenceReportSubjectCharacteristicComponent i : characteristic)
473            dst.characteristic.add(i.copy());
474        };
475        if (note != null) {
476          dst.note = new ArrayList<Annotation>();
477          for (Annotation i : note)
478            dst.note.add(i.copy());
479        };
480      }
481
482      @Override
483      public boolean equalsDeep(Base other_) {
484        if (!super.equalsDeep(other_))
485          return false;
486        if (!(other_ instanceof EvidenceReportSubjectComponent))
487          return false;
488        EvidenceReportSubjectComponent o = (EvidenceReportSubjectComponent) other_;
489        return compareDeep(characteristic, o.characteristic, true) && compareDeep(note, o.note, true);
490      }
491
492      @Override
493      public boolean equalsShallow(Base other_) {
494        if (!super.equalsShallow(other_))
495          return false;
496        if (!(other_ instanceof EvidenceReportSubjectComponent))
497          return false;
498        EvidenceReportSubjectComponent o = (EvidenceReportSubjectComponent) other_;
499        return true;
500      }
501
502      public boolean isEmpty() {
503        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(characteristic, note);
504      }
505
506  public String fhirType() {
507    return "EvidenceReport.subject";
508
509  }
510
511  }
512
513    @Block()
514    public static class EvidenceReportSubjectCharacteristicComponent extends BackboneElement implements IBaseBackboneElement {
515        /**
516         * Characteristic code.
517         */
518        @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
519        @Description(shortDefinition="Characteristic code", formalDefinition="Characteristic code." )
520        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/focus-characteristic-code")
521        protected CodeableConcept code;
522
523        /**
524         * Characteristic value.
525         */
526        @Child(name = "value", type = {Reference.class, CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1, modifier=false, summary=false)
527        @Description(shortDefinition="Characteristic value", formalDefinition="Characteristic value." )
528        protected DataType value;
529
530        /**
531         * Is used to express not the characteristic.
532         */
533        @Child(name = "exclude", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false)
534        @Description(shortDefinition="Is used to express not the characteristic", formalDefinition="Is used to express not the characteristic." )
535        protected BooleanType exclude;
536
537        /**
538         * Timeframe for the characteristic.
539         */
540        @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false)
541        @Description(shortDefinition="Timeframe for the characteristic", formalDefinition="Timeframe for the characteristic." )
542        protected Period period;
543
544        private static final long serialVersionUID = 279867823L;
545
546    /**
547     * Constructor
548     */
549      public EvidenceReportSubjectCharacteristicComponent() {
550        super();
551      }
552
553    /**
554     * Constructor
555     */
556      public EvidenceReportSubjectCharacteristicComponent(CodeableConcept code, DataType value) {
557        super();
558        this.setCode(code);
559        this.setValue(value);
560      }
561
562        /**
563         * @return {@link #code} (Characteristic code.)
564         */
565        public CodeableConcept getCode() { 
566          if (this.code == null)
567            if (Configuration.errorOnAutoCreate())
568              throw new Error("Attempt to auto-create EvidenceReportSubjectCharacteristicComponent.code");
569            else if (Configuration.doAutoCreate())
570              this.code = new CodeableConcept(); // cc
571          return this.code;
572        }
573
574        public boolean hasCode() { 
575          return this.code != null && !this.code.isEmpty();
576        }
577
578        /**
579         * @param value {@link #code} (Characteristic code.)
580         */
581        public EvidenceReportSubjectCharacteristicComponent setCode(CodeableConcept value) { 
582          this.code = value;
583          return this;
584        }
585
586        /**
587         * @return {@link #value} (Characteristic value.)
588         */
589        public DataType getValue() { 
590          return this.value;
591        }
592
593        /**
594         * @return {@link #value} (Characteristic value.)
595         */
596        public Reference getValueReference() throws FHIRException { 
597          if (this.value == null)
598            this.value = new Reference();
599          if (!(this.value instanceof Reference))
600            throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered");
601          return (Reference) this.value;
602        }
603
604        public boolean hasValueReference() { 
605          return this != null && this.value instanceof Reference;
606        }
607
608        /**
609         * @return {@link #value} (Characteristic value.)
610         */
611        public CodeableConcept getValueCodeableConcept() throws FHIRException { 
612          if (this.value == null)
613            this.value = new CodeableConcept();
614          if (!(this.value instanceof CodeableConcept))
615            throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered");
616          return (CodeableConcept) this.value;
617        }
618
619        public boolean hasValueCodeableConcept() { 
620          return this != null && this.value instanceof CodeableConcept;
621        }
622
623        /**
624         * @return {@link #value} (Characteristic value.)
625         */
626        public BooleanType getValueBooleanType() throws FHIRException { 
627          if (this.value == null)
628            this.value = new BooleanType();
629          if (!(this.value instanceof BooleanType))
630            throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered");
631          return (BooleanType) this.value;
632        }
633
634        public boolean hasValueBooleanType() { 
635          return this != null && this.value instanceof BooleanType;
636        }
637
638        /**
639         * @return {@link #value} (Characteristic value.)
640         */
641        public Quantity getValueQuantity() throws FHIRException { 
642          if (this.value == null)
643            this.value = new Quantity();
644          if (!(this.value instanceof Quantity))
645            throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered");
646          return (Quantity) this.value;
647        }
648
649        public boolean hasValueQuantity() { 
650          return this != null && this.value instanceof Quantity;
651        }
652
653        /**
654         * @return {@link #value} (Characteristic value.)
655         */
656        public Range getValueRange() throws FHIRException { 
657          if (this.value == null)
658            this.value = new Range();
659          if (!(this.value instanceof Range))
660            throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered");
661          return (Range) this.value;
662        }
663
664        public boolean hasValueRange() { 
665          return this != null && this.value instanceof Range;
666        }
667
668        public boolean hasValue() { 
669          return this.value != null && !this.value.isEmpty();
670        }
671
672        /**
673         * @param value {@link #value} (Characteristic value.)
674         */
675        public EvidenceReportSubjectCharacteristicComponent setValue(DataType value) { 
676          if (value != null && !(value instanceof Reference || value instanceof CodeableConcept || value instanceof BooleanType || value instanceof Quantity || value instanceof Range))
677            throw new Error("Not the right type for EvidenceReport.subject.characteristic.value[x]: "+value.fhirType());
678          this.value = value;
679          return this;
680        }
681
682        /**
683         * @return {@link #exclude} (Is used to express not the characteristic.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value
684         */
685        public BooleanType getExcludeElement() { 
686          if (this.exclude == null)
687            if (Configuration.errorOnAutoCreate())
688              throw new Error("Attempt to auto-create EvidenceReportSubjectCharacteristicComponent.exclude");
689            else if (Configuration.doAutoCreate())
690              this.exclude = new BooleanType(); // bb
691          return this.exclude;
692        }
693
694        public boolean hasExcludeElement() { 
695          return this.exclude != null && !this.exclude.isEmpty();
696        }
697
698        public boolean hasExclude() { 
699          return this.exclude != null && !this.exclude.isEmpty();
700        }
701
702        /**
703         * @param value {@link #exclude} (Is used to express not the characteristic.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value
704         */
705        public EvidenceReportSubjectCharacteristicComponent setExcludeElement(BooleanType value) { 
706          this.exclude = value;
707          return this;
708        }
709
710        /**
711         * @return Is used to express not the characteristic.
712         */
713        public boolean getExclude() { 
714          return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue();
715        }
716
717        /**
718         * @param value Is used to express not the characteristic.
719         */
720        public EvidenceReportSubjectCharacteristicComponent setExclude(boolean value) { 
721            if (this.exclude == null)
722              this.exclude = new BooleanType();
723            this.exclude.setValue(value);
724          return this;
725        }
726
727        /**
728         * @return {@link #period} (Timeframe for the characteristic.)
729         */
730        public Period getPeriod() { 
731          if (this.period == null)
732            if (Configuration.errorOnAutoCreate())
733              throw new Error("Attempt to auto-create EvidenceReportSubjectCharacteristicComponent.period");
734            else if (Configuration.doAutoCreate())
735              this.period = new Period(); // cc
736          return this.period;
737        }
738
739        public boolean hasPeriod() { 
740          return this.period != null && !this.period.isEmpty();
741        }
742
743        /**
744         * @param value {@link #period} (Timeframe for the characteristic.)
745         */
746        public EvidenceReportSubjectCharacteristicComponent setPeriod(Period value) { 
747          this.period = value;
748          return this;
749        }
750
751        protected void listChildren(List<Property> children) {
752          super.listChildren(children);
753          children.add(new Property("code", "CodeableConcept", "Characteristic code.", 0, 1, code));
754          children.add(new Property("value[x]", "Reference(Any)|CodeableConcept|boolean|Quantity|Range", "Characteristic value.", 0, 1, value));
755          children.add(new Property("exclude", "boolean", "Is used to express not the characteristic.", 0, 1, exclude));
756          children.add(new Property("period", "Period", "Timeframe for the characteristic.", 0, 1, period));
757        }
758
759        @Override
760        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
761          switch (_hash) {
762          case 3059181: /*code*/  return new Property("code", "CodeableConcept", "Characteristic code.", 0, 1, code);
763          case -1410166417: /*value[x]*/  return new Property("value[x]", "Reference(Any)|CodeableConcept|boolean|Quantity|Range", "Characteristic value.", 0, 1, value);
764          case 111972721: /*value*/  return new Property("value[x]", "Reference(Any)|CodeableConcept|boolean|Quantity|Range", "Characteristic value.", 0, 1, value);
765          case 1755241690: /*valueReference*/  return new Property("value[x]", "Reference(Any)", "Characteristic value.", 0, 1, value);
766          case 924902896: /*valueCodeableConcept*/  return new Property("value[x]", "CodeableConcept", "Characteristic value.", 0, 1, value);
767          case 733421943: /*valueBoolean*/  return new Property("value[x]", "boolean", "Characteristic value.", 0, 1, value);
768          case -2029823716: /*valueQuantity*/  return new Property("value[x]", "Quantity", "Characteristic value.", 0, 1, value);
769          case 2030761548: /*valueRange*/  return new Property("value[x]", "Range", "Characteristic value.", 0, 1, value);
770          case -1321148966: /*exclude*/  return new Property("exclude", "boolean", "Is used to express not the characteristic.", 0, 1, exclude);
771          case -991726143: /*period*/  return new Property("period", "Period", "Timeframe for the characteristic.", 0, 1, period);
772          default: return super.getNamedProperty(_hash, _name, _checkValid);
773          }
774
775        }
776
777      @Override
778      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
779        switch (hash) {
780        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
781        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DataType
782        case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // BooleanType
783        case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
784        default: return super.getProperty(hash, name, checkValid);
785        }
786
787      }
788
789      @Override
790      public Base setProperty(int hash, String name, Base value) throws FHIRException {
791        switch (hash) {
792        case 3059181: // code
793          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
794          return value;
795        case 111972721: // value
796          this.value = TypeConvertor.castToType(value); // DataType
797          return value;
798        case -1321148966: // exclude
799          this.exclude = TypeConvertor.castToBoolean(value); // BooleanType
800          return value;
801        case -991726143: // period
802          this.period = TypeConvertor.castToPeriod(value); // Period
803          return value;
804        default: return super.setProperty(hash, name, value);
805        }
806
807      }
808
809      @Override
810      public Base setProperty(String name, Base value) throws FHIRException {
811        if (name.equals("code")) {
812          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
813        } else if (name.equals("value[x]")) {
814          this.value = TypeConvertor.castToType(value); // DataType
815        } else if (name.equals("exclude")) {
816          this.exclude = TypeConvertor.castToBoolean(value); // BooleanType
817        } else if (name.equals("period")) {
818          this.period = TypeConvertor.castToPeriod(value); // Period
819        } else
820          return super.setProperty(name, value);
821        return value;
822      }
823
824      @Override
825      public Base makeProperty(int hash, String name) throws FHIRException {
826        switch (hash) {
827        case 3059181:  return getCode();
828        case -1410166417:  return getValue();
829        case 111972721:  return getValue();
830        case -1321148966:  return getExcludeElement();
831        case -991726143:  return getPeriod();
832        default: return super.makeProperty(hash, name);
833        }
834
835      }
836
837      @Override
838      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
839        switch (hash) {
840        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
841        case 111972721: /*value*/ return new String[] {"Reference", "CodeableConcept", "boolean", "Quantity", "Range"};
842        case -1321148966: /*exclude*/ return new String[] {"boolean"};
843        case -991726143: /*period*/ return new String[] {"Period"};
844        default: return super.getTypesForProperty(hash, name);
845        }
846
847      }
848
849      @Override
850      public Base addChild(String name) throws FHIRException {
851        if (name.equals("code")) {
852          this.code = new CodeableConcept();
853          return this.code;
854        }
855        else if (name.equals("valueReference")) {
856          this.value = new Reference();
857          return this.value;
858        }
859        else if (name.equals("valueCodeableConcept")) {
860          this.value = new CodeableConcept();
861          return this.value;
862        }
863        else if (name.equals("valueBoolean")) {
864          this.value = new BooleanType();
865          return this.value;
866        }
867        else if (name.equals("valueQuantity")) {
868          this.value = new Quantity();
869          return this.value;
870        }
871        else if (name.equals("valueRange")) {
872          this.value = new Range();
873          return this.value;
874        }
875        else if (name.equals("exclude")) {
876          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.subject.characteristic.exclude");
877        }
878        else if (name.equals("period")) {
879          this.period = new Period();
880          return this.period;
881        }
882        else
883          return super.addChild(name);
884      }
885
886      public EvidenceReportSubjectCharacteristicComponent copy() {
887        EvidenceReportSubjectCharacteristicComponent dst = new EvidenceReportSubjectCharacteristicComponent();
888        copyValues(dst);
889        return dst;
890      }
891
892      public void copyValues(EvidenceReportSubjectCharacteristicComponent dst) {
893        super.copyValues(dst);
894        dst.code = code == null ? null : code.copy();
895        dst.value = value == null ? null : value.copy();
896        dst.exclude = exclude == null ? null : exclude.copy();
897        dst.period = period == null ? null : period.copy();
898      }
899
900      @Override
901      public boolean equalsDeep(Base other_) {
902        if (!super.equalsDeep(other_))
903          return false;
904        if (!(other_ instanceof EvidenceReportSubjectCharacteristicComponent))
905          return false;
906        EvidenceReportSubjectCharacteristicComponent o = (EvidenceReportSubjectCharacteristicComponent) other_;
907        return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true)
908           && compareDeep(period, o.period, true);
909      }
910
911      @Override
912      public boolean equalsShallow(Base other_) {
913        if (!super.equalsShallow(other_))
914          return false;
915        if (!(other_ instanceof EvidenceReportSubjectCharacteristicComponent))
916          return false;
917        EvidenceReportSubjectCharacteristicComponent o = (EvidenceReportSubjectCharacteristicComponent) other_;
918        return compareValues(exclude, o.exclude, true);
919      }
920
921      public boolean isEmpty() {
922        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, value, exclude, period
923          );
924      }
925
926  public String fhirType() {
927    return "EvidenceReport.subject.characteristic";
928
929  }
930
931  }
932
933    @Block()
934    public static class EvidenceReportRelatesToComponent extends BackboneElement implements IBaseBackboneElement {
935        /**
936         * The type of relationship that this composition has with anther composition or document.
937         */
938        @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
939        @Description(shortDefinition="replaces | amends | appends | transforms | replacedWith | amendedWith | appendedWith | transformedWith", formalDefinition="The type of relationship that this composition has with anther composition or document." )
940        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-relation-type")
941        protected Enumeration<ReportRelationshipType> code;
942
943        /**
944         * The target composition/document of this relationship.
945         */
946        @Child(name = "target", type = {}, order=2, min=1, max=1, modifier=false, summary=false)
947        @Description(shortDefinition="Target of the relationship", formalDefinition="The target composition/document of this relationship." )
948        protected EvidenceReportRelatesToTargetComponent target;
949
950        private static final long serialVersionUID = -1716908969L;
951
952    /**
953     * Constructor
954     */
955      public EvidenceReportRelatesToComponent() {
956        super();
957      }
958
959    /**
960     * Constructor
961     */
962      public EvidenceReportRelatesToComponent(ReportRelationshipType code, EvidenceReportRelatesToTargetComponent target) {
963        super();
964        this.setCode(code);
965        this.setTarget(target);
966      }
967
968        /**
969         * @return {@link #code} (The type of relationship that this composition has with anther composition or document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
970         */
971        public Enumeration<ReportRelationshipType> getCodeElement() { 
972          if (this.code == null)
973            if (Configuration.errorOnAutoCreate())
974              throw new Error("Attempt to auto-create EvidenceReportRelatesToComponent.code");
975            else if (Configuration.doAutoCreate())
976              this.code = new Enumeration<ReportRelationshipType>(new ReportRelationshipTypeEnumFactory()); // bb
977          return this.code;
978        }
979
980        public boolean hasCodeElement() { 
981          return this.code != null && !this.code.isEmpty();
982        }
983
984        public boolean hasCode() { 
985          return this.code != null && !this.code.isEmpty();
986        }
987
988        /**
989         * @param value {@link #code} (The type of relationship that this composition has with anther composition or document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
990         */
991        public EvidenceReportRelatesToComponent setCodeElement(Enumeration<ReportRelationshipType> value) { 
992          this.code = value;
993          return this;
994        }
995
996        /**
997         * @return The type of relationship that this composition has with anther composition or document.
998         */
999        public ReportRelationshipType getCode() { 
1000          return this.code == null ? null : this.code.getValue();
1001        }
1002
1003        /**
1004         * @param value The type of relationship that this composition has with anther composition or document.
1005         */
1006        public EvidenceReportRelatesToComponent setCode(ReportRelationshipType value) { 
1007            if (this.code == null)
1008              this.code = new Enumeration<ReportRelationshipType>(new ReportRelationshipTypeEnumFactory());
1009            this.code.setValue(value);
1010          return this;
1011        }
1012
1013        /**
1014         * @return {@link #target} (The target composition/document of this relationship.)
1015         */
1016        public EvidenceReportRelatesToTargetComponent getTarget() { 
1017          if (this.target == null)
1018            if (Configuration.errorOnAutoCreate())
1019              throw new Error("Attempt to auto-create EvidenceReportRelatesToComponent.target");
1020            else if (Configuration.doAutoCreate())
1021              this.target = new EvidenceReportRelatesToTargetComponent(); // cc
1022          return this.target;
1023        }
1024
1025        public boolean hasTarget() { 
1026          return this.target != null && !this.target.isEmpty();
1027        }
1028
1029        /**
1030         * @param value {@link #target} (The target composition/document of this relationship.)
1031         */
1032        public EvidenceReportRelatesToComponent setTarget(EvidenceReportRelatesToTargetComponent value) { 
1033          this.target = value;
1034          return this;
1035        }
1036
1037        protected void listChildren(List<Property> children) {
1038          super.listChildren(children);
1039          children.add(new Property("code", "code", "The type of relationship that this composition has with anther composition or document.", 0, 1, code));
1040          children.add(new Property("target", "", "The target composition/document of this relationship.", 0, 1, target));
1041        }
1042
1043        @Override
1044        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1045          switch (_hash) {
1046          case 3059181: /*code*/  return new Property("code", "code", "The type of relationship that this composition has with anther composition or document.", 0, 1, code);
1047          case -880905839: /*target*/  return new Property("target", "", "The target composition/document of this relationship.", 0, 1, target);
1048          default: return super.getNamedProperty(_hash, _name, _checkValid);
1049          }
1050
1051        }
1052
1053      @Override
1054      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1055        switch (hash) {
1056        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<ReportRelationshipType>
1057        case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // EvidenceReportRelatesToTargetComponent
1058        default: return super.getProperty(hash, name, checkValid);
1059        }
1060
1061      }
1062
1063      @Override
1064      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1065        switch (hash) {
1066        case 3059181: // code
1067          value = new ReportRelationshipTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1068          this.code = (Enumeration) value; // Enumeration<ReportRelationshipType>
1069          return value;
1070        case -880905839: // target
1071          this.target = (EvidenceReportRelatesToTargetComponent) value; // EvidenceReportRelatesToTargetComponent
1072          return value;
1073        default: return super.setProperty(hash, name, value);
1074        }
1075
1076      }
1077
1078      @Override
1079      public Base setProperty(String name, Base value) throws FHIRException {
1080        if (name.equals("code")) {
1081          value = new ReportRelationshipTypeEnumFactory().fromType(TypeConvertor.castToCode(value));
1082          this.code = (Enumeration) value; // Enumeration<ReportRelationshipType>
1083        } else if (name.equals("target")) {
1084          this.target = (EvidenceReportRelatesToTargetComponent) value; // EvidenceReportRelatesToTargetComponent
1085        } else
1086          return super.setProperty(name, value);
1087        return value;
1088      }
1089
1090      @Override
1091      public Base makeProperty(int hash, String name) throws FHIRException {
1092        switch (hash) {
1093        case 3059181:  return getCodeElement();
1094        case -880905839:  return getTarget();
1095        default: return super.makeProperty(hash, name);
1096        }
1097
1098      }
1099
1100      @Override
1101      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1102        switch (hash) {
1103        case 3059181: /*code*/ return new String[] {"code"};
1104        case -880905839: /*target*/ return new String[] {};
1105        default: return super.getTypesForProperty(hash, name);
1106        }
1107
1108      }
1109
1110      @Override
1111      public Base addChild(String name) throws FHIRException {
1112        if (name.equals("code")) {
1113          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.relatesTo.code");
1114        }
1115        else if (name.equals("target")) {
1116          this.target = new EvidenceReportRelatesToTargetComponent();
1117          return this.target;
1118        }
1119        else
1120          return super.addChild(name);
1121      }
1122
1123      public EvidenceReportRelatesToComponent copy() {
1124        EvidenceReportRelatesToComponent dst = new EvidenceReportRelatesToComponent();
1125        copyValues(dst);
1126        return dst;
1127      }
1128
1129      public void copyValues(EvidenceReportRelatesToComponent dst) {
1130        super.copyValues(dst);
1131        dst.code = code == null ? null : code.copy();
1132        dst.target = target == null ? null : target.copy();
1133      }
1134
1135      @Override
1136      public boolean equalsDeep(Base other_) {
1137        if (!super.equalsDeep(other_))
1138          return false;
1139        if (!(other_ instanceof EvidenceReportRelatesToComponent))
1140          return false;
1141        EvidenceReportRelatesToComponent o = (EvidenceReportRelatesToComponent) other_;
1142        return compareDeep(code, o.code, true) && compareDeep(target, o.target, true);
1143      }
1144
1145      @Override
1146      public boolean equalsShallow(Base other_) {
1147        if (!super.equalsShallow(other_))
1148          return false;
1149        if (!(other_ instanceof EvidenceReportRelatesToComponent))
1150          return false;
1151        EvidenceReportRelatesToComponent o = (EvidenceReportRelatesToComponent) other_;
1152        return compareValues(code, o.code, true);
1153      }
1154
1155      public boolean isEmpty() {
1156        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(code, target);
1157      }
1158
1159  public String fhirType() {
1160    return "EvidenceReport.relatesTo";
1161
1162  }
1163
1164  }
1165
1166    @Block()
1167    public static class EvidenceReportRelatesToTargetComponent extends BackboneElement implements IBaseBackboneElement {
1168        /**
1169         * Target of the relationship URL.
1170         */
1171        @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1172        @Description(shortDefinition="Target of the relationship URL", formalDefinition="Target of the relationship URL." )
1173        protected UriType url;
1174
1175        /**
1176         * Target of the relationship Identifier.
1177         */
1178        @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false)
1179        @Description(shortDefinition="Target of the relationship Identifier", formalDefinition="Target of the relationship Identifier." )
1180        protected Identifier identifier;
1181
1182        /**
1183         * Target of the relationship Display.
1184         */
1185        @Child(name = "display", type = {MarkdownType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1186        @Description(shortDefinition="Target of the relationship Display", formalDefinition="Target of the relationship Display." )
1187        protected MarkdownType display;
1188
1189        /**
1190         * Target of the relationship Resource reference.
1191         */
1192        @Child(name = "resource", type = {Reference.class}, order=4, min=0, max=1, modifier=false, summary=false)
1193        @Description(shortDefinition="Target of the relationship Resource reference", formalDefinition="Target of the relationship Resource reference." )
1194        protected Reference resource;
1195
1196        private static final long serialVersionUID = -804526425L;
1197
1198    /**
1199     * Constructor
1200     */
1201      public EvidenceReportRelatesToTargetComponent() {
1202        super();
1203      }
1204
1205        /**
1206         * @return {@link #url} (Target of the relationship URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1207         */
1208        public UriType getUrlElement() { 
1209          if (this.url == null)
1210            if (Configuration.errorOnAutoCreate())
1211              throw new Error("Attempt to auto-create EvidenceReportRelatesToTargetComponent.url");
1212            else if (Configuration.doAutoCreate())
1213              this.url = new UriType(); // bb
1214          return this.url;
1215        }
1216
1217        public boolean hasUrlElement() { 
1218          return this.url != null && !this.url.isEmpty();
1219        }
1220
1221        public boolean hasUrl() { 
1222          return this.url != null && !this.url.isEmpty();
1223        }
1224
1225        /**
1226         * @param value {@link #url} (Target of the relationship URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1227         */
1228        public EvidenceReportRelatesToTargetComponent setUrlElement(UriType value) { 
1229          this.url = value;
1230          return this;
1231        }
1232
1233        /**
1234         * @return Target of the relationship URL.
1235         */
1236        public String getUrl() { 
1237          return this.url == null ? null : this.url.getValue();
1238        }
1239
1240        /**
1241         * @param value Target of the relationship URL.
1242         */
1243        public EvidenceReportRelatesToTargetComponent setUrl(String value) { 
1244          if (Utilities.noString(value))
1245            this.url = null;
1246          else {
1247            if (this.url == null)
1248              this.url = new UriType();
1249            this.url.setValue(value);
1250          }
1251          return this;
1252        }
1253
1254        /**
1255         * @return {@link #identifier} (Target of the relationship Identifier.)
1256         */
1257        public Identifier getIdentifier() { 
1258          if (this.identifier == null)
1259            if (Configuration.errorOnAutoCreate())
1260              throw new Error("Attempt to auto-create EvidenceReportRelatesToTargetComponent.identifier");
1261            else if (Configuration.doAutoCreate())
1262              this.identifier = new Identifier(); // cc
1263          return this.identifier;
1264        }
1265
1266        public boolean hasIdentifier() { 
1267          return this.identifier != null && !this.identifier.isEmpty();
1268        }
1269
1270        /**
1271         * @param value {@link #identifier} (Target of the relationship Identifier.)
1272         */
1273        public EvidenceReportRelatesToTargetComponent setIdentifier(Identifier value) { 
1274          this.identifier = value;
1275          return this;
1276        }
1277
1278        /**
1279         * @return {@link #display} (Target of the relationship Display.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
1280         */
1281        public MarkdownType getDisplayElement() { 
1282          if (this.display == null)
1283            if (Configuration.errorOnAutoCreate())
1284              throw new Error("Attempt to auto-create EvidenceReportRelatesToTargetComponent.display");
1285            else if (Configuration.doAutoCreate())
1286              this.display = new MarkdownType(); // bb
1287          return this.display;
1288        }
1289
1290        public boolean hasDisplayElement() { 
1291          return this.display != null && !this.display.isEmpty();
1292        }
1293
1294        public boolean hasDisplay() { 
1295          return this.display != null && !this.display.isEmpty();
1296        }
1297
1298        /**
1299         * @param value {@link #display} (Target of the relationship Display.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
1300         */
1301        public EvidenceReportRelatesToTargetComponent setDisplayElement(MarkdownType value) { 
1302          this.display = value;
1303          return this;
1304        }
1305
1306        /**
1307         * @return Target of the relationship Display.
1308         */
1309        public String getDisplay() { 
1310          return this.display == null ? null : this.display.getValue();
1311        }
1312
1313        /**
1314         * @param value Target of the relationship Display.
1315         */
1316        public EvidenceReportRelatesToTargetComponent setDisplay(String value) { 
1317          if (value == null)
1318            this.display = null;
1319          else {
1320            if (this.display == null)
1321              this.display = new MarkdownType();
1322            this.display.setValue(value);
1323          }
1324          return this;
1325        }
1326
1327        /**
1328         * @return {@link #resource} (Target of the relationship Resource reference.)
1329         */
1330        public Reference getResource() { 
1331          if (this.resource == null)
1332            if (Configuration.errorOnAutoCreate())
1333              throw new Error("Attempt to auto-create EvidenceReportRelatesToTargetComponent.resource");
1334            else if (Configuration.doAutoCreate())
1335              this.resource = new Reference(); // cc
1336          return this.resource;
1337        }
1338
1339        public boolean hasResource() { 
1340          return this.resource != null && !this.resource.isEmpty();
1341        }
1342
1343        /**
1344         * @param value {@link #resource} (Target of the relationship Resource reference.)
1345         */
1346        public EvidenceReportRelatesToTargetComponent setResource(Reference value) { 
1347          this.resource = value;
1348          return this;
1349        }
1350
1351        protected void listChildren(List<Property> children) {
1352          super.listChildren(children);
1353          children.add(new Property("url", "uri", "Target of the relationship URL.", 0, 1, url));
1354          children.add(new Property("identifier", "Identifier", "Target of the relationship Identifier.", 0, 1, identifier));
1355          children.add(new Property("display", "markdown", "Target of the relationship Display.", 0, 1, display));
1356          children.add(new Property("resource", "Reference(Any)", "Target of the relationship Resource reference.", 0, 1, resource));
1357        }
1358
1359        @Override
1360        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1361          switch (_hash) {
1362          case 116079: /*url*/  return new Property("url", "uri", "Target of the relationship URL.", 0, 1, url);
1363          case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Target of the relationship Identifier.", 0, 1, identifier);
1364          case 1671764162: /*display*/  return new Property("display", "markdown", "Target of the relationship Display.", 0, 1, display);
1365          case -341064690: /*resource*/  return new Property("resource", "Reference(Any)", "Target of the relationship Resource reference.", 0, 1, resource);
1366          default: return super.getNamedProperty(_hash, _name, _checkValid);
1367          }
1368
1369        }
1370
1371      @Override
1372      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1373        switch (hash) {
1374        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1375        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
1376        case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // MarkdownType
1377        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
1378        default: return super.getProperty(hash, name, checkValid);
1379        }
1380
1381      }
1382
1383      @Override
1384      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1385        switch (hash) {
1386        case 116079: // url
1387          this.url = TypeConvertor.castToUri(value); // UriType
1388          return value;
1389        case -1618432855: // identifier
1390          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1391          return value;
1392        case 1671764162: // display
1393          this.display = TypeConvertor.castToMarkdown(value); // MarkdownType
1394          return value;
1395        case -341064690: // resource
1396          this.resource = TypeConvertor.castToReference(value); // Reference
1397          return value;
1398        default: return super.setProperty(hash, name, value);
1399        }
1400
1401      }
1402
1403      @Override
1404      public Base setProperty(String name, Base value) throws FHIRException {
1405        if (name.equals("url")) {
1406          this.url = TypeConvertor.castToUri(value); // UriType
1407        } else if (name.equals("identifier")) {
1408          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
1409        } else if (name.equals("display")) {
1410          this.display = TypeConvertor.castToMarkdown(value); // MarkdownType
1411        } else if (name.equals("resource")) {
1412          this.resource = TypeConvertor.castToReference(value); // Reference
1413        } else
1414          return super.setProperty(name, value);
1415        return value;
1416      }
1417
1418      @Override
1419      public Base makeProperty(int hash, String name) throws FHIRException {
1420        switch (hash) {
1421        case 116079:  return getUrlElement();
1422        case -1618432855:  return getIdentifier();
1423        case 1671764162:  return getDisplayElement();
1424        case -341064690:  return getResource();
1425        default: return super.makeProperty(hash, name);
1426        }
1427
1428      }
1429
1430      @Override
1431      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1432        switch (hash) {
1433        case 116079: /*url*/ return new String[] {"uri"};
1434        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1435        case 1671764162: /*display*/ return new String[] {"markdown"};
1436        case -341064690: /*resource*/ return new String[] {"Reference"};
1437        default: return super.getTypesForProperty(hash, name);
1438        }
1439
1440      }
1441
1442      @Override
1443      public Base addChild(String name) throws FHIRException {
1444        if (name.equals("url")) {
1445          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.relatesTo.target.url");
1446        }
1447        else if (name.equals("identifier")) {
1448          this.identifier = new Identifier();
1449          return this.identifier;
1450        }
1451        else if (name.equals("display")) {
1452          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.relatesTo.target.display");
1453        }
1454        else if (name.equals("resource")) {
1455          this.resource = new Reference();
1456          return this.resource;
1457        }
1458        else
1459          return super.addChild(name);
1460      }
1461
1462      public EvidenceReportRelatesToTargetComponent copy() {
1463        EvidenceReportRelatesToTargetComponent dst = new EvidenceReportRelatesToTargetComponent();
1464        copyValues(dst);
1465        return dst;
1466      }
1467
1468      public void copyValues(EvidenceReportRelatesToTargetComponent dst) {
1469        super.copyValues(dst);
1470        dst.url = url == null ? null : url.copy();
1471        dst.identifier = identifier == null ? null : identifier.copy();
1472        dst.display = display == null ? null : display.copy();
1473        dst.resource = resource == null ? null : resource.copy();
1474      }
1475
1476      @Override
1477      public boolean equalsDeep(Base other_) {
1478        if (!super.equalsDeep(other_))
1479          return false;
1480        if (!(other_ instanceof EvidenceReportRelatesToTargetComponent))
1481          return false;
1482        EvidenceReportRelatesToTargetComponent o = (EvidenceReportRelatesToTargetComponent) other_;
1483        return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(display, o.display, true)
1484           && compareDeep(resource, o.resource, true);
1485      }
1486
1487      @Override
1488      public boolean equalsShallow(Base other_) {
1489        if (!super.equalsShallow(other_))
1490          return false;
1491        if (!(other_ instanceof EvidenceReportRelatesToTargetComponent))
1492          return false;
1493        EvidenceReportRelatesToTargetComponent o = (EvidenceReportRelatesToTargetComponent) other_;
1494        return compareValues(url, o.url, true) && compareValues(display, o.display, true);
1495      }
1496
1497      public boolean isEmpty() {
1498        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, identifier, display
1499          , resource);
1500      }
1501
1502  public String fhirType() {
1503    return "EvidenceReport.relatesTo.target";
1504
1505  }
1506
1507  }
1508
1509    @Block()
1510    public static class SectionComponent extends BackboneElement implements IBaseBackboneElement {
1511        /**
1512         * The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.
1513         */
1514        @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1515        @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents." )
1516        protected StringType title;
1517
1518        /**
1519         * A code identifying the kind of content contained within the section. This should be consistent with the section title.
1520         */
1521        @Child(name = "focus", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
1522        @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This should be consistent with the section title." )
1523        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/evidence-report-section")
1524        protected CodeableConcept focus;
1525
1526        /**
1527         * A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title.
1528         */
1529        @Child(name = "focusReference", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false)
1530        @Description(shortDefinition="Classification of section by Resource", formalDefinition="A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title." )
1531        protected Reference focusReference;
1532
1533        /**
1534         * Identifies who is responsible for the information in this section, not necessarily who typed it in.
1535         */
1536        @Child(name = "author", type = {Person.class, Device.class, Group.class, Organization.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1537        @Description(shortDefinition="Who and/or what authored the section", formalDefinition="Identifies who is responsible for the information in this section, not necessarily who typed it in." )
1538        protected List<Reference> author;
1539
1540        /**
1541         * A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative.
1542         */
1543        @Child(name = "text", type = {Narrative.class}, order=5, min=0, max=1, modifier=false, summary=false)
1544        @Description(shortDefinition="Text summary of the section, for human interpretation", formalDefinition="A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative." )
1545        protected Narrative text;
1546
1547        /**
1548         * How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
1549         */
1550        @Child(name = "mode", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
1551        @Description(shortDefinition="working | snapshot | changes", formalDefinition="How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted." )
1552        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-mode")
1553        protected Enumeration<ListMode> mode;
1554
1555        /**
1556         * Specifies the order applied to the items in the section entries.
1557         */
1558        @Child(name = "orderedBy", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false)
1559        @Description(shortDefinition="Order of section entries", formalDefinition="Specifies the order applied to the items in the section entries." )
1560        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-order")
1561        protected CodeableConcept orderedBy;
1562
1563        /**
1564         * Specifies any type of classification of the evidence report.
1565         */
1566        @Child(name = "entryClassifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1567        @Description(shortDefinition="Extensible classifiers as content", formalDefinition="Specifies any type of classification of the evidence report." )
1568        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/evidence-classifier-code")
1569        protected List<CodeableConcept> entryClassifier;
1570
1571        /**
1572         * A reference to the actual resource from which the narrative in the section is derived.
1573         */
1574        @Child(name = "entryReference", type = {Reference.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1575        @Description(shortDefinition="Reference to resources as content", formalDefinition="A reference to the actual resource from which the narrative in the section is derived." )
1576        protected List<Reference> entryReference;
1577
1578        /**
1579         * Quantity as content.
1580         */
1581        @Child(name = "entryQuantity", type = {Quantity.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1582        @Description(shortDefinition="Quantity as content", formalDefinition="Quantity as content." )
1583        protected List<Quantity> entryQuantity;
1584
1585        /**
1586         * If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.
1587         */
1588        @Child(name = "emptyReason", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false)
1589        @Description(shortDefinition="Why the section is empty", formalDefinition="If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason." )
1590        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/list-empty-reason")
1591        protected CodeableConcept emptyReason;
1592
1593        /**
1594         * A nested sub-section within this section.
1595         */
1596        @Child(name = "section", type = {SectionComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1597        @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." )
1598        protected List<SectionComponent> section;
1599
1600        private static final long serialVersionUID = -324854168L;
1601
1602    /**
1603     * Constructor
1604     */
1605      public SectionComponent() {
1606        super();
1607      }
1608
1609        /**
1610         * @return {@link #title} (The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1611         */
1612        public StringType getTitleElement() { 
1613          if (this.title == null)
1614            if (Configuration.errorOnAutoCreate())
1615              throw new Error("Attempt to auto-create SectionComponent.title");
1616            else if (Configuration.doAutoCreate())
1617              this.title = new StringType(); // bb
1618          return this.title;
1619        }
1620
1621        public boolean hasTitleElement() { 
1622          return this.title != null && !this.title.isEmpty();
1623        }
1624
1625        public boolean hasTitle() { 
1626          return this.title != null && !this.title.isEmpty();
1627        }
1628
1629        /**
1630         * @param value {@link #title} (The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
1631         */
1632        public SectionComponent setTitleElement(StringType value) { 
1633          this.title = value;
1634          return this;
1635        }
1636
1637        /**
1638         * @return The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.
1639         */
1640        public String getTitle() { 
1641          return this.title == null ? null : this.title.getValue();
1642        }
1643
1644        /**
1645         * @param value The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.
1646         */
1647        public SectionComponent setTitle(String value) { 
1648          if (Utilities.noString(value))
1649            this.title = null;
1650          else {
1651            if (this.title == null)
1652              this.title = new StringType();
1653            this.title.setValue(value);
1654          }
1655          return this;
1656        }
1657
1658        /**
1659         * @return {@link #focus} (A code identifying the kind of content contained within the section. This should be consistent with the section title.)
1660         */
1661        public CodeableConcept getFocus() { 
1662          if (this.focus == null)
1663            if (Configuration.errorOnAutoCreate())
1664              throw new Error("Attempt to auto-create SectionComponent.focus");
1665            else if (Configuration.doAutoCreate())
1666              this.focus = new CodeableConcept(); // cc
1667          return this.focus;
1668        }
1669
1670        public boolean hasFocus() { 
1671          return this.focus != null && !this.focus.isEmpty();
1672        }
1673
1674        /**
1675         * @param value {@link #focus} (A code identifying the kind of content contained within the section. This should be consistent with the section title.)
1676         */
1677        public SectionComponent setFocus(CodeableConcept value) { 
1678          this.focus = value;
1679          return this;
1680        }
1681
1682        /**
1683         * @return {@link #focusReference} (A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title.)
1684         */
1685        public Reference getFocusReference() { 
1686          if (this.focusReference == null)
1687            if (Configuration.errorOnAutoCreate())
1688              throw new Error("Attempt to auto-create SectionComponent.focusReference");
1689            else if (Configuration.doAutoCreate())
1690              this.focusReference = new Reference(); // cc
1691          return this.focusReference;
1692        }
1693
1694        public boolean hasFocusReference() { 
1695          return this.focusReference != null && !this.focusReference.isEmpty();
1696        }
1697
1698        /**
1699         * @param value {@link #focusReference} (A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title.)
1700         */
1701        public SectionComponent setFocusReference(Reference value) { 
1702          this.focusReference = value;
1703          return this;
1704        }
1705
1706        /**
1707         * @return {@link #author} (Identifies who is responsible for the information in this section, not necessarily who typed it in.)
1708         */
1709        public List<Reference> getAuthor() { 
1710          if (this.author == null)
1711            this.author = new ArrayList<Reference>();
1712          return this.author;
1713        }
1714
1715        /**
1716         * @return Returns a reference to <code>this</code> for easy method chaining
1717         */
1718        public SectionComponent setAuthor(List<Reference> theAuthor) { 
1719          this.author = theAuthor;
1720          return this;
1721        }
1722
1723        public boolean hasAuthor() { 
1724          if (this.author == null)
1725            return false;
1726          for (Reference item : this.author)
1727            if (!item.isEmpty())
1728              return true;
1729          return false;
1730        }
1731
1732        public Reference addAuthor() { //3
1733          Reference t = new Reference();
1734          if (this.author == null)
1735            this.author = new ArrayList<Reference>();
1736          this.author.add(t);
1737          return t;
1738        }
1739
1740        public SectionComponent addAuthor(Reference t) { //3
1741          if (t == null)
1742            return this;
1743          if (this.author == null)
1744            this.author = new ArrayList<Reference>();
1745          this.author.add(t);
1746          return this;
1747        }
1748
1749        /**
1750         * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
1751         */
1752        public Reference getAuthorFirstRep() { 
1753          if (getAuthor().isEmpty()) {
1754            addAuthor();
1755          }
1756          return getAuthor().get(0);
1757        }
1758
1759        /**
1760         * @return {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative.)
1761         */
1762        public Narrative getText() { 
1763          if (this.text == null)
1764            if (Configuration.errorOnAutoCreate())
1765              throw new Error("Attempt to auto-create SectionComponent.text");
1766            else if (Configuration.doAutoCreate())
1767              this.text = new Narrative(); // cc
1768          return this.text;
1769        }
1770
1771        public boolean hasText() { 
1772          return this.text != null && !this.text.isEmpty();
1773        }
1774
1775        /**
1776         * @param value {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative.)
1777         */
1778        public SectionComponent setText(Narrative value) { 
1779          this.text = value;
1780          return this;
1781        }
1782
1783        /**
1784         * @return {@link #mode} (How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1785         */
1786        public Enumeration<ListMode> getModeElement() { 
1787          if (this.mode == null)
1788            if (Configuration.errorOnAutoCreate())
1789              throw new Error("Attempt to auto-create SectionComponent.mode");
1790            else if (Configuration.doAutoCreate())
1791              this.mode = new Enumeration<ListMode>(new ListModeEnumFactory()); // bb
1792          return this.mode;
1793        }
1794
1795        public boolean hasModeElement() { 
1796          return this.mode != null && !this.mode.isEmpty();
1797        }
1798
1799        public boolean hasMode() { 
1800          return this.mode != null && !this.mode.isEmpty();
1801        }
1802
1803        /**
1804         * @param value {@link #mode} (How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value
1805         */
1806        public SectionComponent setModeElement(Enumeration<ListMode> value) { 
1807          this.mode = value;
1808          return this;
1809        }
1810
1811        /**
1812         * @return How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
1813         */
1814        public ListMode getMode() { 
1815          return this.mode == null ? null : this.mode.getValue();
1816        }
1817
1818        /**
1819         * @param value How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.
1820         */
1821        public SectionComponent setMode(ListMode value) { 
1822          if (value == null)
1823            this.mode = null;
1824          else {
1825            if (this.mode == null)
1826              this.mode = new Enumeration<ListMode>(new ListModeEnumFactory());
1827            this.mode.setValue(value);
1828          }
1829          return this;
1830        }
1831
1832        /**
1833         * @return {@link #orderedBy} (Specifies the order applied to the items in the section entries.)
1834         */
1835        public CodeableConcept getOrderedBy() { 
1836          if (this.orderedBy == null)
1837            if (Configuration.errorOnAutoCreate())
1838              throw new Error("Attempt to auto-create SectionComponent.orderedBy");
1839            else if (Configuration.doAutoCreate())
1840              this.orderedBy = new CodeableConcept(); // cc
1841          return this.orderedBy;
1842        }
1843
1844        public boolean hasOrderedBy() { 
1845          return this.orderedBy != null && !this.orderedBy.isEmpty();
1846        }
1847
1848        /**
1849         * @param value {@link #orderedBy} (Specifies the order applied to the items in the section entries.)
1850         */
1851        public SectionComponent setOrderedBy(CodeableConcept value) { 
1852          this.orderedBy = value;
1853          return this;
1854        }
1855
1856        /**
1857         * @return {@link #entryClassifier} (Specifies any type of classification of the evidence report.)
1858         */
1859        public List<CodeableConcept> getEntryClassifier() { 
1860          if (this.entryClassifier == null)
1861            this.entryClassifier = new ArrayList<CodeableConcept>();
1862          return this.entryClassifier;
1863        }
1864
1865        /**
1866         * @return Returns a reference to <code>this</code> for easy method chaining
1867         */
1868        public SectionComponent setEntryClassifier(List<CodeableConcept> theEntryClassifier) { 
1869          this.entryClassifier = theEntryClassifier;
1870          return this;
1871        }
1872
1873        public boolean hasEntryClassifier() { 
1874          if (this.entryClassifier == null)
1875            return false;
1876          for (CodeableConcept item : this.entryClassifier)
1877            if (!item.isEmpty())
1878              return true;
1879          return false;
1880        }
1881
1882        public CodeableConcept addEntryClassifier() { //3
1883          CodeableConcept t = new CodeableConcept();
1884          if (this.entryClassifier == null)
1885            this.entryClassifier = new ArrayList<CodeableConcept>();
1886          this.entryClassifier.add(t);
1887          return t;
1888        }
1889
1890        public SectionComponent addEntryClassifier(CodeableConcept t) { //3
1891          if (t == null)
1892            return this;
1893          if (this.entryClassifier == null)
1894            this.entryClassifier = new ArrayList<CodeableConcept>();
1895          this.entryClassifier.add(t);
1896          return this;
1897        }
1898
1899        /**
1900         * @return The first repetition of repeating field {@link #entryClassifier}, creating it if it does not already exist {3}
1901         */
1902        public CodeableConcept getEntryClassifierFirstRep() { 
1903          if (getEntryClassifier().isEmpty()) {
1904            addEntryClassifier();
1905          }
1906          return getEntryClassifier().get(0);
1907        }
1908
1909        /**
1910         * @return {@link #entryReference} (A reference to the actual resource from which the narrative in the section is derived.)
1911         */
1912        public List<Reference> getEntryReference() { 
1913          if (this.entryReference == null)
1914            this.entryReference = new ArrayList<Reference>();
1915          return this.entryReference;
1916        }
1917
1918        /**
1919         * @return Returns a reference to <code>this</code> for easy method chaining
1920         */
1921        public SectionComponent setEntryReference(List<Reference> theEntryReference) { 
1922          this.entryReference = theEntryReference;
1923          return this;
1924        }
1925
1926        public boolean hasEntryReference() { 
1927          if (this.entryReference == null)
1928            return false;
1929          for (Reference item : this.entryReference)
1930            if (!item.isEmpty())
1931              return true;
1932          return false;
1933        }
1934
1935        public Reference addEntryReference() { //3
1936          Reference t = new Reference();
1937          if (this.entryReference == null)
1938            this.entryReference = new ArrayList<Reference>();
1939          this.entryReference.add(t);
1940          return t;
1941        }
1942
1943        public SectionComponent addEntryReference(Reference t) { //3
1944          if (t == null)
1945            return this;
1946          if (this.entryReference == null)
1947            this.entryReference = new ArrayList<Reference>();
1948          this.entryReference.add(t);
1949          return this;
1950        }
1951
1952        /**
1953         * @return The first repetition of repeating field {@link #entryReference}, creating it if it does not already exist {3}
1954         */
1955        public Reference getEntryReferenceFirstRep() { 
1956          if (getEntryReference().isEmpty()) {
1957            addEntryReference();
1958          }
1959          return getEntryReference().get(0);
1960        }
1961
1962        /**
1963         * @return {@link #entryQuantity} (Quantity as content.)
1964         */
1965        public List<Quantity> getEntryQuantity() { 
1966          if (this.entryQuantity == null)
1967            this.entryQuantity = new ArrayList<Quantity>();
1968          return this.entryQuantity;
1969        }
1970
1971        /**
1972         * @return Returns a reference to <code>this</code> for easy method chaining
1973         */
1974        public SectionComponent setEntryQuantity(List<Quantity> theEntryQuantity) { 
1975          this.entryQuantity = theEntryQuantity;
1976          return this;
1977        }
1978
1979        public boolean hasEntryQuantity() { 
1980          if (this.entryQuantity == null)
1981            return false;
1982          for (Quantity item : this.entryQuantity)
1983            if (!item.isEmpty())
1984              return true;
1985          return false;
1986        }
1987
1988        public Quantity addEntryQuantity() { //3
1989          Quantity t = new Quantity();
1990          if (this.entryQuantity == null)
1991            this.entryQuantity = new ArrayList<Quantity>();
1992          this.entryQuantity.add(t);
1993          return t;
1994        }
1995
1996        public SectionComponent addEntryQuantity(Quantity t) { //3
1997          if (t == null)
1998            return this;
1999          if (this.entryQuantity == null)
2000            this.entryQuantity = new ArrayList<Quantity>();
2001          this.entryQuantity.add(t);
2002          return this;
2003        }
2004
2005        /**
2006         * @return The first repetition of repeating field {@link #entryQuantity}, creating it if it does not already exist {3}
2007         */
2008        public Quantity getEntryQuantityFirstRep() { 
2009          if (getEntryQuantity().isEmpty()) {
2010            addEntryQuantity();
2011          }
2012          return getEntryQuantity().get(0);
2013        }
2014
2015        /**
2016         * @return {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.)
2017         */
2018        public CodeableConcept getEmptyReason() { 
2019          if (this.emptyReason == null)
2020            if (Configuration.errorOnAutoCreate())
2021              throw new Error("Attempt to auto-create SectionComponent.emptyReason");
2022            else if (Configuration.doAutoCreate())
2023              this.emptyReason = new CodeableConcept(); // cc
2024          return this.emptyReason;
2025        }
2026
2027        public boolean hasEmptyReason() { 
2028          return this.emptyReason != null && !this.emptyReason.isEmpty();
2029        }
2030
2031        /**
2032         * @param value {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.)
2033         */
2034        public SectionComponent setEmptyReason(CodeableConcept value) { 
2035          this.emptyReason = value;
2036          return this;
2037        }
2038
2039        /**
2040         * @return {@link #section} (A nested sub-section within this section.)
2041         */
2042        public List<SectionComponent> getSection() { 
2043          if (this.section == null)
2044            this.section = new ArrayList<SectionComponent>();
2045          return this.section;
2046        }
2047
2048        /**
2049         * @return Returns a reference to <code>this</code> for easy method chaining
2050         */
2051        public SectionComponent setSection(List<SectionComponent> theSection) { 
2052          this.section = theSection;
2053          return this;
2054        }
2055
2056        public boolean hasSection() { 
2057          if (this.section == null)
2058            return false;
2059          for (SectionComponent item : this.section)
2060            if (!item.isEmpty())
2061              return true;
2062          return false;
2063        }
2064
2065        public SectionComponent addSection() { //3
2066          SectionComponent t = new SectionComponent();
2067          if (this.section == null)
2068            this.section = new ArrayList<SectionComponent>();
2069          this.section.add(t);
2070          return t;
2071        }
2072
2073        public SectionComponent addSection(SectionComponent t) { //3
2074          if (t == null)
2075            return this;
2076          if (this.section == null)
2077            this.section = new ArrayList<SectionComponent>();
2078          this.section.add(t);
2079          return this;
2080        }
2081
2082        /**
2083         * @return The first repetition of repeating field {@link #section}, creating it if it does not already exist {3}
2084         */
2085        public SectionComponent getSectionFirstRep() { 
2086          if (getSection().isEmpty()) {
2087            addSection();
2088          }
2089          return getSection().get(0);
2090        }
2091
2092        protected void listChildren(List<Property> children) {
2093          super.listChildren(children);
2094          children.add(new Property("title", "string", "The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, 1, title));
2095          children.add(new Property("focus", "CodeableConcept", "A code identifying the kind of content contained within the section. This should be consistent with the section title.", 0, 1, focus));
2096          children.add(new Property("focusReference", "Reference(Any)", "A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title.", 0, 1, focusReference));
2097          children.add(new Property("author", "Reference(Person|Device|Group|Organization)", "Identifies who is responsible for the information in this section, not necessarily who typed it in.", 0, java.lang.Integer.MAX_VALUE, author));
2098          children.add(new Property("text", "Narrative", "A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative.", 0, 1, text));
2099          children.add(new Property("mode", "code", "How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, 1, mode));
2100          children.add(new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, 1, orderedBy));
2101          children.add(new Property("entryClassifier", "CodeableConcept", "Specifies any type of classification of the evidence report.", 0, java.lang.Integer.MAX_VALUE, entryClassifier));
2102          children.add(new Property("entryReference", "Reference(Any)", "A reference to the actual resource from which the narrative in the section is derived.", 0, java.lang.Integer.MAX_VALUE, entryReference));
2103          children.add(new Property("entryQuantity", "Quantity", "Quantity as content.", 0, java.lang.Integer.MAX_VALUE, entryQuantity));
2104          children.add(new Property("emptyReason", "CodeableConcept", "If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.", 0, 1, emptyReason));
2105          children.add(new Property("section", "@EvidenceReport.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section));
2106        }
2107
2108        @Override
2109        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2110          switch (_hash) {
2111          case 110371416: /*title*/  return new Property("title", "string", "The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, 1, title);
2112          case 97604824: /*focus*/  return new Property("focus", "CodeableConcept", "A code identifying the kind of content contained within the section. This should be consistent with the section title.", 0, 1, focus);
2113          case 1823604051: /*focusReference*/  return new Property("focusReference", "Reference(Any)", "A definitional Resource identifying the kind of content contained within the section. This should be consistent with the section title.", 0, 1, focusReference);
2114          case -1406328437: /*author*/  return new Property("author", "Reference(Person|Device|Group|Organization)", "Identifies who is responsible for the information in this section, not necessarily who typed it in.", 0, java.lang.Integer.MAX_VALUE, author);
2115          case 3556653: /*text*/  return new Property("text", "Narrative", "A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is peferred to contain sufficient detail to make it acceptable for a human to just read the narrative.", 0, 1, text);
2116          case 3357091: /*mode*/  return new Property("mode", "code", "How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.", 0, 1, mode);
2117          case -391079516: /*orderedBy*/  return new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, 1, orderedBy);
2118          case -948201421: /*entryClassifier*/  return new Property("entryClassifier", "CodeableConcept", "Specifies any type of classification of the evidence report.", 0, java.lang.Integer.MAX_VALUE, entryClassifier);
2119          case 438810361: /*entryReference*/  return new Property("entryReference", "Reference(Any)", "A reference to the actual resource from which the narrative in the section is derived.", 0, java.lang.Integer.MAX_VALUE, entryReference);
2120          case 1945583389: /*entryQuantity*/  return new Property("entryQuantity", "Quantity", "Quantity as content.", 0, java.lang.Integer.MAX_VALUE, entryQuantity);
2121          case 1140135409: /*emptyReason*/  return new Property("emptyReason", "CodeableConcept", "If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.", 0, 1, emptyReason);
2122          case 1970241253: /*section*/  return new Property("section", "@EvidenceReport.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section);
2123          default: return super.getNamedProperty(_hash, _name, _checkValid);
2124          }
2125
2126        }
2127
2128      @Override
2129      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2130        switch (hash) {
2131        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
2132        case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // CodeableConcept
2133        case 1823604051: /*focusReference*/ return this.focusReference == null ? new Base[0] : new Base[] {this.focusReference}; // Reference
2134        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference
2135        case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative
2136        case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration<ListMode>
2137        case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept
2138        case -948201421: /*entryClassifier*/ return this.entryClassifier == null ? new Base[0] : this.entryClassifier.toArray(new Base[this.entryClassifier.size()]); // CodeableConcept
2139        case 438810361: /*entryReference*/ return this.entryReference == null ? new Base[0] : this.entryReference.toArray(new Base[this.entryReference.size()]); // Reference
2140        case 1945583389: /*entryQuantity*/ return this.entryQuantity == null ? new Base[0] : this.entryQuantity.toArray(new Base[this.entryQuantity.size()]); // Quantity
2141        case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept
2142        case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent
2143        default: return super.getProperty(hash, name, checkValid);
2144        }
2145
2146      }
2147
2148      @Override
2149      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2150        switch (hash) {
2151        case 110371416: // title
2152          this.title = TypeConvertor.castToString(value); // StringType
2153          return value;
2154        case 97604824: // focus
2155          this.focus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2156          return value;
2157        case 1823604051: // focusReference
2158          this.focusReference = TypeConvertor.castToReference(value); // Reference
2159          return value;
2160        case -1406328437: // author
2161          this.getAuthor().add(TypeConvertor.castToReference(value)); // Reference
2162          return value;
2163        case 3556653: // text
2164          this.text = TypeConvertor.castToNarrative(value); // Narrative
2165          return value;
2166        case 3357091: // mode
2167          value = new ListModeEnumFactory().fromType(TypeConvertor.castToCode(value));
2168          this.mode = (Enumeration) value; // Enumeration<ListMode>
2169          return value;
2170        case -391079516: // orderedBy
2171          this.orderedBy = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2172          return value;
2173        case -948201421: // entryClassifier
2174          this.getEntryClassifier().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2175          return value;
2176        case 438810361: // entryReference
2177          this.getEntryReference().add(TypeConvertor.castToReference(value)); // Reference
2178          return value;
2179        case 1945583389: // entryQuantity
2180          this.getEntryQuantity().add(TypeConvertor.castToQuantity(value)); // Quantity
2181          return value;
2182        case 1140135409: // emptyReason
2183          this.emptyReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2184          return value;
2185        case 1970241253: // section
2186          this.getSection().add((SectionComponent) value); // SectionComponent
2187          return value;
2188        default: return super.setProperty(hash, name, value);
2189        }
2190
2191      }
2192
2193      @Override
2194      public Base setProperty(String name, Base value) throws FHIRException {
2195        if (name.equals("title")) {
2196          this.title = TypeConvertor.castToString(value); // StringType
2197        } else if (name.equals("focus")) {
2198          this.focus = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2199        } else if (name.equals("focusReference")) {
2200          this.focusReference = TypeConvertor.castToReference(value); // Reference
2201        } else if (name.equals("author")) {
2202          this.getAuthor().add(TypeConvertor.castToReference(value));
2203        } else if (name.equals("text")) {
2204          this.text = TypeConvertor.castToNarrative(value); // Narrative
2205        } else if (name.equals("mode")) {
2206          value = new ListModeEnumFactory().fromType(TypeConvertor.castToCode(value));
2207          this.mode = (Enumeration) value; // Enumeration<ListMode>
2208        } else if (name.equals("orderedBy")) {
2209          this.orderedBy = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2210        } else if (name.equals("entryClassifier")) {
2211          this.getEntryClassifier().add(TypeConvertor.castToCodeableConcept(value));
2212        } else if (name.equals("entryReference")) {
2213          this.getEntryReference().add(TypeConvertor.castToReference(value));
2214        } else if (name.equals("entryQuantity")) {
2215          this.getEntryQuantity().add(TypeConvertor.castToQuantity(value));
2216        } else if (name.equals("emptyReason")) {
2217          this.emptyReason = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2218        } else if (name.equals("section")) {
2219          this.getSection().add((SectionComponent) value);
2220        } else
2221          return super.setProperty(name, value);
2222        return value;
2223      }
2224
2225      @Override
2226      public Base makeProperty(int hash, String name) throws FHIRException {
2227        switch (hash) {
2228        case 110371416:  return getTitleElement();
2229        case 97604824:  return getFocus();
2230        case 1823604051:  return getFocusReference();
2231        case -1406328437:  return addAuthor(); 
2232        case 3556653:  return getText();
2233        case 3357091:  return getModeElement();
2234        case -391079516:  return getOrderedBy();
2235        case -948201421:  return addEntryClassifier(); 
2236        case 438810361:  return addEntryReference(); 
2237        case 1945583389:  return addEntryQuantity(); 
2238        case 1140135409:  return getEmptyReason();
2239        case 1970241253:  return addSection(); 
2240        default: return super.makeProperty(hash, name);
2241        }
2242
2243      }
2244
2245      @Override
2246      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2247        switch (hash) {
2248        case 110371416: /*title*/ return new String[] {"string"};
2249        case 97604824: /*focus*/ return new String[] {"CodeableConcept"};
2250        case 1823604051: /*focusReference*/ return new String[] {"Reference"};
2251        case -1406328437: /*author*/ return new String[] {"Reference"};
2252        case 3556653: /*text*/ return new String[] {"Narrative"};
2253        case 3357091: /*mode*/ return new String[] {"code"};
2254        case -391079516: /*orderedBy*/ return new String[] {"CodeableConcept"};
2255        case -948201421: /*entryClassifier*/ return new String[] {"CodeableConcept"};
2256        case 438810361: /*entryReference*/ return new String[] {"Reference"};
2257        case 1945583389: /*entryQuantity*/ return new String[] {"Quantity"};
2258        case 1140135409: /*emptyReason*/ return new String[] {"CodeableConcept"};
2259        case 1970241253: /*section*/ return new String[] {"@EvidenceReport.section"};
2260        default: return super.getTypesForProperty(hash, name);
2261        }
2262
2263      }
2264
2265      @Override
2266      public Base addChild(String name) throws FHIRException {
2267        if (name.equals("title")) {
2268          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.section.title");
2269        }
2270        else if (name.equals("focus")) {
2271          this.focus = new CodeableConcept();
2272          return this.focus;
2273        }
2274        else if (name.equals("focusReference")) {
2275          this.focusReference = new Reference();
2276          return this.focusReference;
2277        }
2278        else if (name.equals("author")) {
2279          return addAuthor();
2280        }
2281        else if (name.equals("text")) {
2282          this.text = new Narrative();
2283          return this.text;
2284        }
2285        else if (name.equals("mode")) {
2286          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.section.mode");
2287        }
2288        else if (name.equals("orderedBy")) {
2289          this.orderedBy = new CodeableConcept();
2290          return this.orderedBy;
2291        }
2292        else if (name.equals("entryClassifier")) {
2293          return addEntryClassifier();
2294        }
2295        else if (name.equals("entryReference")) {
2296          return addEntryReference();
2297        }
2298        else if (name.equals("entryQuantity")) {
2299          return addEntryQuantity();
2300        }
2301        else if (name.equals("emptyReason")) {
2302          this.emptyReason = new CodeableConcept();
2303          return this.emptyReason;
2304        }
2305        else if (name.equals("section")) {
2306          return addSection();
2307        }
2308        else
2309          return super.addChild(name);
2310      }
2311
2312      public SectionComponent copy() {
2313        SectionComponent dst = new SectionComponent();
2314        copyValues(dst);
2315        return dst;
2316      }
2317
2318      public void copyValues(SectionComponent dst) {
2319        super.copyValues(dst);
2320        dst.title = title == null ? null : title.copy();
2321        dst.focus = focus == null ? null : focus.copy();
2322        dst.focusReference = focusReference == null ? null : focusReference.copy();
2323        if (author != null) {
2324          dst.author = new ArrayList<Reference>();
2325          for (Reference i : author)
2326            dst.author.add(i.copy());
2327        };
2328        dst.text = text == null ? null : text.copy();
2329        dst.mode = mode == null ? null : mode.copy();
2330        dst.orderedBy = orderedBy == null ? null : orderedBy.copy();
2331        if (entryClassifier != null) {
2332          dst.entryClassifier = new ArrayList<CodeableConcept>();
2333          for (CodeableConcept i : entryClassifier)
2334            dst.entryClassifier.add(i.copy());
2335        };
2336        if (entryReference != null) {
2337          dst.entryReference = new ArrayList<Reference>();
2338          for (Reference i : entryReference)
2339            dst.entryReference.add(i.copy());
2340        };
2341        if (entryQuantity != null) {
2342          dst.entryQuantity = new ArrayList<Quantity>();
2343          for (Quantity i : entryQuantity)
2344            dst.entryQuantity.add(i.copy());
2345        };
2346        dst.emptyReason = emptyReason == null ? null : emptyReason.copy();
2347        if (section != null) {
2348          dst.section = new ArrayList<SectionComponent>();
2349          for (SectionComponent i : section)
2350            dst.section.add(i.copy());
2351        };
2352      }
2353
2354      @Override
2355      public boolean equalsDeep(Base other_) {
2356        if (!super.equalsDeep(other_))
2357          return false;
2358        if (!(other_ instanceof SectionComponent))
2359          return false;
2360        SectionComponent o = (SectionComponent) other_;
2361        return compareDeep(title, o.title, true) && compareDeep(focus, o.focus, true) && compareDeep(focusReference, o.focusReference, true)
2362           && compareDeep(author, o.author, true) && compareDeep(text, o.text, true) && compareDeep(mode, o.mode, true)
2363           && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(entryClassifier, o.entryClassifier, true)
2364           && compareDeep(entryReference, o.entryReference, true) && compareDeep(entryQuantity, o.entryQuantity, true)
2365           && compareDeep(emptyReason, o.emptyReason, true) && compareDeep(section, o.section, true);
2366      }
2367
2368      @Override
2369      public boolean equalsShallow(Base other_) {
2370        if (!super.equalsShallow(other_))
2371          return false;
2372        if (!(other_ instanceof SectionComponent))
2373          return false;
2374        SectionComponent o = (SectionComponent) other_;
2375        return compareValues(title, o.title, true) && compareValues(mode, o.mode, true);
2376      }
2377
2378      public boolean isEmpty() {
2379        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(title, focus, focusReference
2380          , author, text, mode, orderedBy, entryClassifier, entryReference, entryQuantity
2381          , emptyReason, section);
2382      }
2383
2384  public String fhirType() {
2385    return "EvidenceReport.section";
2386
2387  }
2388
2389  }
2390
2391    /**
2392     * An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
2393     */
2394    @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true)
2395    @Description(shortDefinition="Canonical identifier for this EvidenceReport, represented as a globally unique URI", formalDefinition="An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers." )
2396    protected UriType url;
2397
2398    /**
2399     * The status of this summary. Enables tracking the life-cycle of the content.
2400     */
2401    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
2402    @Description(shortDefinition="draft | active | retired | unknown", formalDefinition="The status of this summary. Enables tracking the life-cycle of the content." )
2403    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/publication-status")
2404    protected Enumeration<PublicationStatus> status;
2405
2406    /**
2407     * The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence report instances.
2408     */
2409    @Child(name = "useContext", type = {UsageContext.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2410    @Description(shortDefinition="The context that the content is intended to support", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence report instances." )
2411    protected List<UsageContext> useContext;
2412
2413    /**
2414     * A formal identifier that is used to identify this EvidenceReport when it is represented in other formats, or referenced in a specification, model, design or an instance.
2415     */
2416    @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2417    @Description(shortDefinition="Unique identifier for the evidence report", formalDefinition="A formal identifier that is used to identify this EvidenceReport when it is represented in other formats, or referenced in a specification, model, design or an instance." )
2418    protected List<Identifier> identifier;
2419
2420    /**
2421     * A formal identifier that is used to identify things closely related to this EvidenceReport.
2422     */
2423    @Child(name = "relatedIdentifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2424    @Description(shortDefinition="Identifiers for articles that may relate to more than one evidence report", formalDefinition="A formal identifier that is used to identify things closely related to this EvidenceReport." )
2425    protected List<Identifier> relatedIdentifier;
2426
2427    /**
2428     * Citation Resource or display of suggested citation for this report.
2429     */
2430    @Child(name = "citeAs", type = {Citation.class, MarkdownType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2431    @Description(shortDefinition="Citation for this report", formalDefinition="Citation Resource or display of suggested citation for this report." )
2432    protected DataType citeAs;
2433
2434    /**
2435     * Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression.
2436     */
2437    @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false)
2438    @Description(shortDefinition="Kind of report", formalDefinition="Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression." )
2439    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/evidence-report-type")
2440    protected CodeableConcept type;
2441
2442    /**
2443     * Used for footnotes and annotations.
2444     */
2445    @Child(name = "note", type = {Annotation.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2446    @Description(shortDefinition="Used for footnotes and annotations", formalDefinition="Used for footnotes and annotations." )
2447    protected List<Annotation> note;
2448
2449    /**
2450     * Link, description or reference to artifact associated with the report.
2451     */
2452    @Child(name = "relatedArtifact", type = {RelatedArtifact.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2453    @Description(shortDefinition="Link, description or reference to artifact associated with the report", formalDefinition="Link, description or reference to artifact associated with the report." )
2454    protected List<RelatedArtifact> relatedArtifact;
2455
2456    /**
2457     * Specifies the subject or focus of the report. Answers "What is this report about?".
2458     */
2459    @Child(name = "subject", type = {}, order=9, min=1, max=1, modifier=false, summary=true)
2460    @Description(shortDefinition="Focus of the report", formalDefinition="Specifies the subject or focus of the report. Answers \"What is this report about?\"." )
2461    protected EvidenceReportSubjectComponent subject;
2462
2463    /**
2464     * The name of the organization or individual that published the evidence report.
2465     */
2466    @Child(name = "publisher", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true)
2467    @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the organization or individual that published the evidence report." )
2468    protected StringType publisher;
2469
2470    /**
2471     * Contact details to assist a user in finding and communicating with the publisher.
2472     */
2473    @Child(name = "contact", type = {ContactDetail.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2474    @Description(shortDefinition="Contact details for the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." )
2475    protected List<ContactDetail> contact;
2476
2477    /**
2478     * An individiual, organization, or device primarily involved in the creation and maintenance of the content.
2479     */
2480    @Child(name = "author", type = {ContactDetail.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2481    @Description(shortDefinition="Who authored the content", formalDefinition="An individiual, organization, or device primarily involved in the creation and maintenance of the content." )
2482    protected List<ContactDetail> author;
2483
2484    /**
2485     * An individiual, organization, or device primarily responsible for internal coherence of the content.
2486     */
2487    @Child(name = "editor", type = {ContactDetail.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2488    @Description(shortDefinition="Who edited the content", formalDefinition="An individiual, organization, or device primarily responsible for internal coherence of the content." )
2489    protected List<ContactDetail> editor;
2490
2491    /**
2492     * An individiual, organization, or device primarily responsible for review of some aspect of the content.
2493     */
2494    @Child(name = "reviewer", type = {ContactDetail.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2495    @Description(shortDefinition="Who reviewed the content", formalDefinition="An individiual, organization, or device primarily responsible for review of some aspect of the content." )
2496    protected List<ContactDetail> reviewer;
2497
2498    /**
2499     * An individiual, organization, or device responsible for officially endorsing the content for use in some setting.
2500     */
2501    @Child(name = "endorser", type = {ContactDetail.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
2502    @Description(shortDefinition="Who endorsed the content", formalDefinition="An individiual, organization, or device responsible for officially endorsing the content for use in some setting." )
2503    protected List<ContactDetail> endorser;
2504
2505    /**
2506     * Relationships that this composition has with other compositions or documents that already exist.
2507     */
2508    @Child(name = "relatesTo", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2509    @Description(shortDefinition="Relationships to other compositions/documents", formalDefinition="Relationships that this composition has with other compositions or documents that already exist." )
2510    protected List<EvidenceReportRelatesToComponent> relatesTo;
2511
2512    /**
2513     * The root of the sections that make up the composition.
2514     */
2515    @Child(name = "section", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2516    @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." )
2517    protected List<SectionComponent> section;
2518
2519    private static final long serialVersionUID = -1087028792L;
2520
2521  /**
2522   * Constructor
2523   */
2524    public EvidenceReport() {
2525      super();
2526    }
2527
2528  /**
2529   * Constructor
2530   */
2531    public EvidenceReport(PublicationStatus status, EvidenceReportSubjectComponent subject) {
2532      super();
2533      this.setStatus(status);
2534      this.setSubject(subject);
2535    }
2536
2537    /**
2538     * @return {@link #url} (An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2539     */
2540    public UriType getUrlElement() { 
2541      if (this.url == null)
2542        if (Configuration.errorOnAutoCreate())
2543          throw new Error("Attempt to auto-create EvidenceReport.url");
2544        else if (Configuration.doAutoCreate())
2545          this.url = new UriType(); // bb
2546      return this.url;
2547    }
2548
2549    public boolean hasUrlElement() { 
2550      return this.url != null && !this.url.isEmpty();
2551    }
2552
2553    public boolean hasUrl() { 
2554      return this.url != null && !this.url.isEmpty();
2555    }
2556
2557    /**
2558     * @param value {@link #url} (An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
2559     */
2560    public EvidenceReport setUrlElement(UriType value) { 
2561      this.url = value;
2562      return this;
2563    }
2564
2565    /**
2566     * @return An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
2567     */
2568    public String getUrl() { 
2569      return this.url == null ? null : this.url.getValue();
2570    }
2571
2572    /**
2573     * @param value An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.
2574     */
2575    public EvidenceReport setUrl(String value) { 
2576      if (Utilities.noString(value))
2577        this.url = null;
2578      else {
2579        if (this.url == null)
2580          this.url = new UriType();
2581        this.url.setValue(value);
2582      }
2583      return this;
2584    }
2585
2586    /**
2587     * @return {@link #status} (The status of this summary. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2588     */
2589    public Enumeration<PublicationStatus> getStatusElement() { 
2590      if (this.status == null)
2591        if (Configuration.errorOnAutoCreate())
2592          throw new Error("Attempt to auto-create EvidenceReport.status");
2593        else if (Configuration.doAutoCreate())
2594          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
2595      return this.status;
2596    }
2597
2598    public boolean hasStatusElement() { 
2599      return this.status != null && !this.status.isEmpty();
2600    }
2601
2602    public boolean hasStatus() { 
2603      return this.status != null && !this.status.isEmpty();
2604    }
2605
2606    /**
2607     * @param value {@link #status} (The status of this summary. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2608     */
2609    public EvidenceReport setStatusElement(Enumeration<PublicationStatus> value) { 
2610      this.status = value;
2611      return this;
2612    }
2613
2614    /**
2615     * @return The status of this summary. Enables tracking the life-cycle of the content.
2616     */
2617    public PublicationStatus getStatus() { 
2618      return this.status == null ? null : this.status.getValue();
2619    }
2620
2621    /**
2622     * @param value The status of this summary. Enables tracking the life-cycle of the content.
2623     */
2624    public EvidenceReport setStatus(PublicationStatus value) { 
2625        if (this.status == null)
2626          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
2627        this.status.setValue(value);
2628      return this;
2629    }
2630
2631    /**
2632     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence report instances.)
2633     */
2634    public List<UsageContext> getUseContext() { 
2635      if (this.useContext == null)
2636        this.useContext = new ArrayList<UsageContext>();
2637      return this.useContext;
2638    }
2639
2640    /**
2641     * @return Returns a reference to <code>this</code> for easy method chaining
2642     */
2643    public EvidenceReport setUseContext(List<UsageContext> theUseContext) { 
2644      this.useContext = theUseContext;
2645      return this;
2646    }
2647
2648    public boolean hasUseContext() { 
2649      if (this.useContext == null)
2650        return false;
2651      for (UsageContext item : this.useContext)
2652        if (!item.isEmpty())
2653          return true;
2654      return false;
2655    }
2656
2657    public UsageContext addUseContext() { //3
2658      UsageContext t = new UsageContext();
2659      if (this.useContext == null)
2660        this.useContext = new ArrayList<UsageContext>();
2661      this.useContext.add(t);
2662      return t;
2663    }
2664
2665    public EvidenceReport addUseContext(UsageContext t) { //3
2666      if (t == null)
2667        return this;
2668      if (this.useContext == null)
2669        this.useContext = new ArrayList<UsageContext>();
2670      this.useContext.add(t);
2671      return this;
2672    }
2673
2674    /**
2675     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist {3}
2676     */
2677    public UsageContext getUseContextFirstRep() { 
2678      if (getUseContext().isEmpty()) {
2679        addUseContext();
2680      }
2681      return getUseContext().get(0);
2682    }
2683
2684    /**
2685     * @return {@link #identifier} (A formal identifier that is used to identify this EvidenceReport when it is represented in other formats, or referenced in a specification, model, design or an instance.)
2686     */
2687    public List<Identifier> getIdentifier() { 
2688      if (this.identifier == null)
2689        this.identifier = new ArrayList<Identifier>();
2690      return this.identifier;
2691    }
2692
2693    /**
2694     * @return Returns a reference to <code>this</code> for easy method chaining
2695     */
2696    public EvidenceReport setIdentifier(List<Identifier> theIdentifier) { 
2697      this.identifier = theIdentifier;
2698      return this;
2699    }
2700
2701    public boolean hasIdentifier() { 
2702      if (this.identifier == null)
2703        return false;
2704      for (Identifier item : this.identifier)
2705        if (!item.isEmpty())
2706          return true;
2707      return false;
2708    }
2709
2710    public Identifier addIdentifier() { //3
2711      Identifier t = new Identifier();
2712      if (this.identifier == null)
2713        this.identifier = new ArrayList<Identifier>();
2714      this.identifier.add(t);
2715      return t;
2716    }
2717
2718    public EvidenceReport addIdentifier(Identifier t) { //3
2719      if (t == null)
2720        return this;
2721      if (this.identifier == null)
2722        this.identifier = new ArrayList<Identifier>();
2723      this.identifier.add(t);
2724      return this;
2725    }
2726
2727    /**
2728     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
2729     */
2730    public Identifier getIdentifierFirstRep() { 
2731      if (getIdentifier().isEmpty()) {
2732        addIdentifier();
2733      }
2734      return getIdentifier().get(0);
2735    }
2736
2737    /**
2738     * @return {@link #relatedIdentifier} (A formal identifier that is used to identify things closely related to this EvidenceReport.)
2739     */
2740    public List<Identifier> getRelatedIdentifier() { 
2741      if (this.relatedIdentifier == null)
2742        this.relatedIdentifier = new ArrayList<Identifier>();
2743      return this.relatedIdentifier;
2744    }
2745
2746    /**
2747     * @return Returns a reference to <code>this</code> for easy method chaining
2748     */
2749    public EvidenceReport setRelatedIdentifier(List<Identifier> theRelatedIdentifier) { 
2750      this.relatedIdentifier = theRelatedIdentifier;
2751      return this;
2752    }
2753
2754    public boolean hasRelatedIdentifier() { 
2755      if (this.relatedIdentifier == null)
2756        return false;
2757      for (Identifier item : this.relatedIdentifier)
2758        if (!item.isEmpty())
2759          return true;
2760      return false;
2761    }
2762
2763    public Identifier addRelatedIdentifier() { //3
2764      Identifier t = new Identifier();
2765      if (this.relatedIdentifier == null)
2766        this.relatedIdentifier = new ArrayList<Identifier>();
2767      this.relatedIdentifier.add(t);
2768      return t;
2769    }
2770
2771    public EvidenceReport addRelatedIdentifier(Identifier t) { //3
2772      if (t == null)
2773        return this;
2774      if (this.relatedIdentifier == null)
2775        this.relatedIdentifier = new ArrayList<Identifier>();
2776      this.relatedIdentifier.add(t);
2777      return this;
2778    }
2779
2780    /**
2781     * @return The first repetition of repeating field {@link #relatedIdentifier}, creating it if it does not already exist {3}
2782     */
2783    public Identifier getRelatedIdentifierFirstRep() { 
2784      if (getRelatedIdentifier().isEmpty()) {
2785        addRelatedIdentifier();
2786      }
2787      return getRelatedIdentifier().get(0);
2788    }
2789
2790    /**
2791     * @return {@link #citeAs} (Citation Resource or display of suggested citation for this report.)
2792     */
2793    public DataType getCiteAs() { 
2794      return this.citeAs;
2795    }
2796
2797    /**
2798     * @return {@link #citeAs} (Citation Resource or display of suggested citation for this report.)
2799     */
2800    public Reference getCiteAsReference() throws FHIRException { 
2801      if (this.citeAs == null)
2802        this.citeAs = new Reference();
2803      if (!(this.citeAs instanceof Reference))
2804        throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.citeAs.getClass().getName()+" was encountered");
2805      return (Reference) this.citeAs;
2806    }
2807
2808    public boolean hasCiteAsReference() { 
2809      return this != null && this.citeAs instanceof Reference;
2810    }
2811
2812    /**
2813     * @return {@link #citeAs} (Citation Resource or display of suggested citation for this report.)
2814     */
2815    public MarkdownType getCiteAsMarkdownType() throws FHIRException { 
2816      if (this.citeAs == null)
2817        this.citeAs = new MarkdownType();
2818      if (!(this.citeAs instanceof MarkdownType))
2819        throw new FHIRException("Type mismatch: the type MarkdownType was expected, but "+this.citeAs.getClass().getName()+" was encountered");
2820      return (MarkdownType) this.citeAs;
2821    }
2822
2823    public boolean hasCiteAsMarkdownType() { 
2824      return this != null && this.citeAs instanceof MarkdownType;
2825    }
2826
2827    public boolean hasCiteAs() { 
2828      return this.citeAs != null && !this.citeAs.isEmpty();
2829    }
2830
2831    /**
2832     * @param value {@link #citeAs} (Citation Resource or display of suggested citation for this report.)
2833     */
2834    public EvidenceReport setCiteAs(DataType value) { 
2835      if (value != null && !(value instanceof Reference || value instanceof MarkdownType))
2836        throw new Error("Not the right type for EvidenceReport.citeAs[x]: "+value.fhirType());
2837      this.citeAs = value;
2838      return this;
2839    }
2840
2841    /**
2842     * @return {@link #type} (Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression.)
2843     */
2844    public CodeableConcept getType() { 
2845      if (this.type == null)
2846        if (Configuration.errorOnAutoCreate())
2847          throw new Error("Attempt to auto-create EvidenceReport.type");
2848        else if (Configuration.doAutoCreate())
2849          this.type = new CodeableConcept(); // cc
2850      return this.type;
2851    }
2852
2853    public boolean hasType() { 
2854      return this.type != null && !this.type.isEmpty();
2855    }
2856
2857    /**
2858     * @param value {@link #type} (Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression.)
2859     */
2860    public EvidenceReport setType(CodeableConcept value) { 
2861      this.type = value;
2862      return this;
2863    }
2864
2865    /**
2866     * @return {@link #note} (Used for footnotes and annotations.)
2867     */
2868    public List<Annotation> getNote() { 
2869      if (this.note == null)
2870        this.note = new ArrayList<Annotation>();
2871      return this.note;
2872    }
2873
2874    /**
2875     * @return Returns a reference to <code>this</code> for easy method chaining
2876     */
2877    public EvidenceReport setNote(List<Annotation> theNote) { 
2878      this.note = theNote;
2879      return this;
2880    }
2881
2882    public boolean hasNote() { 
2883      if (this.note == null)
2884        return false;
2885      for (Annotation item : this.note)
2886        if (!item.isEmpty())
2887          return true;
2888      return false;
2889    }
2890
2891    public Annotation addNote() { //3
2892      Annotation t = new Annotation();
2893      if (this.note == null)
2894        this.note = new ArrayList<Annotation>();
2895      this.note.add(t);
2896      return t;
2897    }
2898
2899    public EvidenceReport addNote(Annotation t) { //3
2900      if (t == null)
2901        return this;
2902      if (this.note == null)
2903        this.note = new ArrayList<Annotation>();
2904      this.note.add(t);
2905      return this;
2906    }
2907
2908    /**
2909     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
2910     */
2911    public Annotation getNoteFirstRep() { 
2912      if (getNote().isEmpty()) {
2913        addNote();
2914      }
2915      return getNote().get(0);
2916    }
2917
2918    /**
2919     * @return {@link #relatedArtifact} (Link, description or reference to artifact associated with the report.)
2920     */
2921    public List<RelatedArtifact> getRelatedArtifact() { 
2922      if (this.relatedArtifact == null)
2923        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2924      return this.relatedArtifact;
2925    }
2926
2927    /**
2928     * @return Returns a reference to <code>this</code> for easy method chaining
2929     */
2930    public EvidenceReport setRelatedArtifact(List<RelatedArtifact> theRelatedArtifact) { 
2931      this.relatedArtifact = theRelatedArtifact;
2932      return this;
2933    }
2934
2935    public boolean hasRelatedArtifact() { 
2936      if (this.relatedArtifact == null)
2937        return false;
2938      for (RelatedArtifact item : this.relatedArtifact)
2939        if (!item.isEmpty())
2940          return true;
2941      return false;
2942    }
2943
2944    public RelatedArtifact addRelatedArtifact() { //3
2945      RelatedArtifact t = new RelatedArtifact();
2946      if (this.relatedArtifact == null)
2947        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2948      this.relatedArtifact.add(t);
2949      return t;
2950    }
2951
2952    public EvidenceReport addRelatedArtifact(RelatedArtifact t) { //3
2953      if (t == null)
2954        return this;
2955      if (this.relatedArtifact == null)
2956        this.relatedArtifact = new ArrayList<RelatedArtifact>();
2957      this.relatedArtifact.add(t);
2958      return this;
2959    }
2960
2961    /**
2962     * @return The first repetition of repeating field {@link #relatedArtifact}, creating it if it does not already exist {3}
2963     */
2964    public RelatedArtifact getRelatedArtifactFirstRep() { 
2965      if (getRelatedArtifact().isEmpty()) {
2966        addRelatedArtifact();
2967      }
2968      return getRelatedArtifact().get(0);
2969    }
2970
2971    /**
2972     * @return {@link #subject} (Specifies the subject or focus of the report. Answers "What is this report about?".)
2973     */
2974    public EvidenceReportSubjectComponent getSubject() { 
2975      if (this.subject == null)
2976        if (Configuration.errorOnAutoCreate())
2977          throw new Error("Attempt to auto-create EvidenceReport.subject");
2978        else if (Configuration.doAutoCreate())
2979          this.subject = new EvidenceReportSubjectComponent(); // cc
2980      return this.subject;
2981    }
2982
2983    public boolean hasSubject() { 
2984      return this.subject != null && !this.subject.isEmpty();
2985    }
2986
2987    /**
2988     * @param value {@link #subject} (Specifies the subject or focus of the report. Answers "What is this report about?".)
2989     */
2990    public EvidenceReport setSubject(EvidenceReportSubjectComponent value) { 
2991      this.subject = value;
2992      return this;
2993    }
2994
2995    /**
2996     * @return {@link #publisher} (The name of the organization or individual that published the evidence report.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
2997     */
2998    public StringType getPublisherElement() { 
2999      if (this.publisher == null)
3000        if (Configuration.errorOnAutoCreate())
3001          throw new Error("Attempt to auto-create EvidenceReport.publisher");
3002        else if (Configuration.doAutoCreate())
3003          this.publisher = new StringType(); // bb
3004      return this.publisher;
3005    }
3006
3007    public boolean hasPublisherElement() { 
3008      return this.publisher != null && !this.publisher.isEmpty();
3009    }
3010
3011    public boolean hasPublisher() { 
3012      return this.publisher != null && !this.publisher.isEmpty();
3013    }
3014
3015    /**
3016     * @param value {@link #publisher} (The name of the organization or individual that published the evidence report.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
3017     */
3018    public EvidenceReport setPublisherElement(StringType value) { 
3019      this.publisher = value;
3020      return this;
3021    }
3022
3023    /**
3024     * @return The name of the organization or individual that published the evidence report.
3025     */
3026    public String getPublisher() { 
3027      return this.publisher == null ? null : this.publisher.getValue();
3028    }
3029
3030    /**
3031     * @param value The name of the organization or individual that published the evidence report.
3032     */
3033    public EvidenceReport setPublisher(String value) { 
3034      if (Utilities.noString(value))
3035        this.publisher = null;
3036      else {
3037        if (this.publisher == null)
3038          this.publisher = new StringType();
3039        this.publisher.setValue(value);
3040      }
3041      return this;
3042    }
3043
3044    /**
3045     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
3046     */
3047    public List<ContactDetail> getContact() { 
3048      if (this.contact == null)
3049        this.contact = new ArrayList<ContactDetail>();
3050      return this.contact;
3051    }
3052
3053    /**
3054     * @return Returns a reference to <code>this</code> for easy method chaining
3055     */
3056    public EvidenceReport setContact(List<ContactDetail> theContact) { 
3057      this.contact = theContact;
3058      return this;
3059    }
3060
3061    public boolean hasContact() { 
3062      if (this.contact == null)
3063        return false;
3064      for (ContactDetail item : this.contact)
3065        if (!item.isEmpty())
3066          return true;
3067      return false;
3068    }
3069
3070    public ContactDetail addContact() { //3
3071      ContactDetail t = new ContactDetail();
3072      if (this.contact == null)
3073        this.contact = new ArrayList<ContactDetail>();
3074      this.contact.add(t);
3075      return t;
3076    }
3077
3078    public EvidenceReport addContact(ContactDetail t) { //3
3079      if (t == null)
3080        return this;
3081      if (this.contact == null)
3082        this.contact = new ArrayList<ContactDetail>();
3083      this.contact.add(t);
3084      return this;
3085    }
3086
3087    /**
3088     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist {3}
3089     */
3090    public ContactDetail getContactFirstRep() { 
3091      if (getContact().isEmpty()) {
3092        addContact();
3093      }
3094      return getContact().get(0);
3095    }
3096
3097    /**
3098     * @return {@link #author} (An individiual, organization, or device primarily involved in the creation and maintenance of the content.)
3099     */
3100    public List<ContactDetail> getAuthor() { 
3101      if (this.author == null)
3102        this.author = new ArrayList<ContactDetail>();
3103      return this.author;
3104    }
3105
3106    /**
3107     * @return Returns a reference to <code>this</code> for easy method chaining
3108     */
3109    public EvidenceReport setAuthor(List<ContactDetail> theAuthor) { 
3110      this.author = theAuthor;
3111      return this;
3112    }
3113
3114    public boolean hasAuthor() { 
3115      if (this.author == null)
3116        return false;
3117      for (ContactDetail item : this.author)
3118        if (!item.isEmpty())
3119          return true;
3120      return false;
3121    }
3122
3123    public ContactDetail addAuthor() { //3
3124      ContactDetail t = new ContactDetail();
3125      if (this.author == null)
3126        this.author = new ArrayList<ContactDetail>();
3127      this.author.add(t);
3128      return t;
3129    }
3130
3131    public EvidenceReport addAuthor(ContactDetail t) { //3
3132      if (t == null)
3133        return this;
3134      if (this.author == null)
3135        this.author = new ArrayList<ContactDetail>();
3136      this.author.add(t);
3137      return this;
3138    }
3139
3140    /**
3141     * @return The first repetition of repeating field {@link #author}, creating it if it does not already exist {3}
3142     */
3143    public ContactDetail getAuthorFirstRep() { 
3144      if (getAuthor().isEmpty()) {
3145        addAuthor();
3146      }
3147      return getAuthor().get(0);
3148    }
3149
3150    /**
3151     * @return {@link #editor} (An individiual, organization, or device primarily responsible for internal coherence of the content.)
3152     */
3153    public List<ContactDetail> getEditor() { 
3154      if (this.editor == null)
3155        this.editor = new ArrayList<ContactDetail>();
3156      return this.editor;
3157    }
3158
3159    /**
3160     * @return Returns a reference to <code>this</code> for easy method chaining
3161     */
3162    public EvidenceReport setEditor(List<ContactDetail> theEditor) { 
3163      this.editor = theEditor;
3164      return this;
3165    }
3166
3167    public boolean hasEditor() { 
3168      if (this.editor == null)
3169        return false;
3170      for (ContactDetail item : this.editor)
3171        if (!item.isEmpty())
3172          return true;
3173      return false;
3174    }
3175
3176    public ContactDetail addEditor() { //3
3177      ContactDetail t = new ContactDetail();
3178      if (this.editor == null)
3179        this.editor = new ArrayList<ContactDetail>();
3180      this.editor.add(t);
3181      return t;
3182    }
3183
3184    public EvidenceReport addEditor(ContactDetail t) { //3
3185      if (t == null)
3186        return this;
3187      if (this.editor == null)
3188        this.editor = new ArrayList<ContactDetail>();
3189      this.editor.add(t);
3190      return this;
3191    }
3192
3193    /**
3194     * @return The first repetition of repeating field {@link #editor}, creating it if it does not already exist {3}
3195     */
3196    public ContactDetail getEditorFirstRep() { 
3197      if (getEditor().isEmpty()) {
3198        addEditor();
3199      }
3200      return getEditor().get(0);
3201    }
3202
3203    /**
3204     * @return {@link #reviewer} (An individiual, organization, or device primarily responsible for review of some aspect of the content.)
3205     */
3206    public List<ContactDetail> getReviewer() { 
3207      if (this.reviewer == null)
3208        this.reviewer = new ArrayList<ContactDetail>();
3209      return this.reviewer;
3210    }
3211
3212    /**
3213     * @return Returns a reference to <code>this</code> for easy method chaining
3214     */
3215    public EvidenceReport setReviewer(List<ContactDetail> theReviewer) { 
3216      this.reviewer = theReviewer;
3217      return this;
3218    }
3219
3220    public boolean hasReviewer() { 
3221      if (this.reviewer == null)
3222        return false;
3223      for (ContactDetail item : this.reviewer)
3224        if (!item.isEmpty())
3225          return true;
3226      return false;
3227    }
3228
3229    public ContactDetail addReviewer() { //3
3230      ContactDetail t = new ContactDetail();
3231      if (this.reviewer == null)
3232        this.reviewer = new ArrayList<ContactDetail>();
3233      this.reviewer.add(t);
3234      return t;
3235    }
3236
3237    public EvidenceReport addReviewer(ContactDetail t) { //3
3238      if (t == null)
3239        return this;
3240      if (this.reviewer == null)
3241        this.reviewer = new ArrayList<ContactDetail>();
3242      this.reviewer.add(t);
3243      return this;
3244    }
3245
3246    /**
3247     * @return The first repetition of repeating field {@link #reviewer}, creating it if it does not already exist {3}
3248     */
3249    public ContactDetail getReviewerFirstRep() { 
3250      if (getReviewer().isEmpty()) {
3251        addReviewer();
3252      }
3253      return getReviewer().get(0);
3254    }
3255
3256    /**
3257     * @return {@link #endorser} (An individiual, organization, or device responsible for officially endorsing the content for use in some setting.)
3258     */
3259    public List<ContactDetail> getEndorser() { 
3260      if (this.endorser == null)
3261        this.endorser = new ArrayList<ContactDetail>();
3262      return this.endorser;
3263    }
3264
3265    /**
3266     * @return Returns a reference to <code>this</code> for easy method chaining
3267     */
3268    public EvidenceReport setEndorser(List<ContactDetail> theEndorser) { 
3269      this.endorser = theEndorser;
3270      return this;
3271    }
3272
3273    public boolean hasEndorser() { 
3274      if (this.endorser == null)
3275        return false;
3276      for (ContactDetail item : this.endorser)
3277        if (!item.isEmpty())
3278          return true;
3279      return false;
3280    }
3281
3282    public ContactDetail addEndorser() { //3
3283      ContactDetail t = new ContactDetail();
3284      if (this.endorser == null)
3285        this.endorser = new ArrayList<ContactDetail>();
3286      this.endorser.add(t);
3287      return t;
3288    }
3289
3290    public EvidenceReport addEndorser(ContactDetail t) { //3
3291      if (t == null)
3292        return this;
3293      if (this.endorser == null)
3294        this.endorser = new ArrayList<ContactDetail>();
3295      this.endorser.add(t);
3296      return this;
3297    }
3298
3299    /**
3300     * @return The first repetition of repeating field {@link #endorser}, creating it if it does not already exist {3}
3301     */
3302    public ContactDetail getEndorserFirstRep() { 
3303      if (getEndorser().isEmpty()) {
3304        addEndorser();
3305      }
3306      return getEndorser().get(0);
3307    }
3308
3309    /**
3310     * @return {@link #relatesTo} (Relationships that this composition has with other compositions or documents that already exist.)
3311     */
3312    public List<EvidenceReportRelatesToComponent> getRelatesTo() { 
3313      if (this.relatesTo == null)
3314        this.relatesTo = new ArrayList<EvidenceReportRelatesToComponent>();
3315      return this.relatesTo;
3316    }
3317
3318    /**
3319     * @return Returns a reference to <code>this</code> for easy method chaining
3320     */
3321    public EvidenceReport setRelatesTo(List<EvidenceReportRelatesToComponent> theRelatesTo) { 
3322      this.relatesTo = theRelatesTo;
3323      return this;
3324    }
3325
3326    public boolean hasRelatesTo() { 
3327      if (this.relatesTo == null)
3328        return false;
3329      for (EvidenceReportRelatesToComponent item : this.relatesTo)
3330        if (!item.isEmpty())
3331          return true;
3332      return false;
3333    }
3334
3335    public EvidenceReportRelatesToComponent addRelatesTo() { //3
3336      EvidenceReportRelatesToComponent t = new EvidenceReportRelatesToComponent();
3337      if (this.relatesTo == null)
3338        this.relatesTo = new ArrayList<EvidenceReportRelatesToComponent>();
3339      this.relatesTo.add(t);
3340      return t;
3341    }
3342
3343    public EvidenceReport addRelatesTo(EvidenceReportRelatesToComponent t) { //3
3344      if (t == null)
3345        return this;
3346      if (this.relatesTo == null)
3347        this.relatesTo = new ArrayList<EvidenceReportRelatesToComponent>();
3348      this.relatesTo.add(t);
3349      return this;
3350    }
3351
3352    /**
3353     * @return The first repetition of repeating field {@link #relatesTo}, creating it if it does not already exist {3}
3354     */
3355    public EvidenceReportRelatesToComponent getRelatesToFirstRep() { 
3356      if (getRelatesTo().isEmpty()) {
3357        addRelatesTo();
3358      }
3359      return getRelatesTo().get(0);
3360    }
3361
3362    /**
3363     * @return {@link #section} (The root of the sections that make up the composition.)
3364     */
3365    public List<SectionComponent> getSection() { 
3366      if (this.section == null)
3367        this.section = new ArrayList<SectionComponent>();
3368      return this.section;
3369    }
3370
3371    /**
3372     * @return Returns a reference to <code>this</code> for easy method chaining
3373     */
3374    public EvidenceReport setSection(List<SectionComponent> theSection) { 
3375      this.section = theSection;
3376      return this;
3377    }
3378
3379    public boolean hasSection() { 
3380      if (this.section == null)
3381        return false;
3382      for (SectionComponent item : this.section)
3383        if (!item.isEmpty())
3384          return true;
3385      return false;
3386    }
3387
3388    public SectionComponent addSection() { //3
3389      SectionComponent t = new SectionComponent();
3390      if (this.section == null)
3391        this.section = new ArrayList<SectionComponent>();
3392      this.section.add(t);
3393      return t;
3394    }
3395
3396    public EvidenceReport addSection(SectionComponent t) { //3
3397      if (t == null)
3398        return this;
3399      if (this.section == null)
3400        this.section = new ArrayList<SectionComponent>();
3401      this.section.add(t);
3402      return this;
3403    }
3404
3405    /**
3406     * @return The first repetition of repeating field {@link #section}, creating it if it does not already exist {3}
3407     */
3408    public SectionComponent getSectionFirstRep() { 
3409      if (getSection().isEmpty()) {
3410        addSection();
3411      }
3412      return getSection().get(0);
3413    }
3414
3415    /**
3416     * not supported on this implementation
3417     */
3418    @Override
3419    public int getVersionMax() { 
3420      return 0;
3421    }
3422    /**
3423     * @return {@link #version} (The identifier that is used to identify this version of the evidence report when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence report author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3424     */
3425    public StringType getVersionElement() { 
3426      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"version\"");
3427    }
3428
3429    public boolean hasVersionElement() { 
3430      return false;
3431    }
3432    public boolean hasVersion() {
3433      return false;
3434    }
3435
3436    /**
3437     * @param value {@link #version} (The identifier that is used to identify this version of the evidence report when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence report author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
3438     */
3439    public EvidenceReport setVersionElement(StringType value) { 
3440      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"version\"");
3441    }
3442    public String getVersion() { 
3443      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"version\"");
3444    }
3445    /**
3446     * @param value The identifier that is used to identify this version of the evidence report when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence report author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
3447     */
3448    public EvidenceReport setVersion(String value) { 
3449      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"version\"");
3450    }
3451    /**
3452     * not supported on this implementation
3453     */
3454    @Override
3455    public int getNameMax() { 
3456      return 0;
3457    }
3458    /**
3459     * @return {@link #name} (A natural language name identifying the evidence report. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3460     */
3461    public StringType getNameElement() { 
3462      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"name\"");
3463    }
3464
3465    public boolean hasNameElement() { 
3466      return false;
3467    }
3468    public boolean hasName() {
3469      return false;
3470    }
3471
3472    /**
3473     * @param value {@link #name} (A natural language name identifying the evidence report. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3474     */
3475    public EvidenceReport setNameElement(StringType value) { 
3476      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"name\"");
3477    }
3478    public String getName() { 
3479      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"name\"");
3480    }
3481    /**
3482     * @param value A natural language name identifying the evidence report. This name should be usable as an identifier for the module by machine processing applications such as code generation.
3483     */
3484    public EvidenceReport setName(String value) { 
3485      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"name\"");
3486    }
3487    /**
3488     * not supported on this implementation
3489     */
3490    @Override
3491    public int getTitleMax() { 
3492      return 0;
3493    }
3494    /**
3495     * @return {@link #title} (A short, descriptive, user-friendly title for the evidence report.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
3496     */
3497    public StringType getTitleElement() { 
3498      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"title\"");
3499    }
3500
3501    public boolean hasTitleElement() { 
3502      return false;
3503    }
3504    public boolean hasTitle() {
3505      return false;
3506    }
3507
3508    /**
3509     * @param value {@link #title} (A short, descriptive, user-friendly title for the evidence report.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
3510     */
3511    public EvidenceReport setTitleElement(StringType value) { 
3512      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"title\"");
3513    }
3514    public String getTitle() { 
3515      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"title\"");
3516    }
3517    /**
3518     * @param value A short, descriptive, user-friendly title for the evidence report.
3519     */
3520    public EvidenceReport setTitle(String value) { 
3521      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"title\"");
3522    }
3523    /**
3524     * not supported on this implementation
3525     */
3526    @Override
3527    public int getExperimentalMax() { 
3528      return 0;
3529    }
3530    /**
3531     * @return {@link #experimental} (A Boolean value to indicate that this evidence report is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
3532     */
3533    public BooleanType getExperimentalElement() { 
3534      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"experimental\"");
3535    }
3536
3537    public boolean hasExperimentalElement() { 
3538      return false;
3539    }
3540    public boolean hasExperimental() {
3541      return false;
3542    }
3543
3544    /**
3545     * @param value {@link #experimental} (A Boolean value to indicate that this evidence report is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
3546     */
3547    public EvidenceReport setExperimentalElement(BooleanType value) { 
3548      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"experimental\"");
3549    }
3550    public boolean getExperimental() { 
3551      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"experimental\"");
3552    }
3553    /**
3554     * @param value A Boolean value to indicate that this evidence report is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
3555     */
3556    public EvidenceReport setExperimental(boolean value) { 
3557      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"experimental\"");
3558    }
3559    /**
3560     * not supported on this implementation
3561     */
3562    @Override
3563    public int getDateMax() { 
3564      return 0;
3565    }
3566    /**
3567     * @return {@link #date} (The date  (and optionally time) when the evidence report was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence report changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3568     */
3569    public DateTimeType getDateElement() { 
3570      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"date\"");
3571    }
3572
3573    public boolean hasDateElement() { 
3574      return false;
3575    }
3576    public boolean hasDate() {
3577      return false;
3578    }
3579
3580    /**
3581     * @param value {@link #date} (The date  (and optionally time) when the evidence report was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence report changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
3582     */
3583    public EvidenceReport setDateElement(DateTimeType value) { 
3584      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"date\"");
3585    }
3586    public Date getDate() { 
3587      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"date\"");
3588    }
3589    /**
3590     * @param value The date  (and optionally time) when the evidence report was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence report changes.
3591     */
3592    public EvidenceReport setDate(Date value) { 
3593      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"date\"");
3594    }
3595    /**
3596     * not supported on this implementation
3597     */
3598    @Override
3599    public int getDescriptionMax() { 
3600      return 0;
3601    }
3602    /**
3603     * @return {@link #description} (A free text natural language description of the evidence report from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3604     */
3605    public MarkdownType getDescriptionElement() { 
3606      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"description\"");
3607    }
3608
3609    public boolean hasDescriptionElement() { 
3610      return false;
3611    }
3612    public boolean hasDescription() {
3613      return false;
3614    }
3615
3616    /**
3617     * @param value {@link #description} (A free text natural language description of the evidence report from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
3618     */
3619    public EvidenceReport setDescriptionElement(MarkdownType value) { 
3620      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"description\"");
3621    }
3622    public String getDescription() { 
3623      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"description\"");
3624    }
3625    /**
3626     * @param value A free text natural language description of the evidence report from a consumer's perspective.
3627     */
3628    public EvidenceReport setDescription(String value) { 
3629      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"description\"");
3630    }
3631    /**
3632     * not supported on this implementation
3633     */
3634    @Override
3635    public int getJurisdictionMax() { 
3636      return 0;
3637    }
3638    /**
3639     * @return {@link #jurisdiction} (A legal or geographic region in which the evidence report is intended to be used.)
3640     */
3641    public List<CodeableConcept> getJurisdiction() { 
3642      return new ArrayList<>();
3643    }
3644    /**
3645     * @return Returns a reference to <code>this</code> for easy method chaining
3646     */
3647    public EvidenceReport setJurisdiction(List<CodeableConcept> theJurisdiction) { 
3648      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"jurisdiction\"");
3649    }
3650    public boolean hasJurisdiction() { 
3651      return false;
3652    }
3653
3654    public CodeableConcept addJurisdiction() { //3
3655      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"jurisdiction\"");
3656    }
3657    public EvidenceReport addJurisdiction(CodeableConcept t) { //3
3658      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"jurisdiction\"");
3659    }
3660    /**
3661     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist {2}
3662     */
3663    public CodeableConcept getJurisdictionFirstRep() { 
3664      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"jurisdiction\"");
3665    }
3666    /**
3667     * not supported on this implementation
3668     */
3669    @Override
3670    public int getPurposeMax() { 
3671      return 0;
3672    }
3673    /**
3674     * @return {@link #purpose} (Explanation of why this evidence report is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3675     */
3676    public MarkdownType getPurposeElement() { 
3677      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"purpose\"");
3678    }
3679
3680    public boolean hasPurposeElement() { 
3681      return false;
3682    }
3683    public boolean hasPurpose() {
3684      return false;
3685    }
3686
3687    /**
3688     * @param value {@link #purpose} (Explanation of why this evidence report is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
3689     */
3690    public EvidenceReport setPurposeElement(MarkdownType value) { 
3691      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"purpose\"");
3692    }
3693    public String getPurpose() { 
3694      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"purpose\"");
3695    }
3696    /**
3697     * @param value Explanation of why this evidence report is needed and why it has been designed as it has.
3698     */
3699    public EvidenceReport setPurpose(String value) { 
3700      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"purpose\"");
3701    }
3702    /**
3703     * not supported on this implementation
3704     */
3705    @Override
3706    public int getCopyrightMax() { 
3707      return 0;
3708    }
3709    /**
3710     * @return {@link #copyright} (A copyright statement relating to the evidence report and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence report.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3711     */
3712    public MarkdownType getCopyrightElement() { 
3713      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"copyright\"");
3714    }
3715
3716    public boolean hasCopyrightElement() { 
3717      return false;
3718    }
3719    public boolean hasCopyright() {
3720      return false;
3721    }
3722
3723    /**
3724     * @param value {@link #copyright} (A copyright statement relating to the evidence report and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence report.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
3725     */
3726    public EvidenceReport setCopyrightElement(MarkdownType value) { 
3727      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"copyright\"");
3728    }
3729    public String getCopyright() { 
3730      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"copyright\"");
3731    }
3732    /**
3733     * @param value A copyright statement relating to the evidence report and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence report.
3734     */
3735    public EvidenceReport setCopyright(String value) { 
3736      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"copyright\"");
3737    }
3738    /**
3739     * not supported on this implementation
3740     */
3741    @Override
3742    public int getApprovalDateMax() { 
3743      return 0;
3744    }
3745    /**
3746     * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3747     */
3748    public DateType getApprovalDateElement() { 
3749      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"approvalDate\"");
3750    }
3751
3752    public boolean hasApprovalDateElement() { 
3753      return false;
3754    }
3755    public boolean hasApprovalDate() {
3756      return false;
3757    }
3758
3759    /**
3760     * @param value {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value
3761     */
3762    public EvidenceReport setApprovalDateElement(DateType value) { 
3763      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"approvalDate\"");
3764    }
3765    public Date getApprovalDate() { 
3766      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"approvalDate\"");
3767    }
3768    /**
3769     * @param value The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.
3770     */
3771    public EvidenceReport setApprovalDate(Date value) { 
3772      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"approvalDate\"");
3773    }
3774    /**
3775     * not supported on this implementation
3776     */
3777    @Override
3778    public int getLastReviewDateMax() { 
3779      return 0;
3780    }
3781    /**
3782     * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3783     */
3784    public DateType getLastReviewDateElement() { 
3785      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"lastReviewDate\"");
3786    }
3787
3788    public boolean hasLastReviewDateElement() { 
3789      return false;
3790    }
3791    public boolean hasLastReviewDate() {
3792      return false;
3793    }
3794
3795    /**
3796     * @param value {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value
3797     */
3798    public EvidenceReport setLastReviewDateElement(DateType value) { 
3799      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"lastReviewDate\"");
3800    }
3801    public Date getLastReviewDate() { 
3802      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"lastReviewDate\"");
3803    }
3804    /**
3805     * @param value The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.
3806     */
3807    public EvidenceReport setLastReviewDate(Date value) { 
3808      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"lastReviewDate\"");
3809    }
3810    /**
3811     * not supported on this implementation
3812     */
3813    @Override
3814    public int getEffectivePeriodMax() { 
3815      return 0;
3816    }
3817    /**
3818     * @return {@link #effectivePeriod} (The period during which the evidence report content was or is planned to be in active use.)
3819     */
3820    public Period getEffectivePeriod() { 
3821      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"effectivePeriod\"");
3822    }
3823    public boolean hasEffectivePeriod() { 
3824      return false;
3825    }
3826    /**
3827     * @param value {@link #effectivePeriod} (The period during which the evidence report content was or is planned to be in active use.)
3828     */
3829    public EvidenceReport setEffectivePeriod(Period value) { 
3830      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"effectivePeriod\"");
3831    }
3832
3833    /**
3834     * not supported on this implementation
3835     */
3836    @Override
3837    public int getTopicMax() { 
3838      return 0;
3839    }
3840    /**
3841     * @return {@link #topic} (Descriptive topics related to the content of the evidence report. Topics provide a high-level categorization of the evidence report that can be useful for filtering and searching.)
3842     */
3843    public List<CodeableConcept> getTopic() { 
3844      return new ArrayList<>();
3845    }
3846    /**
3847     * @return Returns a reference to <code>this</code> for easy method chaining
3848     */
3849    public EvidenceReport setTopic(List<CodeableConcept> theTopic) { 
3850      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"topic\"");
3851    }
3852    public boolean hasTopic() { 
3853      return false;
3854    }
3855
3856    public CodeableConcept addTopic() { //3
3857      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"topic\"");
3858    }
3859    public EvidenceReport addTopic(CodeableConcept t) { //3
3860      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"topic\"");
3861    }
3862    /**
3863     * @return The first repetition of repeating field {@link #topic}, creating it if it does not already exist {2}
3864     */
3865    public CodeableConcept getTopicFirstRep() { 
3866      throw new Error("The resource type \"EvidenceReport\" does not implement the property \"topic\"");
3867    }
3868      protected void listChildren(List<Property> children) {
3869        super.listChildren(children);
3870        children.add(new Property("url", "uri", "An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.", 0, 1, url));
3871        children.add(new Property("status", "code", "The status of this summary. Enables tracking the life-cycle of the content.", 0, 1, status));
3872        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence report instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
3873        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this EvidenceReport when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier));
3874        children.add(new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this EvidenceReport.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier));
3875        children.add(new Property("citeAs[x]", "Reference(Citation)|markdown", "Citation Resource or display of suggested citation for this report.", 0, 1, citeAs));
3876        children.add(new Property("type", "CodeableConcept", "Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression.", 0, 1, type));
3877        children.add(new Property("note", "Annotation", "Used for footnotes and annotations.", 0, java.lang.Integer.MAX_VALUE, note));
3878        children.add(new Property("relatedArtifact", "RelatedArtifact", "Link, description or reference to artifact associated with the report.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact));
3879        children.add(new Property("subject", "", "Specifies the subject or focus of the report. Answers \"What is this report about?\".", 0, 1, subject));
3880        children.add(new Property("publisher", "string", "The name of the organization or individual that published the evidence report.", 0, 1, publisher));
3881        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
3882        children.add(new Property("author", "ContactDetail", "An individiual, organization, or device primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author));
3883        children.add(new Property("editor", "ContactDetail", "An individiual, organization, or device primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor));
3884        children.add(new Property("reviewer", "ContactDetail", "An individiual, organization, or device primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer));
3885        children.add(new Property("endorser", "ContactDetail", "An individiual, organization, or device responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser));
3886        children.add(new Property("relatesTo", "", "Relationships that this composition has with other compositions or documents that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo));
3887        children.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section));
3888      }
3889
3890      @Override
3891      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3892        switch (_hash) {
3893        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this EvidenceReport when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this summary is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the summary is stored on different servers.", 0, 1, url);
3894        case -892481550: /*status*/  return new Property("status", "code", "The status of this summary. Enables tracking the life-cycle of the content.", 0, 1, status);
3895        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence report instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
3896        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this EvidenceReport when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier);
3897        case -1007604940: /*relatedIdentifier*/  return new Property("relatedIdentifier", "Identifier", "A formal identifier that is used to identify things closely related to this EvidenceReport.", 0, java.lang.Integer.MAX_VALUE, relatedIdentifier);
3898        case -1706539017: /*citeAs[x]*/  return new Property("citeAs[x]", "Reference(Citation)|markdown", "Citation Resource or display of suggested citation for this report.", 0, 1, citeAs);
3899        case -1360156695: /*citeAs*/  return new Property("citeAs[x]", "Reference(Citation)|markdown", "Citation Resource or display of suggested citation for this report.", 0, 1, citeAs);
3900        case 1269009762: /*citeAsReference*/  return new Property("citeAs[x]", "Reference(Citation)", "Citation Resource or display of suggested citation for this report.", 0, 1, citeAs);
3901        case 456265720: /*citeAsMarkdown*/  return new Property("citeAs[x]", "markdown", "Citation Resource or display of suggested citation for this report.", 0, 1, citeAs);
3902        case 3575610: /*type*/  return new Property("type", "CodeableConcept", "Specifies the kind of report, such as grouping of classifiers, search results, or human-compiled expression.", 0, 1, type);
3903        case 3387378: /*note*/  return new Property("note", "Annotation", "Used for footnotes and annotations.", 0, java.lang.Integer.MAX_VALUE, note);
3904        case 666807069: /*relatedArtifact*/  return new Property("relatedArtifact", "RelatedArtifact", "Link, description or reference to artifact associated with the report.", 0, java.lang.Integer.MAX_VALUE, relatedArtifact);
3905        case -1867885268: /*subject*/  return new Property("subject", "", "Specifies the subject or focus of the report. Answers \"What is this report about?\".", 0, 1, subject);
3906        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the evidence report.", 0, 1, publisher);
3907        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
3908        case -1406328437: /*author*/  return new Property("author", "ContactDetail", "An individiual, organization, or device primarily involved in the creation and maintenance of the content.", 0, java.lang.Integer.MAX_VALUE, author);
3909        case -1307827859: /*editor*/  return new Property("editor", "ContactDetail", "An individiual, organization, or device primarily responsible for internal coherence of the content.", 0, java.lang.Integer.MAX_VALUE, editor);
3910        case -261190139: /*reviewer*/  return new Property("reviewer", "ContactDetail", "An individiual, organization, or device primarily responsible for review of some aspect of the content.", 0, java.lang.Integer.MAX_VALUE, reviewer);
3911        case 1740277666: /*endorser*/  return new Property("endorser", "ContactDetail", "An individiual, organization, or device responsible for officially endorsing the content for use in some setting.", 0, java.lang.Integer.MAX_VALUE, endorser);
3912        case -7765931: /*relatesTo*/  return new Property("relatesTo", "", "Relationships that this composition has with other compositions or documents that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo);
3913        case 1970241253: /*section*/  return new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section);
3914        default: return super.getNamedProperty(_hash, _name, _checkValid);
3915        }
3916
3917      }
3918
3919      @Override
3920      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3921        switch (hash) {
3922        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
3923        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
3924        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
3925        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
3926        case -1007604940: /*relatedIdentifier*/ return this.relatedIdentifier == null ? new Base[0] : this.relatedIdentifier.toArray(new Base[this.relatedIdentifier.size()]); // Identifier
3927        case -1360156695: /*citeAs*/ return this.citeAs == null ? new Base[0] : new Base[] {this.citeAs}; // DataType
3928        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
3929        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
3930        case 666807069: /*relatedArtifact*/ return this.relatedArtifact == null ? new Base[0] : this.relatedArtifact.toArray(new Base[this.relatedArtifact.size()]); // RelatedArtifact
3931        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // EvidenceReportSubjectComponent
3932        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
3933        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
3934        case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // ContactDetail
3935        case -1307827859: /*editor*/ return this.editor == null ? new Base[0] : this.editor.toArray(new Base[this.editor.size()]); // ContactDetail
3936        case -261190139: /*reviewer*/ return this.reviewer == null ? new Base[0] : this.reviewer.toArray(new Base[this.reviewer.size()]); // ContactDetail
3937        case 1740277666: /*endorser*/ return this.endorser == null ? new Base[0] : this.endorser.toArray(new Base[this.endorser.size()]); // ContactDetail
3938        case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // EvidenceReportRelatesToComponent
3939        case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent
3940        default: return super.getProperty(hash, name, checkValid);
3941        }
3942
3943      }
3944
3945      @Override
3946      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3947        switch (hash) {
3948        case 116079: // url
3949          this.url = TypeConvertor.castToUri(value); // UriType
3950          return value;
3951        case -892481550: // status
3952          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3953          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
3954          return value;
3955        case -669707736: // useContext
3956          this.getUseContext().add(TypeConvertor.castToUsageContext(value)); // UsageContext
3957          return value;
3958        case -1618432855: // identifier
3959          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3960          return value;
3961        case -1007604940: // relatedIdentifier
3962          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
3963          return value;
3964        case -1360156695: // citeAs
3965          this.citeAs = TypeConvertor.castToType(value); // DataType
3966          return value;
3967        case 3575610: // type
3968          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
3969          return value;
3970        case 3387378: // note
3971          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
3972          return value;
3973        case 666807069: // relatedArtifact
3974          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value)); // RelatedArtifact
3975          return value;
3976        case -1867885268: // subject
3977          this.subject = (EvidenceReportSubjectComponent) value; // EvidenceReportSubjectComponent
3978          return value;
3979        case 1447404028: // publisher
3980          this.publisher = TypeConvertor.castToString(value); // StringType
3981          return value;
3982        case 951526432: // contact
3983          this.getContact().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3984          return value;
3985        case -1406328437: // author
3986          this.getAuthor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3987          return value;
3988        case -1307827859: // editor
3989          this.getEditor().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3990          return value;
3991        case -261190139: // reviewer
3992          this.getReviewer().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3993          return value;
3994        case 1740277666: // endorser
3995          this.getEndorser().add(TypeConvertor.castToContactDetail(value)); // ContactDetail
3996          return value;
3997        case -7765931: // relatesTo
3998          this.getRelatesTo().add((EvidenceReportRelatesToComponent) value); // EvidenceReportRelatesToComponent
3999          return value;
4000        case 1970241253: // section
4001          this.getSection().add((SectionComponent) value); // SectionComponent
4002          return value;
4003        default: return super.setProperty(hash, name, value);
4004        }
4005
4006      }
4007
4008      @Override
4009      public Base setProperty(String name, Base value) throws FHIRException {
4010        if (name.equals("url")) {
4011          this.url = TypeConvertor.castToUri(value); // UriType
4012        } else if (name.equals("status")) {
4013          value = new PublicationStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
4014          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
4015        } else if (name.equals("useContext")) {
4016          this.getUseContext().add(TypeConvertor.castToUsageContext(value));
4017        } else if (name.equals("identifier")) {
4018          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
4019        } else if (name.equals("relatedIdentifier")) {
4020          this.getRelatedIdentifier().add(TypeConvertor.castToIdentifier(value));
4021        } else if (name.equals("citeAs[x]")) {
4022          this.citeAs = TypeConvertor.castToType(value); // DataType
4023        } else if (name.equals("type")) {
4024          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
4025        } else if (name.equals("note")) {
4026          this.getNote().add(TypeConvertor.castToAnnotation(value));
4027        } else if (name.equals("relatedArtifact")) {
4028          this.getRelatedArtifact().add(TypeConvertor.castToRelatedArtifact(value));
4029        } else if (name.equals("subject")) {
4030          this.subject = (EvidenceReportSubjectComponent) value; // EvidenceReportSubjectComponent
4031        } else if (name.equals("publisher")) {
4032          this.publisher = TypeConvertor.castToString(value); // StringType
4033        } else if (name.equals("contact")) {
4034          this.getContact().add(TypeConvertor.castToContactDetail(value));
4035        } else if (name.equals("author")) {
4036          this.getAuthor().add(TypeConvertor.castToContactDetail(value));
4037        } else if (name.equals("editor")) {
4038          this.getEditor().add(TypeConvertor.castToContactDetail(value));
4039        } else if (name.equals("reviewer")) {
4040          this.getReviewer().add(TypeConvertor.castToContactDetail(value));
4041        } else if (name.equals("endorser")) {
4042          this.getEndorser().add(TypeConvertor.castToContactDetail(value));
4043        } else if (name.equals("relatesTo")) {
4044          this.getRelatesTo().add((EvidenceReportRelatesToComponent) value);
4045        } else if (name.equals("section")) {
4046          this.getSection().add((SectionComponent) value);
4047        } else
4048          return super.setProperty(name, value);
4049        return value;
4050      }
4051
4052      @Override
4053      public Base makeProperty(int hash, String name) throws FHIRException {
4054        switch (hash) {
4055        case 116079:  return getUrlElement();
4056        case -892481550:  return getStatusElement();
4057        case -669707736:  return addUseContext(); 
4058        case -1618432855:  return addIdentifier(); 
4059        case -1007604940:  return addRelatedIdentifier(); 
4060        case -1706539017:  return getCiteAs();
4061        case -1360156695:  return getCiteAs();
4062        case 3575610:  return getType();
4063        case 3387378:  return addNote(); 
4064        case 666807069:  return addRelatedArtifact(); 
4065        case -1867885268:  return getSubject();
4066        case 1447404028:  return getPublisherElement();
4067        case 951526432:  return addContact(); 
4068        case -1406328437:  return addAuthor(); 
4069        case -1307827859:  return addEditor(); 
4070        case -261190139:  return addReviewer(); 
4071        case 1740277666:  return addEndorser(); 
4072        case -7765931:  return addRelatesTo(); 
4073        case 1970241253:  return addSection(); 
4074        default: return super.makeProperty(hash, name);
4075        }
4076
4077      }
4078
4079      @Override
4080      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4081        switch (hash) {
4082        case 116079: /*url*/ return new String[] {"uri"};
4083        case -892481550: /*status*/ return new String[] {"code"};
4084        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
4085        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
4086        case -1007604940: /*relatedIdentifier*/ return new String[] {"Identifier"};
4087        case -1360156695: /*citeAs*/ return new String[] {"Reference", "markdown"};
4088        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
4089        case 3387378: /*note*/ return new String[] {"Annotation"};
4090        case 666807069: /*relatedArtifact*/ return new String[] {"RelatedArtifact"};
4091        case -1867885268: /*subject*/ return new String[] {};
4092        case 1447404028: /*publisher*/ return new String[] {"string"};
4093        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
4094        case -1406328437: /*author*/ return new String[] {"ContactDetail"};
4095        case -1307827859: /*editor*/ return new String[] {"ContactDetail"};
4096        case -261190139: /*reviewer*/ return new String[] {"ContactDetail"};
4097        case 1740277666: /*endorser*/ return new String[] {"ContactDetail"};
4098        case -7765931: /*relatesTo*/ return new String[] {};
4099        case 1970241253: /*section*/ return new String[] {};
4100        default: return super.getTypesForProperty(hash, name);
4101        }
4102
4103      }
4104
4105      @Override
4106      public Base addChild(String name) throws FHIRException {
4107        if (name.equals("url")) {
4108          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.url");
4109        }
4110        else if (name.equals("status")) {
4111          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.status");
4112        }
4113        else if (name.equals("useContext")) {
4114          return addUseContext();
4115        }
4116        else if (name.equals("identifier")) {
4117          return addIdentifier();
4118        }
4119        else if (name.equals("relatedIdentifier")) {
4120          return addRelatedIdentifier();
4121        }
4122        else if (name.equals("citeAsReference")) {
4123          this.citeAs = new Reference();
4124          return this.citeAs;
4125        }
4126        else if (name.equals("citeAsMarkdown")) {
4127          this.citeAs = new MarkdownType();
4128          return this.citeAs;
4129        }
4130        else if (name.equals("type")) {
4131          this.type = new CodeableConcept();
4132          return this.type;
4133        }
4134        else if (name.equals("note")) {
4135          return addNote();
4136        }
4137        else if (name.equals("relatedArtifact")) {
4138          return addRelatedArtifact();
4139        }
4140        else if (name.equals("subject")) {
4141          this.subject = new EvidenceReportSubjectComponent();
4142          return this.subject;
4143        }
4144        else if (name.equals("publisher")) {
4145          throw new FHIRException("Cannot call addChild on a primitive type EvidenceReport.publisher");
4146        }
4147        else if (name.equals("contact")) {
4148          return addContact();
4149        }
4150        else if (name.equals("author")) {
4151          return addAuthor();
4152        }
4153        else if (name.equals("editor")) {
4154          return addEditor();
4155        }
4156        else if (name.equals("reviewer")) {
4157          return addReviewer();
4158        }
4159        else if (name.equals("endorser")) {
4160          return addEndorser();
4161        }
4162        else if (name.equals("relatesTo")) {
4163          return addRelatesTo();
4164        }
4165        else if (name.equals("section")) {
4166          return addSection();
4167        }
4168        else
4169          return super.addChild(name);
4170      }
4171
4172  public String fhirType() {
4173    return "EvidenceReport";
4174
4175  }
4176
4177      public EvidenceReport copy() {
4178        EvidenceReport dst = new EvidenceReport();
4179        copyValues(dst);
4180        return dst;
4181      }
4182
4183      public void copyValues(EvidenceReport dst) {
4184        super.copyValues(dst);
4185        dst.url = url == null ? null : url.copy();
4186        dst.status = status == null ? null : status.copy();
4187        if (useContext != null) {
4188          dst.useContext = new ArrayList<UsageContext>();
4189          for (UsageContext i : useContext)
4190            dst.useContext.add(i.copy());
4191        };
4192        if (identifier != null) {
4193          dst.identifier = new ArrayList<Identifier>();
4194          for (Identifier i : identifier)
4195            dst.identifier.add(i.copy());
4196        };
4197        if (relatedIdentifier != null) {
4198          dst.relatedIdentifier = new ArrayList<Identifier>();
4199          for (Identifier i : relatedIdentifier)
4200            dst.relatedIdentifier.add(i.copy());
4201        };
4202        dst.citeAs = citeAs == null ? null : citeAs.copy();
4203        dst.type = type == null ? null : type.copy();
4204        if (note != null) {
4205          dst.note = new ArrayList<Annotation>();
4206          for (Annotation i : note)
4207            dst.note.add(i.copy());
4208        };
4209        if (relatedArtifact != null) {
4210          dst.relatedArtifact = new ArrayList<RelatedArtifact>();
4211          for (RelatedArtifact i : relatedArtifact)
4212            dst.relatedArtifact.add(i.copy());
4213        };
4214        dst.subject = subject == null ? null : subject.copy();
4215        dst.publisher = publisher == null ? null : publisher.copy();
4216        if (contact != null) {
4217          dst.contact = new ArrayList<ContactDetail>();
4218          for (ContactDetail i : contact)
4219            dst.contact.add(i.copy());
4220        };
4221        if (author != null) {
4222          dst.author = new ArrayList<ContactDetail>();
4223          for (ContactDetail i : author)
4224            dst.author.add(i.copy());
4225        };
4226        if (editor != null) {
4227          dst.editor = new ArrayList<ContactDetail>();
4228          for (ContactDetail i : editor)
4229            dst.editor.add(i.copy());
4230        };
4231        if (reviewer != null) {
4232          dst.reviewer = new ArrayList<ContactDetail>();
4233          for (ContactDetail i : reviewer)
4234            dst.reviewer.add(i.copy());
4235        };
4236        if (endorser != null) {
4237          dst.endorser = new ArrayList<ContactDetail>();
4238          for (ContactDetail i : endorser)
4239            dst.endorser.add(i.copy());
4240        };
4241        if (relatesTo != null) {
4242          dst.relatesTo = new ArrayList<EvidenceReportRelatesToComponent>();
4243          for (EvidenceReportRelatesToComponent i : relatesTo)
4244            dst.relatesTo.add(i.copy());
4245        };
4246        if (section != null) {
4247          dst.section = new ArrayList<SectionComponent>();
4248          for (SectionComponent i : section)
4249            dst.section.add(i.copy());
4250        };
4251      }
4252
4253      protected EvidenceReport typedCopy() {
4254        return copy();
4255      }
4256
4257      @Override
4258      public boolean equalsDeep(Base other_) {
4259        if (!super.equalsDeep(other_))
4260          return false;
4261        if (!(other_ instanceof EvidenceReport))
4262          return false;
4263        EvidenceReport o = (EvidenceReport) other_;
4264        return compareDeep(url, o.url, true) && compareDeep(status, o.status, true) && compareDeep(useContext, o.useContext, true)
4265           && compareDeep(identifier, o.identifier, true) && compareDeep(relatedIdentifier, o.relatedIdentifier, true)
4266           && compareDeep(citeAs, o.citeAs, true) && compareDeep(type, o.type, true) && compareDeep(note, o.note, true)
4267           && compareDeep(relatedArtifact, o.relatedArtifact, true) && compareDeep(subject, o.subject, true)
4268           && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(author, o.author, true)
4269           && compareDeep(editor, o.editor, true) && compareDeep(reviewer, o.reviewer, true) && compareDeep(endorser, o.endorser, true)
4270           && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(section, o.section, true);
4271      }
4272
4273      @Override
4274      public boolean equalsShallow(Base other_) {
4275        if (!super.equalsShallow(other_))
4276          return false;
4277        if (!(other_ instanceof EvidenceReport))
4278          return false;
4279        EvidenceReport o = (EvidenceReport) other_;
4280        return compareValues(url, o.url, true) && compareValues(status, o.status, true) && compareValues(publisher, o.publisher, true)
4281          ;
4282      }
4283
4284      public boolean isEmpty() {
4285        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, status, useContext
4286          , identifier, relatedIdentifier, citeAs, type, note, relatedArtifact, subject
4287          , publisher, contact, author, editor, reviewer, endorser, relatesTo, section
4288          );
4289      }
4290
4291  @Override
4292  public ResourceType getResourceType() {
4293    return ResourceType.EvidenceReport;
4294   }
4295
4296 /**
4297   * Search parameter: <b>context-quantity</b>
4298   * <p>
4299   * Description: <b>A quantity- or range-valued use context assigned to the evidence report</b><br>
4300   * Type: <b>quantity</b><br>
4301   * Path: <b>(EvidenceReport.useContext.value as Quantity) | (EvidenceReport.useContext.value as Range)</b><br>
4302   * </p>
4303   */
4304  @SearchParamDefinition(name="context-quantity", path="(EvidenceReport.useContext.value as Quantity) | (EvidenceReport.useContext.value as Range)", description="A quantity- or range-valued use context assigned to the evidence report", type="quantity" )
4305  public static final String SP_CONTEXT_QUANTITY = "context-quantity";
4306 /**
4307   * <b>Fluent Client</b> search parameter constant for <b>context-quantity</b>
4308   * <p>
4309   * Description: <b>A quantity- or range-valued use context assigned to the evidence report</b><br>
4310   * Type: <b>quantity</b><br>
4311   * Path: <b>(EvidenceReport.useContext.value as Quantity) | (EvidenceReport.useContext.value as Range)</b><br>
4312   * </p>
4313   */
4314  public static final ca.uhn.fhir.rest.gclient.QuantityClientParam CONTEXT_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_CONTEXT_QUANTITY);
4315
4316 /**
4317   * Search parameter: <b>context-type-quantity</b>
4318   * <p>
4319   * Description: <b>A use context type and quantity- or range-based value assigned to the evidence report</b><br>
4320   * Type: <b>composite</b><br>
4321   * Path: <b>EvidenceReport.useContext</b><br>
4322   * </p>
4323   */
4324  @SearchParamDefinition(name="context-type-quantity", path="EvidenceReport.useContext", description="A use context type and quantity- or range-based value assigned to the evidence report", type="composite", compositeOf={"context-type", "context-quantity"} )
4325  public static final String SP_CONTEXT_TYPE_QUANTITY = "context-type-quantity";
4326 /**
4327   * <b>Fluent Client</b> search parameter constant for <b>context-type-quantity</b>
4328   * <p>
4329   * Description: <b>A use context type and quantity- or range-based value assigned to the evidence report</b><br>
4330   * Type: <b>composite</b><br>
4331   * Path: <b>EvidenceReport.useContext</b><br>
4332   * </p>
4333   */
4334  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam> CONTEXT_TYPE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.QuantityClientParam>(SP_CONTEXT_TYPE_QUANTITY);
4335
4336 /**
4337   * Search parameter: <b>context-type-value</b>
4338   * <p>
4339   * Description: <b>A use context type and value assigned to the evidence report</b><br>
4340   * Type: <b>composite</b><br>
4341   * Path: <b>EvidenceReport.useContext</b><br>
4342   * </p>
4343   */
4344  @SearchParamDefinition(name="context-type-value", path="EvidenceReport.useContext", description="A use context type and value assigned to the evidence report", type="composite", compositeOf={"context-type", "context"} )
4345  public static final String SP_CONTEXT_TYPE_VALUE = "context-type-value";
4346 /**
4347   * <b>Fluent Client</b> search parameter constant for <b>context-type-value</b>
4348   * <p>
4349   * Description: <b>A use context type and value assigned to the evidence report</b><br>
4350   * Type: <b>composite</b><br>
4351   * Path: <b>EvidenceReport.useContext</b><br>
4352   * </p>
4353   */
4354  public static final ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam> CONTEXT_TYPE_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam<ca.uhn.fhir.rest.gclient.TokenClientParam, ca.uhn.fhir.rest.gclient.TokenClientParam>(SP_CONTEXT_TYPE_VALUE);
4355
4356 /**
4357   * Search parameter: <b>context-type</b>
4358   * <p>
4359   * Description: <b>A type of use context assigned to the evidence report</b><br>
4360   * Type: <b>token</b><br>
4361   * Path: <b>EvidenceReport.useContext.code</b><br>
4362   * </p>
4363   */
4364  @SearchParamDefinition(name="context-type", path="EvidenceReport.useContext.code", description="A type of use context assigned to the evidence report", type="token" )
4365  public static final String SP_CONTEXT_TYPE = "context-type";
4366 /**
4367   * <b>Fluent Client</b> search parameter constant for <b>context-type</b>
4368   * <p>
4369   * Description: <b>A type of use context assigned to the evidence report</b><br>
4370   * Type: <b>token</b><br>
4371   * Path: <b>EvidenceReport.useContext.code</b><br>
4372   * </p>
4373   */
4374  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE);
4375
4376 /**
4377   * Search parameter: <b>context</b>
4378   * <p>
4379   * Description: <b>A use context assigned to the evidence report</b><br>
4380   * Type: <b>token</b><br>
4381   * Path: <b>(EvidenceReport.useContext.value as CodeableConcept)</b><br>
4382   * </p>
4383   */
4384  @SearchParamDefinition(name="context", path="(EvidenceReport.useContext.value as CodeableConcept)", description="A use context assigned to the evidence report", type="token" )
4385  public static final String SP_CONTEXT = "context";
4386 /**
4387   * <b>Fluent Client</b> search parameter constant for <b>context</b>
4388   * <p>
4389   * Description: <b>A use context assigned to the evidence report</b><br>
4390   * Type: <b>token</b><br>
4391   * Path: <b>(EvidenceReport.useContext.value as CodeableConcept)</b><br>
4392   * </p>
4393   */
4394  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT);
4395
4396 /**
4397   * Search parameter: <b>identifier</b>
4398   * <p>
4399   * Description: <b>External identifier for the evidence report</b><br>
4400   * Type: <b>token</b><br>
4401   * Path: <b>EvidenceReport.identifier</b><br>
4402   * </p>
4403   */
4404  @SearchParamDefinition(name="identifier", path="EvidenceReport.identifier", description="External identifier for the evidence report", type="token" )
4405  public static final String SP_IDENTIFIER = "identifier";
4406 /**
4407   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4408   * <p>
4409   * Description: <b>External identifier for the evidence report</b><br>
4410   * Type: <b>token</b><br>
4411   * Path: <b>EvidenceReport.identifier</b><br>
4412   * </p>
4413   */
4414  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4415
4416 /**
4417   * Search parameter: <b>publisher</b>
4418   * <p>
4419   * Description: <b>Name of the publisher of the evidence report</b><br>
4420   * Type: <b>string</b><br>
4421   * Path: <b>EvidenceReport.publisher</b><br>
4422   * </p>
4423   */
4424  @SearchParamDefinition(name="publisher", path="EvidenceReport.publisher", description="Name of the publisher of the evidence report", type="string" )
4425  public static final String SP_PUBLISHER = "publisher";
4426 /**
4427   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
4428   * <p>
4429   * Description: <b>Name of the publisher of the evidence report</b><br>
4430   * Type: <b>string</b><br>
4431   * Path: <b>EvidenceReport.publisher</b><br>
4432   * </p>
4433   */
4434  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
4435
4436 /**
4437   * Search parameter: <b>status</b>
4438   * <p>
4439   * Description: <b>The current status of the evidence report</b><br>
4440   * Type: <b>token</b><br>
4441   * Path: <b>EvidenceReport.status</b><br>
4442   * </p>
4443   */
4444  @SearchParamDefinition(name="status", path="EvidenceReport.status", description="The current status of the evidence report", type="token" )
4445  public static final String SP_STATUS = "status";
4446 /**
4447   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4448   * <p>
4449   * Description: <b>The current status of the evidence report</b><br>
4450   * Type: <b>token</b><br>
4451   * Path: <b>EvidenceReport.status</b><br>
4452   * </p>
4453   */
4454  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4455
4456 /**
4457   * Search parameter: <b>url</b>
4458   * <p>
4459   * Description: <b>The uri that identifies the evidence report</b><br>
4460   * Type: <b>uri</b><br>
4461   * Path: <b>EvidenceReport.url</b><br>
4462   * </p>
4463   */
4464  @SearchParamDefinition(name="url", path="EvidenceReport.url", description="The uri that identifies the evidence report", type="uri" )
4465  public static final String SP_URL = "url";
4466 /**
4467   * <b>Fluent Client</b> search parameter constant for <b>url</b>
4468   * <p>
4469   * Description: <b>The uri that identifies the evidence report</b><br>
4470   * Type: <b>uri</b><br>
4471   * Path: <b>EvidenceReport.url</b><br>
4472   * </p>
4473   */
4474  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
4475
4476
4477}
4478