001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import org.hl7.fhir.utilities.Utilities;
040import ca.uhn.fhir.model.api.annotation.ResourceDef;
041import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
042import ca.uhn.fhir.model.api.annotation.Child;
043import ca.uhn.fhir.model.api.annotation.ChildOrder;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.Block;
046import org.hl7.fhir.instance.model.api.*;
047import org.hl7.fhir.exceptions.FHIRException;
048/**
049 * The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.
050 */
051@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/StructureDefinition/DiagnosticReport")
052public class DiagnosticReport extends DomainResource {
053
054    public enum DiagnosticReportStatus {
055        /**
056         * The existence of the report is registered, but there is nothing yet available.
057         */
058        REGISTERED, 
059        /**
060         * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.
061         */
062        PARTIAL, 
063        /**
064         * Verified early results are available, but not all  results are final.
065         */
066        PRELIMINARY, 
067        /**
068         * The report is complete and verified by an authorized person.
069         */
070        FINAL, 
071        /**
072         * Subsequent to being final, the report has been modified.  This includes any change in the results, diagnosis, narrative text, or other content of a report that has been issued.
073         */
074        AMENDED, 
075        /**
076         * Subsequent to being final, the report has been modified  to correct an error in the report or referenced results.
077         */
078        CORRECTED, 
079        /**
080         * Subsequent to being final, the report has been modified by adding new content. The existing content is unchanged.
081         */
082        APPENDED, 
083        /**
084         * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
085         */
086        CANCELLED, 
087        /**
088         * The report has been withdrawn following a previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".).
089         */
090        ENTEREDINERROR, 
091        /**
092         * The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for "other" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.
093         */
094        UNKNOWN, 
095        /**
096         * added to help the parsers with the generic types
097         */
098        NULL;
099        public static DiagnosticReportStatus fromCode(String codeString) throws FHIRException {
100            if (codeString == null || "".equals(codeString))
101                return null;
102        if ("registered".equals(codeString))
103          return REGISTERED;
104        if ("partial".equals(codeString))
105          return PARTIAL;
106        if ("preliminary".equals(codeString))
107          return PRELIMINARY;
108        if ("final".equals(codeString))
109          return FINAL;
110        if ("amended".equals(codeString))
111          return AMENDED;
112        if ("corrected".equals(codeString))
113          return CORRECTED;
114        if ("appended".equals(codeString))
115          return APPENDED;
116        if ("cancelled".equals(codeString))
117          return CANCELLED;
118        if ("entered-in-error".equals(codeString))
119          return ENTEREDINERROR;
120        if ("unknown".equals(codeString))
121          return UNKNOWN;
122        if (Configuration.isAcceptInvalidEnums())
123          return null;
124        else
125          throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
126        }
127        public String toCode() {
128          switch (this) {
129            case REGISTERED: return "registered";
130            case PARTIAL: return "partial";
131            case PRELIMINARY: return "preliminary";
132            case FINAL: return "final";
133            case AMENDED: return "amended";
134            case CORRECTED: return "corrected";
135            case APPENDED: return "appended";
136            case CANCELLED: return "cancelled";
137            case ENTEREDINERROR: return "entered-in-error";
138            case UNKNOWN: return "unknown";
139            case NULL: return null;
140            default: return "?";
141          }
142        }
143        public String getSystem() {
144          switch (this) {
145            case REGISTERED: return "http://hl7.org/fhir/diagnostic-report-status";
146            case PARTIAL: return "http://hl7.org/fhir/diagnostic-report-status";
147            case PRELIMINARY: return "http://hl7.org/fhir/diagnostic-report-status";
148            case FINAL: return "http://hl7.org/fhir/diagnostic-report-status";
149            case AMENDED: return "http://hl7.org/fhir/diagnostic-report-status";
150            case CORRECTED: return "http://hl7.org/fhir/diagnostic-report-status";
151            case APPENDED: return "http://hl7.org/fhir/diagnostic-report-status";
152            case CANCELLED: return "http://hl7.org/fhir/diagnostic-report-status";
153            case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-report-status";
154            case UNKNOWN: return "http://hl7.org/fhir/diagnostic-report-status";
155            case NULL: return null;
156            default: return "?";
157          }
158        }
159        public String getDefinition() {
160          switch (this) {
161            case REGISTERED: return "The existence of the report is registered, but there is nothing yet available.";
162            case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.";
163            case PRELIMINARY: return "Verified early results are available, but not all  results are final.";
164            case FINAL: return "The report is complete and verified by an authorized person.";
165            case AMENDED: return "Subsequent to being final, the report has been modified.  This includes any change in the results, diagnosis, narrative text, or other content of a report that has been issued.";
166            case CORRECTED: return "Subsequent to being final, the report has been modified  to correct an error in the report or referenced results.";
167            case APPENDED: return "Subsequent to being final, the report has been modified by adding new content. The existing content is unchanged.";
168            case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
169            case ENTEREDINERROR: return "The report has been withdrawn following a previous final release.  This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".).";
170            case UNKNOWN: return "The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which.";
171            case NULL: return null;
172            default: return "?";
173          }
174        }
175        public String getDisplay() {
176          switch (this) {
177            case REGISTERED: return "Registered";
178            case PARTIAL: return "Partial";
179            case PRELIMINARY: return "Preliminary";
180            case FINAL: return "Final";
181            case AMENDED: return "Amended";
182            case CORRECTED: return "Corrected";
183            case APPENDED: return "Appended";
184            case CANCELLED: return "Cancelled";
185            case ENTEREDINERROR: return "Entered in Error";
186            case UNKNOWN: return "Unknown";
187            case NULL: return null;
188            default: return "?";
189          }
190        }
191    }
192
193  public static class DiagnosticReportStatusEnumFactory implements EnumFactory<DiagnosticReportStatus> {
194    public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException {
195      if (codeString == null || "".equals(codeString))
196            if (codeString == null || "".equals(codeString))
197                return null;
198        if ("registered".equals(codeString))
199          return DiagnosticReportStatus.REGISTERED;
200        if ("partial".equals(codeString))
201          return DiagnosticReportStatus.PARTIAL;
202        if ("preliminary".equals(codeString))
203          return DiagnosticReportStatus.PRELIMINARY;
204        if ("final".equals(codeString))
205          return DiagnosticReportStatus.FINAL;
206        if ("amended".equals(codeString))
207          return DiagnosticReportStatus.AMENDED;
208        if ("corrected".equals(codeString))
209          return DiagnosticReportStatus.CORRECTED;
210        if ("appended".equals(codeString))
211          return DiagnosticReportStatus.APPENDED;
212        if ("cancelled".equals(codeString))
213          return DiagnosticReportStatus.CANCELLED;
214        if ("entered-in-error".equals(codeString))
215          return DiagnosticReportStatus.ENTEREDINERROR;
216        if ("unknown".equals(codeString))
217          return DiagnosticReportStatus.UNKNOWN;
218        throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'");
219        }
220        public Enumeration<DiagnosticReportStatus> fromType(Base code) throws FHIRException {
221          if (code == null)
222            return null;
223          if (code.isEmpty())
224            return new Enumeration<DiagnosticReportStatus>(this);
225          String codeString = ((PrimitiveType) code).asStringValue();
226          if (codeString == null || "".equals(codeString))
227            return null;
228        if ("registered".equals(codeString))
229          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.REGISTERED);
230        if ("partial".equals(codeString))
231          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PARTIAL);
232        if ("preliminary".equals(codeString))
233          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PRELIMINARY);
234        if ("final".equals(codeString))
235          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.FINAL);
236        if ("amended".equals(codeString))
237          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.AMENDED);
238        if ("corrected".equals(codeString))
239          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CORRECTED);
240        if ("appended".equals(codeString))
241          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.APPENDED);
242        if ("cancelled".equals(codeString))
243          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CANCELLED);
244        if ("entered-in-error".equals(codeString))
245          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.ENTEREDINERROR);
246        if ("unknown".equals(codeString))
247          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.UNKNOWN);
248        throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
249        }
250    public String toCode(DiagnosticReportStatus code) {
251      if (code == DiagnosticReportStatus.REGISTERED)
252        return "registered";
253      if (code == DiagnosticReportStatus.PARTIAL)
254        return "partial";
255      if (code == DiagnosticReportStatus.PRELIMINARY)
256        return "preliminary";
257      if (code == DiagnosticReportStatus.FINAL)
258        return "final";
259      if (code == DiagnosticReportStatus.AMENDED)
260        return "amended";
261      if (code == DiagnosticReportStatus.CORRECTED)
262        return "corrected";
263      if (code == DiagnosticReportStatus.APPENDED)
264        return "appended";
265      if (code == DiagnosticReportStatus.CANCELLED)
266        return "cancelled";
267      if (code == DiagnosticReportStatus.ENTEREDINERROR)
268        return "entered-in-error";
269      if (code == DiagnosticReportStatus.UNKNOWN)
270        return "unknown";
271      return "?";
272      }
273    public String toSystem(DiagnosticReportStatus code) {
274      return code.getSystem();
275      }
276    }
277
278    @Block()
279    public static class DiagnosticReportMediaComponent extends BackboneElement implements IBaseBackboneElement {
280        /**
281         * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.
282         */
283        @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
284        @Description(shortDefinition="Comment about the image (e.g. explanation)", formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features." )
285        protected StringType comment;
286
287        /**
288         * Reference to the image source.
289         */
290        @Child(name = "link", type = {Media.class}, order=2, min=1, max=1, modifier=false, summary=true)
291        @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." )
292        protected Reference link;
293
294        /**
295         * The actual object that is the target of the reference (Reference to the image source.)
296         */
297        protected Media linkTarget;
298
299        private static final long serialVersionUID = 935791940L;
300
301    /**
302     * Constructor
303     */
304      public DiagnosticReportMediaComponent() {
305        super();
306      }
307
308    /**
309     * Constructor
310     */
311      public DiagnosticReportMediaComponent(Reference link) {
312        super();
313        this.link = link;
314      }
315
316        /**
317         * @return {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
318         */
319        public StringType getCommentElement() { 
320          if (this.comment == null)
321            if (Configuration.errorOnAutoCreate())
322              throw new Error("Attempt to auto-create DiagnosticReportMediaComponent.comment");
323            else if (Configuration.doAutoCreate())
324              this.comment = new StringType(); // bb
325          return this.comment;
326        }
327
328        public boolean hasCommentElement() { 
329          return this.comment != null && !this.comment.isEmpty();
330        }
331
332        public boolean hasComment() { 
333          return this.comment != null && !this.comment.isEmpty();
334        }
335
336        /**
337         * @param value {@link #comment} (A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value
338         */
339        public DiagnosticReportMediaComponent setCommentElement(StringType value) { 
340          this.comment = value;
341          return this;
342        }
343
344        /**
345         * @return A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.
346         */
347        public String getComment() { 
348          return this.comment == null ? null : this.comment.getValue();
349        }
350
351        /**
352         * @param value A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.
353         */
354        public DiagnosticReportMediaComponent setComment(String value) { 
355          if (Utilities.noString(value))
356            this.comment = null;
357          else {
358            if (this.comment == null)
359              this.comment = new StringType();
360            this.comment.setValue(value);
361          }
362          return this;
363        }
364
365        /**
366         * @return {@link #link} (Reference to the image source.)
367         */
368        public Reference getLink() { 
369          if (this.link == null)
370            if (Configuration.errorOnAutoCreate())
371              throw new Error("Attempt to auto-create DiagnosticReportMediaComponent.link");
372            else if (Configuration.doAutoCreate())
373              this.link = new Reference(); // cc
374          return this.link;
375        }
376
377        public boolean hasLink() { 
378          return this.link != null && !this.link.isEmpty();
379        }
380
381        /**
382         * @param value {@link #link} (Reference to the image source.)
383         */
384        public DiagnosticReportMediaComponent setLink(Reference value) { 
385          this.link = value;
386          return this;
387        }
388
389        /**
390         * @return {@link #link} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the image source.)
391         */
392        public Media getLinkTarget() { 
393          if (this.linkTarget == null)
394            if (Configuration.errorOnAutoCreate())
395              throw new Error("Attempt to auto-create DiagnosticReportMediaComponent.link");
396            else if (Configuration.doAutoCreate())
397              this.linkTarget = new Media(); // aa
398          return this.linkTarget;
399        }
400
401        /**
402         * @param value {@link #link} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the image source.)
403         */
404        public DiagnosticReportMediaComponent setLinkTarget(Media value) { 
405          this.linkTarget = value;
406          return this;
407        }
408
409        protected void listChildren(List<Property> children) {
410          super.listChildren(children);
411          children.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, 1, comment));
412          children.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, 1, link));
413        }
414
415        @Override
416        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
417          switch (_hash) {
418          case 950398559: /*comment*/  return new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, 1, comment);
419          case 3321850: /*link*/  return new Property("link", "Reference(Media)", "Reference to the image source.", 0, 1, link);
420          default: return super.getNamedProperty(_hash, _name, _checkValid);
421          }
422
423        }
424
425      @Override
426      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
427        switch (hash) {
428        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
429        case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference
430        default: return super.getProperty(hash, name, checkValid);
431        }
432
433      }
434
435      @Override
436      public Base setProperty(int hash, String name, Base value) throws FHIRException {
437        switch (hash) {
438        case 950398559: // comment
439          this.comment = castToString(value); // StringType
440          return value;
441        case 3321850: // link
442          this.link = castToReference(value); // Reference
443          return value;
444        default: return super.setProperty(hash, name, value);
445        }
446
447      }
448
449      @Override
450      public Base setProperty(String name, Base value) throws FHIRException {
451        if (name.equals("comment")) {
452          this.comment = castToString(value); // StringType
453        } else if (name.equals("link")) {
454          this.link = castToReference(value); // Reference
455        } else
456          return super.setProperty(name, value);
457        return value;
458      }
459
460      @Override
461      public Base makeProperty(int hash, String name) throws FHIRException {
462        switch (hash) {
463        case 950398559:  return getCommentElement();
464        case 3321850:  return getLink(); 
465        default: return super.makeProperty(hash, name);
466        }
467
468      }
469
470      @Override
471      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
472        switch (hash) {
473        case 950398559: /*comment*/ return new String[] {"string"};
474        case 3321850: /*link*/ return new String[] {"Reference"};
475        default: return super.getTypesForProperty(hash, name);
476        }
477
478      }
479
480      @Override
481      public Base addChild(String name) throws FHIRException {
482        if (name.equals("comment")) {
483          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.comment");
484        }
485        else if (name.equals("link")) {
486          this.link = new Reference();
487          return this.link;
488        }
489        else
490          return super.addChild(name);
491      }
492
493      public DiagnosticReportMediaComponent copy() {
494        DiagnosticReportMediaComponent dst = new DiagnosticReportMediaComponent();
495        copyValues(dst);
496        return dst;
497      }
498
499      public void copyValues(DiagnosticReportMediaComponent dst) {
500        super.copyValues(dst);
501        dst.comment = comment == null ? null : comment.copy();
502        dst.link = link == null ? null : link.copy();
503      }
504
505      @Override
506      public boolean equalsDeep(Base other_) {
507        if (!super.equalsDeep(other_))
508          return false;
509        if (!(other_ instanceof DiagnosticReportMediaComponent))
510          return false;
511        DiagnosticReportMediaComponent o = (DiagnosticReportMediaComponent) other_;
512        return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true);
513      }
514
515      @Override
516      public boolean equalsShallow(Base other_) {
517        if (!super.equalsShallow(other_))
518          return false;
519        if (!(other_ instanceof DiagnosticReportMediaComponent))
520          return false;
521        DiagnosticReportMediaComponent o = (DiagnosticReportMediaComponent) other_;
522        return compareValues(comment, o.comment, true);
523      }
524
525      public boolean isEmpty() {
526        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(comment, link);
527      }
528
529  public String fhirType() {
530    return "DiagnosticReport.media";
531
532  }
533
534  }
535
536    /**
537     * Identifiers assigned to this report by the performer or other systems.
538     */
539    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
540    @Description(shortDefinition="Business identifier for report", formalDefinition="Identifiers assigned to this report by the performer or other systems." )
541    protected List<Identifier> identifier;
542
543    /**
544     * Details concerning a service requested.
545     */
546    @Child(name = "basedOn", type = {CarePlan.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, ServiceRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
547    @Description(shortDefinition="What was requested", formalDefinition="Details concerning a service requested." )
548    protected List<Reference> basedOn;
549    /**
550     * The actual objects that are the target of the reference (Details concerning a service requested.)
551     */
552    protected List<Resource> basedOnTarget;
553
554
555    /**
556     * The status of the diagnostic report.
557     */
558    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
559    @Description(shortDefinition="registered | partial | preliminary | final +", formalDefinition="The status of the diagnostic report." )
560    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-report-status")
561    protected Enumeration<DiagnosticReportStatus> status;
562
563    /**
564     * A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.
565     */
566    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
567    @Description(shortDefinition="Service category", formalDefinition="A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes." )
568    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-service-sections")
569    protected List<CodeableConcept> category;
570
571    /**
572     * A code or name that describes this diagnostic report.
573     */
574    @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true)
575    @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." )
576    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-codes")
577    protected CodeableConcept code;
578
579    /**
580     * The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.
581     */
582    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true)
583    @Description(shortDefinition="The subject of the report - usually, but not always, the patient", formalDefinition="The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources." )
584    protected Reference subject;
585
586    /**
587     * The actual object that is the target of the reference (The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.)
588     */
589    protected Resource subjectTarget;
590
591    /**
592     * The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.
593     */
594    @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=true)
595    @Description(shortDefinition="Health care event when test ordered", formalDefinition="The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about." )
596    protected Reference encounter;
597
598    /**
599     * The actual object that is the target of the reference (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
600     */
601    protected Encounter encounterTarget;
602
603    /**
604     * The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.
605     */
606    @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
607    @Description(shortDefinition="Clinically relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself." )
608    protected Type effective;
609
610    /**
611     * The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.
612     */
613    @Child(name = "issued", type = {InstantType.class}, order=8, min=0, max=1, modifier=false, summary=true)
614    @Description(shortDefinition="DateTime this version was made", formalDefinition="The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified." )
615    protected InstantType issued;
616
617    /**
618     * The diagnostic service that is responsible for issuing the report.
619     */
620    @Child(name = "performer", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
621    @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." )
622    protected List<Reference> performer;
623    /**
624     * The actual objects that are the target of the reference (The diagnostic service that is responsible for issuing the report.)
625     */
626    protected List<Resource> performerTarget;
627
628
629    /**
630     * The practitioner or organization that is responsible for the report's conclusions and interpretations.
631     */
632    @Child(name = "resultsInterpreter", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
633    @Description(shortDefinition="Primary result interpreter", formalDefinition="The practitioner or organization that is responsible for the report's conclusions and interpretations." )
634    protected List<Reference> resultsInterpreter;
635    /**
636     * The actual objects that are the target of the reference (The practitioner or organization that is responsible for the report's conclusions and interpretations.)
637     */
638    protected List<Resource> resultsInterpreterTarget;
639
640
641    /**
642     * Details about the specimens on which this diagnostic report is based.
643     */
644    @Child(name = "specimen", type = {Specimen.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
645    @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." )
646    protected List<Reference> specimen;
647    /**
648     * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.)
649     */
650    protected List<Specimen> specimenTarget;
651
652
653    /**
654     * [Observations](observation.html)  that are part of this diagnostic report.
655     */
656    @Child(name = "result", type = {Observation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
657    @Description(shortDefinition="Observations", formalDefinition="[Observations](observation.html)  that are part of this diagnostic report." )
658    protected List<Reference> result;
659    /**
660     * The actual objects that are the target of the reference ([Observations](observation.html)  that are part of this diagnostic report.)
661     */
662    protected List<Observation> resultTarget;
663
664
665    /**
666     * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.
667     */
668    @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
669    @Description(shortDefinition="Reference to full details of imaging associated with the diagnostic report", formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images." )
670    protected List<Reference> imagingStudy;
671    /**
672     * The actual objects that are the target of the reference (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.)
673     */
674    protected List<ImagingStudy> imagingStudyTarget;
675
676
677    /**
678     * A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).
679     */
680    @Child(name = "media", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
681    @Description(shortDefinition="Key images associated with this report", formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)." )
682    protected List<DiagnosticReportMediaComponent> media;
683
684    /**
685     * Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
686     */
687    @Child(name = "conclusion", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false)
688    @Description(shortDefinition="Clinical conclusion (interpretation) of test results", formalDefinition="Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report." )
689    protected StringType conclusion;
690
691    /**
692     * One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.
693     */
694    @Child(name = "conclusionCode", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
695    @Description(shortDefinition="Codes for the clinical conclusion of test results", formalDefinition="One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report." )
696    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
697    protected List<CodeableConcept> conclusionCode;
698
699    /**
700     * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
701     */
702    @Child(name = "presentedForm", type = {Attachment.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
703    @Description(shortDefinition="Entire report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." )
704    protected List<Attachment> presentedForm;
705
706    private static final long serialVersionUID = 589102296L;
707
708  /**
709   * Constructor
710   */
711    public DiagnosticReport() {
712      super();
713    }
714
715  /**
716   * Constructor
717   */
718    public DiagnosticReport(Enumeration<DiagnosticReportStatus> status, CodeableConcept code) {
719      super();
720      this.status = status;
721      this.code = code;
722    }
723
724    /**
725     * @return {@link #identifier} (Identifiers assigned to this report by the performer or other systems.)
726     */
727    public List<Identifier> getIdentifier() { 
728      if (this.identifier == null)
729        this.identifier = new ArrayList<Identifier>();
730      return this.identifier;
731    }
732
733    /**
734     * @return Returns a reference to <code>this</code> for easy method chaining
735     */
736    public DiagnosticReport setIdentifier(List<Identifier> theIdentifier) { 
737      this.identifier = theIdentifier;
738      return this;
739    }
740
741    public boolean hasIdentifier() { 
742      if (this.identifier == null)
743        return false;
744      for (Identifier item : this.identifier)
745        if (!item.isEmpty())
746          return true;
747      return false;
748    }
749
750    public Identifier addIdentifier() { //3
751      Identifier t = new Identifier();
752      if (this.identifier == null)
753        this.identifier = new ArrayList<Identifier>();
754      this.identifier.add(t);
755      return t;
756    }
757
758    public DiagnosticReport addIdentifier(Identifier t) { //3
759      if (t == null)
760        return this;
761      if (this.identifier == null)
762        this.identifier = new ArrayList<Identifier>();
763      this.identifier.add(t);
764      return this;
765    }
766
767    /**
768     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
769     */
770    public Identifier getIdentifierFirstRep() { 
771      if (getIdentifier().isEmpty()) {
772        addIdentifier();
773      }
774      return getIdentifier().get(0);
775    }
776
777    /**
778     * @return {@link #basedOn} (Details concerning a service requested.)
779     */
780    public List<Reference> getBasedOn() { 
781      if (this.basedOn == null)
782        this.basedOn = new ArrayList<Reference>();
783      return this.basedOn;
784    }
785
786    /**
787     * @return Returns a reference to <code>this</code> for easy method chaining
788     */
789    public DiagnosticReport setBasedOn(List<Reference> theBasedOn) { 
790      this.basedOn = theBasedOn;
791      return this;
792    }
793
794    public boolean hasBasedOn() { 
795      if (this.basedOn == null)
796        return false;
797      for (Reference item : this.basedOn)
798        if (!item.isEmpty())
799          return true;
800      return false;
801    }
802
803    public Reference addBasedOn() { //3
804      Reference t = new Reference();
805      if (this.basedOn == null)
806        this.basedOn = new ArrayList<Reference>();
807      this.basedOn.add(t);
808      return t;
809    }
810
811    public DiagnosticReport addBasedOn(Reference t) { //3
812      if (t == null)
813        return this;
814      if (this.basedOn == null)
815        this.basedOn = new ArrayList<Reference>();
816      this.basedOn.add(t);
817      return this;
818    }
819
820    /**
821     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
822     */
823    public Reference getBasedOnFirstRep() { 
824      if (getBasedOn().isEmpty()) {
825        addBasedOn();
826      }
827      return getBasedOn().get(0);
828    }
829
830    /**
831     * @deprecated Use Reference#setResource(IBaseResource) instead
832     */
833    @Deprecated
834    public List<Resource> getBasedOnTarget() { 
835      if (this.basedOnTarget == null)
836        this.basedOnTarget = new ArrayList<Resource>();
837      return this.basedOnTarget;
838    }
839
840    /**
841     * @return {@link #status} (The status of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
842     */
843    public Enumeration<DiagnosticReportStatus> getStatusElement() { 
844      if (this.status == null)
845        if (Configuration.errorOnAutoCreate())
846          throw new Error("Attempt to auto-create DiagnosticReport.status");
847        else if (Configuration.doAutoCreate())
848          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory()); // bb
849      return this.status;
850    }
851
852    public boolean hasStatusElement() { 
853      return this.status != null && !this.status.isEmpty();
854    }
855
856    public boolean hasStatus() { 
857      return this.status != null && !this.status.isEmpty();
858    }
859
860    /**
861     * @param value {@link #status} (The status of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
862     */
863    public DiagnosticReport setStatusElement(Enumeration<DiagnosticReportStatus> value) { 
864      this.status = value;
865      return this;
866    }
867
868    /**
869     * @return The status of the diagnostic report.
870     */
871    public DiagnosticReportStatus getStatus() { 
872      return this.status == null ? null : this.status.getValue();
873    }
874
875    /**
876     * @param value The status of the diagnostic report.
877     */
878    public DiagnosticReport setStatus(DiagnosticReportStatus value) { 
879        if (this.status == null)
880          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory());
881        this.status.setValue(value);
882      return this;
883    }
884
885    /**
886     * @return {@link #category} (A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.)
887     */
888    public List<CodeableConcept> getCategory() { 
889      if (this.category == null)
890        this.category = new ArrayList<CodeableConcept>();
891      return this.category;
892    }
893
894    /**
895     * @return Returns a reference to <code>this</code> for easy method chaining
896     */
897    public DiagnosticReport setCategory(List<CodeableConcept> theCategory) { 
898      this.category = theCategory;
899      return this;
900    }
901
902    public boolean hasCategory() { 
903      if (this.category == null)
904        return false;
905      for (CodeableConcept item : this.category)
906        if (!item.isEmpty())
907          return true;
908      return false;
909    }
910
911    public CodeableConcept addCategory() { //3
912      CodeableConcept t = new CodeableConcept();
913      if (this.category == null)
914        this.category = new ArrayList<CodeableConcept>();
915      this.category.add(t);
916      return t;
917    }
918
919    public DiagnosticReport addCategory(CodeableConcept t) { //3
920      if (t == null)
921        return this;
922      if (this.category == null)
923        this.category = new ArrayList<CodeableConcept>();
924      this.category.add(t);
925      return this;
926    }
927
928    /**
929     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist
930     */
931    public CodeableConcept getCategoryFirstRep() { 
932      if (getCategory().isEmpty()) {
933        addCategory();
934      }
935      return getCategory().get(0);
936    }
937
938    /**
939     * @return {@link #code} (A code or name that describes this diagnostic report.)
940     */
941    public CodeableConcept getCode() { 
942      if (this.code == null)
943        if (Configuration.errorOnAutoCreate())
944          throw new Error("Attempt to auto-create DiagnosticReport.code");
945        else if (Configuration.doAutoCreate())
946          this.code = new CodeableConcept(); // cc
947      return this.code;
948    }
949
950    public boolean hasCode() { 
951      return this.code != null && !this.code.isEmpty();
952    }
953
954    /**
955     * @param value {@link #code} (A code or name that describes this diagnostic report.)
956     */
957    public DiagnosticReport setCode(CodeableConcept value) { 
958      this.code = value;
959      return this;
960    }
961
962    /**
963     * @return {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.)
964     */
965    public Reference getSubject() { 
966      if (this.subject == null)
967        if (Configuration.errorOnAutoCreate())
968          throw new Error("Attempt to auto-create DiagnosticReport.subject");
969        else if (Configuration.doAutoCreate())
970          this.subject = new Reference(); // cc
971      return this.subject;
972    }
973
974    public boolean hasSubject() { 
975      return this.subject != null && !this.subject.isEmpty();
976    }
977
978    /**
979     * @param value {@link #subject} (The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.)
980     */
981    public DiagnosticReport setSubject(Reference value) { 
982      this.subject = value;
983      return this;
984    }
985
986    /**
987     * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.)
988     */
989    public Resource getSubjectTarget() { 
990      return this.subjectTarget;
991    }
992
993    /**
994     * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.)
995     */
996    public DiagnosticReport setSubjectTarget(Resource value) { 
997      this.subjectTarget = value;
998      return this;
999    }
1000
1001    /**
1002     * @return {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1003     */
1004    public Reference getEncounter() { 
1005      if (this.encounter == null)
1006        if (Configuration.errorOnAutoCreate())
1007          throw new Error("Attempt to auto-create DiagnosticReport.encounter");
1008        else if (Configuration.doAutoCreate())
1009          this.encounter = new Reference(); // cc
1010      return this.encounter;
1011    }
1012
1013    public boolean hasEncounter() { 
1014      return this.encounter != null && !this.encounter.isEmpty();
1015    }
1016
1017    /**
1018     * @param value {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1019     */
1020    public DiagnosticReport setEncounter(Reference value) { 
1021      this.encounter = value;
1022      return this;
1023    }
1024
1025    /**
1026     * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1027     */
1028    public Encounter getEncounterTarget() { 
1029      if (this.encounterTarget == null)
1030        if (Configuration.errorOnAutoCreate())
1031          throw new Error("Attempt to auto-create DiagnosticReport.encounter");
1032        else if (Configuration.doAutoCreate())
1033          this.encounterTarget = new Encounter(); // aa
1034      return this.encounterTarget;
1035    }
1036
1037    /**
1038     * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1039     */
1040    public DiagnosticReport setEncounterTarget(Encounter value) { 
1041      this.encounterTarget = value;
1042      return this;
1043    }
1044
1045    /**
1046     * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.)
1047     */
1048    public Type getEffective() { 
1049      return this.effective;
1050    }
1051
1052    /**
1053     * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.)
1054     */
1055    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
1056      if (this.effective == null)
1057        this.effective = new DateTimeType();
1058      if (!(this.effective instanceof DateTimeType))
1059        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
1060      return (DateTimeType) this.effective;
1061    }
1062
1063    public boolean hasEffectiveDateTimeType() { 
1064      return this != null && this.effective instanceof DateTimeType;
1065    }
1066
1067    /**
1068     * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.)
1069     */
1070    public Period getEffectivePeriod() throws FHIRException { 
1071      if (this.effective == null)
1072        this.effective = new Period();
1073      if (!(this.effective instanceof Period))
1074        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
1075      return (Period) this.effective;
1076    }
1077
1078    public boolean hasEffectivePeriod() { 
1079      return this != null && this.effective instanceof Period;
1080    }
1081
1082    public boolean hasEffective() { 
1083      return this.effective != null && !this.effective.isEmpty();
1084    }
1085
1086    /**
1087     * @param value {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.)
1088     */
1089    public DiagnosticReport setEffective(Type value) { 
1090      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1091        throw new Error("Not the right type for DiagnosticReport.effective[x]: "+value.fhirType());
1092      this.effective = value;
1093      return this;
1094    }
1095
1096    /**
1097     * @return {@link #issued} (The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1098     */
1099    public InstantType getIssuedElement() { 
1100      if (this.issued == null)
1101        if (Configuration.errorOnAutoCreate())
1102          throw new Error("Attempt to auto-create DiagnosticReport.issued");
1103        else if (Configuration.doAutoCreate())
1104          this.issued = new InstantType(); // bb
1105      return this.issued;
1106    }
1107
1108    public boolean hasIssuedElement() { 
1109      return this.issued != null && !this.issued.isEmpty();
1110    }
1111
1112    public boolean hasIssued() { 
1113      return this.issued != null && !this.issued.isEmpty();
1114    }
1115
1116    /**
1117     * @param value {@link #issued} (The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
1118     */
1119    public DiagnosticReport setIssuedElement(InstantType value) { 
1120      this.issued = value;
1121      return this;
1122    }
1123
1124    /**
1125     * @return The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.
1126     */
1127    public Date getIssued() { 
1128      return this.issued == null ? null : this.issued.getValue();
1129    }
1130
1131    /**
1132     * @param value The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.
1133     */
1134    public DiagnosticReport setIssued(Date value) { 
1135      if (value == null)
1136        this.issued = null;
1137      else {
1138        if (this.issued == null)
1139          this.issued = new InstantType();
1140        this.issued.setValue(value);
1141      }
1142      return this;
1143    }
1144
1145    /**
1146     * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.)
1147     */
1148    public List<Reference> getPerformer() { 
1149      if (this.performer == null)
1150        this.performer = new ArrayList<Reference>();
1151      return this.performer;
1152    }
1153
1154    /**
1155     * @return Returns a reference to <code>this</code> for easy method chaining
1156     */
1157    public DiagnosticReport setPerformer(List<Reference> thePerformer) { 
1158      this.performer = thePerformer;
1159      return this;
1160    }
1161
1162    public boolean hasPerformer() { 
1163      if (this.performer == null)
1164        return false;
1165      for (Reference item : this.performer)
1166        if (!item.isEmpty())
1167          return true;
1168      return false;
1169    }
1170
1171    public Reference addPerformer() { //3
1172      Reference t = new Reference();
1173      if (this.performer == null)
1174        this.performer = new ArrayList<Reference>();
1175      this.performer.add(t);
1176      return t;
1177    }
1178
1179    public DiagnosticReport addPerformer(Reference t) { //3
1180      if (t == null)
1181        return this;
1182      if (this.performer == null)
1183        this.performer = new ArrayList<Reference>();
1184      this.performer.add(t);
1185      return this;
1186    }
1187
1188    /**
1189     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
1190     */
1191    public Reference getPerformerFirstRep() { 
1192      if (getPerformer().isEmpty()) {
1193        addPerformer();
1194      }
1195      return getPerformer().get(0);
1196    }
1197
1198    /**
1199     * @deprecated Use Reference#setResource(IBaseResource) instead
1200     */
1201    @Deprecated
1202    public List<Resource> getPerformerTarget() { 
1203      if (this.performerTarget == null)
1204        this.performerTarget = new ArrayList<Resource>();
1205      return this.performerTarget;
1206    }
1207
1208    /**
1209     * @return {@link #resultsInterpreter} (The practitioner or organization that is responsible for the report's conclusions and interpretations.)
1210     */
1211    public List<Reference> getResultsInterpreter() { 
1212      if (this.resultsInterpreter == null)
1213        this.resultsInterpreter = new ArrayList<Reference>();
1214      return this.resultsInterpreter;
1215    }
1216
1217    /**
1218     * @return Returns a reference to <code>this</code> for easy method chaining
1219     */
1220    public DiagnosticReport setResultsInterpreter(List<Reference> theResultsInterpreter) { 
1221      this.resultsInterpreter = theResultsInterpreter;
1222      return this;
1223    }
1224
1225    public boolean hasResultsInterpreter() { 
1226      if (this.resultsInterpreter == null)
1227        return false;
1228      for (Reference item : this.resultsInterpreter)
1229        if (!item.isEmpty())
1230          return true;
1231      return false;
1232    }
1233
1234    public Reference addResultsInterpreter() { //3
1235      Reference t = new Reference();
1236      if (this.resultsInterpreter == null)
1237        this.resultsInterpreter = new ArrayList<Reference>();
1238      this.resultsInterpreter.add(t);
1239      return t;
1240    }
1241
1242    public DiagnosticReport addResultsInterpreter(Reference t) { //3
1243      if (t == null)
1244        return this;
1245      if (this.resultsInterpreter == null)
1246        this.resultsInterpreter = new ArrayList<Reference>();
1247      this.resultsInterpreter.add(t);
1248      return this;
1249    }
1250
1251    /**
1252     * @return The first repetition of repeating field {@link #resultsInterpreter}, creating it if it does not already exist
1253     */
1254    public Reference getResultsInterpreterFirstRep() { 
1255      if (getResultsInterpreter().isEmpty()) {
1256        addResultsInterpreter();
1257      }
1258      return getResultsInterpreter().get(0);
1259    }
1260
1261    /**
1262     * @deprecated Use Reference#setResource(IBaseResource) instead
1263     */
1264    @Deprecated
1265    public List<Resource> getResultsInterpreterTarget() { 
1266      if (this.resultsInterpreterTarget == null)
1267        this.resultsInterpreterTarget = new ArrayList<Resource>();
1268      return this.resultsInterpreterTarget;
1269    }
1270
1271    /**
1272     * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.)
1273     */
1274    public List<Reference> getSpecimen() { 
1275      if (this.specimen == null)
1276        this.specimen = new ArrayList<Reference>();
1277      return this.specimen;
1278    }
1279
1280    /**
1281     * @return Returns a reference to <code>this</code> for easy method chaining
1282     */
1283    public DiagnosticReport setSpecimen(List<Reference> theSpecimen) { 
1284      this.specimen = theSpecimen;
1285      return this;
1286    }
1287
1288    public boolean hasSpecimen() { 
1289      if (this.specimen == null)
1290        return false;
1291      for (Reference item : this.specimen)
1292        if (!item.isEmpty())
1293          return true;
1294      return false;
1295    }
1296
1297    public Reference addSpecimen() { //3
1298      Reference t = new Reference();
1299      if (this.specimen == null)
1300        this.specimen = new ArrayList<Reference>();
1301      this.specimen.add(t);
1302      return t;
1303    }
1304
1305    public DiagnosticReport addSpecimen(Reference t) { //3
1306      if (t == null)
1307        return this;
1308      if (this.specimen == null)
1309        this.specimen = new ArrayList<Reference>();
1310      this.specimen.add(t);
1311      return this;
1312    }
1313
1314    /**
1315     * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist
1316     */
1317    public Reference getSpecimenFirstRep() { 
1318      if (getSpecimen().isEmpty()) {
1319        addSpecimen();
1320      }
1321      return getSpecimen().get(0);
1322    }
1323
1324    /**
1325     * @deprecated Use Reference#setResource(IBaseResource) instead
1326     */
1327    @Deprecated
1328    public List<Specimen> getSpecimenTarget() { 
1329      if (this.specimenTarget == null)
1330        this.specimenTarget = new ArrayList<Specimen>();
1331      return this.specimenTarget;
1332    }
1333
1334    /**
1335     * @deprecated Use Reference#setResource(IBaseResource) instead
1336     */
1337    @Deprecated
1338    public Specimen addSpecimenTarget() { 
1339      Specimen r = new Specimen();
1340      if (this.specimenTarget == null)
1341        this.specimenTarget = new ArrayList<Specimen>();
1342      this.specimenTarget.add(r);
1343      return r;
1344    }
1345
1346    /**
1347     * @return {@link #result} ([Observations](observation.html)  that are part of this diagnostic report.)
1348     */
1349    public List<Reference> getResult() { 
1350      if (this.result == null)
1351        this.result = new ArrayList<Reference>();
1352      return this.result;
1353    }
1354
1355    /**
1356     * @return Returns a reference to <code>this</code> for easy method chaining
1357     */
1358    public DiagnosticReport setResult(List<Reference> theResult) { 
1359      this.result = theResult;
1360      return this;
1361    }
1362
1363    public boolean hasResult() { 
1364      if (this.result == null)
1365        return false;
1366      for (Reference item : this.result)
1367        if (!item.isEmpty())
1368          return true;
1369      return false;
1370    }
1371
1372    public Reference addResult() { //3
1373      Reference t = new Reference();
1374      if (this.result == null)
1375        this.result = new ArrayList<Reference>();
1376      this.result.add(t);
1377      return t;
1378    }
1379
1380    public DiagnosticReport addResult(Reference t) { //3
1381      if (t == null)
1382        return this;
1383      if (this.result == null)
1384        this.result = new ArrayList<Reference>();
1385      this.result.add(t);
1386      return this;
1387    }
1388
1389    /**
1390     * @return The first repetition of repeating field {@link #result}, creating it if it does not already exist
1391     */
1392    public Reference getResultFirstRep() { 
1393      if (getResult().isEmpty()) {
1394        addResult();
1395      }
1396      return getResult().get(0);
1397    }
1398
1399    /**
1400     * @deprecated Use Reference#setResource(IBaseResource) instead
1401     */
1402    @Deprecated
1403    public List<Observation> getResultTarget() { 
1404      if (this.resultTarget == null)
1405        this.resultTarget = new ArrayList<Observation>();
1406      return this.resultTarget;
1407    }
1408
1409    /**
1410     * @deprecated Use Reference#setResource(IBaseResource) instead
1411     */
1412    @Deprecated
1413    public Observation addResultTarget() { 
1414      Observation r = new Observation();
1415      if (this.resultTarget == null)
1416        this.resultTarget = new ArrayList<Observation>();
1417      this.resultTarget.add(r);
1418      return r;
1419    }
1420
1421    /**
1422     * @return {@link #imagingStudy} (One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.)
1423     */
1424    public List<Reference> getImagingStudy() { 
1425      if (this.imagingStudy == null)
1426        this.imagingStudy = new ArrayList<Reference>();
1427      return this.imagingStudy;
1428    }
1429
1430    /**
1431     * @return Returns a reference to <code>this</code> for easy method chaining
1432     */
1433    public DiagnosticReport setImagingStudy(List<Reference> theImagingStudy) { 
1434      this.imagingStudy = theImagingStudy;
1435      return this;
1436    }
1437
1438    public boolean hasImagingStudy() { 
1439      if (this.imagingStudy == null)
1440        return false;
1441      for (Reference item : this.imagingStudy)
1442        if (!item.isEmpty())
1443          return true;
1444      return false;
1445    }
1446
1447    public Reference addImagingStudy() { //3
1448      Reference t = new Reference();
1449      if (this.imagingStudy == null)
1450        this.imagingStudy = new ArrayList<Reference>();
1451      this.imagingStudy.add(t);
1452      return t;
1453    }
1454
1455    public DiagnosticReport addImagingStudy(Reference t) { //3
1456      if (t == null)
1457        return this;
1458      if (this.imagingStudy == null)
1459        this.imagingStudy = new ArrayList<Reference>();
1460      this.imagingStudy.add(t);
1461      return this;
1462    }
1463
1464    /**
1465     * @return The first repetition of repeating field {@link #imagingStudy}, creating it if it does not already exist
1466     */
1467    public Reference getImagingStudyFirstRep() { 
1468      if (getImagingStudy().isEmpty()) {
1469        addImagingStudy();
1470      }
1471      return getImagingStudy().get(0);
1472    }
1473
1474    /**
1475     * @deprecated Use Reference#setResource(IBaseResource) instead
1476     */
1477    @Deprecated
1478    public List<ImagingStudy> getImagingStudyTarget() { 
1479      if (this.imagingStudyTarget == null)
1480        this.imagingStudyTarget = new ArrayList<ImagingStudy>();
1481      return this.imagingStudyTarget;
1482    }
1483
1484    /**
1485     * @deprecated Use Reference#setResource(IBaseResource) instead
1486     */
1487    @Deprecated
1488    public ImagingStudy addImagingStudyTarget() { 
1489      ImagingStudy r = new ImagingStudy();
1490      if (this.imagingStudyTarget == null)
1491        this.imagingStudyTarget = new ArrayList<ImagingStudy>();
1492      this.imagingStudyTarget.add(r);
1493      return r;
1494    }
1495
1496    /**
1497     * @return {@link #media} (A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).)
1498     */
1499    public List<DiagnosticReportMediaComponent> getMedia() { 
1500      if (this.media == null)
1501        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1502      return this.media;
1503    }
1504
1505    /**
1506     * @return Returns a reference to <code>this</code> for easy method chaining
1507     */
1508    public DiagnosticReport setMedia(List<DiagnosticReportMediaComponent> theMedia) { 
1509      this.media = theMedia;
1510      return this;
1511    }
1512
1513    public boolean hasMedia() { 
1514      if (this.media == null)
1515        return false;
1516      for (DiagnosticReportMediaComponent item : this.media)
1517        if (!item.isEmpty())
1518          return true;
1519      return false;
1520    }
1521
1522    public DiagnosticReportMediaComponent addMedia() { //3
1523      DiagnosticReportMediaComponent t = new DiagnosticReportMediaComponent();
1524      if (this.media == null)
1525        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1526      this.media.add(t);
1527      return t;
1528    }
1529
1530    public DiagnosticReport addMedia(DiagnosticReportMediaComponent t) { //3
1531      if (t == null)
1532        return this;
1533      if (this.media == null)
1534        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1535      this.media.add(t);
1536      return this;
1537    }
1538
1539    /**
1540     * @return The first repetition of repeating field {@link #media}, creating it if it does not already exist
1541     */
1542    public DiagnosticReportMediaComponent getMediaFirstRep() { 
1543      if (getMedia().isEmpty()) {
1544        addMedia();
1545      }
1546      return getMedia().get(0);
1547    }
1548
1549    /**
1550     * @return {@link #conclusion} (Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value
1551     */
1552    public StringType getConclusionElement() { 
1553      if (this.conclusion == null)
1554        if (Configuration.errorOnAutoCreate())
1555          throw new Error("Attempt to auto-create DiagnosticReport.conclusion");
1556        else if (Configuration.doAutoCreate())
1557          this.conclusion = new StringType(); // bb
1558      return this.conclusion;
1559    }
1560
1561    public boolean hasConclusionElement() { 
1562      return this.conclusion != null && !this.conclusion.isEmpty();
1563    }
1564
1565    public boolean hasConclusion() { 
1566      return this.conclusion != null && !this.conclusion.isEmpty();
1567    }
1568
1569    /**
1570     * @param value {@link #conclusion} (Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value
1571     */
1572    public DiagnosticReport setConclusionElement(StringType value) { 
1573      this.conclusion = value;
1574      return this;
1575    }
1576
1577    /**
1578     * @return Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
1579     */
1580    public String getConclusion() { 
1581      return this.conclusion == null ? null : this.conclusion.getValue();
1582    }
1583
1584    /**
1585     * @param value Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
1586     */
1587    public DiagnosticReport setConclusion(String value) { 
1588      if (Utilities.noString(value))
1589        this.conclusion = null;
1590      else {
1591        if (this.conclusion == null)
1592          this.conclusion = new StringType();
1593        this.conclusion.setValue(value);
1594      }
1595      return this;
1596    }
1597
1598    /**
1599     * @return {@link #conclusionCode} (One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.)
1600     */
1601    public List<CodeableConcept> getConclusionCode() { 
1602      if (this.conclusionCode == null)
1603        this.conclusionCode = new ArrayList<CodeableConcept>();
1604      return this.conclusionCode;
1605    }
1606
1607    /**
1608     * @return Returns a reference to <code>this</code> for easy method chaining
1609     */
1610    public DiagnosticReport setConclusionCode(List<CodeableConcept> theConclusionCode) { 
1611      this.conclusionCode = theConclusionCode;
1612      return this;
1613    }
1614
1615    public boolean hasConclusionCode() { 
1616      if (this.conclusionCode == null)
1617        return false;
1618      for (CodeableConcept item : this.conclusionCode)
1619        if (!item.isEmpty())
1620          return true;
1621      return false;
1622    }
1623
1624    public CodeableConcept addConclusionCode() { //3
1625      CodeableConcept t = new CodeableConcept();
1626      if (this.conclusionCode == null)
1627        this.conclusionCode = new ArrayList<CodeableConcept>();
1628      this.conclusionCode.add(t);
1629      return t;
1630    }
1631
1632    public DiagnosticReport addConclusionCode(CodeableConcept t) { //3
1633      if (t == null)
1634        return this;
1635      if (this.conclusionCode == null)
1636        this.conclusionCode = new ArrayList<CodeableConcept>();
1637      this.conclusionCode.add(t);
1638      return this;
1639    }
1640
1641    /**
1642     * @return The first repetition of repeating field {@link #conclusionCode}, creating it if it does not already exist
1643     */
1644    public CodeableConcept getConclusionCodeFirstRep() { 
1645      if (getConclusionCode().isEmpty()) {
1646        addConclusionCode();
1647      }
1648      return getConclusionCode().get(0);
1649    }
1650
1651    /**
1652     * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.)
1653     */
1654    public List<Attachment> getPresentedForm() { 
1655      if (this.presentedForm == null)
1656        this.presentedForm = new ArrayList<Attachment>();
1657      return this.presentedForm;
1658    }
1659
1660    /**
1661     * @return Returns a reference to <code>this</code> for easy method chaining
1662     */
1663    public DiagnosticReport setPresentedForm(List<Attachment> thePresentedForm) { 
1664      this.presentedForm = thePresentedForm;
1665      return this;
1666    }
1667
1668    public boolean hasPresentedForm() { 
1669      if (this.presentedForm == null)
1670        return false;
1671      for (Attachment item : this.presentedForm)
1672        if (!item.isEmpty())
1673          return true;
1674      return false;
1675    }
1676
1677    public Attachment addPresentedForm() { //3
1678      Attachment t = new Attachment();
1679      if (this.presentedForm == null)
1680        this.presentedForm = new ArrayList<Attachment>();
1681      this.presentedForm.add(t);
1682      return t;
1683    }
1684
1685    public DiagnosticReport addPresentedForm(Attachment t) { //3
1686      if (t == null)
1687        return this;
1688      if (this.presentedForm == null)
1689        this.presentedForm = new ArrayList<Attachment>();
1690      this.presentedForm.add(t);
1691      return this;
1692    }
1693
1694    /**
1695     * @return The first repetition of repeating field {@link #presentedForm}, creating it if it does not already exist
1696     */
1697    public Attachment getPresentedFormFirstRep() { 
1698      if (getPresentedForm().isEmpty()) {
1699        addPresentedForm();
1700      }
1701      return getPresentedForm().get(0);
1702    }
1703
1704      protected void listChildren(List<Property> children) {
1705        super.listChildren(children);
1706        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this report by the performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
1707        children.add(new Property("basedOn", "Reference(CarePlan|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ServiceRequest)", "Details concerning a service requested.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1708        children.add(new Property("status", "code", "The status of the diagnostic report.", 0, 1, status));
1709        children.add(new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category));
1710        children.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code));
1711        children.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, 1, subject));
1712        children.add(new Property("encounter", "Reference(Encounter)", "The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.", 0, 1, encounter));
1713        children.add(new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective));
1714        children.add(new Property("issued", "instant", "The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.", 0, 1, issued));
1715        children.add(new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer));
1716        children.add(new Property("resultsInterpreter", "Reference(Practitioner|PractitionerRole|Organization|CareTeam)", "The practitioner or organization that is responsible for the report's conclusions and interpretations.", 0, java.lang.Integer.MAX_VALUE, resultsInterpreter));
1717        children.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen));
1718        children.add(new Property("result", "Reference(Observation)", "[Observations](observation.html)  that are part of this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, result));
1719        children.add(new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy));
1720        children.add(new Property("media", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, media));
1721        children.add(new Property("conclusion", "string", "Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.", 0, 1, conclusion));
1722        children.add(new Property("conclusionCode", "CodeableConcept", "One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusionCode));
1723        children.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm));
1724      }
1725
1726      @Override
1727      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1728        switch (_hash) {
1729        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this report by the performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
1730        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ServiceRequest)", "Details concerning a service requested.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1731        case -892481550: /*status*/  return new Property("status", "code", "The status of the diagnostic report.", 0, 1, status);
1732        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category);
1733        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code);
1734        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, 1, subject);
1735        case 1524132147: /*encounter*/  return new Property("encounter", "Reference(Encounter)", "The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.", 0, 1, encounter);
1736        case 247104889: /*effective[x]*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1737        case -1468651097: /*effective*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1738        case -275306910: /*effectiveDateTime*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1739        case -403934648: /*effectivePeriod*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1740        case -1179159893: /*issued*/  return new Property("issued", "instant", "The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.", 0, 1, issued);
1741        case 481140686: /*performer*/  return new Property("performer", "Reference(Practitioner|PractitionerRole|Organization|CareTeam)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer);
1742        case 2134944932: /*resultsInterpreter*/  return new Property("resultsInterpreter", "Reference(Practitioner|PractitionerRole|Organization|CareTeam)", "The practitioner or organization that is responsible for the report's conclusions and interpretations.", 0, java.lang.Integer.MAX_VALUE, resultsInterpreter);
1743        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen);
1744        case -934426595: /*result*/  return new Property("result", "Reference(Observation)", "[Observations](observation.html)  that are part of this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, result);
1745        case -814900911: /*imagingStudy*/  return new Property("imagingStudy", "Reference(ImagingStudy)", "One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.", 0, java.lang.Integer.MAX_VALUE, imagingStudy);
1746        case 103772132: /*media*/  return new Property("media", "", "A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).", 0, java.lang.Integer.MAX_VALUE, media);
1747        case -1731259873: /*conclusion*/  return new Property("conclusion", "string", "Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.", 0, 1, conclusion);
1748        case -1731523412: /*conclusionCode*/  return new Property("conclusionCode", "CodeableConcept", "One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusionCode);
1749        case 230090366: /*presentedForm*/  return new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm);
1750        default: return super.getNamedProperty(_hash, _name, _checkValid);
1751        }
1752
1753      }
1754
1755      @Override
1756      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1757        switch (hash) {
1758        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1759        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1760        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DiagnosticReportStatus>
1761        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1762        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1763        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1764        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1765        case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type
1766        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
1767        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
1768        case 2134944932: /*resultsInterpreter*/ return this.resultsInterpreter == null ? new Base[0] : this.resultsInterpreter.toArray(new Base[this.resultsInterpreter.size()]); // Reference
1769        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
1770        case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference
1771        case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : this.imagingStudy.toArray(new Base[this.imagingStudy.size()]); // Reference
1772        case 103772132: /*media*/ return this.media == null ? new Base[0] : this.media.toArray(new Base[this.media.size()]); // DiagnosticReportMediaComponent
1773        case -1731259873: /*conclusion*/ return this.conclusion == null ? new Base[0] : new Base[] {this.conclusion}; // StringType
1774        case -1731523412: /*conclusionCode*/ return this.conclusionCode == null ? new Base[0] : this.conclusionCode.toArray(new Base[this.conclusionCode.size()]); // CodeableConcept
1775        case 230090366: /*presentedForm*/ return this.presentedForm == null ? new Base[0] : this.presentedForm.toArray(new Base[this.presentedForm.size()]); // Attachment
1776        default: return super.getProperty(hash, name, checkValid);
1777        }
1778
1779      }
1780
1781      @Override
1782      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1783        switch (hash) {
1784        case -1618432855: // identifier
1785          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1786          return value;
1787        case -332612366: // basedOn
1788          this.getBasedOn().add(castToReference(value)); // Reference
1789          return value;
1790        case -892481550: // status
1791          value = new DiagnosticReportStatusEnumFactory().fromType(castToCode(value));
1792          this.status = (Enumeration) value; // Enumeration<DiagnosticReportStatus>
1793          return value;
1794        case 50511102: // category
1795          this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept
1796          return value;
1797        case 3059181: // code
1798          this.code = castToCodeableConcept(value); // CodeableConcept
1799          return value;
1800        case -1867885268: // subject
1801          this.subject = castToReference(value); // Reference
1802          return value;
1803        case 1524132147: // encounter
1804          this.encounter = castToReference(value); // Reference
1805          return value;
1806        case -1468651097: // effective
1807          this.effective = castToType(value); // Type
1808          return value;
1809        case -1179159893: // issued
1810          this.issued = castToInstant(value); // InstantType
1811          return value;
1812        case 481140686: // performer
1813          this.getPerformer().add(castToReference(value)); // Reference
1814          return value;
1815        case 2134944932: // resultsInterpreter
1816          this.getResultsInterpreter().add(castToReference(value)); // Reference
1817          return value;
1818        case -2132868344: // specimen
1819          this.getSpecimen().add(castToReference(value)); // Reference
1820          return value;
1821        case -934426595: // result
1822          this.getResult().add(castToReference(value)); // Reference
1823          return value;
1824        case -814900911: // imagingStudy
1825          this.getImagingStudy().add(castToReference(value)); // Reference
1826          return value;
1827        case 103772132: // media
1828          this.getMedia().add((DiagnosticReportMediaComponent) value); // DiagnosticReportMediaComponent
1829          return value;
1830        case -1731259873: // conclusion
1831          this.conclusion = castToString(value); // StringType
1832          return value;
1833        case -1731523412: // conclusionCode
1834          this.getConclusionCode().add(castToCodeableConcept(value)); // CodeableConcept
1835          return value;
1836        case 230090366: // presentedForm
1837          this.getPresentedForm().add(castToAttachment(value)); // Attachment
1838          return value;
1839        default: return super.setProperty(hash, name, value);
1840        }
1841
1842      }
1843
1844      @Override
1845      public Base setProperty(String name, Base value) throws FHIRException {
1846        if (name.equals("identifier")) {
1847          this.getIdentifier().add(castToIdentifier(value));
1848        } else if (name.equals("basedOn")) {
1849          this.getBasedOn().add(castToReference(value));
1850        } else if (name.equals("status")) {
1851          value = new DiagnosticReportStatusEnumFactory().fromType(castToCode(value));
1852          this.status = (Enumeration) value; // Enumeration<DiagnosticReportStatus>
1853        } else if (name.equals("category")) {
1854          this.getCategory().add(castToCodeableConcept(value));
1855        } else if (name.equals("code")) {
1856          this.code = castToCodeableConcept(value); // CodeableConcept
1857        } else if (name.equals("subject")) {
1858          this.subject = castToReference(value); // Reference
1859        } else if (name.equals("encounter")) {
1860          this.encounter = castToReference(value); // Reference
1861        } else if (name.equals("effective[x]")) {
1862          this.effective = castToType(value); // Type
1863        } else if (name.equals("issued")) {
1864          this.issued = castToInstant(value); // InstantType
1865        } else if (name.equals("performer")) {
1866          this.getPerformer().add(castToReference(value));
1867        } else if (name.equals("resultsInterpreter")) {
1868          this.getResultsInterpreter().add(castToReference(value));
1869        } else if (name.equals("specimen")) {
1870          this.getSpecimen().add(castToReference(value));
1871        } else if (name.equals("result")) {
1872          this.getResult().add(castToReference(value));
1873        } else if (name.equals("imagingStudy")) {
1874          this.getImagingStudy().add(castToReference(value));
1875        } else if (name.equals("media")) {
1876          this.getMedia().add((DiagnosticReportMediaComponent) value);
1877        } else if (name.equals("conclusion")) {
1878          this.conclusion = castToString(value); // StringType
1879        } else if (name.equals("conclusionCode")) {
1880          this.getConclusionCode().add(castToCodeableConcept(value));
1881        } else if (name.equals("presentedForm")) {
1882          this.getPresentedForm().add(castToAttachment(value));
1883        } else
1884          return super.setProperty(name, value);
1885        return value;
1886      }
1887
1888      @Override
1889      public Base makeProperty(int hash, String name) throws FHIRException {
1890        switch (hash) {
1891        case -1618432855:  return addIdentifier(); 
1892        case -332612366:  return addBasedOn(); 
1893        case -892481550:  return getStatusElement();
1894        case 50511102:  return addCategory(); 
1895        case 3059181:  return getCode(); 
1896        case -1867885268:  return getSubject(); 
1897        case 1524132147:  return getEncounter(); 
1898        case 247104889:  return getEffective(); 
1899        case -1468651097:  return getEffective(); 
1900        case -1179159893:  return getIssuedElement();
1901        case 481140686:  return addPerformer(); 
1902        case 2134944932:  return addResultsInterpreter(); 
1903        case -2132868344:  return addSpecimen(); 
1904        case -934426595:  return addResult(); 
1905        case -814900911:  return addImagingStudy(); 
1906        case 103772132:  return addMedia(); 
1907        case -1731259873:  return getConclusionElement();
1908        case -1731523412:  return addConclusionCode(); 
1909        case 230090366:  return addPresentedForm(); 
1910        default: return super.makeProperty(hash, name);
1911        }
1912
1913      }
1914
1915      @Override
1916      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1917        switch (hash) {
1918        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
1919        case -332612366: /*basedOn*/ return new String[] {"Reference"};
1920        case -892481550: /*status*/ return new String[] {"code"};
1921        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
1922        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
1923        case -1867885268: /*subject*/ return new String[] {"Reference"};
1924        case 1524132147: /*encounter*/ return new String[] {"Reference"};
1925        case -1468651097: /*effective*/ return new String[] {"dateTime", "Period"};
1926        case -1179159893: /*issued*/ return new String[] {"instant"};
1927        case 481140686: /*performer*/ return new String[] {"Reference"};
1928        case 2134944932: /*resultsInterpreter*/ return new String[] {"Reference"};
1929        case -2132868344: /*specimen*/ return new String[] {"Reference"};
1930        case -934426595: /*result*/ return new String[] {"Reference"};
1931        case -814900911: /*imagingStudy*/ return new String[] {"Reference"};
1932        case 103772132: /*media*/ return new String[] {};
1933        case -1731259873: /*conclusion*/ return new String[] {"string"};
1934        case -1731523412: /*conclusionCode*/ return new String[] {"CodeableConcept"};
1935        case 230090366: /*presentedForm*/ return new String[] {"Attachment"};
1936        default: return super.getTypesForProperty(hash, name);
1937        }
1938
1939      }
1940
1941      @Override
1942      public Base addChild(String name) throws FHIRException {
1943        if (name.equals("identifier")) {
1944          return addIdentifier();
1945        }
1946        else if (name.equals("basedOn")) {
1947          return addBasedOn();
1948        }
1949        else if (name.equals("status")) {
1950          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.status");
1951        }
1952        else if (name.equals("category")) {
1953          return addCategory();
1954        }
1955        else if (name.equals("code")) {
1956          this.code = new CodeableConcept();
1957          return this.code;
1958        }
1959        else if (name.equals("subject")) {
1960          this.subject = new Reference();
1961          return this.subject;
1962        }
1963        else if (name.equals("encounter")) {
1964          this.encounter = new Reference();
1965          return this.encounter;
1966        }
1967        else if (name.equals("effectiveDateTime")) {
1968          this.effective = new DateTimeType();
1969          return this.effective;
1970        }
1971        else if (name.equals("effectivePeriod")) {
1972          this.effective = new Period();
1973          return this.effective;
1974        }
1975        else if (name.equals("issued")) {
1976          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.issued");
1977        }
1978        else if (name.equals("performer")) {
1979          return addPerformer();
1980        }
1981        else if (name.equals("resultsInterpreter")) {
1982          return addResultsInterpreter();
1983        }
1984        else if (name.equals("specimen")) {
1985          return addSpecimen();
1986        }
1987        else if (name.equals("result")) {
1988          return addResult();
1989        }
1990        else if (name.equals("imagingStudy")) {
1991          return addImagingStudy();
1992        }
1993        else if (name.equals("media")) {
1994          return addMedia();
1995        }
1996        else if (name.equals("conclusion")) {
1997          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.conclusion");
1998        }
1999        else if (name.equals("conclusionCode")) {
2000          return addConclusionCode();
2001        }
2002        else if (name.equals("presentedForm")) {
2003          return addPresentedForm();
2004        }
2005        else
2006          return super.addChild(name);
2007      }
2008
2009  public String fhirType() {
2010    return "DiagnosticReport";
2011
2012  }
2013
2014      public DiagnosticReport copy() {
2015        DiagnosticReport dst = new DiagnosticReport();
2016        copyValues(dst);
2017        return dst;
2018      }
2019
2020      public void copyValues(DiagnosticReport dst) {
2021        super.copyValues(dst);
2022        if (identifier != null) {
2023          dst.identifier = new ArrayList<Identifier>();
2024          for (Identifier i : identifier)
2025            dst.identifier.add(i.copy());
2026        };
2027        if (basedOn != null) {
2028          dst.basedOn = new ArrayList<Reference>();
2029          for (Reference i : basedOn)
2030            dst.basedOn.add(i.copy());
2031        };
2032        dst.status = status == null ? null : status.copy();
2033        if (category != null) {
2034          dst.category = new ArrayList<CodeableConcept>();
2035          for (CodeableConcept i : category)
2036            dst.category.add(i.copy());
2037        };
2038        dst.code = code == null ? null : code.copy();
2039        dst.subject = subject == null ? null : subject.copy();
2040        dst.encounter = encounter == null ? null : encounter.copy();
2041        dst.effective = effective == null ? null : effective.copy();
2042        dst.issued = issued == null ? null : issued.copy();
2043        if (performer != null) {
2044          dst.performer = new ArrayList<Reference>();
2045          for (Reference i : performer)
2046            dst.performer.add(i.copy());
2047        };
2048        if (resultsInterpreter != null) {
2049          dst.resultsInterpreter = new ArrayList<Reference>();
2050          for (Reference i : resultsInterpreter)
2051            dst.resultsInterpreter.add(i.copy());
2052        };
2053        if (specimen != null) {
2054          dst.specimen = new ArrayList<Reference>();
2055          for (Reference i : specimen)
2056            dst.specimen.add(i.copy());
2057        };
2058        if (result != null) {
2059          dst.result = new ArrayList<Reference>();
2060          for (Reference i : result)
2061            dst.result.add(i.copy());
2062        };
2063        if (imagingStudy != null) {
2064          dst.imagingStudy = new ArrayList<Reference>();
2065          for (Reference i : imagingStudy)
2066            dst.imagingStudy.add(i.copy());
2067        };
2068        if (media != null) {
2069          dst.media = new ArrayList<DiagnosticReportMediaComponent>();
2070          for (DiagnosticReportMediaComponent i : media)
2071            dst.media.add(i.copy());
2072        };
2073        dst.conclusion = conclusion == null ? null : conclusion.copy();
2074        if (conclusionCode != null) {
2075          dst.conclusionCode = new ArrayList<CodeableConcept>();
2076          for (CodeableConcept i : conclusionCode)
2077            dst.conclusionCode.add(i.copy());
2078        };
2079        if (presentedForm != null) {
2080          dst.presentedForm = new ArrayList<Attachment>();
2081          for (Attachment i : presentedForm)
2082            dst.presentedForm.add(i.copy());
2083        };
2084      }
2085
2086      protected DiagnosticReport typedCopy() {
2087        return copy();
2088      }
2089
2090      @Override
2091      public boolean equalsDeep(Base other_) {
2092        if (!super.equalsDeep(other_))
2093          return false;
2094        if (!(other_ instanceof DiagnosticReport))
2095          return false;
2096        DiagnosticReport o = (DiagnosticReport) other_;
2097        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(status, o.status, true)
2098           && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true)
2099           && compareDeep(encounter, o.encounter, true) && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true)
2100           && compareDeep(performer, o.performer, true) && compareDeep(resultsInterpreter, o.resultsInterpreter, true)
2101           && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) && compareDeep(imagingStudy, o.imagingStudy, true)
2102           && compareDeep(media, o.media, true) && compareDeep(conclusion, o.conclusion, true) && compareDeep(conclusionCode, o.conclusionCode, true)
2103           && compareDeep(presentedForm, o.presentedForm, true);
2104      }
2105
2106      @Override
2107      public boolean equalsShallow(Base other_) {
2108        if (!super.equalsShallow(other_))
2109          return false;
2110        if (!(other_ instanceof DiagnosticReport))
2111          return false;
2112        DiagnosticReport o = (DiagnosticReport) other_;
2113        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true)
2114          ;
2115      }
2116
2117      public boolean isEmpty() {
2118        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, status
2119          , category, code, subject, encounter, effective, issued, performer, resultsInterpreter
2120          , specimen, result, imagingStudy, media, conclusion, conclusionCode, presentedForm
2121          );
2122      }
2123
2124  @Override
2125  public ResourceType getResourceType() {
2126    return ResourceType.DiagnosticReport;
2127   }
2128
2129 /**
2130   * Search parameter: <b>date</b>
2131   * <p>
2132   * Description: <b>The clinically relevant time of the report</b><br>
2133   * Type: <b>date</b><br>
2134   * Path: <b>DiagnosticReport.effective[x]</b><br>
2135   * </p>
2136   */
2137  @SearchParamDefinition(name="date", path="DiagnosticReport.effective", description="The clinically relevant time of the report", type="date" )
2138  public static final String SP_DATE = "date";
2139 /**
2140   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2141   * <p>
2142   * Description: <b>The clinically relevant time of the report</b><br>
2143   * Type: <b>date</b><br>
2144   * Path: <b>DiagnosticReport.effective[x]</b><br>
2145   * </p>
2146   */
2147  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2148
2149 /**
2150   * Search parameter: <b>identifier</b>
2151   * <p>
2152   * Description: <b>An identifier for the report</b><br>
2153   * Type: <b>token</b><br>
2154   * Path: <b>DiagnosticReport.identifier</b><br>
2155   * </p>
2156   */
2157  @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" )
2158  public static final String SP_IDENTIFIER = "identifier";
2159 /**
2160   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2161   * <p>
2162   * Description: <b>An identifier for the report</b><br>
2163   * Type: <b>token</b><br>
2164   * Path: <b>DiagnosticReport.identifier</b><br>
2165   * </p>
2166   */
2167  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2168
2169 /**
2170   * Search parameter: <b>performer</b>
2171   * <p>
2172   * Description: <b>Who is responsible for the report</b><br>
2173   * Type: <b>reference</b><br>
2174   * Path: <b>DiagnosticReport.performer</b><br>
2175   * </p>
2176   */
2177  @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who is responsible for the report", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={CareTeam.class, Organization.class, Practitioner.class, PractitionerRole.class } )
2178  public static final String SP_PERFORMER = "performer";
2179 /**
2180   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2181   * <p>
2182   * Description: <b>Who is responsible for the report</b><br>
2183   * Type: <b>reference</b><br>
2184   * Path: <b>DiagnosticReport.performer</b><br>
2185   * </p>
2186   */
2187  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2188
2189/**
2190   * Constant for fluent queries to be used to add include statements. Specifies
2191   * the path value of "<b>DiagnosticReport:performer</b>".
2192   */
2193  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:performer").toLocked();
2194
2195 /**
2196   * Search parameter: <b>code</b>
2197   * <p>
2198   * Description: <b>The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result</b><br>
2199   * Type: <b>token</b><br>
2200   * Path: <b>DiagnosticReport.code</b><br>
2201   * </p>
2202   */
2203  @SearchParamDefinition(name="code", path="DiagnosticReport.code", description="The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result", type="token" )
2204  public static final String SP_CODE = "code";
2205 /**
2206   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2207   * <p>
2208   * Description: <b>The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result</b><br>
2209   * Type: <b>token</b><br>
2210   * Path: <b>DiagnosticReport.code</b><br>
2211   * </p>
2212   */
2213  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2214
2215 /**
2216   * Search parameter: <b>subject</b>
2217   * <p>
2218   * Description: <b>The subject of the report</b><br>
2219   * Type: <b>reference</b><br>
2220   * Path: <b>DiagnosticReport.subject</b><br>
2221   * </p>
2222   */
2223  @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Device.class, Group.class, Location.class, Patient.class } )
2224  public static final String SP_SUBJECT = "subject";
2225 /**
2226   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2227   * <p>
2228   * Description: <b>The subject of the report</b><br>
2229   * Type: <b>reference</b><br>
2230   * Path: <b>DiagnosticReport.subject</b><br>
2231   * </p>
2232   */
2233  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2234
2235/**
2236   * Constant for fluent queries to be used to add include statements. Specifies
2237   * the path value of "<b>DiagnosticReport:subject</b>".
2238   */
2239  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:subject").toLocked();
2240
2241 /**
2242   * Search parameter: <b>media</b>
2243   * <p>
2244   * Description: <b>A reference to the image source.</b><br>
2245   * Type: <b>reference</b><br>
2246   * Path: <b>DiagnosticReport.media.link</b><br>
2247   * </p>
2248   */
2249  @SearchParamDefinition(name="media", path="DiagnosticReport.media.link", description="A reference to the image source.", type="reference", target={Media.class } )
2250  public static final String SP_MEDIA = "media";
2251 /**
2252   * <b>Fluent Client</b> search parameter constant for <b>media</b>
2253   * <p>
2254   * Description: <b>A reference to the image source.</b><br>
2255   * Type: <b>reference</b><br>
2256   * Path: <b>DiagnosticReport.media.link</b><br>
2257   * </p>
2258   */
2259  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDIA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDIA);
2260
2261/**
2262   * Constant for fluent queries to be used to add include statements. Specifies
2263   * the path value of "<b>DiagnosticReport:media</b>".
2264   */
2265  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDIA = new ca.uhn.fhir.model.api.Include("DiagnosticReport:media").toLocked();
2266
2267 /**
2268   * Search parameter: <b>encounter</b>
2269   * <p>
2270   * Description: <b>The Encounter when the order was made</b><br>
2271   * Type: <b>reference</b><br>
2272   * Path: <b>DiagnosticReport.encounter</b><br>
2273   * </p>
2274   */
2275  @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Encounter") }, target={Encounter.class } )
2276  public static final String SP_ENCOUNTER = "encounter";
2277 /**
2278   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2279   * <p>
2280   * Description: <b>The Encounter when the order was made</b><br>
2281   * Type: <b>reference</b><br>
2282   * Path: <b>DiagnosticReport.encounter</b><br>
2283   * </p>
2284   */
2285  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2286
2287/**
2288   * Constant for fluent queries to be used to add include statements. Specifies
2289   * the path value of "<b>DiagnosticReport:encounter</b>".
2290   */
2291  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:encounter").toLocked();
2292
2293 /**
2294   * Search parameter: <b>result</b>
2295   * <p>
2296   * Description: <b>Link to an atomic result (observation resource)</b><br>
2297   * Type: <b>reference</b><br>
2298   * Path: <b>DiagnosticReport.result</b><br>
2299   * </p>
2300   */
2301  @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference", target={Observation.class } )
2302  public static final String SP_RESULT = "result";
2303 /**
2304   * <b>Fluent Client</b> search parameter constant for <b>result</b>
2305   * <p>
2306   * Description: <b>Link to an atomic result (observation resource)</b><br>
2307   * Type: <b>reference</b><br>
2308   * Path: <b>DiagnosticReport.result</b><br>
2309   * </p>
2310   */
2311  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULT);
2312
2313/**
2314   * Constant for fluent queries to be used to add include statements. Specifies
2315   * the path value of "<b>DiagnosticReport:result</b>".
2316   */
2317  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:result").toLocked();
2318
2319 /**
2320   * Search parameter: <b>conclusion</b>
2321   * <p>
2322   * Description: <b>A coded conclusion (interpretation/impression) on the report</b><br>
2323   * Type: <b>token</b><br>
2324   * Path: <b>DiagnosticReport.conclusionCode</b><br>
2325   * </p>
2326   */
2327  @SearchParamDefinition(name="conclusion", path="DiagnosticReport.conclusionCode", description="A coded conclusion (interpretation/impression) on the report", type="token" )
2328  public static final String SP_CONCLUSION = "conclusion";
2329 /**
2330   * <b>Fluent Client</b> search parameter constant for <b>conclusion</b>
2331   * <p>
2332   * Description: <b>A coded conclusion (interpretation/impression) on the report</b><br>
2333   * Type: <b>token</b><br>
2334   * Path: <b>DiagnosticReport.conclusionCode</b><br>
2335   * </p>
2336   */
2337  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONCLUSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONCLUSION);
2338
2339 /**
2340   * Search parameter: <b>based-on</b>
2341   * <p>
2342   * Description: <b>Reference to the service request.</b><br>
2343   * Type: <b>reference</b><br>
2344   * Path: <b>DiagnosticReport.basedOn</b><br>
2345   * </p>
2346   */
2347  @SearchParamDefinition(name="based-on", path="DiagnosticReport.basedOn", description="Reference to the service request.", type="reference", target={CarePlan.class, ImmunizationRecommendation.class, MedicationRequest.class, NutritionOrder.class, ServiceRequest.class } )
2348  public static final String SP_BASED_ON = "based-on";
2349 /**
2350   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2351   * <p>
2352   * Description: <b>Reference to the service request.</b><br>
2353   * Type: <b>reference</b><br>
2354   * Path: <b>DiagnosticReport.basedOn</b><br>
2355   * </p>
2356   */
2357  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2358
2359/**
2360   * Constant for fluent queries to be used to add include statements. Specifies
2361   * the path value of "<b>DiagnosticReport:based-on</b>".
2362   */
2363  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DiagnosticReport:based-on").toLocked();
2364
2365 /**
2366   * Search parameter: <b>patient</b>
2367   * <p>
2368   * Description: <b>The subject of the report if a patient</b><br>
2369   * Type: <b>reference</b><br>
2370   * Path: <b>DiagnosticReport.subject</b><br>
2371   * </p>
2372   */
2373  @SearchParamDefinition(name="patient", path="DiagnosticReport.subject.where(resolve() is Patient)", description="The subject of the report if a patient", type="reference", target={Patient.class } )
2374  public static final String SP_PATIENT = "patient";
2375 /**
2376   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2377   * <p>
2378   * Description: <b>The subject of the report if a patient</b><br>
2379   * Type: <b>reference</b><br>
2380   * Path: <b>DiagnosticReport.subject</b><br>
2381   * </p>
2382   */
2383  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2384
2385/**
2386   * Constant for fluent queries to be used to add include statements. Specifies
2387   * the path value of "<b>DiagnosticReport:patient</b>".
2388   */
2389  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:patient").toLocked();
2390
2391 /**
2392   * Search parameter: <b>specimen</b>
2393   * <p>
2394   * Description: <b>The specimen details</b><br>
2395   * Type: <b>reference</b><br>
2396   * Path: <b>DiagnosticReport.specimen</b><br>
2397   * </p>
2398   */
2399  @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference", target={Specimen.class } )
2400  public static final String SP_SPECIMEN = "specimen";
2401 /**
2402   * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
2403   * <p>
2404   * Description: <b>The specimen details</b><br>
2405   * Type: <b>reference</b><br>
2406   * Path: <b>DiagnosticReport.specimen</b><br>
2407   * </p>
2408   */
2409  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN);
2410
2411/**
2412   * Constant for fluent queries to be used to add include statements. Specifies
2413   * the path value of "<b>DiagnosticReport:specimen</b>".
2414   */
2415  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticReport:specimen").toLocked();
2416
2417 /**
2418   * Search parameter: <b>issued</b>
2419   * <p>
2420   * Description: <b>When the report was issued</b><br>
2421   * Type: <b>date</b><br>
2422   * Path: <b>DiagnosticReport.issued</b><br>
2423   * </p>
2424   */
2425  @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" )
2426  public static final String SP_ISSUED = "issued";
2427 /**
2428   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
2429   * <p>
2430   * Description: <b>When the report was issued</b><br>
2431   * Type: <b>date</b><br>
2432   * Path: <b>DiagnosticReport.issued</b><br>
2433   * </p>
2434   */
2435  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
2436
2437 /**
2438   * Search parameter: <b>category</b>
2439   * <p>
2440   * Description: <b>Which diagnostic discipline/department created the report</b><br>
2441   * Type: <b>token</b><br>
2442   * Path: <b>DiagnosticReport.category</b><br>
2443   * </p>
2444   */
2445  @SearchParamDefinition(name="category", path="DiagnosticReport.category", description="Which diagnostic discipline/department created the report", type="token" )
2446  public static final String SP_CATEGORY = "category";
2447 /**
2448   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2449   * <p>
2450   * Description: <b>Which diagnostic discipline/department created the report</b><br>
2451   * Type: <b>token</b><br>
2452   * Path: <b>DiagnosticReport.category</b><br>
2453   * </p>
2454   */
2455  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2456
2457 /**
2458   * Search parameter: <b>results-interpreter</b>
2459   * <p>
2460   * Description: <b>Who was the source of the report</b><br>
2461   * Type: <b>reference</b><br>
2462   * Path: <b>DiagnosticReport.resultsInterpreter</b><br>
2463   * </p>
2464   */
2465  @SearchParamDefinition(name="results-interpreter", path="DiagnosticReport.resultsInterpreter", description="Who was the source of the report", type="reference", target={CareTeam.class, Organization.class, Practitioner.class, PractitionerRole.class } )
2466  public static final String SP_RESULTS_INTERPRETER = "results-interpreter";
2467 /**
2468   * <b>Fluent Client</b> search parameter constant for <b>results-interpreter</b>
2469   * <p>
2470   * Description: <b>Who was the source of the report</b><br>
2471   * Type: <b>reference</b><br>
2472   * Path: <b>DiagnosticReport.resultsInterpreter</b><br>
2473   * </p>
2474   */
2475  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULTS_INTERPRETER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULTS_INTERPRETER);
2476
2477/**
2478   * Constant for fluent queries to be used to add include statements. Specifies
2479   * the path value of "<b>DiagnosticReport:results-interpreter</b>".
2480   */
2481  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULTS_INTERPRETER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:results-interpreter").toLocked();
2482
2483 /**
2484   * Search parameter: <b>status</b>
2485   * <p>
2486   * Description: <b>The status of the report</b><br>
2487   * Type: <b>token</b><br>
2488   * Path: <b>DiagnosticReport.status</b><br>
2489   * </p>
2490   */
2491  @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" )
2492  public static final String SP_STATUS = "status";
2493 /**
2494   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2495   * <p>
2496   * Description: <b>The status of the report</b><br>
2497   * Type: <b>token</b><br>
2498   * Path: <b>DiagnosticReport.status</b><br>
2499   * </p>
2500   */
2501  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2502
2503
2504}