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 Tue, Dec 13, 2022 17:53+1100 for FHIR vcurrent
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(PrimitiveType<?> code) throws FHIRException {
223          if (code == null)
224            return null;
225          if (code.isEmpty())
226            return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.NULL, code);
227          String codeString = ((PrimitiveType) code).asStringValue();
228          if (codeString == null || "".equals(codeString))
229            return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.NULL, code);
230        if ("registered".equals(codeString))
231          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.REGISTERED, code);
232        if ("partial".equals(codeString))
233          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PARTIAL, code);
234        if ("preliminary".equals(codeString))
235          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PRELIMINARY, code);
236        if ("final".equals(codeString))
237          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.FINAL, code);
238        if ("amended".equals(codeString))
239          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.AMENDED, code);
240        if ("corrected".equals(codeString))
241          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CORRECTED, code);
242        if ("appended".equals(codeString))
243          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.APPENDED, code);
244        if ("cancelled".equals(codeString))
245          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CANCELLED, code);
246        if ("entered-in-error".equals(codeString))
247          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.ENTEREDINERROR, code);
248        if ("unknown".equals(codeString))
249          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.UNKNOWN, code);
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 DiagnosticReportSupportingInfoComponent extends BackboneElement implements IBaseBackboneElement {
282        /**
283         * The code value for the role of the supporting information in the diagnostic report.
284         */
285        @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false)
286        @Description(shortDefinition="Supporting information role code", formalDefinition="The code value for the role of the supporting information in the diagnostic report." )
287        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://terminology.hl7.org/ValueSet/v2-0936")
288        protected CodeableConcept type;
289
290        /**
291         * The reference for the supporting information in the diagnostic report.
292         */
293        @Child(name = "reference", type = {Procedure.class, Observation.class, DiagnosticReport.class, Citation.class}, order=2, min=1, max=1, modifier=false, summary=false)
294        @Description(shortDefinition="Supporting information reference", formalDefinition="The reference for the supporting information in the diagnostic report." )
295        protected Reference reference;
296
297        private static final long serialVersionUID = 492391425L;
298
299    /**
300     * Constructor
301     */
302      public DiagnosticReportSupportingInfoComponent() {
303        super();
304      }
305
306    /**
307     * Constructor
308     */
309      public DiagnosticReportSupportingInfoComponent(CodeableConcept type, Reference reference) {
310        super();
311        this.setType(type);
312        this.setReference(reference);
313      }
314
315        /**
316         * @return {@link #type} (The code value for the role of the supporting information in the diagnostic report.)
317         */
318        public CodeableConcept getType() { 
319          if (this.type == null)
320            if (Configuration.errorOnAutoCreate())
321              throw new Error("Attempt to auto-create DiagnosticReportSupportingInfoComponent.type");
322            else if (Configuration.doAutoCreate())
323              this.type = new CodeableConcept(); // cc
324          return this.type;
325        }
326
327        public boolean hasType() { 
328          return this.type != null && !this.type.isEmpty();
329        }
330
331        /**
332         * @param value {@link #type} (The code value for the role of the supporting information in the diagnostic report.)
333         */
334        public DiagnosticReportSupportingInfoComponent setType(CodeableConcept value) { 
335          this.type = value;
336          return this;
337        }
338
339        /**
340         * @return {@link #reference} (The reference for the supporting information in the diagnostic report.)
341         */
342        public Reference getReference() { 
343          if (this.reference == null)
344            if (Configuration.errorOnAutoCreate())
345              throw new Error("Attempt to auto-create DiagnosticReportSupportingInfoComponent.reference");
346            else if (Configuration.doAutoCreate())
347              this.reference = new Reference(); // cc
348          return this.reference;
349        }
350
351        public boolean hasReference() { 
352          return this.reference != null && !this.reference.isEmpty();
353        }
354
355        /**
356         * @param value {@link #reference} (The reference for the supporting information in the diagnostic report.)
357         */
358        public DiagnosticReportSupportingInfoComponent setReference(Reference value) { 
359          this.reference = value;
360          return this;
361        }
362
363        protected void listChildren(List<Property> children) {
364          super.listChildren(children);
365          children.add(new Property("type", "CodeableConcept", "The code value for the role of the supporting information in the diagnostic report.", 0, 1, type));
366          children.add(new Property("reference", "Reference(Procedure|Observation|DiagnosticReport|Citation)", "The reference for the supporting information in the diagnostic report.", 0, 1, reference));
367        }
368
369        @Override
370        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
371          switch (_hash) {
372          case 3575610: /*type*/  return new Property("type", "CodeableConcept", "The code value for the role of the supporting information in the diagnostic report.", 0, 1, type);
373          case -925155509: /*reference*/  return new Property("reference", "Reference(Procedure|Observation|DiagnosticReport|Citation)", "The reference for the supporting information in the diagnostic report.", 0, 1, reference);
374          default: return super.getNamedProperty(_hash, _name, _checkValid);
375          }
376
377        }
378
379      @Override
380      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
381        switch (hash) {
382        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
383        case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
384        default: return super.getProperty(hash, name, checkValid);
385        }
386
387      }
388
389      @Override
390      public Base setProperty(int hash, String name, Base value) throws FHIRException {
391        switch (hash) {
392        case 3575610: // type
393          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
394          return value;
395        case -925155509: // reference
396          this.reference = TypeConvertor.castToReference(value); // Reference
397          return value;
398        default: return super.setProperty(hash, name, value);
399        }
400
401      }
402
403      @Override
404      public Base setProperty(String name, Base value) throws FHIRException {
405        if (name.equals("type")) {
406          this.type = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
407        } else if (name.equals("reference")) {
408          this.reference = TypeConvertor.castToReference(value); // Reference
409        } else
410          return super.setProperty(name, value);
411        return value;
412      }
413
414      @Override
415      public Base makeProperty(int hash, String name) throws FHIRException {
416        switch (hash) {
417        case 3575610:  return getType();
418        case -925155509:  return getReference();
419        default: return super.makeProperty(hash, name);
420        }
421
422      }
423
424      @Override
425      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
426        switch (hash) {
427        case 3575610: /*type*/ return new String[] {"CodeableConcept"};
428        case -925155509: /*reference*/ return new String[] {"Reference"};
429        default: return super.getTypesForProperty(hash, name);
430        }
431
432      }
433
434      @Override
435      public Base addChild(String name) throws FHIRException {
436        if (name.equals("type")) {
437          this.type = new CodeableConcept();
438          return this.type;
439        }
440        else if (name.equals("reference")) {
441          this.reference = new Reference();
442          return this.reference;
443        }
444        else
445          return super.addChild(name);
446      }
447
448      public DiagnosticReportSupportingInfoComponent copy() {
449        DiagnosticReportSupportingInfoComponent dst = new DiagnosticReportSupportingInfoComponent();
450        copyValues(dst);
451        return dst;
452      }
453
454      public void copyValues(DiagnosticReportSupportingInfoComponent dst) {
455        super.copyValues(dst);
456        dst.type = type == null ? null : type.copy();
457        dst.reference = reference == null ? null : reference.copy();
458      }
459
460      @Override
461      public boolean equalsDeep(Base other_) {
462        if (!super.equalsDeep(other_))
463          return false;
464        if (!(other_ instanceof DiagnosticReportSupportingInfoComponent))
465          return false;
466        DiagnosticReportSupportingInfoComponent o = (DiagnosticReportSupportingInfoComponent) other_;
467        return compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true);
468      }
469
470      @Override
471      public boolean equalsShallow(Base other_) {
472        if (!super.equalsShallow(other_))
473          return false;
474        if (!(other_ instanceof DiagnosticReportSupportingInfoComponent))
475          return false;
476        DiagnosticReportSupportingInfoComponent o = (DiagnosticReportSupportingInfoComponent) other_;
477        return true;
478      }
479
480      public boolean isEmpty() {
481        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, reference);
482      }
483
484  public String fhirType() {
485    return "DiagnosticReport.supportingInfo";
486
487  }
488
489  }
490
491    @Block()
492    public static class DiagnosticReportMediaComponent extends BackboneElement implements IBaseBackboneElement {
493        /**
494         * 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.
495         */
496        @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
497        @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." )
498        protected StringType comment;
499
500        /**
501         * Reference to the image or data source.
502         */
503        @Child(name = "link", type = {DocumentReference.class}, order=2, min=1, max=1, modifier=false, summary=true)
504        @Description(shortDefinition="Reference to the image or data source", formalDefinition="Reference to the image or data source." )
505        protected Reference link;
506
507        private static final long serialVersionUID = 1827561947L;
508
509    /**
510     * Constructor
511     */
512      public DiagnosticReportMediaComponent() {
513        super();
514      }
515
516    /**
517     * Constructor
518     */
519      public DiagnosticReportMediaComponent(Reference link) {
520        super();
521        this.setLink(link);
522      }
523
524        /**
525         * @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
526         */
527        public StringType getCommentElement() { 
528          if (this.comment == null)
529            if (Configuration.errorOnAutoCreate())
530              throw new Error("Attempt to auto-create DiagnosticReportMediaComponent.comment");
531            else if (Configuration.doAutoCreate())
532              this.comment = new StringType(); // bb
533          return this.comment;
534        }
535
536        public boolean hasCommentElement() { 
537          return this.comment != null && !this.comment.isEmpty();
538        }
539
540        public boolean hasComment() { 
541          return this.comment != null && !this.comment.isEmpty();
542        }
543
544        /**
545         * @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
546         */
547        public DiagnosticReportMediaComponent setCommentElement(StringType value) { 
548          this.comment = value;
549          return this;
550        }
551
552        /**
553         * @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.
554         */
555        public String getComment() { 
556          return this.comment == null ? null : this.comment.getValue();
557        }
558
559        /**
560         * @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.
561         */
562        public DiagnosticReportMediaComponent setComment(String value) { 
563          if (Utilities.noString(value))
564            this.comment = null;
565          else {
566            if (this.comment == null)
567              this.comment = new StringType();
568            this.comment.setValue(value);
569          }
570          return this;
571        }
572
573        /**
574         * @return {@link #link} (Reference to the image or data source.)
575         */
576        public Reference getLink() { 
577          if (this.link == null)
578            if (Configuration.errorOnAutoCreate())
579              throw new Error("Attempt to auto-create DiagnosticReportMediaComponent.link");
580            else if (Configuration.doAutoCreate())
581              this.link = new Reference(); // cc
582          return this.link;
583        }
584
585        public boolean hasLink() { 
586          return this.link != null && !this.link.isEmpty();
587        }
588
589        /**
590         * @param value {@link #link} (Reference to the image or data source.)
591         */
592        public DiagnosticReportMediaComponent setLink(Reference value) { 
593          this.link = value;
594          return this;
595        }
596
597        protected void listChildren(List<Property> children) {
598          super.listChildren(children);
599          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));
600          children.add(new Property("link", "Reference(DocumentReference)", "Reference to the image or data source.", 0, 1, link));
601        }
602
603        @Override
604        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
605          switch (_hash) {
606          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);
607          case 3321850: /*link*/  return new Property("link", "Reference(DocumentReference)", "Reference to the image or data source.", 0, 1, link);
608          default: return super.getNamedProperty(_hash, _name, _checkValid);
609          }
610
611        }
612
613      @Override
614      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
615        switch (hash) {
616        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
617        case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference
618        default: return super.getProperty(hash, name, checkValid);
619        }
620
621      }
622
623      @Override
624      public Base setProperty(int hash, String name, Base value) throws FHIRException {
625        switch (hash) {
626        case 950398559: // comment
627          this.comment = TypeConvertor.castToString(value); // StringType
628          return value;
629        case 3321850: // link
630          this.link = TypeConvertor.castToReference(value); // Reference
631          return value;
632        default: return super.setProperty(hash, name, value);
633        }
634
635      }
636
637      @Override
638      public Base setProperty(String name, Base value) throws FHIRException {
639        if (name.equals("comment")) {
640          this.comment = TypeConvertor.castToString(value); // StringType
641        } else if (name.equals("link")) {
642          this.link = TypeConvertor.castToReference(value); // Reference
643        } else
644          return super.setProperty(name, value);
645        return value;
646      }
647
648      @Override
649      public Base makeProperty(int hash, String name) throws FHIRException {
650        switch (hash) {
651        case 950398559:  return getCommentElement();
652        case 3321850:  return getLink();
653        default: return super.makeProperty(hash, name);
654        }
655
656      }
657
658      @Override
659      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
660        switch (hash) {
661        case 950398559: /*comment*/ return new String[] {"string"};
662        case 3321850: /*link*/ return new String[] {"Reference"};
663        default: return super.getTypesForProperty(hash, name);
664        }
665
666      }
667
668      @Override
669      public Base addChild(String name) throws FHIRException {
670        if (name.equals("comment")) {
671          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.media.comment");
672        }
673        else if (name.equals("link")) {
674          this.link = new Reference();
675          return this.link;
676        }
677        else
678          return super.addChild(name);
679      }
680
681      public DiagnosticReportMediaComponent copy() {
682        DiagnosticReportMediaComponent dst = new DiagnosticReportMediaComponent();
683        copyValues(dst);
684        return dst;
685      }
686
687      public void copyValues(DiagnosticReportMediaComponent dst) {
688        super.copyValues(dst);
689        dst.comment = comment == null ? null : comment.copy();
690        dst.link = link == null ? null : link.copy();
691      }
692
693      @Override
694      public boolean equalsDeep(Base other_) {
695        if (!super.equalsDeep(other_))
696          return false;
697        if (!(other_ instanceof DiagnosticReportMediaComponent))
698          return false;
699        DiagnosticReportMediaComponent o = (DiagnosticReportMediaComponent) other_;
700        return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true);
701      }
702
703      @Override
704      public boolean equalsShallow(Base other_) {
705        if (!super.equalsShallow(other_))
706          return false;
707        if (!(other_ instanceof DiagnosticReportMediaComponent))
708          return false;
709        DiagnosticReportMediaComponent o = (DiagnosticReportMediaComponent) other_;
710        return compareValues(comment, o.comment, true);
711      }
712
713      public boolean isEmpty() {
714        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(comment, link);
715      }
716
717  public String fhirType() {
718    return "DiagnosticReport.media";
719
720  }
721
722  }
723
724    /**
725     * Identifiers assigned to this report by the performer or other systems.
726     */
727    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
728    @Description(shortDefinition="Business identifier for report", formalDefinition="Identifiers assigned to this report by the performer or other systems." )
729    protected List<Identifier> identifier;
730
731    /**
732     * Details concerning a service requested.
733     */
734    @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)
735    @Description(shortDefinition="What was requested", formalDefinition="Details concerning a service requested." )
736    protected List<Reference> basedOn;
737
738    /**
739     * The status of the diagnostic report.
740     */
741    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
742    @Description(shortDefinition="registered | partial | preliminary | final +", formalDefinition="The status of the diagnostic report." )
743    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-report-status")
744    protected Enumeration<DiagnosticReportStatus> status;
745
746    /**
747     * 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.
748     */
749    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
750    @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." )
751    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-service-sections")
752    protected List<CodeableConcept> category;
753
754    /**
755     * A code or name that describes this diagnostic report.
756     */
757    @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true)
758    @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." )
759    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-codes")
760    protected CodeableConcept code;
761
762    /**
763     * 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.
764     */
765    @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)
766    @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." )
767    protected Reference subject;
768
769    /**
770     * The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.
771     */
772    @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=true)
773    @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." )
774    protected Reference encounter;
775
776    /**
777     * 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.
778     */
779    @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
780    @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." )
781    protected DataType effective;
782
783    /**
784     * The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.
785     */
786    @Child(name = "issued", type = {InstantType.class}, order=8, min=0, max=1, modifier=false, summary=true)
787    @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." )
788    protected InstantType issued;
789
790    /**
791     * The diagnostic service that is responsible for issuing the report.
792     */
793    @Child(name = "performer", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
794    @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." )
795    protected List<Reference> performer;
796
797    /**
798     * The practitioner or organization that is responsible for the report's conclusions and interpretations.
799     */
800    @Child(name = "resultsInterpreter", type = {Practitioner.class, PractitionerRole.class, Organization.class, CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
801    @Description(shortDefinition="Primary result interpreter", formalDefinition="The practitioner or organization that is responsible for the report's conclusions and interpretations." )
802    protected List<Reference> resultsInterpreter;
803
804    /**
805     * Details about the specimens on which this diagnostic report is based.
806     */
807    @Child(name = "specimen", type = {Specimen.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
808    @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." )
809    protected List<Reference> specimen;
810
811    /**
812     * [Observations](observation.html)  that are part of this diagnostic report.
813     */
814    @Child(name = "result", type = {Observation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
815    @Description(shortDefinition="Observations", formalDefinition="[Observations](observation.html)  that are part of this diagnostic report." )
816    protected List<Reference> result;
817
818    /**
819     * Comments about the diagnostic report.
820     */
821    @Child(name = "note", type = {Annotation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
822    @Description(shortDefinition="Comments about the diagnostic report", formalDefinition="Comments about the diagnostic report." )
823    protected List<Annotation> note;
824
825    /**
826     * One or more links to full details of any study performed during the diagnostic investigation. An ImagingStudy might comprise a set of radiologic images obtained via a procedure that are analyzed as a group. 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. A GenomicStudy might comprise one or more analyses, each serving a specific purpose. These analyses may vary in method (e.g., karyotyping, CNV, or SNV detection), performer, software, devices used, or regions targeted.
827     */
828    @Child(name = "study", type = {GenomicStudy.class, ImagingStudy.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
829    @Description(shortDefinition="Reference to full details of an analysis associated with the diagnostic report", formalDefinition="One or more links to full details of any study performed during the diagnostic investigation. An ImagingStudy might comprise a set of radiologic images obtained via a procedure that are analyzed as a group. 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. A GenomicStudy might comprise one or more analyses, each serving a specific purpose. These analyses may vary in method (e.g., karyotyping, CNV, or SNV detection), performer, software, devices used, or regions targeted." )
830    protected List<Reference> study;
831
832    /**
833     * This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report.
834     */
835    @Child(name = "supportingInfo", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
836    @Description(shortDefinition="Additional information supporting the diagnostic report", formalDefinition="This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report." )
837    protected List<DiagnosticReportSupportingInfoComponent> supportingInfo;
838
839    /**
840     * 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).
841     */
842    @Child(name = "media", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
843    @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)." )
844    protected List<DiagnosticReportMediaComponent> media;
845
846    /**
847     * Reference to a Composition resource instance that provides structure for organizing the contents of the DiagnosticReport.
848     */
849    @Child(name = "composition", type = {Composition.class}, order=17, min=0, max=1, modifier=false, summary=false)
850    @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." )
851    protected Reference composition;
852
853    /**
854     * Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
855     */
856    @Child(name = "conclusion", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false)
857    @Description(shortDefinition="Clinical conclusion (interpretation) of test results", formalDefinition="Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report." )
858    protected StringType conclusion;
859
860    /**
861     * One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.
862     */
863    @Child(name = "conclusionCode", type = {CodeableConcept.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
864    @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." )
865    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
866    protected List<CodeableConcept> conclusionCode;
867
868    /**
869     * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
870     */
871    @Child(name = "presentedForm", type = {Attachment.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
872    @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." )
873    protected List<Attachment> presentedForm;
874
875    private static final long serialVersionUID = -1870911199L;
876
877  /**
878   * Constructor
879   */
880    public DiagnosticReport() {
881      super();
882    }
883
884  /**
885   * Constructor
886   */
887    public DiagnosticReport(DiagnosticReportStatus status, CodeableConcept code) {
888      super();
889      this.setStatus(status);
890      this.setCode(code);
891    }
892
893    /**
894     * @return {@link #identifier} (Identifiers assigned to this report by the performer or other systems.)
895     */
896    public List<Identifier> getIdentifier() { 
897      if (this.identifier == null)
898        this.identifier = new ArrayList<Identifier>();
899      return this.identifier;
900    }
901
902    /**
903     * @return Returns a reference to <code>this</code> for easy method chaining
904     */
905    public DiagnosticReport setIdentifier(List<Identifier> theIdentifier) { 
906      this.identifier = theIdentifier;
907      return this;
908    }
909
910    public boolean hasIdentifier() { 
911      if (this.identifier == null)
912        return false;
913      for (Identifier item : this.identifier)
914        if (!item.isEmpty())
915          return true;
916      return false;
917    }
918
919    public Identifier addIdentifier() { //3
920      Identifier t = new Identifier();
921      if (this.identifier == null)
922        this.identifier = new ArrayList<Identifier>();
923      this.identifier.add(t);
924      return t;
925    }
926
927    public DiagnosticReport addIdentifier(Identifier t) { //3
928      if (t == null)
929        return this;
930      if (this.identifier == null)
931        this.identifier = new ArrayList<Identifier>();
932      this.identifier.add(t);
933      return this;
934    }
935
936    /**
937     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist {3}
938     */
939    public Identifier getIdentifierFirstRep() { 
940      if (getIdentifier().isEmpty()) {
941        addIdentifier();
942      }
943      return getIdentifier().get(0);
944    }
945
946    /**
947     * @return {@link #basedOn} (Details concerning a service requested.)
948     */
949    public List<Reference> getBasedOn() { 
950      if (this.basedOn == null)
951        this.basedOn = new ArrayList<Reference>();
952      return this.basedOn;
953    }
954
955    /**
956     * @return Returns a reference to <code>this</code> for easy method chaining
957     */
958    public DiagnosticReport setBasedOn(List<Reference> theBasedOn) { 
959      this.basedOn = theBasedOn;
960      return this;
961    }
962
963    public boolean hasBasedOn() { 
964      if (this.basedOn == null)
965        return false;
966      for (Reference item : this.basedOn)
967        if (!item.isEmpty())
968          return true;
969      return false;
970    }
971
972    public Reference addBasedOn() { //3
973      Reference t = new Reference();
974      if (this.basedOn == null)
975        this.basedOn = new ArrayList<Reference>();
976      this.basedOn.add(t);
977      return t;
978    }
979
980    public DiagnosticReport addBasedOn(Reference t) { //3
981      if (t == null)
982        return this;
983      if (this.basedOn == null)
984        this.basedOn = new ArrayList<Reference>();
985      this.basedOn.add(t);
986      return this;
987    }
988
989    /**
990     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist {3}
991     */
992    public Reference getBasedOnFirstRep() { 
993      if (getBasedOn().isEmpty()) {
994        addBasedOn();
995      }
996      return getBasedOn().get(0);
997    }
998
999    /**
1000     * @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
1001     */
1002    public Enumeration<DiagnosticReportStatus> getStatusElement() { 
1003      if (this.status == null)
1004        if (Configuration.errorOnAutoCreate())
1005          throw new Error("Attempt to auto-create DiagnosticReport.status");
1006        else if (Configuration.doAutoCreate())
1007          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory()); // bb
1008      return this.status;
1009    }
1010
1011    public boolean hasStatusElement() { 
1012      return this.status != null && !this.status.isEmpty();
1013    }
1014
1015    public boolean hasStatus() { 
1016      return this.status != null && !this.status.isEmpty();
1017    }
1018
1019    /**
1020     * @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
1021     */
1022    public DiagnosticReport setStatusElement(Enumeration<DiagnosticReportStatus> value) { 
1023      this.status = value;
1024      return this;
1025    }
1026
1027    /**
1028     * @return The status of the diagnostic report.
1029     */
1030    public DiagnosticReportStatus getStatus() { 
1031      return this.status == null ? null : this.status.getValue();
1032    }
1033
1034    /**
1035     * @param value The status of the diagnostic report.
1036     */
1037    public DiagnosticReport setStatus(DiagnosticReportStatus value) { 
1038        if (this.status == null)
1039          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory());
1040        this.status.setValue(value);
1041      return this;
1042    }
1043
1044    /**
1045     * @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.)
1046     */
1047    public List<CodeableConcept> getCategory() { 
1048      if (this.category == null)
1049        this.category = new ArrayList<CodeableConcept>();
1050      return this.category;
1051    }
1052
1053    /**
1054     * @return Returns a reference to <code>this</code> for easy method chaining
1055     */
1056    public DiagnosticReport setCategory(List<CodeableConcept> theCategory) { 
1057      this.category = theCategory;
1058      return this;
1059    }
1060
1061    public boolean hasCategory() { 
1062      if (this.category == null)
1063        return false;
1064      for (CodeableConcept item : this.category)
1065        if (!item.isEmpty())
1066          return true;
1067      return false;
1068    }
1069
1070    public CodeableConcept addCategory() { //3
1071      CodeableConcept t = new CodeableConcept();
1072      if (this.category == null)
1073        this.category = new ArrayList<CodeableConcept>();
1074      this.category.add(t);
1075      return t;
1076    }
1077
1078    public DiagnosticReport addCategory(CodeableConcept t) { //3
1079      if (t == null)
1080        return this;
1081      if (this.category == null)
1082        this.category = new ArrayList<CodeableConcept>();
1083      this.category.add(t);
1084      return this;
1085    }
1086
1087    /**
1088     * @return The first repetition of repeating field {@link #category}, creating it if it does not already exist {3}
1089     */
1090    public CodeableConcept getCategoryFirstRep() { 
1091      if (getCategory().isEmpty()) {
1092        addCategory();
1093      }
1094      return getCategory().get(0);
1095    }
1096
1097    /**
1098     * @return {@link #code} (A code or name that describes this diagnostic report.)
1099     */
1100    public CodeableConcept getCode() { 
1101      if (this.code == null)
1102        if (Configuration.errorOnAutoCreate())
1103          throw new Error("Attempt to auto-create DiagnosticReport.code");
1104        else if (Configuration.doAutoCreate())
1105          this.code = new CodeableConcept(); // cc
1106      return this.code;
1107    }
1108
1109    public boolean hasCode() { 
1110      return this.code != null && !this.code.isEmpty();
1111    }
1112
1113    /**
1114     * @param value {@link #code} (A code or name that describes this diagnostic report.)
1115     */
1116    public DiagnosticReport setCode(CodeableConcept value) { 
1117      this.code = value;
1118      return this;
1119    }
1120
1121    /**
1122     * @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.)
1123     */
1124    public Reference getSubject() { 
1125      if (this.subject == null)
1126        if (Configuration.errorOnAutoCreate())
1127          throw new Error("Attempt to auto-create DiagnosticReport.subject");
1128        else if (Configuration.doAutoCreate())
1129          this.subject = new Reference(); // cc
1130      return this.subject;
1131    }
1132
1133    public boolean hasSubject() { 
1134      return this.subject != null && !this.subject.isEmpty();
1135    }
1136
1137    /**
1138     * @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.)
1139     */
1140    public DiagnosticReport setSubject(Reference value) { 
1141      this.subject = value;
1142      return this;
1143    }
1144
1145    /**
1146     * @return {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1147     */
1148    public Reference getEncounter() { 
1149      if (this.encounter == null)
1150        if (Configuration.errorOnAutoCreate())
1151          throw new Error("Attempt to auto-create DiagnosticReport.encounter");
1152        else if (Configuration.doAutoCreate())
1153          this.encounter = new Reference(); // cc
1154      return this.encounter;
1155    }
1156
1157    public boolean hasEncounter() { 
1158      return this.encounter != null && !this.encounter.isEmpty();
1159    }
1160
1161    /**
1162     * @param value {@link #encounter} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.)
1163     */
1164    public DiagnosticReport setEncounter(Reference value) { 
1165      this.encounter = value;
1166      return this;
1167    }
1168
1169    /**
1170     * @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.)
1171     */
1172    public DataType getEffective() { 
1173      return this.effective;
1174    }
1175
1176    /**
1177     * @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.)
1178     */
1179    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
1180      if (this.effective == null)
1181        this.effective = new DateTimeType();
1182      if (!(this.effective instanceof DateTimeType))
1183        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
1184      return (DateTimeType) this.effective;
1185    }
1186
1187    public boolean hasEffectiveDateTimeType() { 
1188      return this != null && this.effective instanceof DateTimeType;
1189    }
1190
1191    /**
1192     * @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.)
1193     */
1194    public Period getEffectivePeriod() throws FHIRException { 
1195      if (this.effective == null)
1196        this.effective = new Period();
1197      if (!(this.effective instanceof Period))
1198        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
1199      return (Period) this.effective;
1200    }
1201
1202    public boolean hasEffectivePeriod() { 
1203      return this != null && this.effective instanceof Period;
1204    }
1205
1206    public boolean hasEffective() { 
1207      return this.effective != null && !this.effective.isEmpty();
1208    }
1209
1210    /**
1211     * @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.)
1212     */
1213    public DiagnosticReport setEffective(DataType value) { 
1214      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1215        throw new Error("Not the right type for DiagnosticReport.effective[x]: "+value.fhirType());
1216      this.effective = value;
1217      return this;
1218    }
1219
1220    /**
1221     * @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
1222     */
1223    public InstantType getIssuedElement() { 
1224      if (this.issued == null)
1225        if (Configuration.errorOnAutoCreate())
1226          throw new Error("Attempt to auto-create DiagnosticReport.issued");
1227        else if (Configuration.doAutoCreate())
1228          this.issued = new InstantType(); // bb
1229      return this.issued;
1230    }
1231
1232    public boolean hasIssuedElement() { 
1233      return this.issued != null && !this.issued.isEmpty();
1234    }
1235
1236    public boolean hasIssued() { 
1237      return this.issued != null && !this.issued.isEmpty();
1238    }
1239
1240    /**
1241     * @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
1242     */
1243    public DiagnosticReport setIssuedElement(InstantType value) { 
1244      this.issued = value;
1245      return this;
1246    }
1247
1248    /**
1249     * @return The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.
1250     */
1251    public Date getIssued() { 
1252      return this.issued == null ? null : this.issued.getValue();
1253    }
1254
1255    /**
1256     * @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.
1257     */
1258    public DiagnosticReport setIssued(Date value) { 
1259      if (value == null)
1260        this.issued = null;
1261      else {
1262        if (this.issued == null)
1263          this.issued = new InstantType();
1264        this.issued.setValue(value);
1265      }
1266      return this;
1267    }
1268
1269    /**
1270     * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.)
1271     */
1272    public List<Reference> getPerformer() { 
1273      if (this.performer == null)
1274        this.performer = new ArrayList<Reference>();
1275      return this.performer;
1276    }
1277
1278    /**
1279     * @return Returns a reference to <code>this</code> for easy method chaining
1280     */
1281    public DiagnosticReport setPerformer(List<Reference> thePerformer) { 
1282      this.performer = thePerformer;
1283      return this;
1284    }
1285
1286    public boolean hasPerformer() { 
1287      if (this.performer == null)
1288        return false;
1289      for (Reference item : this.performer)
1290        if (!item.isEmpty())
1291          return true;
1292      return false;
1293    }
1294
1295    public Reference addPerformer() { //3
1296      Reference t = new Reference();
1297      if (this.performer == null)
1298        this.performer = new ArrayList<Reference>();
1299      this.performer.add(t);
1300      return t;
1301    }
1302
1303    public DiagnosticReport addPerformer(Reference t) { //3
1304      if (t == null)
1305        return this;
1306      if (this.performer == null)
1307        this.performer = new ArrayList<Reference>();
1308      this.performer.add(t);
1309      return this;
1310    }
1311
1312    /**
1313     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist {3}
1314     */
1315    public Reference getPerformerFirstRep() { 
1316      if (getPerformer().isEmpty()) {
1317        addPerformer();
1318      }
1319      return getPerformer().get(0);
1320    }
1321
1322    /**
1323     * @return {@link #resultsInterpreter} (The practitioner or organization that is responsible for the report's conclusions and interpretations.)
1324     */
1325    public List<Reference> getResultsInterpreter() { 
1326      if (this.resultsInterpreter == null)
1327        this.resultsInterpreter = new ArrayList<Reference>();
1328      return this.resultsInterpreter;
1329    }
1330
1331    /**
1332     * @return Returns a reference to <code>this</code> for easy method chaining
1333     */
1334    public DiagnosticReport setResultsInterpreter(List<Reference> theResultsInterpreter) { 
1335      this.resultsInterpreter = theResultsInterpreter;
1336      return this;
1337    }
1338
1339    public boolean hasResultsInterpreter() { 
1340      if (this.resultsInterpreter == null)
1341        return false;
1342      for (Reference item : this.resultsInterpreter)
1343        if (!item.isEmpty())
1344          return true;
1345      return false;
1346    }
1347
1348    public Reference addResultsInterpreter() { //3
1349      Reference t = new Reference();
1350      if (this.resultsInterpreter == null)
1351        this.resultsInterpreter = new ArrayList<Reference>();
1352      this.resultsInterpreter.add(t);
1353      return t;
1354    }
1355
1356    public DiagnosticReport addResultsInterpreter(Reference t) { //3
1357      if (t == null)
1358        return this;
1359      if (this.resultsInterpreter == null)
1360        this.resultsInterpreter = new ArrayList<Reference>();
1361      this.resultsInterpreter.add(t);
1362      return this;
1363    }
1364
1365    /**
1366     * @return The first repetition of repeating field {@link #resultsInterpreter}, creating it if it does not already exist {3}
1367     */
1368    public Reference getResultsInterpreterFirstRep() { 
1369      if (getResultsInterpreter().isEmpty()) {
1370        addResultsInterpreter();
1371      }
1372      return getResultsInterpreter().get(0);
1373    }
1374
1375    /**
1376     * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.)
1377     */
1378    public List<Reference> getSpecimen() { 
1379      if (this.specimen == null)
1380        this.specimen = new ArrayList<Reference>();
1381      return this.specimen;
1382    }
1383
1384    /**
1385     * @return Returns a reference to <code>this</code> for easy method chaining
1386     */
1387    public DiagnosticReport setSpecimen(List<Reference> theSpecimen) { 
1388      this.specimen = theSpecimen;
1389      return this;
1390    }
1391
1392    public boolean hasSpecimen() { 
1393      if (this.specimen == null)
1394        return false;
1395      for (Reference item : this.specimen)
1396        if (!item.isEmpty())
1397          return true;
1398      return false;
1399    }
1400
1401    public Reference addSpecimen() { //3
1402      Reference t = new Reference();
1403      if (this.specimen == null)
1404        this.specimen = new ArrayList<Reference>();
1405      this.specimen.add(t);
1406      return t;
1407    }
1408
1409    public DiagnosticReport addSpecimen(Reference t) { //3
1410      if (t == null)
1411        return this;
1412      if (this.specimen == null)
1413        this.specimen = new ArrayList<Reference>();
1414      this.specimen.add(t);
1415      return this;
1416    }
1417
1418    /**
1419     * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist {3}
1420     */
1421    public Reference getSpecimenFirstRep() { 
1422      if (getSpecimen().isEmpty()) {
1423        addSpecimen();
1424      }
1425      return getSpecimen().get(0);
1426    }
1427
1428    /**
1429     * @return {@link #result} ([Observations](observation.html)  that are part of this diagnostic report.)
1430     */
1431    public List<Reference> getResult() { 
1432      if (this.result == null)
1433        this.result = new ArrayList<Reference>();
1434      return this.result;
1435    }
1436
1437    /**
1438     * @return Returns a reference to <code>this</code> for easy method chaining
1439     */
1440    public DiagnosticReport setResult(List<Reference> theResult) { 
1441      this.result = theResult;
1442      return this;
1443    }
1444
1445    public boolean hasResult() { 
1446      if (this.result == null)
1447        return false;
1448      for (Reference item : this.result)
1449        if (!item.isEmpty())
1450          return true;
1451      return false;
1452    }
1453
1454    public Reference addResult() { //3
1455      Reference t = new Reference();
1456      if (this.result == null)
1457        this.result = new ArrayList<Reference>();
1458      this.result.add(t);
1459      return t;
1460    }
1461
1462    public DiagnosticReport addResult(Reference t) { //3
1463      if (t == null)
1464        return this;
1465      if (this.result == null)
1466        this.result = new ArrayList<Reference>();
1467      this.result.add(t);
1468      return this;
1469    }
1470
1471    /**
1472     * @return The first repetition of repeating field {@link #result}, creating it if it does not already exist {3}
1473     */
1474    public Reference getResultFirstRep() { 
1475      if (getResult().isEmpty()) {
1476        addResult();
1477      }
1478      return getResult().get(0);
1479    }
1480
1481    /**
1482     * @return {@link #note} (Comments about the diagnostic report.)
1483     */
1484    public List<Annotation> getNote() { 
1485      if (this.note == null)
1486        this.note = new ArrayList<Annotation>();
1487      return this.note;
1488    }
1489
1490    /**
1491     * @return Returns a reference to <code>this</code> for easy method chaining
1492     */
1493    public DiagnosticReport setNote(List<Annotation> theNote) { 
1494      this.note = theNote;
1495      return this;
1496    }
1497
1498    public boolean hasNote() { 
1499      if (this.note == null)
1500        return false;
1501      for (Annotation item : this.note)
1502        if (!item.isEmpty())
1503          return true;
1504      return false;
1505    }
1506
1507    public Annotation addNote() { //3
1508      Annotation t = new Annotation();
1509      if (this.note == null)
1510        this.note = new ArrayList<Annotation>();
1511      this.note.add(t);
1512      return t;
1513    }
1514
1515    public DiagnosticReport addNote(Annotation t) { //3
1516      if (t == null)
1517        return this;
1518      if (this.note == null)
1519        this.note = new ArrayList<Annotation>();
1520      this.note.add(t);
1521      return this;
1522    }
1523
1524    /**
1525     * @return The first repetition of repeating field {@link #note}, creating it if it does not already exist {3}
1526     */
1527    public Annotation getNoteFirstRep() { 
1528      if (getNote().isEmpty()) {
1529        addNote();
1530      }
1531      return getNote().get(0);
1532    }
1533
1534    /**
1535     * @return {@link #study} (One or more links to full details of any study performed during the diagnostic investigation. An ImagingStudy might comprise a set of radiologic images obtained via a procedure that are analyzed as a group. 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. A GenomicStudy might comprise one or more analyses, each serving a specific purpose. These analyses may vary in method (e.g., karyotyping, CNV, or SNV detection), performer, software, devices used, or regions targeted.)
1536     */
1537    public List<Reference> getStudy() { 
1538      if (this.study == null)
1539        this.study = new ArrayList<Reference>();
1540      return this.study;
1541    }
1542
1543    /**
1544     * @return Returns a reference to <code>this</code> for easy method chaining
1545     */
1546    public DiagnosticReport setStudy(List<Reference> theStudy) { 
1547      this.study = theStudy;
1548      return this;
1549    }
1550
1551    public boolean hasStudy() { 
1552      if (this.study == null)
1553        return false;
1554      for (Reference item : this.study)
1555        if (!item.isEmpty())
1556          return true;
1557      return false;
1558    }
1559
1560    public Reference addStudy() { //3
1561      Reference t = new Reference();
1562      if (this.study == null)
1563        this.study = new ArrayList<Reference>();
1564      this.study.add(t);
1565      return t;
1566    }
1567
1568    public DiagnosticReport addStudy(Reference t) { //3
1569      if (t == null)
1570        return this;
1571      if (this.study == null)
1572        this.study = new ArrayList<Reference>();
1573      this.study.add(t);
1574      return this;
1575    }
1576
1577    /**
1578     * @return The first repetition of repeating field {@link #study}, creating it if it does not already exist {3}
1579     */
1580    public Reference getStudyFirstRep() { 
1581      if (getStudy().isEmpty()) {
1582        addStudy();
1583      }
1584      return getStudy().get(0);
1585    }
1586
1587    /**
1588     * @return {@link #supportingInfo} (This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report.)
1589     */
1590    public List<DiagnosticReportSupportingInfoComponent> getSupportingInfo() { 
1591      if (this.supportingInfo == null)
1592        this.supportingInfo = new ArrayList<DiagnosticReportSupportingInfoComponent>();
1593      return this.supportingInfo;
1594    }
1595
1596    /**
1597     * @return Returns a reference to <code>this</code> for easy method chaining
1598     */
1599    public DiagnosticReport setSupportingInfo(List<DiagnosticReportSupportingInfoComponent> theSupportingInfo) { 
1600      this.supportingInfo = theSupportingInfo;
1601      return this;
1602    }
1603
1604    public boolean hasSupportingInfo() { 
1605      if (this.supportingInfo == null)
1606        return false;
1607      for (DiagnosticReportSupportingInfoComponent item : this.supportingInfo)
1608        if (!item.isEmpty())
1609          return true;
1610      return false;
1611    }
1612
1613    public DiagnosticReportSupportingInfoComponent addSupportingInfo() { //3
1614      DiagnosticReportSupportingInfoComponent t = new DiagnosticReportSupportingInfoComponent();
1615      if (this.supportingInfo == null)
1616        this.supportingInfo = new ArrayList<DiagnosticReportSupportingInfoComponent>();
1617      this.supportingInfo.add(t);
1618      return t;
1619    }
1620
1621    public DiagnosticReport addSupportingInfo(DiagnosticReportSupportingInfoComponent t) { //3
1622      if (t == null)
1623        return this;
1624      if (this.supportingInfo == null)
1625        this.supportingInfo = new ArrayList<DiagnosticReportSupportingInfoComponent>();
1626      this.supportingInfo.add(t);
1627      return this;
1628    }
1629
1630    /**
1631     * @return The first repetition of repeating field {@link #supportingInfo}, creating it if it does not already exist {3}
1632     */
1633    public DiagnosticReportSupportingInfoComponent getSupportingInfoFirstRep() { 
1634      if (getSupportingInfo().isEmpty()) {
1635        addSupportingInfo();
1636      }
1637      return getSupportingInfo().get(0);
1638    }
1639
1640    /**
1641     * @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).)
1642     */
1643    public List<DiagnosticReportMediaComponent> getMedia() { 
1644      if (this.media == null)
1645        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1646      return this.media;
1647    }
1648
1649    /**
1650     * @return Returns a reference to <code>this</code> for easy method chaining
1651     */
1652    public DiagnosticReport setMedia(List<DiagnosticReportMediaComponent> theMedia) { 
1653      this.media = theMedia;
1654      return this;
1655    }
1656
1657    public boolean hasMedia() { 
1658      if (this.media == null)
1659        return false;
1660      for (DiagnosticReportMediaComponent item : this.media)
1661        if (!item.isEmpty())
1662          return true;
1663      return false;
1664    }
1665
1666    public DiagnosticReportMediaComponent addMedia() { //3
1667      DiagnosticReportMediaComponent t = new DiagnosticReportMediaComponent();
1668      if (this.media == null)
1669        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1670      this.media.add(t);
1671      return t;
1672    }
1673
1674    public DiagnosticReport addMedia(DiagnosticReportMediaComponent t) { //3
1675      if (t == null)
1676        return this;
1677      if (this.media == null)
1678        this.media = new ArrayList<DiagnosticReportMediaComponent>();
1679      this.media.add(t);
1680      return this;
1681    }
1682
1683    /**
1684     * @return The first repetition of repeating field {@link #media}, creating it if it does not already exist {3}
1685     */
1686    public DiagnosticReportMediaComponent getMediaFirstRep() { 
1687      if (getMedia().isEmpty()) {
1688        addMedia();
1689      }
1690      return getMedia().get(0);
1691    }
1692
1693    /**
1694     * @return {@link #composition} (Reference to a Composition resource instance that provides structure for organizing the contents of the DiagnosticReport.)
1695     */
1696    public Reference getComposition() { 
1697      if (this.composition == null)
1698        if (Configuration.errorOnAutoCreate())
1699          throw new Error("Attempt to auto-create DiagnosticReport.composition");
1700        else if (Configuration.doAutoCreate())
1701          this.composition = new Reference(); // cc
1702      return this.composition;
1703    }
1704
1705    public boolean hasComposition() { 
1706      return this.composition != null && !this.composition.isEmpty();
1707    }
1708
1709    /**
1710     * @param value {@link #composition} (Reference to a Composition resource instance that provides structure for organizing the contents of the DiagnosticReport.)
1711     */
1712    public DiagnosticReport setComposition(Reference value) { 
1713      this.composition = value;
1714      return this;
1715    }
1716
1717    /**
1718     * @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
1719     */
1720    public StringType getConclusionElement() { 
1721      if (this.conclusion == null)
1722        if (Configuration.errorOnAutoCreate())
1723          throw new Error("Attempt to auto-create DiagnosticReport.conclusion");
1724        else if (Configuration.doAutoCreate())
1725          this.conclusion = new StringType(); // bb
1726      return this.conclusion;
1727    }
1728
1729    public boolean hasConclusionElement() { 
1730      return this.conclusion != null && !this.conclusion.isEmpty();
1731    }
1732
1733    public boolean hasConclusion() { 
1734      return this.conclusion != null && !this.conclusion.isEmpty();
1735    }
1736
1737    /**
1738     * @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
1739     */
1740    public DiagnosticReport setConclusionElement(StringType value) { 
1741      this.conclusion = value;
1742      return this;
1743    }
1744
1745    /**
1746     * @return Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
1747     */
1748    public String getConclusion() { 
1749      return this.conclusion == null ? null : this.conclusion.getValue();
1750    }
1751
1752    /**
1753     * @param value Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.
1754     */
1755    public DiagnosticReport setConclusion(String value) { 
1756      if (Utilities.noString(value))
1757        this.conclusion = null;
1758      else {
1759        if (this.conclusion == null)
1760          this.conclusion = new StringType();
1761        this.conclusion.setValue(value);
1762      }
1763      return this;
1764    }
1765
1766    /**
1767     * @return {@link #conclusionCode} (One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.)
1768     */
1769    public List<CodeableConcept> getConclusionCode() { 
1770      if (this.conclusionCode == null)
1771        this.conclusionCode = new ArrayList<CodeableConcept>();
1772      return this.conclusionCode;
1773    }
1774
1775    /**
1776     * @return Returns a reference to <code>this</code> for easy method chaining
1777     */
1778    public DiagnosticReport setConclusionCode(List<CodeableConcept> theConclusionCode) { 
1779      this.conclusionCode = theConclusionCode;
1780      return this;
1781    }
1782
1783    public boolean hasConclusionCode() { 
1784      if (this.conclusionCode == null)
1785        return false;
1786      for (CodeableConcept item : this.conclusionCode)
1787        if (!item.isEmpty())
1788          return true;
1789      return false;
1790    }
1791
1792    public CodeableConcept addConclusionCode() { //3
1793      CodeableConcept t = new CodeableConcept();
1794      if (this.conclusionCode == null)
1795        this.conclusionCode = new ArrayList<CodeableConcept>();
1796      this.conclusionCode.add(t);
1797      return t;
1798    }
1799
1800    public DiagnosticReport addConclusionCode(CodeableConcept t) { //3
1801      if (t == null)
1802        return this;
1803      if (this.conclusionCode == null)
1804        this.conclusionCode = new ArrayList<CodeableConcept>();
1805      this.conclusionCode.add(t);
1806      return this;
1807    }
1808
1809    /**
1810     * @return The first repetition of repeating field {@link #conclusionCode}, creating it if it does not already exist {3}
1811     */
1812    public CodeableConcept getConclusionCodeFirstRep() { 
1813      if (getConclusionCode().isEmpty()) {
1814        addConclusionCode();
1815      }
1816      return getConclusionCode().get(0);
1817    }
1818
1819    /**
1820     * @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.)
1821     */
1822    public List<Attachment> getPresentedForm() { 
1823      if (this.presentedForm == null)
1824        this.presentedForm = new ArrayList<Attachment>();
1825      return this.presentedForm;
1826    }
1827
1828    /**
1829     * @return Returns a reference to <code>this</code> for easy method chaining
1830     */
1831    public DiagnosticReport setPresentedForm(List<Attachment> thePresentedForm) { 
1832      this.presentedForm = thePresentedForm;
1833      return this;
1834    }
1835
1836    public boolean hasPresentedForm() { 
1837      if (this.presentedForm == null)
1838        return false;
1839      for (Attachment item : this.presentedForm)
1840        if (!item.isEmpty())
1841          return true;
1842      return false;
1843    }
1844
1845    public Attachment addPresentedForm() { //3
1846      Attachment t = new Attachment();
1847      if (this.presentedForm == null)
1848        this.presentedForm = new ArrayList<Attachment>();
1849      this.presentedForm.add(t);
1850      return t;
1851    }
1852
1853    public DiagnosticReport addPresentedForm(Attachment t) { //3
1854      if (t == null)
1855        return this;
1856      if (this.presentedForm == null)
1857        this.presentedForm = new ArrayList<Attachment>();
1858      this.presentedForm.add(t);
1859      return this;
1860    }
1861
1862    /**
1863     * @return The first repetition of repeating field {@link #presentedForm}, creating it if it does not already exist {3}
1864     */
1865    public Attachment getPresentedFormFirstRep() { 
1866      if (getPresentedForm().isEmpty()) {
1867        addPresentedForm();
1868      }
1869      return getPresentedForm().get(0);
1870    }
1871
1872      protected void listChildren(List<Property> children) {
1873        super.listChildren(children);
1874        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this report by the performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
1875        children.add(new Property("basedOn", "Reference(CarePlan|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ServiceRequest)", "Details concerning a service requested.", 0, java.lang.Integer.MAX_VALUE, basedOn));
1876        children.add(new Property("status", "code", "The status of the diagnostic report.", 0, 1, status));
1877        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));
1878        children.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code));
1879        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));
1880        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));
1881        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));
1882        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));
1883        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));
1884        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));
1885        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));
1886        children.add(new Property("result", "Reference(Observation)", "[Observations](observation.html)  that are part of this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, result));
1887        children.add(new Property("note", "Annotation", "Comments about the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, note));
1888        children.add(new Property("study", "Reference(GenomicStudy|ImagingStudy)", "One or more links to full details of any study performed during the diagnostic investigation. An ImagingStudy might comprise a set of radiologic images obtained via a procedure that are analyzed as a group. 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. A GenomicStudy might comprise one or more analyses, each serving a specific purpose. These analyses may vary in method (e.g., karyotyping, CNV, or SNV detection), performer, software, devices used, or regions targeted.", 0, java.lang.Integer.MAX_VALUE, study));
1889        children.add(new Property("supportingInfo", "", "This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report.", 0, java.lang.Integer.MAX_VALUE, supportingInfo));
1890        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));
1891        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));
1892        children.add(new Property("conclusion", "string", "Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.", 0, 1, conclusion));
1893        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));
1894        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));
1895      }
1896
1897      @Override
1898      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1899        switch (_hash) {
1900        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);
1901        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);
1902        case -892481550: /*status*/  return new Property("status", "code", "The status of the diagnostic report.", 0, 1, status);
1903        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);
1904        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code);
1905        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);
1906        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);
1907        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);
1908        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);
1909        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);
1910        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);
1911        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);
1912        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);
1913        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);
1914        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);
1915        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);
1916        case 3387378: /*note*/  return new Property("note", "Annotation", "Comments about the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, note);
1917        case 109776329: /*study*/  return new Property("study", "Reference(GenomicStudy|ImagingStudy)", "One or more links to full details of any study performed during the diagnostic investigation. An ImagingStudy might comprise a set of radiologic images obtained via a procedure that are analyzed as a group. 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. A GenomicStudy might comprise one or more analyses, each serving a specific purpose. These analyses may vary in method (e.g., karyotyping, CNV, or SNV detection), performer, software, devices used, or regions targeted.", 0, java.lang.Integer.MAX_VALUE, study);
1918        case 1922406657: /*supportingInfo*/  return new Property("supportingInfo", "", "This backbone element contains supporting information that was used in the creation of the report not included in the results already included in the report.", 0, java.lang.Integer.MAX_VALUE, supportingInfo);
1919        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);
1920        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);
1921        case -1731259873: /*conclusion*/  return new Property("conclusion", "string", "Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.", 0, 1, conclusion);
1922        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);
1923        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);
1924        default: return super.getNamedProperty(_hash, _name, _checkValid);
1925        }
1926
1927      }
1928
1929      @Override
1930      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1931        switch (hash) {
1932        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier
1933        case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference
1934        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<DiagnosticReportStatus>
1935        case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept
1936        case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
1937        case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference
1938        case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference
1939        case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // DataType
1940        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType
1941        case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference
1942        case 2134944932: /*resultsInterpreter*/ return this.resultsInterpreter == null ? new Base[0] : this.resultsInterpreter.toArray(new Base[this.resultsInterpreter.size()]); // Reference
1943        case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference
1944        case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference
1945        case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation
1946        case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // Reference
1947        case 1922406657: /*supportingInfo*/ return this.supportingInfo == null ? new Base[0] : this.supportingInfo.toArray(new Base[this.supportingInfo.size()]); // DiagnosticReportSupportingInfoComponent
1948        case 103772132: /*media*/ return this.media == null ? new Base[0] : this.media.toArray(new Base[this.media.size()]); // DiagnosticReportMediaComponent
1949        case -838923862: /*composition*/ return this.composition == null ? new Base[0] : new Base[] {this.composition}; // Reference
1950        case -1731259873: /*conclusion*/ return this.conclusion == null ? new Base[0] : new Base[] {this.conclusion}; // StringType
1951        case -1731523412: /*conclusionCode*/ return this.conclusionCode == null ? new Base[0] : this.conclusionCode.toArray(new Base[this.conclusionCode.size()]); // CodeableConcept
1952        case 230090366: /*presentedForm*/ return this.presentedForm == null ? new Base[0] : this.presentedForm.toArray(new Base[this.presentedForm.size()]); // Attachment
1953        default: return super.getProperty(hash, name, checkValid);
1954        }
1955
1956      }
1957
1958      @Override
1959      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1960        switch (hash) {
1961        case -1618432855: // identifier
1962          this.getIdentifier().add(TypeConvertor.castToIdentifier(value)); // Identifier
1963          return value;
1964        case -332612366: // basedOn
1965          this.getBasedOn().add(TypeConvertor.castToReference(value)); // Reference
1966          return value;
1967        case -892481550: // status
1968          value = new DiagnosticReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
1969          this.status = (Enumeration) value; // Enumeration<DiagnosticReportStatus>
1970          return value;
1971        case 50511102: // category
1972          this.getCategory().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
1973          return value;
1974        case 3059181: // code
1975          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
1976          return value;
1977        case -1867885268: // subject
1978          this.subject = TypeConvertor.castToReference(value); // Reference
1979          return value;
1980        case 1524132147: // encounter
1981          this.encounter = TypeConvertor.castToReference(value); // Reference
1982          return value;
1983        case -1468651097: // effective
1984          this.effective = TypeConvertor.castToType(value); // DataType
1985          return value;
1986        case -1179159893: // issued
1987          this.issued = TypeConvertor.castToInstant(value); // InstantType
1988          return value;
1989        case 481140686: // performer
1990          this.getPerformer().add(TypeConvertor.castToReference(value)); // Reference
1991          return value;
1992        case 2134944932: // resultsInterpreter
1993          this.getResultsInterpreter().add(TypeConvertor.castToReference(value)); // Reference
1994          return value;
1995        case -2132868344: // specimen
1996          this.getSpecimen().add(TypeConvertor.castToReference(value)); // Reference
1997          return value;
1998        case -934426595: // result
1999          this.getResult().add(TypeConvertor.castToReference(value)); // Reference
2000          return value;
2001        case 3387378: // note
2002          this.getNote().add(TypeConvertor.castToAnnotation(value)); // Annotation
2003          return value;
2004        case 109776329: // study
2005          this.getStudy().add(TypeConvertor.castToReference(value)); // Reference
2006          return value;
2007        case 1922406657: // supportingInfo
2008          this.getSupportingInfo().add((DiagnosticReportSupportingInfoComponent) value); // DiagnosticReportSupportingInfoComponent
2009          return value;
2010        case 103772132: // media
2011          this.getMedia().add((DiagnosticReportMediaComponent) value); // DiagnosticReportMediaComponent
2012          return value;
2013        case -838923862: // composition
2014          this.composition = TypeConvertor.castToReference(value); // Reference
2015          return value;
2016        case -1731259873: // conclusion
2017          this.conclusion = TypeConvertor.castToString(value); // StringType
2018          return value;
2019        case -1731523412: // conclusionCode
2020          this.getConclusionCode().add(TypeConvertor.castToCodeableConcept(value)); // CodeableConcept
2021          return value;
2022        case 230090366: // presentedForm
2023          this.getPresentedForm().add(TypeConvertor.castToAttachment(value)); // Attachment
2024          return value;
2025        default: return super.setProperty(hash, name, value);
2026        }
2027
2028      }
2029
2030      @Override
2031      public Base setProperty(String name, Base value) throws FHIRException {
2032        if (name.equals("identifier")) {
2033          this.getIdentifier().add(TypeConvertor.castToIdentifier(value));
2034        } else if (name.equals("basedOn")) {
2035          this.getBasedOn().add(TypeConvertor.castToReference(value));
2036        } else if (name.equals("status")) {
2037          value = new DiagnosticReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
2038          this.status = (Enumeration) value; // Enumeration<DiagnosticReportStatus>
2039        } else if (name.equals("category")) {
2040          this.getCategory().add(TypeConvertor.castToCodeableConcept(value));
2041        } else if (name.equals("code")) {
2042          this.code = TypeConvertor.castToCodeableConcept(value); // CodeableConcept
2043        } else if (name.equals("subject")) {
2044          this.subject = TypeConvertor.castToReference(value); // Reference
2045        } else if (name.equals("encounter")) {
2046          this.encounter = TypeConvertor.castToReference(value); // Reference
2047        } else if (name.equals("effective[x]")) {
2048          this.effective = TypeConvertor.castToType(value); // DataType
2049        } else if (name.equals("issued")) {
2050          this.issued = TypeConvertor.castToInstant(value); // InstantType
2051        } else if (name.equals("performer")) {
2052          this.getPerformer().add(TypeConvertor.castToReference(value));
2053        } else if (name.equals("resultsInterpreter")) {
2054          this.getResultsInterpreter().add(TypeConvertor.castToReference(value));
2055        } else if (name.equals("specimen")) {
2056          this.getSpecimen().add(TypeConvertor.castToReference(value));
2057        } else if (name.equals("result")) {
2058          this.getResult().add(TypeConvertor.castToReference(value));
2059        } else if (name.equals("note")) {
2060          this.getNote().add(TypeConvertor.castToAnnotation(value));
2061        } else if (name.equals("study")) {
2062          this.getStudy().add(TypeConvertor.castToReference(value));
2063        } else if (name.equals("supportingInfo")) {
2064          this.getSupportingInfo().add((DiagnosticReportSupportingInfoComponent) value);
2065        } else if (name.equals("media")) {
2066          this.getMedia().add((DiagnosticReportMediaComponent) value);
2067        } else if (name.equals("composition")) {
2068          this.composition = TypeConvertor.castToReference(value); // Reference
2069        } else if (name.equals("conclusion")) {
2070          this.conclusion = TypeConvertor.castToString(value); // StringType
2071        } else if (name.equals("conclusionCode")) {
2072          this.getConclusionCode().add(TypeConvertor.castToCodeableConcept(value));
2073        } else if (name.equals("presentedForm")) {
2074          this.getPresentedForm().add(TypeConvertor.castToAttachment(value));
2075        } else
2076          return super.setProperty(name, value);
2077        return value;
2078      }
2079
2080      @Override
2081      public Base makeProperty(int hash, String name) throws FHIRException {
2082        switch (hash) {
2083        case -1618432855:  return addIdentifier(); 
2084        case -332612366:  return addBasedOn(); 
2085        case -892481550:  return getStatusElement();
2086        case 50511102:  return addCategory(); 
2087        case 3059181:  return getCode();
2088        case -1867885268:  return getSubject();
2089        case 1524132147:  return getEncounter();
2090        case 247104889:  return getEffective();
2091        case -1468651097:  return getEffective();
2092        case -1179159893:  return getIssuedElement();
2093        case 481140686:  return addPerformer(); 
2094        case 2134944932:  return addResultsInterpreter(); 
2095        case -2132868344:  return addSpecimen(); 
2096        case -934426595:  return addResult(); 
2097        case 3387378:  return addNote(); 
2098        case 109776329:  return addStudy(); 
2099        case 1922406657:  return addSupportingInfo(); 
2100        case 103772132:  return addMedia(); 
2101        case -838923862:  return getComposition();
2102        case -1731259873:  return getConclusionElement();
2103        case -1731523412:  return addConclusionCode(); 
2104        case 230090366:  return addPresentedForm(); 
2105        default: return super.makeProperty(hash, name);
2106        }
2107
2108      }
2109
2110      @Override
2111      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2112        switch (hash) {
2113        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
2114        case -332612366: /*basedOn*/ return new String[] {"Reference"};
2115        case -892481550: /*status*/ return new String[] {"code"};
2116        case 50511102: /*category*/ return new String[] {"CodeableConcept"};
2117        case 3059181: /*code*/ return new String[] {"CodeableConcept"};
2118        case -1867885268: /*subject*/ return new String[] {"Reference"};
2119        case 1524132147: /*encounter*/ return new String[] {"Reference"};
2120        case -1468651097: /*effective*/ return new String[] {"dateTime", "Period"};
2121        case -1179159893: /*issued*/ return new String[] {"instant"};
2122        case 481140686: /*performer*/ return new String[] {"Reference"};
2123        case 2134944932: /*resultsInterpreter*/ return new String[] {"Reference"};
2124        case -2132868344: /*specimen*/ return new String[] {"Reference"};
2125        case -934426595: /*result*/ return new String[] {"Reference"};
2126        case 3387378: /*note*/ return new String[] {"Annotation"};
2127        case 109776329: /*study*/ return new String[] {"Reference"};
2128        case 1922406657: /*supportingInfo*/ return new String[] {};
2129        case 103772132: /*media*/ return new String[] {};
2130        case -838923862: /*composition*/ return new String[] {"Reference"};
2131        case -1731259873: /*conclusion*/ return new String[] {"string"};
2132        case -1731523412: /*conclusionCode*/ return new String[] {"CodeableConcept"};
2133        case 230090366: /*presentedForm*/ return new String[] {"Attachment"};
2134        default: return super.getTypesForProperty(hash, name);
2135        }
2136
2137      }
2138
2139      @Override
2140      public Base addChild(String name) throws FHIRException {
2141        if (name.equals("identifier")) {
2142          return addIdentifier();
2143        }
2144        else if (name.equals("basedOn")) {
2145          return addBasedOn();
2146        }
2147        else if (name.equals("status")) {
2148          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.status");
2149        }
2150        else if (name.equals("category")) {
2151          return addCategory();
2152        }
2153        else if (name.equals("code")) {
2154          this.code = new CodeableConcept();
2155          return this.code;
2156        }
2157        else if (name.equals("subject")) {
2158          this.subject = new Reference();
2159          return this.subject;
2160        }
2161        else if (name.equals("encounter")) {
2162          this.encounter = new Reference();
2163          return this.encounter;
2164        }
2165        else if (name.equals("effectiveDateTime")) {
2166          this.effective = new DateTimeType();
2167          return this.effective;
2168        }
2169        else if (name.equals("effectivePeriod")) {
2170          this.effective = new Period();
2171          return this.effective;
2172        }
2173        else if (name.equals("issued")) {
2174          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.issued");
2175        }
2176        else if (name.equals("performer")) {
2177          return addPerformer();
2178        }
2179        else if (name.equals("resultsInterpreter")) {
2180          return addResultsInterpreter();
2181        }
2182        else if (name.equals("specimen")) {
2183          return addSpecimen();
2184        }
2185        else if (name.equals("result")) {
2186          return addResult();
2187        }
2188        else if (name.equals("note")) {
2189          return addNote();
2190        }
2191        else if (name.equals("study")) {
2192          return addStudy();
2193        }
2194        else if (name.equals("supportingInfo")) {
2195          return addSupportingInfo();
2196        }
2197        else if (name.equals("media")) {
2198          return addMedia();
2199        }
2200        else if (name.equals("composition")) {
2201          this.composition = new Reference();
2202          return this.composition;
2203        }
2204        else if (name.equals("conclusion")) {
2205          throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.conclusion");
2206        }
2207        else if (name.equals("conclusionCode")) {
2208          return addConclusionCode();
2209        }
2210        else if (name.equals("presentedForm")) {
2211          return addPresentedForm();
2212        }
2213        else
2214          return super.addChild(name);
2215      }
2216
2217  public String fhirType() {
2218    return "DiagnosticReport";
2219
2220  }
2221
2222      public DiagnosticReport copy() {
2223        DiagnosticReport dst = new DiagnosticReport();
2224        copyValues(dst);
2225        return dst;
2226      }
2227
2228      public void copyValues(DiagnosticReport dst) {
2229        super.copyValues(dst);
2230        if (identifier != null) {
2231          dst.identifier = new ArrayList<Identifier>();
2232          for (Identifier i : identifier)
2233            dst.identifier.add(i.copy());
2234        };
2235        if (basedOn != null) {
2236          dst.basedOn = new ArrayList<Reference>();
2237          for (Reference i : basedOn)
2238            dst.basedOn.add(i.copy());
2239        };
2240        dst.status = status == null ? null : status.copy();
2241        if (category != null) {
2242          dst.category = new ArrayList<CodeableConcept>();
2243          for (CodeableConcept i : category)
2244            dst.category.add(i.copy());
2245        };
2246        dst.code = code == null ? null : code.copy();
2247        dst.subject = subject == null ? null : subject.copy();
2248        dst.encounter = encounter == null ? null : encounter.copy();
2249        dst.effective = effective == null ? null : effective.copy();
2250        dst.issued = issued == null ? null : issued.copy();
2251        if (performer != null) {
2252          dst.performer = new ArrayList<Reference>();
2253          for (Reference i : performer)
2254            dst.performer.add(i.copy());
2255        };
2256        if (resultsInterpreter != null) {
2257          dst.resultsInterpreter = new ArrayList<Reference>();
2258          for (Reference i : resultsInterpreter)
2259            dst.resultsInterpreter.add(i.copy());
2260        };
2261        if (specimen != null) {
2262          dst.specimen = new ArrayList<Reference>();
2263          for (Reference i : specimen)
2264            dst.specimen.add(i.copy());
2265        };
2266        if (result != null) {
2267          dst.result = new ArrayList<Reference>();
2268          for (Reference i : result)
2269            dst.result.add(i.copy());
2270        };
2271        if (note != null) {
2272          dst.note = new ArrayList<Annotation>();
2273          for (Annotation i : note)
2274            dst.note.add(i.copy());
2275        };
2276        if (study != null) {
2277          dst.study = new ArrayList<Reference>();
2278          for (Reference i : study)
2279            dst.study.add(i.copy());
2280        };
2281        if (supportingInfo != null) {
2282          dst.supportingInfo = new ArrayList<DiagnosticReportSupportingInfoComponent>();
2283          for (DiagnosticReportSupportingInfoComponent i : supportingInfo)
2284            dst.supportingInfo.add(i.copy());
2285        };
2286        if (media != null) {
2287          dst.media = new ArrayList<DiagnosticReportMediaComponent>();
2288          for (DiagnosticReportMediaComponent i : media)
2289            dst.media.add(i.copy());
2290        };
2291        dst.composition = composition == null ? null : composition.copy();
2292        dst.conclusion = conclusion == null ? null : conclusion.copy();
2293        if (conclusionCode != null) {
2294          dst.conclusionCode = new ArrayList<CodeableConcept>();
2295          for (CodeableConcept i : conclusionCode)
2296            dst.conclusionCode.add(i.copy());
2297        };
2298        if (presentedForm != null) {
2299          dst.presentedForm = new ArrayList<Attachment>();
2300          for (Attachment i : presentedForm)
2301            dst.presentedForm.add(i.copy());
2302        };
2303      }
2304
2305      protected DiagnosticReport typedCopy() {
2306        return copy();
2307      }
2308
2309      @Override
2310      public boolean equalsDeep(Base other_) {
2311        if (!super.equalsDeep(other_))
2312          return false;
2313        if (!(other_ instanceof DiagnosticReport))
2314          return false;
2315        DiagnosticReport o = (DiagnosticReport) other_;
2316        return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(status, o.status, true)
2317           && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true)
2318           && compareDeep(encounter, o.encounter, true) && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true)
2319           && compareDeep(performer, o.performer, true) && compareDeep(resultsInterpreter, o.resultsInterpreter, true)
2320           && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) && compareDeep(note, o.note, true)
2321           && compareDeep(study, o.study, true) && compareDeep(supportingInfo, o.supportingInfo, true) && compareDeep(media, o.media, true)
2322           && compareDeep(composition, o.composition, true) && compareDeep(conclusion, o.conclusion, true)
2323           && compareDeep(conclusionCode, o.conclusionCode, true) && compareDeep(presentedForm, o.presentedForm, true)
2324          ;
2325      }
2326
2327      @Override
2328      public boolean equalsShallow(Base other_) {
2329        if (!super.equalsShallow(other_))
2330          return false;
2331        if (!(other_ instanceof DiagnosticReport))
2332          return false;
2333        DiagnosticReport o = (DiagnosticReport) other_;
2334        return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true)
2335          ;
2336      }
2337
2338      public boolean isEmpty() {
2339        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, basedOn, status
2340          , category, code, subject, encounter, effective, issued, performer, resultsInterpreter
2341          , specimen, result, note, study, supportingInfo, media, composition, conclusion
2342          , conclusionCode, presentedForm);
2343      }
2344
2345  @Override
2346  public ResourceType getResourceType() {
2347    return ResourceType.DiagnosticReport;
2348   }
2349
2350 /**
2351   * Search parameter: <b>based-on</b>
2352   * <p>
2353   * Description: <b>Reference to the service request.</b><br>
2354   * Type: <b>reference</b><br>
2355   * Path: <b>DiagnosticReport.basedOn</b><br>
2356   * </p>
2357   */
2358  @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 } )
2359  public static final String SP_BASED_ON = "based-on";
2360 /**
2361   * <b>Fluent Client</b> search parameter constant for <b>based-on</b>
2362   * <p>
2363   * Description: <b>Reference to the service request.</b><br>
2364   * Type: <b>reference</b><br>
2365   * Path: <b>DiagnosticReport.basedOn</b><br>
2366   * </p>
2367   */
2368  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASED_ON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASED_ON);
2369
2370/**
2371   * Constant for fluent queries to be used to add include statements. Specifies
2372   * the path value of "<b>DiagnosticReport:based-on</b>".
2373   */
2374  public static final ca.uhn.fhir.model.api.Include INCLUDE_BASED_ON = new ca.uhn.fhir.model.api.Include("DiagnosticReport:based-on").toLocked();
2375
2376 /**
2377   * Search parameter: <b>category</b>
2378   * <p>
2379   * Description: <b>Which diagnostic discipline/department created the report</b><br>
2380   * Type: <b>token</b><br>
2381   * Path: <b>DiagnosticReport.category</b><br>
2382   * </p>
2383   */
2384  @SearchParamDefinition(name="category", path="DiagnosticReport.category", description="Which diagnostic discipline/department created the report", type="token" )
2385  public static final String SP_CATEGORY = "category";
2386 /**
2387   * <b>Fluent Client</b> search parameter constant for <b>category</b>
2388   * <p>
2389   * Description: <b>Which diagnostic discipline/department created the report</b><br>
2390   * Type: <b>token</b><br>
2391   * Path: <b>DiagnosticReport.category</b><br>
2392   * </p>
2393   */
2394  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY);
2395
2396 /**
2397   * Search parameter: <b>conclusion</b>
2398   * <p>
2399   * Description: <b>A coded conclusion (interpretation/impression) on the report</b><br>
2400   * Type: <b>token</b><br>
2401   * Path: <b>DiagnosticReport.conclusionCode</b><br>
2402   * </p>
2403   */
2404  @SearchParamDefinition(name="conclusion", path="DiagnosticReport.conclusionCode", description="A coded conclusion (interpretation/impression) on the report", type="token" )
2405  public static final String SP_CONCLUSION = "conclusion";
2406 /**
2407   * <b>Fluent Client</b> search parameter constant for <b>conclusion</b>
2408   * <p>
2409   * Description: <b>A coded conclusion (interpretation/impression) on the report</b><br>
2410   * Type: <b>token</b><br>
2411   * Path: <b>DiagnosticReport.conclusionCode</b><br>
2412   * </p>
2413   */
2414  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONCLUSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONCLUSION);
2415
2416 /**
2417   * Search parameter: <b>issued</b>
2418   * <p>
2419   * Description: <b>When the report was issued</b><br>
2420   * Type: <b>date</b><br>
2421   * Path: <b>DiagnosticReport.issued</b><br>
2422   * </p>
2423   */
2424  @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" )
2425  public static final String SP_ISSUED = "issued";
2426 /**
2427   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
2428   * <p>
2429   * Description: <b>When the report was issued</b><br>
2430   * Type: <b>date</b><br>
2431   * Path: <b>DiagnosticReport.issued</b><br>
2432   * </p>
2433   */
2434  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
2435
2436 /**
2437   * Search parameter: <b>media</b>
2438   * <p>
2439   * Description: <b>A reference to the image source.</b><br>
2440   * Type: <b>reference</b><br>
2441   * Path: <b>DiagnosticReport.media.link</b><br>
2442   * </p>
2443   */
2444  @SearchParamDefinition(name="media", path="DiagnosticReport.media.link", description="A reference to the image source.", type="reference", target={DocumentReference.class } )
2445  public static final String SP_MEDIA = "media";
2446 /**
2447   * <b>Fluent Client</b> search parameter constant for <b>media</b>
2448   * <p>
2449   * Description: <b>A reference to the image source.</b><br>
2450   * Type: <b>reference</b><br>
2451   * Path: <b>DiagnosticReport.media.link</b><br>
2452   * </p>
2453   */
2454  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDIA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDIA);
2455
2456/**
2457   * Constant for fluent queries to be used to add include statements. Specifies
2458   * the path value of "<b>DiagnosticReport:media</b>".
2459   */
2460  public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDIA = new ca.uhn.fhir.model.api.Include("DiagnosticReport:media").toLocked();
2461
2462 /**
2463   * Search parameter: <b>performer</b>
2464   * <p>
2465   * Description: <b>Who is responsible for the report</b><br>
2466   * Type: <b>reference</b><br>
2467   * Path: <b>DiagnosticReport.performer</b><br>
2468   * </p>
2469   */
2470  @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 } )
2471  public static final String SP_PERFORMER = "performer";
2472 /**
2473   * <b>Fluent Client</b> search parameter constant for <b>performer</b>
2474   * <p>
2475   * Description: <b>Who is responsible for the report</b><br>
2476   * Type: <b>reference</b><br>
2477   * Path: <b>DiagnosticReport.performer</b><br>
2478   * </p>
2479   */
2480  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER);
2481
2482/**
2483   * Constant for fluent queries to be used to add include statements. Specifies
2484   * the path value of "<b>DiagnosticReport:performer</b>".
2485   */
2486  public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:performer").toLocked();
2487
2488 /**
2489   * Search parameter: <b>result</b>
2490   * <p>
2491   * Description: <b>Link to an atomic result (observation resource)</b><br>
2492   * Type: <b>reference</b><br>
2493   * Path: <b>DiagnosticReport.result</b><br>
2494   * </p>
2495   */
2496  @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference", target={Observation.class } )
2497  public static final String SP_RESULT = "result";
2498 /**
2499   * <b>Fluent Client</b> search parameter constant for <b>result</b>
2500   * <p>
2501   * Description: <b>Link to an atomic result (observation resource)</b><br>
2502   * Type: <b>reference</b><br>
2503   * Path: <b>DiagnosticReport.result</b><br>
2504   * </p>
2505   */
2506  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULT);
2507
2508/**
2509   * Constant for fluent queries to be used to add include statements. Specifies
2510   * the path value of "<b>DiagnosticReport:result</b>".
2511   */
2512  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:result").toLocked();
2513
2514 /**
2515   * Search parameter: <b>results-interpreter</b>
2516   * <p>
2517   * Description: <b>Who was the source of the report</b><br>
2518   * Type: <b>reference</b><br>
2519   * Path: <b>DiagnosticReport.resultsInterpreter</b><br>
2520   * </p>
2521   */
2522  @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 } )
2523  public static final String SP_RESULTS_INTERPRETER = "results-interpreter";
2524 /**
2525   * <b>Fluent Client</b> search parameter constant for <b>results-interpreter</b>
2526   * <p>
2527   * Description: <b>Who was the source of the report</b><br>
2528   * Type: <b>reference</b><br>
2529   * Path: <b>DiagnosticReport.resultsInterpreter</b><br>
2530   * </p>
2531   */
2532  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULTS_INTERPRETER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULTS_INTERPRETER);
2533
2534/**
2535   * Constant for fluent queries to be used to add include statements. Specifies
2536   * the path value of "<b>DiagnosticReport:results-interpreter</b>".
2537   */
2538  public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULTS_INTERPRETER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:results-interpreter").toLocked();
2539
2540 /**
2541   * Search parameter: <b>specimen</b>
2542   * <p>
2543   * Description: <b>The specimen details</b><br>
2544   * Type: <b>reference</b><br>
2545   * Path: <b>DiagnosticReport.specimen</b><br>
2546   * </p>
2547   */
2548  @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference", target={Specimen.class } )
2549  public static final String SP_SPECIMEN = "specimen";
2550 /**
2551   * <b>Fluent Client</b> search parameter constant for <b>specimen</b>
2552   * <p>
2553   * Description: <b>The specimen details</b><br>
2554   * Type: <b>reference</b><br>
2555   * Path: <b>DiagnosticReport.specimen</b><br>
2556   * </p>
2557   */
2558  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN);
2559
2560/**
2561   * Constant for fluent queries to be used to add include statements. Specifies
2562   * the path value of "<b>DiagnosticReport:specimen</b>".
2563   */
2564  public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticReport:specimen").toLocked();
2565
2566 /**
2567   * Search parameter: <b>status</b>
2568   * <p>
2569   * Description: <b>The status of the report</b><br>
2570   * Type: <b>token</b><br>
2571   * Path: <b>DiagnosticReport.status</b><br>
2572   * </p>
2573   */
2574  @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" )
2575  public static final String SP_STATUS = "status";
2576 /**
2577   * <b>Fluent Client</b> search parameter constant for <b>status</b>
2578   * <p>
2579   * Description: <b>The status of the report</b><br>
2580   * Type: <b>token</b><br>
2581   * Path: <b>DiagnosticReport.status</b><br>
2582   * </p>
2583   */
2584  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
2585
2586 /**
2587   * Search parameter: <b>study</b>
2588   * <p>
2589   * Description: <b>Studies associated with the diagnostic report</b><br>
2590   * Type: <b>reference</b><br>
2591   * Path: <b>DiagnosticReport.study</b><br>
2592   * </p>
2593   */
2594  @SearchParamDefinition(name="study", path="DiagnosticReport.study", description="Studies associated with the diagnostic report", type="reference", target={GenomicStudy.class, ImagingStudy.class } )
2595  public static final String SP_STUDY = "study";
2596 /**
2597   * <b>Fluent Client</b> search parameter constant for <b>study</b>
2598   * <p>
2599   * Description: <b>Studies associated with the diagnostic report</b><br>
2600   * Type: <b>reference</b><br>
2601   * Path: <b>DiagnosticReport.study</b><br>
2602   * </p>
2603   */
2604  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam STUDY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_STUDY);
2605
2606/**
2607   * Constant for fluent queries to be used to add include statements. Specifies
2608   * the path value of "<b>DiagnosticReport:study</b>".
2609   */
2610  public static final ca.uhn.fhir.model.api.Include INCLUDE_STUDY = new ca.uhn.fhir.model.api.Include("DiagnosticReport:study").toLocked();
2611
2612 /**
2613   * Search parameter: <b>subject</b>
2614   * <p>
2615   * Description: <b>The subject of the report</b><br>
2616   * Type: <b>reference</b><br>
2617   * Path: <b>DiagnosticReport.subject</b><br>
2618   * </p>
2619   */
2620  @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 } )
2621  public static final String SP_SUBJECT = "subject";
2622 /**
2623   * <b>Fluent Client</b> search parameter constant for <b>subject</b>
2624   * <p>
2625   * Description: <b>The subject of the report</b><br>
2626   * Type: <b>reference</b><br>
2627   * Path: <b>DiagnosticReport.subject</b><br>
2628   * </p>
2629   */
2630  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT);
2631
2632/**
2633   * Constant for fluent queries to be used to add include statements. Specifies
2634   * the path value of "<b>DiagnosticReport:subject</b>".
2635   */
2636  public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:subject").toLocked();
2637
2638 /**
2639   * Search parameter: <b>code</b>
2640   * <p>
2641   * Description: <b>Multiple Resources: 
2642
2643* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2644* [Condition](condition.html): Code for the condition
2645* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2646* [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
2647* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2648* [List](list.html): What the purpose of this list is
2649* [Medication](medication.html): Returns medications for a specific code
2650* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2651* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2652* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2653* [MedicationUsage](medicationusage.html): Return statements of this medication code
2654* [Observation](observation.html): The code of the observation type
2655* [Procedure](procedure.html): A code to identify a  procedure
2656</b><br>
2657   * Type: <b>token</b><br>
2658   * 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</b><br>
2659   * </p>
2660   */
2661  @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", 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", type="token" )
2662  public static final String SP_CODE = "code";
2663 /**
2664   * <b>Fluent Client</b> search parameter constant for <b>code</b>
2665   * <p>
2666   * Description: <b>Multiple Resources: 
2667
2668* [AllergyIntolerance](allergyintolerance.html): Code that identifies the allergy or intolerance
2669* [Condition](condition.html): Code for the condition
2670* [DeviceRequest](devicerequest.html): Code for what is being requested/ordered
2671* [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
2672* [FamilyMemberHistory](familymemberhistory.html): A search by a condition code
2673* [List](list.html): What the purpose of this list is
2674* [Medication](medication.html): Returns medications for a specific code
2675* [MedicationAdministration](medicationadministration.html): Return administrations of this medication code
2676* [MedicationDispense](medicationdispense.html): Returns dispenses of this medicine code
2677* [MedicationRequest](medicationrequest.html): Return prescriptions of this medication code
2678* [MedicationUsage](medicationusage.html): Return statements of this medication code
2679* [Observation](observation.html): The code of the observation type
2680* [Procedure](procedure.html): A code to identify a  procedure
2681</b><br>
2682   * Type: <b>token</b><br>
2683   * 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</b><br>
2684   * </p>
2685   */
2686  public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE);
2687
2688 /**
2689   * Search parameter: <b>date</b>
2690   * <p>
2691   * Description: <b>Multiple Resources: 
2692
2693* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2694* [CarePlan](careplan.html): Time period plan covers
2695* [CareTeam](careteam.html): A date within the coverage time period.
2696* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2697* [Composition](composition.html): Composition editing time
2698* [Consent](consent.html): When consent was agreed to
2699* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2700* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2701* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2702* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2703* [Flag](flag.html): Time period when flag is active
2704* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2705* [List](list.html): When the list was prepared
2706* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2707* [Procedure](procedure.html): When the procedure occurred or is occurring
2708* [RiskAssessment](riskassessment.html): When was assessment made?
2709* [SupplyRequest](supplyrequest.html): When the request was made
2710</b><br>
2711   * Type: <b>date</b><br>
2712   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2713   * </p>
2714   */
2715  @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (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" )
2716  public static final String SP_DATE = "date";
2717 /**
2718   * <b>Fluent Client</b> search parameter constant for <b>date</b>
2719   * <p>
2720   * Description: <b>Multiple Resources: 
2721
2722* [AllergyIntolerance](allergyintolerance.html): Date first version of the resource instance was recorded
2723* [CarePlan](careplan.html): Time period plan covers
2724* [CareTeam](careteam.html): A date within the coverage time period.
2725* [ClinicalImpression](clinicalimpression.html): When the assessment was documented
2726* [Composition](composition.html): Composition editing time
2727* [Consent](consent.html): When consent was agreed to
2728* [DiagnosticReport](diagnosticreport.html): The clinically relevant time of the report
2729* [Encounter](encounter.html): A date within the actualPeriod the Encounter lasted
2730* [EpisodeOfCare](episodeofcare.html): The provided date search value falls within the episode of care's period
2731* [FamilyMemberHistory](familymemberhistory.html): When history was recorded or last updated
2732* [Flag](flag.html): Time period when flag is active
2733* [Immunization](immunization.html): Vaccination  (non)-Administration Date
2734* [List](list.html): When the list was prepared
2735* [Observation](observation.html): Obtained date/time. If the obtained element is a period, a date that falls in the period
2736* [Procedure](procedure.html): When the procedure occurred or is occurring
2737* [RiskAssessment](riskassessment.html): When was assessment made?
2738* [SupplyRequest](supplyrequest.html): When the request was made
2739</b><br>
2740   * Type: <b>date</b><br>
2741   * Path: <b>AllergyIntolerance.recordedDate | CarePlan.period | ClinicalImpression.date | Composition.date | Consent.date | DiagnosticReport.effective.as(dateTime) | DiagnosticReport.effective.as(Period) | Encounter.actualPeriod | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrence as dateTime) | List.date | Observation.effective.as(dateTime) | Observation.effective.as(Period) | Observation.effective.as(Timing) | Observation.effective.as(instant) | Procedure.occurrence.as(dateTime) | Procedure.occurrence.as(Period) | Procedure.occurrence.as(Timing) | (RiskAssessment.occurrence as dateTime) | SupplyRequest.authoredOn</b><br>
2742   * </p>
2743   */
2744  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
2745
2746 /**
2747   * Search parameter: <b>encounter</b>
2748   * <p>
2749   * Description: <b>Multiple Resources: 
2750
2751* [Composition](composition.html): Context of the Composition
2752* [DeviceRequest](devicerequest.html): Encounter during which request was created
2753* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2754* [Flag](flag.html): Alert relevant during encounter
2755* [List](list.html): Context in which list created
2756* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2757* [Observation](observation.html): Encounter related to the observation
2758* [Procedure](procedure.html): The Encounter during which this Procedure was created
2759* [RiskAssessment](riskassessment.html): Where was assessment performed?
2760* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2761* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2762</b><br>
2763   * Type: <b>reference</b><br>
2764   * 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>
2765   * </p>
2766   */
2767  @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 } )
2768  public static final String SP_ENCOUNTER = "encounter";
2769 /**
2770   * <b>Fluent Client</b> search parameter constant for <b>encounter</b>
2771   * <p>
2772   * Description: <b>Multiple Resources: 
2773
2774* [Composition](composition.html): Context of the Composition
2775* [DeviceRequest](devicerequest.html): Encounter during which request was created
2776* [DiagnosticReport](diagnosticreport.html): The Encounter when the order was made
2777* [Flag](flag.html): Alert relevant during encounter
2778* [List](list.html): Context in which list created
2779* [NutritionOrder](nutritionorder.html): Return nutrition orders with this encounter identifier
2780* [Observation](observation.html): Encounter related to the observation
2781* [Procedure](procedure.html): The Encounter during which this Procedure was created
2782* [RiskAssessment](riskassessment.html): Where was assessment performed?
2783* [ServiceRequest](servicerequest.html): An encounter in which this request is made
2784* [VisionPrescription](visionprescription.html): Return prescriptions with this encounter identifier
2785</b><br>
2786   * Type: <b>reference</b><br>
2787   * 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>
2788   * </p>
2789   */
2790  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER);
2791
2792/**
2793   * Constant for fluent queries to be used to add include statements. Specifies
2794   * the path value of "<b>DiagnosticReport:encounter</b>".
2795   */
2796  public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:encounter").toLocked();
2797
2798 /**
2799   * Search parameter: <b>identifier</b>
2800   * <p>
2801   * Description: <b>Multiple Resources: 
2802
2803* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2804* [CarePlan](careplan.html): External Ids for this plan
2805* [CareTeam](careteam.html): External Ids for this team
2806* [Composition](composition.html): Version-independent identifier for the Composition
2807* [Condition](condition.html): A unique identifier of the condition record
2808* [Consent](consent.html): Identifier for this record (external references)
2809* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2810* [DeviceRequest](devicerequest.html): Business identifier for request/order
2811* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2812* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2813* [DocumentReference](documentreference.html): Identifier of the attachment binary
2814* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2815* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2816* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2817* [Goal](goal.html): External Ids for this goal
2818* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2819* [Immunization](immunization.html): Business identifier
2820* [List](list.html): Business identifier
2821* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2822* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2823* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2824* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2825* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2826* [Observation](observation.html): The unique id for a particular observation
2827* [Procedure](procedure.html): A unique identifier for a procedure
2828* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2829* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2830* [SupplyDelivery](supplydelivery.html): External identifier
2831* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2832* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2833</b><br>
2834   * Type: <b>token</b><br>
2835   * 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>
2836   * </p>
2837   */
2838  @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" )
2839  public static final String SP_IDENTIFIER = "identifier";
2840 /**
2841   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
2842   * <p>
2843   * Description: <b>Multiple Resources: 
2844
2845* [AllergyIntolerance](allergyintolerance.html): External ids for this item
2846* [CarePlan](careplan.html): External Ids for this plan
2847* [CareTeam](careteam.html): External Ids for this team
2848* [Composition](composition.html): Version-independent identifier for the Composition
2849* [Condition](condition.html): A unique identifier of the condition record
2850* [Consent](consent.html): Identifier for this record (external references)
2851* [DetectedIssue](detectedissue.html): Unique id for the detected issue
2852* [DeviceRequest](devicerequest.html): Business identifier for request/order
2853* [DiagnosticReport](diagnosticreport.html): An identifier for the report
2854* [DocumentManifest](documentmanifest.html): Unique Identifier for the set of documents
2855* [DocumentReference](documentreference.html): Identifier of the attachment binary
2856* [Encounter](encounter.html): Identifier(s) by which this encounter is known
2857* [EpisodeOfCare](episodeofcare.html): Business Identifier(s) relevant for this EpisodeOfCare
2858* [FamilyMemberHistory](familymemberhistory.html): A search by a record identifier
2859* [Goal](goal.html): External Ids for this goal
2860* [ImagingStudy](imagingstudy.html): Identifiers for the Study, such as DICOM Study Instance UID
2861* [Immunization](immunization.html): Business identifier
2862* [List](list.html): Business identifier
2863* [MedicationAdministration](medicationadministration.html): Return administrations with this external identifier
2864* [MedicationDispense](medicationdispense.html): Returns dispenses with this external identifier
2865* [MedicationRequest](medicationrequest.html): Return prescriptions with this external identifier
2866* [MedicationUsage](medicationusage.html): Return statements with this external identifier
2867* [NutritionOrder](nutritionorder.html): Return nutrition orders with this external identifier
2868* [Observation](observation.html): The unique id for a particular observation
2869* [Procedure](procedure.html): A unique identifier for a procedure
2870* [RiskAssessment](riskassessment.html): Unique identifier for the assessment
2871* [ServiceRequest](servicerequest.html): Identifiers assigned to this order
2872* [SupplyDelivery](supplydelivery.html): External identifier
2873* [SupplyRequest](supplyrequest.html): Business Identifier for SupplyRequest
2874* [VisionPrescription](visionprescription.html): Return prescriptions with this external identifier
2875</b><br>
2876   * Type: <b>token</b><br>
2877   * 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>
2878   * </p>
2879   */
2880  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
2881
2882 /**
2883   * Search parameter: <b>patient</b>
2884   * <p>
2885   * Description: <b>Multiple Resources: 
2886
2887* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2888* [CarePlan](careplan.html): Who the care plan is for
2889* [CareTeam](careteam.html): Who care team is for
2890* [ClinicalImpression](clinicalimpression.html): Patient assessed
2891* [Composition](composition.html): Who and/or what the composition is about
2892* [Condition](condition.html): Who has the condition?
2893* [Consent](consent.html): Who the consent applies to
2894* [DetectedIssue](detectedissue.html): Associated patient
2895* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2896* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2897* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2898* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2899* [DocumentReference](documentreference.html): Who/what is the subject of the document
2900* [Encounter](encounter.html): The patient present at the encounter
2901* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2902* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2903* [Flag](flag.html): The identity of a subject to list flags for
2904* [Goal](goal.html): Who this goal is intended for
2905* [ImagingStudy](imagingstudy.html): Who the study is about
2906* [Immunization](immunization.html): The patient for the vaccination record
2907* [List](list.html): If all resources have the same subject
2908* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2909* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2910* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2911* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2912* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2913* [Observation](observation.html): The subject that the observation is about (if patient)
2914* [Procedure](procedure.html): Search by subject - a patient
2915* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2916* [ServiceRequest](servicerequest.html): Search by subject - a patient
2917* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2918* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2919* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2920</b><br>
2921   * Type: <b>reference</b><br>
2922   * 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.subject | 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.subject.where(resolve() is 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 | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2923   * </p>
2924   */
2925  @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.subject | 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.subject.where(resolve() is 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 | SupplyRequest.deliverFor | 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 individual or set of individuals 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* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined\r\n* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for\r\n", type="reference", target={BiologicallyDerivedProduct.class, Device.class, Group.class, Location.class, Medication.class, NutritionProduct.class, Organization.class, Patient.class, Practitioner.class, Procedure.class, Substance.class } )
2926  public static final String SP_PATIENT = "patient";
2927 /**
2928   * <b>Fluent Client</b> search parameter constant for <b>patient</b>
2929   * <p>
2930   * Description: <b>Multiple Resources: 
2931
2932* [AllergyIntolerance](allergyintolerance.html): Who the sensitivity is for
2933* [CarePlan](careplan.html): Who the care plan is for
2934* [CareTeam](careteam.html): Who care team is for
2935* [ClinicalImpression](clinicalimpression.html): Patient assessed
2936* [Composition](composition.html): Who and/or what the composition is about
2937* [Condition](condition.html): Who has the condition?
2938* [Consent](consent.html): Who the consent applies to
2939* [DetectedIssue](detectedissue.html): Associated patient
2940* [DeviceRequest](devicerequest.html): Individual the service is ordered for
2941* [DeviceUsage](deviceusage.html): Search by patient who used / uses the device
2942* [DiagnosticReport](diagnosticreport.html): The subject of the report if a patient
2943* [DocumentManifest](documentmanifest.html): The subject of the set of documents
2944* [DocumentReference](documentreference.html): Who/what is the subject of the document
2945* [Encounter](encounter.html): The patient present at the encounter
2946* [EpisodeOfCare](episodeofcare.html): The patient who is the focus of this episode of care
2947* [FamilyMemberHistory](familymemberhistory.html): The identity of a subject to list family member history items for
2948* [Flag](flag.html): The identity of a subject to list flags for
2949* [Goal](goal.html): Who this goal is intended for
2950* [ImagingStudy](imagingstudy.html): Who the study is about
2951* [Immunization](immunization.html): The patient for the vaccination record
2952* [List](list.html): If all resources have the same subject
2953* [MedicationAdministration](medicationadministration.html): The identity of a patient to list administrations  for
2954* [MedicationDispense](medicationdispense.html): The identity of a patient to list dispenses  for
2955* [MedicationRequest](medicationrequest.html): Returns prescriptions for a specific patient
2956* [MedicationUsage](medicationusage.html): Returns statements for a specific patient.
2957* [NutritionOrder](nutritionorder.html): The identity of the individual or set of individuals who requires the diet, formula or nutritional supplement
2958* [Observation](observation.html): The subject that the observation is about (if patient)
2959* [Procedure](procedure.html): Search by subject - a patient
2960* [RiskAssessment](riskassessment.html): Who/what does assessment apply to?
2961* [ServiceRequest](servicerequest.html): Search by subject - a patient
2962* [SupplyDelivery](supplydelivery.html): Patient for whom the item is supplied
2963* [SupplyRequest](supplyrequest.html): The patient or subject for whom the supply is destined
2964* [VisionPrescription](visionprescription.html): The identity of a patient to list dispenses for
2965</b><br>
2966   * Type: <b>reference</b><br>
2967   * 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.subject | 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.subject.where(resolve() is 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 | SupplyRequest.deliverFor | VisionPrescription.patient</b><br>
2968   * </p>
2969   */
2970  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT);
2971
2972/**
2973   * Constant for fluent queries to be used to add include statements. Specifies
2974   * the path value of "<b>DiagnosticReport:patient</b>".
2975   */
2976  public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:patient").toLocked();
2977
2978
2979}