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