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