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