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