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