001package org.hl7.fhir.dstu2016may.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.exceptions.FHIRException;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * 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.
051 */
052@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport")
053public class DiagnosticReport extends DomainResource {
054
055    public enum DiagnosticReportStatus {
056        /**
057         * The existence of the report is registered, but there is nothing yet available.
058         */
059        REGISTERED, 
060        /**
061         * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.
062         */
063        PARTIAL, 
064        /**
065         * The report is complete and verified by an authorized person.
066         */
067        FINAL, 
068        /**
069         * The report has been modified subsequent to being Final, and is complete and verified by an authorized person
070         */
071        CORRECTED, 
072        /**
073         * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed.
074         */
075        APPENDED, 
076        /**
077         * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
078         */
079        CANCELLED, 
080        /**
081         * The report has been withdrawn following a previous final release.
082         */
083        ENTEREDINERROR, 
084        /**
085         * added to help the parsers
086         */
087        NULL;
088        public static DiagnosticReportStatus fromCode(String codeString) throws FHIRException {
089            if (codeString == null || "".equals(codeString))
090                return null;
091        if ("registered".equals(codeString))
092          return REGISTERED;
093        if ("partial".equals(codeString))
094          return PARTIAL;
095        if ("final".equals(codeString))
096          return FINAL;
097        if ("corrected".equals(codeString))
098          return CORRECTED;
099        if ("appended".equals(codeString))
100          return APPENDED;
101        if ("cancelled".equals(codeString))
102          return CANCELLED;
103        if ("entered-in-error".equals(codeString))
104          return ENTEREDINERROR;
105        throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
106        }
107        public String toCode() {
108          switch (this) {
109            case REGISTERED: return "registered";
110            case PARTIAL: return "partial";
111            case FINAL: return "final";
112            case CORRECTED: return "corrected";
113            case APPENDED: return "appended";
114            case CANCELLED: return "cancelled";
115            case ENTEREDINERROR: return "entered-in-error";
116            case NULL: return null;
117            default: return "?";
118          }
119        }
120        public String getSystem() {
121          switch (this) {
122            case REGISTERED: return "http://hl7.org/fhir/diagnostic-report-status";
123            case PARTIAL: return "http://hl7.org/fhir/diagnostic-report-status";
124            case FINAL: return "http://hl7.org/fhir/diagnostic-report-status";
125            case CORRECTED: return "http://hl7.org/fhir/diagnostic-report-status";
126            case APPENDED: return "http://hl7.org/fhir/diagnostic-report-status";
127            case CANCELLED: return "http://hl7.org/fhir/diagnostic-report-status";
128            case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-report-status";
129            case NULL: return null;
130            default: return "?";
131          }
132        }
133        public String getDefinition() {
134          switch (this) {
135            case REGISTERED: return "The existence of the report is registered, but there is nothing yet available.";
136            case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.";
137            case FINAL: return "The report is complete and verified by an authorized person.";
138            case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person";
139            case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed.";
140            case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
141            case ENTEREDINERROR: return "The report has been withdrawn following a previous final release.";
142            case NULL: return null;
143            default: return "?";
144          }
145        }
146        public String getDisplay() {
147          switch (this) {
148            case REGISTERED: return "Registered";
149            case PARTIAL: return "Partial";
150            case FINAL: return "Final";
151            case CORRECTED: return "Corrected";
152            case APPENDED: return "Appended";
153            case CANCELLED: return "Cancelled";
154            case ENTEREDINERROR: return "Entered in Error";
155            case NULL: return null;
156            default: return "?";
157          }
158        }
159    }
160
161  public static class DiagnosticReportStatusEnumFactory implements EnumFactory<DiagnosticReportStatus> {
162    public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException {
163      if (codeString == null || "".equals(codeString))
164            if (codeString == null || "".equals(codeString))
165                return null;
166        if ("registered".equals(codeString))
167          return DiagnosticReportStatus.REGISTERED;
168        if ("partial".equals(codeString))
169          return DiagnosticReportStatus.PARTIAL;
170        if ("final".equals(codeString))
171          return DiagnosticReportStatus.FINAL;
172        if ("corrected".equals(codeString))
173          return DiagnosticReportStatus.CORRECTED;
174        if ("appended".equals(codeString))
175          return DiagnosticReportStatus.APPENDED;
176        if ("cancelled".equals(codeString))
177          return DiagnosticReportStatus.CANCELLED;
178        if ("entered-in-error".equals(codeString))
179          return DiagnosticReportStatus.ENTEREDINERROR;
180        throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'");
181        }
182        public Enumeration<DiagnosticReportStatus> fromType(Base code) throws FHIRException {
183          if (code == null || code.isEmpty())
184            return null;
185          String codeString = ((PrimitiveType) code).asStringValue();
186          if (codeString == null || "".equals(codeString))
187            return null;
188        if ("registered".equals(codeString))
189          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.REGISTERED);
190        if ("partial".equals(codeString))
191          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PARTIAL);
192        if ("final".equals(codeString))
193          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.FINAL);
194        if ("corrected".equals(codeString))
195          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CORRECTED);
196        if ("appended".equals(codeString))
197          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.APPENDED);
198        if ("cancelled".equals(codeString))
199          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CANCELLED);
200        if ("entered-in-error".equals(codeString))
201          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.ENTEREDINERROR);
202        throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
203        }
204    public String toCode(DiagnosticReportStatus code) {
205      if (code == DiagnosticReportStatus.REGISTERED)
206        return "registered";
207      if (code == DiagnosticReportStatus.PARTIAL)
208        return "partial";
209      if (code == DiagnosticReportStatus.FINAL)
210        return "final";
211      if (code == DiagnosticReportStatus.CORRECTED)
212        return "corrected";
213      if (code == DiagnosticReportStatus.APPENDED)
214        return "appended";
215      if (code == DiagnosticReportStatus.CANCELLED)
216        return "cancelled";
217      if (code == DiagnosticReportStatus.ENTEREDINERROR)
218        return "entered-in-error";
219      return "?";
220      }
221    public String toSystem(DiagnosticReportStatus code) {
222      return code.getSystem();
223      }
224    }
225
226    @Block()
227    public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement {
228        /**
229         * 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.
230         */
231        @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
232        @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." )
233        protected StringType comment;
234
235        /**
236         * Reference to the image source.
237         */
238        @Child(name = "link", type = {Media.class}, order=2, min=1, max=1, modifier=false, summary=true)
239        @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." )
240        protected Reference link;
241
242        /**
243         * The actual object that is the target of the reference (Reference to the image source.)
244         */
245        protected Media linkTarget;
246
247        private static final long serialVersionUID = 935791940L;
248
249    /**
250     * Constructor
251     */
252      public DiagnosticReportImageComponent() {
253        super();
254      }
255
256    /**
257     * Constructor
258     */
259      public DiagnosticReportImageComponent(Reference link) {
260        super();
261        this.link = link;
262      }
263
264        /**
265         * @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
266         */
267        public StringType getCommentElement() { 
268          if (this.comment == null)
269            if (Configuration.errorOnAutoCreate())
270              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment");
271            else if (Configuration.doAutoCreate())
272              this.comment = new StringType(); // bb
273          return this.comment;
274        }
275
276        public boolean hasCommentElement() { 
277          return this.comment != null && !this.comment.isEmpty();
278        }
279
280        public boolean hasComment() { 
281          return this.comment != null && !this.comment.isEmpty();
282        }
283
284        /**
285         * @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
286         */
287        public DiagnosticReportImageComponent setCommentElement(StringType value) { 
288          this.comment = value;
289          return this;
290        }
291
292        /**
293         * @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.
294         */
295        public String getComment() { 
296          return this.comment == null ? null : this.comment.getValue();
297        }
298
299        /**
300         * @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.
301         */
302        public DiagnosticReportImageComponent setComment(String value) { 
303          if (Utilities.noString(value))
304            this.comment = null;
305          else {
306            if (this.comment == null)
307              this.comment = new StringType();
308            this.comment.setValue(value);
309          }
310          return this;
311        }
312
313        /**
314         * @return {@link #link} (Reference to the image source.)
315         */
316        public Reference getLink() { 
317          if (this.link == null)
318            if (Configuration.errorOnAutoCreate())
319              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link");
320            else if (Configuration.doAutoCreate())
321              this.link = new Reference(); // cc
322          return this.link;
323        }
324
325        public boolean hasLink() { 
326          return this.link != null && !this.link.isEmpty();
327        }
328
329        /**
330         * @param value {@link #link} (Reference to the image source.)
331         */
332        public DiagnosticReportImageComponent setLink(Reference value) { 
333          this.link = value;
334          return this;
335        }
336
337        /**
338         * @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.)
339         */
340        public Media getLinkTarget() { 
341          if (this.linkTarget == null)
342            if (Configuration.errorOnAutoCreate())
343              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link");
344            else if (Configuration.doAutoCreate())
345              this.linkTarget = new Media(); // aa
346          return this.linkTarget;
347        }
348
349        /**
350         * @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.)
351         */
352        public DiagnosticReportImageComponent setLinkTarget(Media value) { 
353          this.linkTarget = value;
354          return this;
355        }
356
357        protected void listChildren(List<Property> childrenList) {
358          super.listChildren(childrenList);
359          childrenList.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, java.lang.Integer.MAX_VALUE, comment));
360          childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link));
361        }
362
363      @Override
364      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
365        switch (hash) {
366        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
367        case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference
368        default: return super.getProperty(hash, name, checkValid);
369        }
370
371      }
372
373      @Override
374      public void setProperty(int hash, String name, Base value) throws FHIRException {
375        switch (hash) {
376        case 950398559: // comment
377          this.comment = castToString(value); // StringType
378          break;
379        case 3321850: // link
380          this.link = castToReference(value); // Reference
381          break;
382        default: super.setProperty(hash, name, value);
383        }
384
385      }
386
387      @Override
388      public void setProperty(String name, Base value) throws FHIRException {
389        if (name.equals("comment"))
390          this.comment = castToString(value); // StringType
391        else if (name.equals("link"))
392          this.link = castToReference(value); // Reference
393        else
394          super.setProperty(name, value);
395      }
396
397      @Override
398      public Base makeProperty(int hash, String name) throws FHIRException {
399        switch (hash) {
400        case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType
401        case 3321850:  return getLink(); // Reference
402        default: return super.makeProperty(hash, name);
403        }
404
405      }
406
407      @Override
408      public Base addChild(String name) throws FHIRException {
409        if (name.equals("comment")) {
410          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.comment");
411        }
412        else if (name.equals("link")) {
413          this.link = new Reference();
414          return this.link;
415        }
416        else
417          return super.addChild(name);
418      }
419
420      public DiagnosticReportImageComponent copy() {
421        DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent();
422        copyValues(dst);
423        dst.comment = comment == null ? null : comment.copy();
424        dst.link = link == null ? null : link.copy();
425        return dst;
426      }
427
428      @Override
429      public boolean equalsDeep(Base other) {
430        if (!super.equalsDeep(other))
431          return false;
432        if (!(other instanceof DiagnosticReportImageComponent))
433          return false;
434        DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other;
435        return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true);
436      }
437
438      @Override
439      public boolean equalsShallow(Base other) {
440        if (!super.equalsShallow(other))
441          return false;
442        if (!(other instanceof DiagnosticReportImageComponent))
443          return false;
444        DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other;
445        return compareValues(comment, o.comment, true);
446      }
447
448      public boolean isEmpty() {
449        return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty())
450          ;
451      }
452
453  public String fhirType() {
454    return "DiagnosticReport.image";
455
456  }
457
458  }
459
460    /**
461     * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.
462     */
463    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
464    @Description(shortDefinition="Id for external references to this report", formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider." )
465    protected List<Identifier> identifier;
466
467    /**
468     * The status of the diagnostic report as a whole.
469     */
470    @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true)
471    @Description(shortDefinition="registered | partial | final | corrected | appended | cancelled | entered-in-error", formalDefinition="The status of the diagnostic report as a whole." )
472    protected Enumeration<DiagnosticReportStatus> status;
473
474    /**
475     * 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.
476     */
477    @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true)
478    @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." )
479    protected CodeableConcept category;
480
481    /**
482     * A code or name that describes this diagnostic report.
483     */
484    @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true)
485    @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." )
486    protected CodeableConcept code;
487
488    /**
489     * 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.
490     */
491    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true)
492    @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." )
493    protected Reference subject;
494
495    /**
496     * 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.)
497     */
498    protected Resource subjectTarget;
499
500    /**
501     * The link to the health care event (encounter) when the order was made.
502     */
503    @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true)
504    @Description(shortDefinition="Health care event when test ordered", formalDefinition="The link to the health care event (encounter) when the order was made." )
505    protected Reference encounter;
506
507    /**
508     * The actual object that is the target of the reference (The link to the health care event (encounter) when the order was made.)
509     */
510    protected Encounter encounterTarget;
511
512    /**
513     * 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.
514     */
515    @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true)
516    @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." )
517    protected Type effective;
518
519    /**
520     * The date and time that this version of the report was released from the source diagnostic service.
521     */
522    @Child(name = "issued", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true)
523    @Description(shortDefinition="DateTime this version was released", formalDefinition="The date and time that this version of the report was released from the source diagnostic service." )
524    protected InstantType issued;
525
526    /**
527     * The diagnostic service that is responsible for issuing the report.
528     */
529    @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=8, min=1, max=1, modifier=false, summary=true)
530    @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." )
531    protected Reference performer;
532
533    /**
534     * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.)
535     */
536    protected Resource performerTarget;
537
538    /**
539     * Details concerning a test or procedure requested.
540     */
541    @Child(name = "request", type = {DiagnosticOrder.class, ProcedureRequest.class, ReferralRequest.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
542    @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test or procedure requested." )
543    protected List<Reference> request;
544    /**
545     * The actual objects that are the target of the reference (Details concerning a test or procedure requested.)
546     */
547    protected List<Resource> requestTarget;
548
549
550    /**
551     * Details about the specimens on which this diagnostic report is based.
552     */
553    @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
554    @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." )
555    protected List<Reference> specimen;
556    /**
557     * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.)
558     */
559    protected List<Specimen> specimenTarget;
560
561
562    /**
563     * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").
564     */
565    @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
566    @Description(shortDefinition="Observations - simple, or complex nested groups", formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\")." )
567    protected List<Reference> result;
568    /**
569     * The actual objects that are the target of the reference (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").)
570     */
571    protected List<Observation> resultTarget;
572
573
574    /**
575     * 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.
576     */
577    @Child(name = "imagingStudy", type = {ImagingStudy.class, ImagingObjectSelection.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
578    @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." )
579    protected List<Reference> imagingStudy;
580    /**
581     * 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.)
582     */
583    protected List<Resource> imagingStudyTarget;
584
585
586    /**
587     * 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).
588     */
589    @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
590    @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)." )
591    protected List<DiagnosticReportImageComponent> image;
592
593    /**
594     * Concise and clinically contextualized narrative interpretation of the diagnostic report.
595     */
596    @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
597    @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." )
598    protected StringType conclusion;
599
600    /**
601     * Codes for the conclusion.
602     */
603    @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
604    @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." )
605    protected List<CodeableConcept> codedDiagnosis;
606
607    /**
608     * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
609     */
610    @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
611    @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." )
612    protected List<Attachment> presentedForm;
613
614    private static final long serialVersionUID = 920334551L;
615
616  /**
617   * Constructor
618   */
619    public DiagnosticReport() {
620      super();
621    }
622
623  /**
624   * Constructor
625   */
626    public DiagnosticReport(Enumeration<DiagnosticReportStatus> status, CodeableConcept code, Reference subject, Type effective, InstantType issued, Reference performer) {
627      super();
628      this.status = status;
629      this.code = code;
630      this.subject = subject;
631      this.effective = effective;
632      this.issued = issued;
633      this.performer = performer;
634    }
635
636    /**
637     * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.)
638     */
639    public List<Identifier> getIdentifier() { 
640      if (this.identifier == null)
641        this.identifier = new ArrayList<Identifier>();
642      return this.identifier;
643    }
644
645    public boolean hasIdentifier() { 
646      if (this.identifier == null)
647        return false;
648      for (Identifier item : this.identifier)
649        if (!item.isEmpty())
650          return true;
651      return false;
652    }
653
654    /**
655     * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.)
656     */
657    // syntactic sugar
658    public Identifier addIdentifier() { //3
659      Identifier t = new Identifier();
660      if (this.identifier == null)
661        this.identifier = new ArrayList<Identifier>();
662      this.identifier.add(t);
663      return t;
664    }
665
666    // syntactic sugar
667    public DiagnosticReport addIdentifier(Identifier t) { //3
668      if (t == null)
669        return this;
670      if (this.identifier == null)
671        this.identifier = new ArrayList<Identifier>();
672      this.identifier.add(t);
673      return this;
674    }
675
676    /**
677     * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
678     */
679    public Enumeration<DiagnosticReportStatus> getStatusElement() { 
680      if (this.status == null)
681        if (Configuration.errorOnAutoCreate())
682          throw new Error("Attempt to auto-create DiagnosticReport.status");
683        else if (Configuration.doAutoCreate())
684          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory()); // bb
685      return this.status;
686    }
687
688    public boolean hasStatusElement() { 
689      return this.status != null && !this.status.isEmpty();
690    }
691
692    public boolean hasStatus() { 
693      return this.status != null && !this.status.isEmpty();
694    }
695
696    /**
697     * @param value {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
698     */
699    public DiagnosticReport setStatusElement(Enumeration<DiagnosticReportStatus> value) { 
700      this.status = value;
701      return this;
702    }
703
704    /**
705     * @return The status of the diagnostic report as a whole.
706     */
707    public DiagnosticReportStatus getStatus() { 
708      return this.status == null ? null : this.status.getValue();
709    }
710
711    /**
712     * @param value The status of the diagnostic report as a whole.
713     */
714    public DiagnosticReport setStatus(DiagnosticReportStatus value) { 
715        if (this.status == null)
716          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory());
717        this.status.setValue(value);
718      return this;
719    }
720
721    /**
722     * @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.)
723     */
724    public CodeableConcept getCategory() { 
725      if (this.category == null)
726        if (Configuration.errorOnAutoCreate())
727          throw new Error("Attempt to auto-create DiagnosticReport.category");
728        else if (Configuration.doAutoCreate())
729          this.category = new CodeableConcept(); // cc
730      return this.category;
731    }
732
733    public boolean hasCategory() { 
734      return this.category != null && !this.category.isEmpty();
735    }
736
737    /**
738     * @param value {@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.)
739     */
740    public DiagnosticReport setCategory(CodeableConcept value) { 
741      this.category = value;
742      return this;
743    }
744
745    /**
746     * @return {@link #code} (A code or name that describes this diagnostic report.)
747     */
748    public CodeableConcept getCode() { 
749      if (this.code == null)
750        if (Configuration.errorOnAutoCreate())
751          throw new Error("Attempt to auto-create DiagnosticReport.code");
752        else if (Configuration.doAutoCreate())
753          this.code = new CodeableConcept(); // cc
754      return this.code;
755    }
756
757    public boolean hasCode() { 
758      return this.code != null && !this.code.isEmpty();
759    }
760
761    /**
762     * @param value {@link #code} (A code or name that describes this diagnostic report.)
763     */
764    public DiagnosticReport setCode(CodeableConcept value) { 
765      this.code = value;
766      return this;
767    }
768
769    /**
770     * @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.)
771     */
772    public Reference getSubject() { 
773      if (this.subject == null)
774        if (Configuration.errorOnAutoCreate())
775          throw new Error("Attempt to auto-create DiagnosticReport.subject");
776        else if (Configuration.doAutoCreate())
777          this.subject = new Reference(); // cc
778      return this.subject;
779    }
780
781    public boolean hasSubject() { 
782      return this.subject != null && !this.subject.isEmpty();
783    }
784
785    /**
786     * @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.)
787     */
788    public DiagnosticReport setSubject(Reference value) { 
789      this.subject = value;
790      return this;
791    }
792
793    /**
794     * @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.)
795     */
796    public Resource getSubjectTarget() { 
797      return this.subjectTarget;
798    }
799
800    /**
801     * @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.)
802     */
803    public DiagnosticReport setSubjectTarget(Resource value) { 
804      this.subjectTarget = value;
805      return this;
806    }
807
808    /**
809     * @return {@link #encounter} (The link to the health care event (encounter) when the order was made.)
810     */
811    public Reference getEncounter() { 
812      if (this.encounter == null)
813        if (Configuration.errorOnAutoCreate())
814          throw new Error("Attempt to auto-create DiagnosticReport.encounter");
815        else if (Configuration.doAutoCreate())
816          this.encounter = new Reference(); // cc
817      return this.encounter;
818    }
819
820    public boolean hasEncounter() { 
821      return this.encounter != null && !this.encounter.isEmpty();
822    }
823
824    /**
825     * @param value {@link #encounter} (The link to the health care event (encounter) when the order was made.)
826     */
827    public DiagnosticReport setEncounter(Reference value) { 
828      this.encounter = value;
829      return this;
830    }
831
832    /**
833     * @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 link to the health care event (encounter) when the order was made.)
834     */
835    public Encounter getEncounterTarget() { 
836      if (this.encounterTarget == null)
837        if (Configuration.errorOnAutoCreate())
838          throw new Error("Attempt to auto-create DiagnosticReport.encounter");
839        else if (Configuration.doAutoCreate())
840          this.encounterTarget = new Encounter(); // aa
841      return this.encounterTarget;
842    }
843
844    /**
845     * @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 link to the health care event (encounter) when the order was made.)
846     */
847    public DiagnosticReport setEncounterTarget(Encounter value) { 
848      this.encounterTarget = value;
849      return this;
850    }
851
852    /**
853     * @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.)
854     */
855    public Type getEffective() { 
856      return this.effective;
857    }
858
859    /**
860     * @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.)
861     */
862    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
863      if (!(this.effective instanceof DateTimeType))
864        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
865      return (DateTimeType) this.effective;
866    }
867
868    public boolean hasEffectiveDateTimeType() { 
869      return this.effective instanceof DateTimeType;
870    }
871
872    /**
873     * @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.)
874     */
875    public Period getEffectivePeriod() throws FHIRException { 
876      if (!(this.effective instanceof Period))
877        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
878      return (Period) this.effective;
879    }
880
881    public boolean hasEffectivePeriod() { 
882      return this.effective instanceof Period;
883    }
884
885    public boolean hasEffective() { 
886      return this.effective != null && !this.effective.isEmpty();
887    }
888
889    /**
890     * @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.)
891     */
892    public DiagnosticReport setEffective(Type value) { 
893      this.effective = value;
894      return this;
895    }
896
897    /**
898     * @return {@link #issued} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
899     */
900    public InstantType getIssuedElement() { 
901      if (this.issued == null)
902        if (Configuration.errorOnAutoCreate())
903          throw new Error("Attempt to auto-create DiagnosticReport.issued");
904        else if (Configuration.doAutoCreate())
905          this.issued = new InstantType(); // bb
906      return this.issued;
907    }
908
909    public boolean hasIssuedElement() { 
910      return this.issued != null && !this.issued.isEmpty();
911    }
912
913    public boolean hasIssued() { 
914      return this.issued != null && !this.issued.isEmpty();
915    }
916
917    /**
918     * @param value {@link #issued} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
919     */
920    public DiagnosticReport setIssuedElement(InstantType value) { 
921      this.issued = value;
922      return this;
923    }
924
925    /**
926     * @return The date and time that this version of the report was released from the source diagnostic service.
927     */
928    public Date getIssued() { 
929      return this.issued == null ? null : this.issued.getValue();
930    }
931
932    /**
933     * @param value The date and time that this version of the report was released from the source diagnostic service.
934     */
935    public DiagnosticReport setIssued(Date value) { 
936        if (this.issued == null)
937          this.issued = new InstantType();
938        this.issued.setValue(value);
939      return this;
940    }
941
942    /**
943     * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.)
944     */
945    public Reference getPerformer() { 
946      if (this.performer == null)
947        if (Configuration.errorOnAutoCreate())
948          throw new Error("Attempt to auto-create DiagnosticReport.performer");
949        else if (Configuration.doAutoCreate())
950          this.performer = new Reference(); // cc
951      return this.performer;
952    }
953
954    public boolean hasPerformer() { 
955      return this.performer != null && !this.performer.isEmpty();
956    }
957
958    /**
959     * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.)
960     */
961    public DiagnosticReport setPerformer(Reference value) { 
962      this.performer = value;
963      return this;
964    }
965
966    /**
967     * @return {@link #performer} 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 diagnostic service that is responsible for issuing the report.)
968     */
969    public Resource getPerformerTarget() { 
970      return this.performerTarget;
971    }
972
973    /**
974     * @param value {@link #performer} 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 diagnostic service that is responsible for issuing the report.)
975     */
976    public DiagnosticReport setPerformerTarget(Resource value) { 
977      this.performerTarget = value;
978      return this;
979    }
980
981    /**
982     * @return {@link #request} (Details concerning a test or procedure requested.)
983     */
984    public List<Reference> getRequest() { 
985      if (this.request == null)
986        this.request = new ArrayList<Reference>();
987      return this.request;
988    }
989
990    public boolean hasRequest() { 
991      if (this.request == null)
992        return false;
993      for (Reference item : this.request)
994        if (!item.isEmpty())
995          return true;
996      return false;
997    }
998
999    /**
1000     * @return {@link #request} (Details concerning a test or procedure requested.)
1001     */
1002    // syntactic sugar
1003    public Reference addRequest() { //3
1004      Reference t = new Reference();
1005      if (this.request == null)
1006        this.request = new ArrayList<Reference>();
1007      this.request.add(t);
1008      return t;
1009    }
1010
1011    // syntactic sugar
1012    public DiagnosticReport addRequest(Reference t) { //3
1013      if (t == null)
1014        return this;
1015      if (this.request == null)
1016        this.request = new ArrayList<Reference>();
1017      this.request.add(t);
1018      return this;
1019    }
1020
1021    /**
1022     * @return {@link #request} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details concerning a test or procedure requested.)
1023     */
1024    public List<Resource> getRequestTarget() { 
1025      if (this.requestTarget == null)
1026        this.requestTarget = new ArrayList<Resource>();
1027      return this.requestTarget;
1028    }
1029
1030    /**
1031     * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.)
1032     */
1033    public List<Reference> getSpecimen() { 
1034      if (this.specimen == null)
1035        this.specimen = new ArrayList<Reference>();
1036      return this.specimen;
1037    }
1038
1039    public boolean hasSpecimen() { 
1040      if (this.specimen == null)
1041        return false;
1042      for (Reference item : this.specimen)
1043        if (!item.isEmpty())
1044          return true;
1045      return false;
1046    }
1047
1048    /**
1049     * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.)
1050     */
1051    // syntactic sugar
1052    public Reference addSpecimen() { //3
1053      Reference t = new Reference();
1054      if (this.specimen == null)
1055        this.specimen = new ArrayList<Reference>();
1056      this.specimen.add(t);
1057      return t;
1058    }
1059
1060    // syntactic sugar
1061    public DiagnosticReport addSpecimen(Reference t) { //3
1062      if (t == null)
1063        return this;
1064      if (this.specimen == null)
1065        this.specimen = new ArrayList<Reference>();
1066      this.specimen.add(t);
1067      return this;
1068    }
1069
1070    /**
1071     * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.)
1072     */
1073    public List<Specimen> getSpecimenTarget() { 
1074      if (this.specimenTarget == null)
1075        this.specimenTarget = new ArrayList<Specimen>();
1076      return this.specimenTarget;
1077    }
1078
1079    // syntactic sugar
1080    /**
1081     * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.)
1082     */
1083    public Specimen addSpecimenTarget() { 
1084      Specimen r = new Specimen();
1085      if (this.specimenTarget == null)
1086        this.specimenTarget = new ArrayList<Specimen>();
1087      this.specimenTarget.add(r);
1088      return r;
1089    }
1090
1091    /**
1092     * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").)
1093     */
1094    public List<Reference> getResult() { 
1095      if (this.result == null)
1096        this.result = new ArrayList<Reference>();
1097      return this.result;
1098    }
1099
1100    public boolean hasResult() { 
1101      if (this.result == null)
1102        return false;
1103      for (Reference item : this.result)
1104        if (!item.isEmpty())
1105          return true;
1106      return false;
1107    }
1108
1109    /**
1110     * @return {@link #result} (Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").)
1111     */
1112    // syntactic sugar
1113    public Reference addResult() { //3
1114      Reference t = new Reference();
1115      if (this.result == null)
1116        this.result = new ArrayList<Reference>();
1117      this.result.add(t);
1118      return t;
1119    }
1120
1121    // syntactic sugar
1122    public DiagnosticReport addResult(Reference t) { //3
1123      if (t == null)
1124        return this;
1125      if (this.result == null)
1126        this.result = new ArrayList<Reference>();
1127      this.result.add(t);
1128      return this;
1129    }
1130
1131    /**
1132     * @return {@link #result} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").)
1133     */
1134    public List<Observation> getResultTarget() { 
1135      if (this.resultTarget == null)
1136        this.resultTarget = new ArrayList<Observation>();
1137      return this.resultTarget;
1138    }
1139
1140    // syntactic sugar
1141    /**
1142     * @return {@link #result} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels").)
1143     */
1144    public Observation addResultTarget() { 
1145      Observation r = new Observation();
1146      if (this.resultTarget == null)
1147        this.resultTarget = new ArrayList<Observation>();
1148      this.resultTarget.add(r);
1149      return r;
1150    }
1151
1152    /**
1153     * @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.)
1154     */
1155    public List<Reference> getImagingStudy() { 
1156      if (this.imagingStudy == null)
1157        this.imagingStudy = new ArrayList<Reference>();
1158      return this.imagingStudy;
1159    }
1160
1161    public boolean hasImagingStudy() { 
1162      if (this.imagingStudy == null)
1163        return false;
1164      for (Reference item : this.imagingStudy)
1165        if (!item.isEmpty())
1166          return true;
1167      return false;
1168    }
1169
1170    /**
1171     * @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.)
1172     */
1173    // syntactic sugar
1174    public Reference addImagingStudy() { //3
1175      Reference t = new Reference();
1176      if (this.imagingStudy == null)
1177        this.imagingStudy = new ArrayList<Reference>();
1178      this.imagingStudy.add(t);
1179      return t;
1180    }
1181
1182    // syntactic sugar
1183    public DiagnosticReport addImagingStudy(Reference t) { //3
1184      if (t == null)
1185        return this;
1186      if (this.imagingStudy == null)
1187        this.imagingStudy = new ArrayList<Reference>();
1188      this.imagingStudy.add(t);
1189      return this;
1190    }
1191
1192    /**
1193     * @return {@link #imagingStudy} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. 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.)
1194     */
1195    public List<Resource> getImagingStudyTarget() { 
1196      if (this.imagingStudyTarget == null)
1197        this.imagingStudyTarget = new ArrayList<Resource>();
1198      return this.imagingStudyTarget;
1199    }
1200
1201    /**
1202     * @return {@link #image} (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).)
1203     */
1204    public List<DiagnosticReportImageComponent> getImage() { 
1205      if (this.image == null)
1206        this.image = new ArrayList<DiagnosticReportImageComponent>();
1207      return this.image;
1208    }
1209
1210    public boolean hasImage() { 
1211      if (this.image == null)
1212        return false;
1213      for (DiagnosticReportImageComponent item : this.image)
1214        if (!item.isEmpty())
1215          return true;
1216      return false;
1217    }
1218
1219    /**
1220     * @return {@link #image} (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).)
1221     */
1222    // syntactic sugar
1223    public DiagnosticReportImageComponent addImage() { //3
1224      DiagnosticReportImageComponent t = new DiagnosticReportImageComponent();
1225      if (this.image == null)
1226        this.image = new ArrayList<DiagnosticReportImageComponent>();
1227      this.image.add(t);
1228      return t;
1229    }
1230
1231    // syntactic sugar
1232    public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3
1233      if (t == null)
1234        return this;
1235      if (this.image == null)
1236        this.image = new ArrayList<DiagnosticReportImageComponent>();
1237      this.image.add(t);
1238      return this;
1239    }
1240
1241    /**
1242     * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value
1243     */
1244    public StringType getConclusionElement() { 
1245      if (this.conclusion == null)
1246        if (Configuration.errorOnAutoCreate())
1247          throw new Error("Attempt to auto-create DiagnosticReport.conclusion");
1248        else if (Configuration.doAutoCreate())
1249          this.conclusion = new StringType(); // bb
1250      return this.conclusion;
1251    }
1252
1253    public boolean hasConclusionElement() { 
1254      return this.conclusion != null && !this.conclusion.isEmpty();
1255    }
1256
1257    public boolean hasConclusion() { 
1258      return this.conclusion != null && !this.conclusion.isEmpty();
1259    }
1260
1261    /**
1262     * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value
1263     */
1264    public DiagnosticReport setConclusionElement(StringType value) { 
1265      this.conclusion = value;
1266      return this;
1267    }
1268
1269    /**
1270     * @return Concise and clinically contextualized narrative interpretation of the diagnostic report.
1271     */
1272    public String getConclusion() { 
1273      return this.conclusion == null ? null : this.conclusion.getValue();
1274    }
1275
1276    /**
1277     * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report.
1278     */
1279    public DiagnosticReport setConclusion(String value) { 
1280      if (Utilities.noString(value))
1281        this.conclusion = null;
1282      else {
1283        if (this.conclusion == null)
1284          this.conclusion = new StringType();
1285        this.conclusion.setValue(value);
1286      }
1287      return this;
1288    }
1289
1290    /**
1291     * @return {@link #codedDiagnosis} (Codes for the conclusion.)
1292     */
1293    public List<CodeableConcept> getCodedDiagnosis() { 
1294      if (this.codedDiagnosis == null)
1295        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1296      return this.codedDiagnosis;
1297    }
1298
1299    public boolean hasCodedDiagnosis() { 
1300      if (this.codedDiagnosis == null)
1301        return false;
1302      for (CodeableConcept item : this.codedDiagnosis)
1303        if (!item.isEmpty())
1304          return true;
1305      return false;
1306    }
1307
1308    /**
1309     * @return {@link #codedDiagnosis} (Codes for the conclusion.)
1310     */
1311    // syntactic sugar
1312    public CodeableConcept addCodedDiagnosis() { //3
1313      CodeableConcept t = new CodeableConcept();
1314      if (this.codedDiagnosis == null)
1315        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1316      this.codedDiagnosis.add(t);
1317      return t;
1318    }
1319
1320    // syntactic sugar
1321    public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3
1322      if (t == null)
1323        return this;
1324      if (this.codedDiagnosis == null)
1325        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1326      this.codedDiagnosis.add(t);
1327      return this;
1328    }
1329
1330    /**
1331     * @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.)
1332     */
1333    public List<Attachment> getPresentedForm() { 
1334      if (this.presentedForm == null)
1335        this.presentedForm = new ArrayList<Attachment>();
1336      return this.presentedForm;
1337    }
1338
1339    public boolean hasPresentedForm() { 
1340      if (this.presentedForm == null)
1341        return false;
1342      for (Attachment item : this.presentedForm)
1343        if (!item.isEmpty())
1344          return true;
1345      return false;
1346    }
1347
1348    /**
1349     * @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.)
1350     */
1351    // syntactic sugar
1352    public Attachment addPresentedForm() { //3
1353      Attachment t = new Attachment();
1354      if (this.presentedForm == null)
1355        this.presentedForm = new ArrayList<Attachment>();
1356      this.presentedForm.add(t);
1357      return t;
1358    }
1359
1360    // syntactic sugar
1361    public DiagnosticReport addPresentedForm(Attachment t) { //3
1362      if (t == null)
1363        return this;
1364      if (this.presentedForm == null)
1365        this.presentedForm = new ArrayList<Attachment>();
1366      this.presentedForm.add(t);
1367      return this;
1368    }
1369
1370      protected void listChildren(List<Property> childrenList) {
1371        super.listChildren(childrenList);
1372        childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier));
1373        childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status));
1374        childrenList.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));
1375        childrenList.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, code));
1376        childrenList.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, java.lang.Integer.MAX_VALUE, subject));
1377        childrenList.add(new Property("encounter", "Reference(Encounter)", "The link to the health care event (encounter) when the order was made.", 0, java.lang.Integer.MAX_VALUE, encounter));
1378        childrenList.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, java.lang.Integer.MAX_VALUE, effective));
1379        childrenList.add(new Property("issued", "instant", "The date and time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued));
1380        childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer));
1381        childrenList.add(new Property("request", "Reference(DiagnosticOrder|ProcedureRequest|ReferralRequest)", "Details concerning a test or procedure requested.", 0, java.lang.Integer.MAX_VALUE, request));
1382        childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen));
1383        childrenList.add(new Property("result", "Reference(Observation)", "Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\").", 0, java.lang.Integer.MAX_VALUE, result));
1384        childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy|ImagingObjectSelection)", "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));
1385        childrenList.add(new Property("image", "", "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, image));
1386        childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion));
1387        childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis));
1388        childrenList.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));
1389      }
1390
1391      @Override
1392      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1393        switch (hash) {
1394        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1395        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DiagnosticReportStatus>
1396        case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
1397        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1398        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1399        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1400        case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type
1401        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
1402        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference
1403        case 1095692943: /*request*/ return this.request == null ? new Base[0] : this.request.toArray(new Base[this.request.size()]); // Reference
1404        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
1405        case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference
1406        case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : this.imagingStudy.toArray(new Base[this.imagingStudy.size()]); // Reference
1407        case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // DiagnosticReportImageComponent
1408        case -1731259873: /*conclusion*/ return this.conclusion == null ? new Base[0] : new Base[] {this.conclusion}; // StringType
1409        case -1364269926: /*codedDiagnosis*/ return this.codedDiagnosis == null ? new Base[0] : this.codedDiagnosis.toArray(new Base[this.codedDiagnosis.size()]); // CodeableConcept
1410        case 230090366: /*presentedForm*/ return this.presentedForm == null ? new Base[0] : this.presentedForm.toArray(new Base[this.presentedForm.size()]); // Attachment
1411        default: return super.getProperty(hash, name, checkValid);
1412        }
1413
1414      }
1415
1416      @Override
1417      public void setProperty(int hash, String name, Base value) throws FHIRException {
1418        switch (hash) {
1419        case -1618432855: // identifier
1420          this.getIdentifier().add(castToIdentifier(value)); // Identifier
1421          break;
1422        case -892481550: // status
1423          this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration<DiagnosticReportStatus>
1424          break;
1425        case 50511102: // category
1426          this.category = castToCodeableConcept(value); // CodeableConcept
1427          break;
1428        case 3059181: // code
1429          this.code = castToCodeableConcept(value); // CodeableConcept
1430          break;
1431        case -1867885268: // subject
1432          this.subject = castToReference(value); // Reference
1433          break;
1434        case 1524132147: // encounter
1435          this.encounter = castToReference(value); // Reference
1436          break;
1437        case -1468651097: // effective
1438          this.effective = (Type) value; // Type
1439          break;
1440        case -1179159893: // issued
1441          this.issued = castToInstant(value); // InstantType
1442          break;
1443        case 481140686: // performer
1444          this.performer = castToReference(value); // Reference
1445          break;
1446        case 1095692943: // request
1447          this.getRequest().add(castToReference(value)); // Reference
1448          break;
1449        case -2132868344: // specimen
1450          this.getSpecimen().add(castToReference(value)); // Reference
1451          break;
1452        case -934426595: // result
1453          this.getResult().add(castToReference(value)); // Reference
1454          break;
1455        case -814900911: // imagingStudy
1456          this.getImagingStudy().add(castToReference(value)); // Reference
1457          break;
1458        case 100313435: // image
1459          this.getImage().add((DiagnosticReportImageComponent) value); // DiagnosticReportImageComponent
1460          break;
1461        case -1731259873: // conclusion
1462          this.conclusion = castToString(value); // StringType
1463          break;
1464        case -1364269926: // codedDiagnosis
1465          this.getCodedDiagnosis().add(castToCodeableConcept(value)); // CodeableConcept
1466          break;
1467        case 230090366: // presentedForm
1468          this.getPresentedForm().add(castToAttachment(value)); // Attachment
1469          break;
1470        default: super.setProperty(hash, name, value);
1471        }
1472
1473      }
1474
1475      @Override
1476      public void setProperty(String name, Base value) throws FHIRException {
1477        if (name.equals("identifier"))
1478          this.getIdentifier().add(castToIdentifier(value));
1479        else if (name.equals("status"))
1480          this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration<DiagnosticReportStatus>
1481        else if (name.equals("category"))
1482          this.category = castToCodeableConcept(value); // CodeableConcept
1483        else if (name.equals("code"))
1484          this.code = castToCodeableConcept(value); // CodeableConcept
1485        else if (name.equals("subject"))
1486          this.subject = castToReference(value); // Reference
1487        else if (name.equals("encounter"))
1488          this.encounter = castToReference(value); // Reference
1489        else if (name.equals("effective[x]"))
1490          this.effective = (Type) value; // Type
1491        else if (name.equals("issued"))
1492          this.issued = castToInstant(value); // InstantType
1493        else if (name.equals("performer"))
1494          this.performer = castToReference(value); // Reference
1495        else if (name.equals("request"))
1496          this.getRequest().add(castToReference(value));
1497        else if (name.equals("specimen"))
1498          this.getSpecimen().add(castToReference(value));
1499        else if (name.equals("result"))
1500          this.getResult().add(castToReference(value));
1501        else if (name.equals("imagingStudy"))
1502          this.getImagingStudy().add(castToReference(value));
1503        else if (name.equals("image"))
1504          this.getImage().add((DiagnosticReportImageComponent) value);
1505        else if (name.equals("conclusion"))
1506          this.conclusion = castToString(value); // StringType
1507        else if (name.equals("codedDiagnosis"))
1508          this.getCodedDiagnosis().add(castToCodeableConcept(value));
1509        else if (name.equals("presentedForm"))
1510          this.getPresentedForm().add(castToAttachment(value));
1511        else
1512          super.setProperty(name, value);
1513      }
1514
1515      @Override
1516      public Base makeProperty(int hash, String name) throws FHIRException {
1517        switch (hash) {
1518        case -1618432855:  return addIdentifier(); // Identifier
1519        case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration<DiagnosticReportStatus>
1520        case 50511102:  return getCategory(); // CodeableConcept
1521        case 3059181:  return getCode(); // CodeableConcept
1522        case -1867885268:  return getSubject(); // Reference
1523        case 1524132147:  return getEncounter(); // Reference
1524        case 247104889:  return getEffective(); // Type
1525        case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // InstantType
1526        case 481140686:  return getPerformer(); // Reference
1527        case 1095692943:  return addRequest(); // Reference
1528        case -2132868344:  return addSpecimen(); // Reference
1529        case -934426595:  return addResult(); // Reference
1530        case -814900911:  return addImagingStudy(); // Reference
1531        case 100313435:  return addImage(); // DiagnosticReportImageComponent
1532        case -1731259873: throw new FHIRException("Cannot make property conclusion as it is not a complex type"); // StringType
1533        case -1364269926:  return addCodedDiagnosis(); // CodeableConcept
1534        case 230090366:  return addPresentedForm(); // Attachment
1535        default: return super.makeProperty(hash, name);
1536        }
1537
1538      }
1539
1540      @Override
1541      public Base addChild(String name) throws FHIRException {
1542        if (name.equals("identifier")) {
1543          return addIdentifier();
1544        }
1545        else if (name.equals("status")) {
1546          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.status");
1547        }
1548        else if (name.equals("category")) {
1549          this.category = new CodeableConcept();
1550          return this.category;
1551        }
1552        else if (name.equals("code")) {
1553          this.code = new CodeableConcept();
1554          return this.code;
1555        }
1556        else if (name.equals("subject")) {
1557          this.subject = new Reference();
1558          return this.subject;
1559        }
1560        else if (name.equals("encounter")) {
1561          this.encounter = new Reference();
1562          return this.encounter;
1563        }
1564        else if (name.equals("effectiveDateTime")) {
1565          this.effective = new DateTimeType();
1566          return this.effective;
1567        }
1568        else if (name.equals("effectivePeriod")) {
1569          this.effective = new Period();
1570          return this.effective;
1571        }
1572        else if (name.equals("issued")) {
1573          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.issued");
1574        }
1575        else if (name.equals("performer")) {
1576          this.performer = new Reference();
1577          return this.performer;
1578        }
1579        else if (name.equals("request")) {
1580          return addRequest();
1581        }
1582        else if (name.equals("specimen")) {
1583          return addSpecimen();
1584        }
1585        else if (name.equals("result")) {
1586          return addResult();
1587        }
1588        else if (name.equals("imagingStudy")) {
1589          return addImagingStudy();
1590        }
1591        else if (name.equals("image")) {
1592          return addImage();
1593        }
1594        else if (name.equals("conclusion")) {
1595          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.conclusion");
1596        }
1597        else if (name.equals("codedDiagnosis")) {
1598          return addCodedDiagnosis();
1599        }
1600        else if (name.equals("presentedForm")) {
1601          return addPresentedForm();
1602        }
1603        else
1604          return super.addChild(name);
1605      }
1606
1607  public String fhirType() {
1608    return "DiagnosticReport";
1609
1610  }
1611
1612      public DiagnosticReport copy() {
1613        DiagnosticReport dst = new DiagnosticReport();
1614        copyValues(dst);
1615        if (identifier != null) {
1616          dst.identifier = new ArrayList<Identifier>();
1617          for (Identifier i : identifier)
1618            dst.identifier.add(i.copy());
1619        };
1620        dst.status = status == null ? null : status.copy();
1621        dst.category = category == null ? null : category.copy();
1622        dst.code = code == null ? null : code.copy();
1623        dst.subject = subject == null ? null : subject.copy();
1624        dst.encounter = encounter == null ? null : encounter.copy();
1625        dst.effective = effective == null ? null : effective.copy();
1626        dst.issued = issued == null ? null : issued.copy();
1627        dst.performer = performer == null ? null : performer.copy();
1628        if (request != null) {
1629          dst.request = new ArrayList<Reference>();
1630          for (Reference i : request)
1631            dst.request.add(i.copy());
1632        };
1633        if (specimen != null) {
1634          dst.specimen = new ArrayList<Reference>();
1635          for (Reference i : specimen)
1636            dst.specimen.add(i.copy());
1637        };
1638        if (result != null) {
1639          dst.result = new ArrayList<Reference>();
1640          for (Reference i : result)
1641            dst.result.add(i.copy());
1642        };
1643        if (imagingStudy != null) {
1644          dst.imagingStudy = new ArrayList<Reference>();
1645          for (Reference i : imagingStudy)
1646            dst.imagingStudy.add(i.copy());
1647        };
1648        if (image != null) {
1649          dst.image = new ArrayList<DiagnosticReportImageComponent>();
1650          for (DiagnosticReportImageComponent i : image)
1651            dst.image.add(i.copy());
1652        };
1653        dst.conclusion = conclusion == null ? null : conclusion.copy();
1654        if (codedDiagnosis != null) {
1655          dst.codedDiagnosis = new ArrayList<CodeableConcept>();
1656          for (CodeableConcept i : codedDiagnosis)
1657            dst.codedDiagnosis.add(i.copy());
1658        };
1659        if (presentedForm != null) {
1660          dst.presentedForm = new ArrayList<Attachment>();
1661          for (Attachment i : presentedForm)
1662            dst.presentedForm.add(i.copy());
1663        };
1664        return dst;
1665      }
1666
1667      protected DiagnosticReport typedCopy() {
1668        return copy();
1669      }
1670
1671      @Override
1672      public boolean equalsDeep(Base other) {
1673        if (!super.equalsDeep(other))
1674          return false;
1675        if (!(other instanceof DiagnosticReport))
1676          return false;
1677        DiagnosticReport o = (DiagnosticReport) other;
1678        return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true)
1679           && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true)
1680           && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true)
1681           && compareDeep(request, o.request, true) && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true)
1682           && compareDeep(imagingStudy, o.imagingStudy, true) && compareDeep(image, o.image, true) && compareDeep(conclusion, o.conclusion, true)
1683           && compareDeep(codedDiagnosis, o.codedDiagnosis, true) && compareDeep(presentedForm, o.presentedForm, true)
1684          ;
1685      }
1686
1687      @Override
1688      public boolean equalsShallow(Base other) {
1689        if (!super.equalsShallow(other))
1690          return false;
1691        if (!(other instanceof DiagnosticReport))
1692          return false;
1693        DiagnosticReport o = (DiagnosticReport) other;
1694        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true)
1695          ;
1696      }
1697
1698      public boolean isEmpty() {
1699        return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty())
1700           && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty())
1701           && (encounter == null || encounter.isEmpty()) && (effective == null || effective.isEmpty())
1702           && (issued == null || issued.isEmpty()) && (performer == null || performer.isEmpty()) && (request == null || request.isEmpty())
1703           && (specimen == null || specimen.isEmpty()) && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty())
1704           && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty())
1705           && (presentedForm == null || presentedForm.isEmpty());
1706      }
1707
1708  @Override
1709  public ResourceType getResourceType() {
1710    return ResourceType.DiagnosticReport;
1711   }
1712
1713 /**
1714   * Search parameter: <b>result</b>
1715   * <p>
1716   * Description: <b>Link to an atomic result (observation resource)</b><br>
1717   * Type: <b>reference</b><br>
1718   * Path: <b>DiagnosticReport.result</b><br>
1719   * </p>
1720   */
1721  @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" )
1722  public static final String SP_RESULT = "result";
1723 /**
1724   * <b>Fluent Client</b> search parameter constant for <b>result</b>
1725   * <p>
1726   * Description: <b>Link to an atomic result (observation resource)</b><br>
1727   * Type: <b>reference</b><br>
1728   * Path: <b>DiagnosticReport.result</b><br>
1729   * </p>
1730   */
1731  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULT);
1732
1733/**
1734   * Constant for fluent queries to be used to add include statements. Specifies
1735   * the path value of "<b>DiagnosticReport:result</b>".
1736   */
1737  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:result").toLocked();
1738
1739 /**
1740   * Search parameter: <b>status</b>
1741   * <p>
1742   * Description: <b>The status of the report</b><br>
1743   * Type: <b>token</b><br>
1744   * Path: <b>DiagnosticReport.status</b><br>
1745   * </p>
1746   */
1747  @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" )
1748  public static final String SP_STATUS = "status";
1749 /**
1750   * <b>Fluent Client</b> search parameter constant for <b>status</b>
1751   * <p>
1752   * Description: <b>The status of the report</b><br>
1753   * Type: <b>token</b><br>
1754   * Path: <b>DiagnosticReport.status</b><br>
1755   * </p>
1756   */
1757  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
1758
1759 /**
1760   * Search parameter: <b>subject</b>
1761   * <p>
1762   * Description: <b>The subject of the report</b><br>
1763   * Type: <b>reference</b><br>
1764   * Path: <b>DiagnosticReport.subject</b><br>
1765   * </p>
1766   */
1767  @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" )
1768  public static final String SP_SUBJECT = "subject";
1769 /**
1770   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
1771   * <p>
1772   * Description: <b>The subject of the report</b><br>
1773   * Type: <b>reference</b><br>
1774   * Path: <b>DiagnosticReport.subject</b><br>
1775   * </p>
1776   */
1777  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
1778
1779/**
1780   * Constant for fluent queries to be used to add include statements. Specifies
1781   * the path value of "<b>DiagnosticReport:subject</b>".
1782   */
1783  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:subject").toLocked();
1784
1785 /**
1786   * Search parameter: <b>issued</b>
1787   * <p>
1788   * Description: <b>When the report was issued</b><br>
1789   * Type: <b>date</b><br>
1790   * Path: <b>DiagnosticReport.issued</b><br>
1791   * </p>
1792   */
1793  @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" )
1794  public static final String SP_ISSUED = "issued";
1795 /**
1796   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
1797   * <p>
1798   * Description: <b>When the report was issued</b><br>
1799   * Type: <b>date</b><br>
1800   * Path: <b>DiagnosticReport.issued</b><br>
1801   * </p>
1802   */
1803  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
1804
1805 /**
1806   * Search parameter: <b>diagnosis</b>
1807   * <p>
1808   * Description: <b>A coded diagnosis on the report</b><br>
1809   * Type: <b>token</b><br>
1810   * Path: <b>DiagnosticReport.codedDiagnosis</b><br>
1811   * </p>
1812   */
1813  @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" )
1814  public static final String SP_DIAGNOSIS = "diagnosis";
1815 /**
1816   * <b>Fluent Client</b> search parameter constant for <b>diagnosis</b>
1817   * <p>
1818   * Description: <b>A coded diagnosis on the report</b><br>
1819   * Type: <b>token</b><br>
1820   * Path: <b>DiagnosticReport.codedDiagnosis</b><br>
1821   * </p>
1822   */
1823  public static final ca.uhn.fhir.rest.gclient.TokenClientParam DIAGNOSIS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIAGNOSIS);
1824
1825 /**
1826   * Search parameter: <b>image</b>
1827   * <p>
1828   * Description: <b>A reference to the image source.</b><br>
1829   * Type: <b>reference</b><br>
1830   * Path: <b>DiagnosticReport.image.link</b><br>
1831   * </p>
1832   */
1833  @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="A reference to the image source.", type="reference" )
1834  public static final String SP_IMAGE = "image";
1835 /**
1836   * <b>Fluent Client</b> search parameter constant for <b>image</b>
1837   * <p>
1838   * Description: <b>A reference to the image source.</b><br>
1839   * Type: <b>reference</b><br>
1840   * Path: <b>DiagnosticReport.image.link</b><br>
1841   * </p>
1842   */
1843  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam IMAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_IMAGE);
1844
1845/**
1846   * Constant for fluent queries to be used to add include statements. Specifies
1847   * the path value of "<b>DiagnosticReport:image</b>".
1848   */
1849  public static final ca.uhn.fhir.model.api.Include INCLUDE_IMAGE = new ca.uhn.fhir.model.api.Include("DiagnosticReport:image").toLocked();
1850
1851 /**
1852   * Search parameter: <b>encounter</b>
1853   * <p>
1854   * Description: <b>The Encounter when the order was made</b><br>
1855   * Type: <b>reference</b><br>
1856   * Path: <b>DiagnosticReport.encounter</b><br>
1857   * </p>
1858   */
1859  @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference" )
1860  public static final String SP_ENCOUNTER = "encounter";
1861 /**
1862   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
1863   * <p>
1864   * Description: <b>The Encounter when the order was made</b><br>
1865   * Type: <b>reference</b><br>
1866   * Path: <b>DiagnosticReport.encounter</b><br>
1867   * </p>
1868   */
1869  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
1870
1871/**
1872   * Constant for fluent queries to be used to add include statements. Specifies
1873   * the path value of "<b>DiagnosticReport:encounter</b>".
1874   */
1875  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:encounter").toLocked();
1876
1877 /**
1878   * Search parameter: <b>code</b>
1879   * <p>
1880   * Description: <b>The code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result</b><br>
1881   * Type: <b>token</b><br>
1882   * Path: <b>DiagnosticReport.code</b><br>
1883   * </p>
1884   */
1885  @SearchParamDefinition(name="code", path="DiagnosticReport.code", description="The code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result", type="token" )
1886  public static final String SP_CODE = "code";
1887 /**
1888   * <b>Fluent Client</b> search parameter constant for <b>code</b>
1889   * <p>
1890   * Description: <b>The code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result</b><br>
1891   * Type: <b>token</b><br>
1892   * Path: <b>DiagnosticReport.code</b><br>
1893   * </p>
1894   */
1895  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
1896
1897 /**
1898   * Search parameter: <b>date</b>
1899   * <p>
1900   * Description: <b>The clinically relevant time of the report</b><br>
1901   * Type: <b>date</b><br>
1902   * Path: <b>DiagnosticReport.effective[x]</b><br>
1903   * </p>
1904   */
1905  @SearchParamDefinition(name="date", path="DiagnosticReport.effective", description="The clinically relevant time of the report", type="date" )
1906  public static final String SP_DATE = "date";
1907 /**
1908   * <b>Fluent Client</b> search parameter constant for <b>date</b>
1909   * <p>
1910   * Description: <b>The clinically relevant time of the report</b><br>
1911   * Type: <b>date</b><br>
1912   * Path: <b>DiagnosticReport.effective[x]</b><br>
1913   * </p>
1914   */
1915  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
1916
1917 /**
1918   * Search parameter: <b>category</b>
1919   * <p>
1920   * Description: <b>Which diagnostic discipline/department created the report</b><br>
1921   * Type: <b>token</b><br>
1922   * Path: <b>DiagnosticReport.category</b><br>
1923   * </p>
1924   */
1925  @SearchParamDefinition(name="category", path="DiagnosticReport.category", description="Which diagnostic discipline/department created the report", type="token" )
1926  public static final String SP_CATEGORY = "category";
1927 /**
1928   * <b>Fluent Client</b> search parameter constant for <b>category</b>
1929   * <p>
1930   * Description: <b>Which diagnostic discipline/department created the report</b><br>
1931   * Type: <b>token</b><br>
1932   * Path: <b>DiagnosticReport.category</b><br>
1933   * </p>
1934   */
1935  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
1936
1937 /**
1938   * Search parameter: <b>patient</b>
1939   * <p>
1940   * Description: <b>The subject of the report if a patient</b><br>
1941   * Type: <b>reference</b><br>
1942   * Path: <b>DiagnosticReport.subject</b><br>
1943   * </p>
1944   */
1945  @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" )
1946  public static final String SP_PATIENT = "patient";
1947 /**
1948   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
1949   * <p>
1950   * Description: <b>The subject of the report if a patient</b><br>
1951   * Type: <b>reference</b><br>
1952   * Path: <b>DiagnosticReport.subject</b><br>
1953   * </p>
1954   */
1955  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
1956
1957/**
1958   * Constant for fluent queries to be used to add include statements. Specifies
1959   * the path value of "<b>DiagnosticReport:patient</b>".
1960   */
1961  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:patient").toLocked();
1962
1963 /**
1964   * Search parameter: <b>request</b>
1965   * <p>
1966   * Description: <b>Reference to the test or procedure request.</b><br>
1967   * Type: <b>reference</b><br>
1968   * Path: <b>DiagnosticReport.request</b><br>
1969   * </p>
1970   */
1971  @SearchParamDefinition(name="request", path="DiagnosticReport.request", description="Reference to the test or procedure request.", type="reference" )
1972  public static final String SP_REQUEST = "request";
1973 /**
1974   * <b>Fluent Client</b> search parameter constant for <b>request</b>
1975   * <p>
1976   * Description: <b>Reference to the test or procedure request.</b><br>
1977   * Type: <b>reference</b><br>
1978   * Path: <b>DiagnosticReport.request</b><br>
1979   * </p>
1980   */
1981  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST);
1982
1983/**
1984   * Constant for fluent queries to be used to add include statements. Specifies
1985   * the path value of "<b>DiagnosticReport:request</b>".
1986   */
1987  public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("DiagnosticReport:request").toLocked();
1988
1989 /**
1990   * Search parameter: <b>specimen</b>
1991   * <p>
1992   * Description: <b>The specimen details</b><br>
1993   * Type: <b>reference</b><br>
1994   * Path: <b>DiagnosticReport.specimen</b><br>
1995   * </p>
1996   */
1997  @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" )
1998  public static final String SP_SPECIMEN = "specimen";
1999 /**
2000   * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
2001   * <p>
2002   * Description: <b>The specimen details</b><br>
2003   * Type: <b>reference</b><br>
2004   * Path: <b>DiagnosticReport.specimen</b><br>
2005   * </p>
2006   */
2007  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN);
2008
2009/**
2010   * Constant for fluent queries to be used to add include statements. Specifies
2011   * the path value of "<b>DiagnosticReport:specimen</b>".
2012   */
2013  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticReport:specimen").toLocked();
2014
2015 /**
2016   * Search parameter: <b>performer</b>
2017   * <p>
2018   * Description: <b>Who was the source of the report (organization)</b><br>
2019   * Type: <b>reference</b><br>
2020   * Path: <b>DiagnosticReport.performer</b><br>
2021   * </p>
2022   */
2023  @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" )
2024  public static final String SP_PERFORMER = "performer";
2025 /**
2026   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2027   * <p>
2028   * Description: <b>Who was the source of the report (organization)</b><br>
2029   * Type: <b>reference</b><br>
2030   * Path: <b>DiagnosticReport.performer</b><br>
2031   * </p>
2032   */
2033  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2034
2035/**
2036   * Constant for fluent queries to be used to add include statements. Specifies
2037   * the path value of "<b>DiagnosticReport:performer</b>".
2038   */
2039  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:performer").toLocked();
2040
2041 /**
2042   * Search parameter: <b>identifier</b>
2043   * <p>
2044   * Description: <b>An identifier for the report</b><br>
2045   * Type: <b>token</b><br>
2046   * Path: <b>DiagnosticReport.identifier</b><br>
2047   * </p>
2048   */
2049  @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" )
2050  public static final String SP_IDENTIFIER = "identifier";
2051 /**
2052   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2053   * <p>
2054   * Description: <b>An identifier for the report</b><br>
2055   * Type: <b>token</b><br>
2056   * Path: <b>DiagnosticReport.identifier</b><br>
2057   * </p>
2058   */
2059  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2060
2061
2062}