001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.exceptions.FHIRException;
040import org.hl7.fhir.exceptions.FHIRFormatError;
041import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
042import org.hl7.fhir.utilities.Utilities;
043
044import ca.uhn.fhir.model.api.annotation.Block;
045import ca.uhn.fhir.model.api.annotation.Child;
046import ca.uhn.fhir.model.api.annotation.Description;
047import ca.uhn.fhir.model.api.annotation.ResourceDef;
048import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
049/**
050 * 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.
051 */
052@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport")
053public class DiagnosticReport extends DomainResource {
054
055    public enum DiagnosticReportStatus {
056        /**
057         * The existence of the report is registered, but there is nothing yet available.
058         */
059        REGISTERED, 
060        /**
061         * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.
062         */
063        PARTIAL, 
064        /**
065         * Verified early results are available, but not all  results are final.
066         */
067        PRELIMINARY, 
068        /**
069         * The report is complete and verified by an authorized person.
070         */
071        FINAL, 
072        /**
073         * 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.
074         */
075        AMENDED, 
076        /**
077         * Subsequent to being final, the report has been modified  to correct an error in the report or referenced results.
078         */
079        CORRECTED, 
080        /**
081         * Subsequent to being final, the report has been modified by adding new content. The existing content is unchanged.
082         */
083        APPENDED, 
084        /**
085         * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
086         */
087        CANCELLED, 
088        /**
089         * 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".)
090         */
091        ENTEREDINERROR, 
092        /**
093         * 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.
094         */
095        UNKNOWN, 
096        /**
097         * added to help the parsers with the generic types
098         */
099        NULL;
100        public static DiagnosticReportStatus fromCode(String codeString) throws FHIRException {
101            if (codeString == null || "".equals(codeString))
102                return null;
103        if ("registered".equals(codeString))
104          return REGISTERED;
105        if ("partial".equals(codeString))
106          return PARTIAL;
107        if ("preliminary".equals(codeString))
108          return PRELIMINARY;
109        if ("final".equals(codeString))
110          return FINAL;
111        if ("amended".equals(codeString))
112          return AMENDED;
113        if ("corrected".equals(codeString))
114          return CORRECTED;
115        if ("appended".equals(codeString))
116          return APPENDED;
117        if ("cancelled".equals(codeString))
118          return CANCELLED;
119        if ("entered-in-error".equals(codeString))
120          return ENTEREDINERROR;
121        if ("unknown".equals(codeString))
122          return UNKNOWN;
123        if (Configuration.isAcceptInvalidEnums())
124          return null;
125        else
126          throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
127        }
128        public String toCode() {
129          switch (this) {
130            case REGISTERED: return "registered";
131            case PARTIAL: return "partial";
132            case PRELIMINARY: return "preliminary";
133            case FINAL: return "final";
134            case AMENDED: return "amended";
135            case CORRECTED: return "corrected";
136            case APPENDED: return "appended";
137            case CANCELLED: return "cancelled";
138            case ENTEREDINERROR: return "entered-in-error";
139            case UNKNOWN: return "unknown";
140            case NULL: return null;
141            default: return "?";
142          }
143        }
144        public String getSystem() {
145          switch (this) {
146            case REGISTERED: return "http://hl7.org/fhir/diagnostic-report-status";
147            case PARTIAL: return "http://hl7.org/fhir/diagnostic-report-status";
148            case PRELIMINARY: return "http://hl7.org/fhir/diagnostic-report-status";
149            case FINAL: return "http://hl7.org/fhir/diagnostic-report-status";
150            case AMENDED: return "http://hl7.org/fhir/diagnostic-report-status";
151            case CORRECTED: return "http://hl7.org/fhir/diagnostic-report-status";
152            case APPENDED: return "http://hl7.org/fhir/diagnostic-report-status";
153            case CANCELLED: return "http://hl7.org/fhir/diagnostic-report-status";
154            case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-report-status";
155            case UNKNOWN: return "http://hl7.org/fhir/diagnostic-report-status";
156            case NULL: return null;
157            default: return "?";
158          }
159        }
160        public String getDefinition() {
161          switch (this) {
162            case REGISTERED: return "The existence of the report is registered, but there is nothing yet available.";
163            case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified.";
164            case PRELIMINARY: return "Verified early results are available, but not all  results are final.";
165            case FINAL: return "The report is complete and verified by an authorized person.";
166            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.";
167            case CORRECTED: return "Subsequent to being final, the report has been modified  to correct an error in the report or referenced results.";
168            case APPENDED: return "Subsequent to being final, the report has been modified by adding new content. The existing content is unchanged.";
169            case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\").";
170            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\".)";
171            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.";
172            case NULL: return null;
173            default: return "?";
174          }
175        }
176        public String getDisplay() {
177          switch (this) {
178            case REGISTERED: return "Registered";
179            case PARTIAL: return "Partial";
180            case PRELIMINARY: return "Preliminary";
181            case FINAL: return "Final";
182            case AMENDED: return "Amended";
183            case CORRECTED: return "Corrected";
184            case APPENDED: return "Appended";
185            case CANCELLED: return "Cancelled";
186            case ENTEREDINERROR: return "Entered in Error";
187            case UNKNOWN: return "Unknown";
188            case NULL: return null;
189            default: return "?";
190          }
191        }
192    }
193
194  public static class DiagnosticReportStatusEnumFactory implements EnumFactory<DiagnosticReportStatus> {
195    public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException {
196      if (codeString == null || "".equals(codeString))
197            if (codeString == null || "".equals(codeString))
198                return null;
199        if ("registered".equals(codeString))
200          return DiagnosticReportStatus.REGISTERED;
201        if ("partial".equals(codeString))
202          return DiagnosticReportStatus.PARTIAL;
203        if ("preliminary".equals(codeString))
204          return DiagnosticReportStatus.PRELIMINARY;
205        if ("final".equals(codeString))
206          return DiagnosticReportStatus.FINAL;
207        if ("amended".equals(codeString))
208          return DiagnosticReportStatus.AMENDED;
209        if ("corrected".equals(codeString))
210          return DiagnosticReportStatus.CORRECTED;
211        if ("appended".equals(codeString))
212          return DiagnosticReportStatus.APPENDED;
213        if ("cancelled".equals(codeString))
214          return DiagnosticReportStatus.CANCELLED;
215        if ("entered-in-error".equals(codeString))
216          return DiagnosticReportStatus.ENTEREDINERROR;
217        if ("unknown".equals(codeString))
218          return DiagnosticReportStatus.UNKNOWN;
219        throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'");
220        }
221        public Enumeration<DiagnosticReportStatus> fromType(PrimitiveType<?> code) throws FHIRException {
222          if (code == null)
223            return null;
224          if (code.isEmpty())
225            return new Enumeration<DiagnosticReportStatus>(this);
226          String codeString = code.asStringValue();
227          if (codeString == null || "".equals(codeString))
228            return null;
229        if ("registered".equals(codeString))
230          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.REGISTERED);
231        if ("partial".equals(codeString))
232          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PARTIAL);
233        if ("preliminary".equals(codeString))
234          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.PRELIMINARY);
235        if ("final".equals(codeString))
236          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.FINAL);
237        if ("amended".equals(codeString))
238          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.AMENDED);
239        if ("corrected".equals(codeString))
240          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CORRECTED);
241        if ("appended".equals(codeString))
242          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.APPENDED);
243        if ("cancelled".equals(codeString))
244          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.CANCELLED);
245        if ("entered-in-error".equals(codeString))
246          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.ENTEREDINERROR);
247        if ("unknown".equals(codeString))
248          return new Enumeration<DiagnosticReportStatus>(this, DiagnosticReportStatus.UNKNOWN);
249        throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'");
250        }
251    public String toCode(DiagnosticReportStatus code) {
252       if (code == DiagnosticReportStatus.NULL)
253           return null;
254       if (code == DiagnosticReportStatus.REGISTERED)
255        return "registered";
256      if (code == DiagnosticReportStatus.PARTIAL)
257        return "partial";
258      if (code == DiagnosticReportStatus.PRELIMINARY)
259        return "preliminary";
260      if (code == DiagnosticReportStatus.FINAL)
261        return "final";
262      if (code == DiagnosticReportStatus.AMENDED)
263        return "amended";
264      if (code == DiagnosticReportStatus.CORRECTED)
265        return "corrected";
266      if (code == DiagnosticReportStatus.APPENDED)
267        return "appended";
268      if (code == DiagnosticReportStatus.CANCELLED)
269        return "cancelled";
270      if (code == DiagnosticReportStatus.ENTEREDINERROR)
271        return "entered-in-error";
272      if (code == DiagnosticReportStatus.UNKNOWN)
273        return "unknown";
274      return "?";
275   }
276    public String toSystem(DiagnosticReportStatus code) {
277      return code.getSystem();
278      }
279    }
280
281    @Block()
282    public static class DiagnosticReportPerformerComponent extends BackboneElement implements IBaseBackboneElement {
283        /**
284         * Describes the type of participation (e.g.  a responsible party, author, or verifier).
285         */
286        @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true)
287        @Description(shortDefinition="Type of performer", formalDefinition="Describes the type of participation (e.g.  a responsible party, author, or verifier)." )
288        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/performer-role")
289        protected CodeableConcept role;
290
291        /**
292         * The reference to the  practitioner or organization involved in producing the report. For example, the diagnostic service that is responsible for issuing the report.
293         */
294        @Child(name = "actor", type = {Practitioner.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=true)
295        @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." )
296        protected Reference actor;
297
298        /**
299         * 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.)
300         */
301        protected Resource actorTarget;
302
303        private static final long serialVersionUID = 805521719L;
304
305    /**
306     * Constructor
307     */
308      public DiagnosticReportPerformerComponent() {
309        super();
310      }
311
312    /**
313     * Constructor
314     */
315      public DiagnosticReportPerformerComponent(Reference actor) {
316        super();
317        this.actor = actor;
318      }
319
320        /**
321         * @return {@link #role} (Describes the type of participation (e.g.  a responsible party, author, or verifier).)
322         */
323        public CodeableConcept getRole() { 
324          if (this.role == null)
325            if (Configuration.errorOnAutoCreate())
326              throw new Error("Attempt to auto-create DiagnosticReportPerformerComponent.role");
327            else if (Configuration.doAutoCreate())
328              this.role = new CodeableConcept(); // cc
329          return this.role;
330        }
331
332        public boolean hasRole() { 
333          return this.role != null && !this.role.isEmpty();
334        }
335
336        /**
337         * @param value {@link #role} (Describes the type of participation (e.g.  a responsible party, author, or verifier).)
338         */
339        public DiagnosticReportPerformerComponent setRole(CodeableConcept value)  { 
340          this.role = value;
341          return this;
342        }
343
344        /**
345         * @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.)
346         */
347        public Reference getActor() { 
348          if (this.actor == null)
349            if (Configuration.errorOnAutoCreate())
350              throw new Error("Attempt to auto-create DiagnosticReportPerformerComponent.actor");
351            else if (Configuration.doAutoCreate())
352              this.actor = new Reference(); // cc
353          return this.actor;
354        }
355
356        public boolean hasActor() { 
357          return this.actor != null && !this.actor.isEmpty();
358        }
359
360        /**
361         * @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.)
362         */
363        public DiagnosticReportPerformerComponent setActor(Reference value)  { 
364          this.actor = value;
365          return this;
366        }
367
368        /**
369         * @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.)
370         */
371        public Resource getActorTarget() { 
372          return this.actorTarget;
373        }
374
375        /**
376         * @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.)
377         */
378        public DiagnosticReportPerformerComponent setActorTarget(Resource value) { 
379          this.actorTarget = value;
380          return this;
381        }
382
383        protected void listChildren(List<Property> children) {
384          super.listChildren(children);
385          children.add(new Property("role", "CodeableConcept", "Describes the type of participation (e.g.  a responsible party, author, or verifier).", 0, 1, role));
386          children.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, 1, actor));
387        }
388
389        @Override
390        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
391          switch (_hash) {
392          case 3506294: /*role*/  return new Property("role", "CodeableConcept", "Describes the type of participation (e.g.  a responsible party, author, or verifier).", 0, 1, role);
393          case 92645877: /*actor*/  return 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, 1, actor);
394          default: return super.getNamedProperty(_hash, _name, _checkValid);
395          }
396
397        }
398
399      @Override
400      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
401        switch (hash) {
402        case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept
403        case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference
404        default: return super.getProperty(hash, name, checkValid);
405        }
406
407      }
408
409      @Override
410      public Base setProperty(int hash, String name, Base value) throws FHIRException {
411        switch (hash) {
412        case 3506294: // role
413          this.role = castToCodeableConcept(value); // CodeableConcept
414          return value;
415        case 92645877: // actor
416          this.actor = castToReference(value); // Reference
417          return value;
418        default: return super.setProperty(hash, name, value);
419        }
420
421      }
422
423      @Override
424      public Base setProperty(String name, Base value) throws FHIRException {
425        if (name.equals("role")) {
426          this.role = castToCodeableConcept(value); // CodeableConcept
427        } else if (name.equals("actor")) {
428          this.actor = castToReference(value); // Reference
429        } else
430          return super.setProperty(name, value);
431        return value;
432      }
433
434      @Override
435      public Base makeProperty(int hash, String name) throws FHIRException {
436        switch (hash) {
437        case 3506294:  return getRole(); 
438        case 92645877:  return getActor(); 
439        default: return super.makeProperty(hash, name);
440        }
441
442      }
443
444      @Override
445      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
446        switch (hash) {
447        case 3506294: /*role*/ return new String[] {"CodeableConcept"};
448        case 92645877: /*actor*/ return new String[] {"Reference"};
449        default: return super.getTypesForProperty(hash, name);
450        }
451
452      }
453
454      @Override
455      public Base addChild(String name) throws FHIRException {
456        if (name.equals("role")) {
457          this.role = new CodeableConcept();
458          return this.role;
459        }
460        else if (name.equals("actor")) {
461          this.actor = new Reference();
462          return this.actor;
463        }
464        else
465          return super.addChild(name);
466      }
467
468      public DiagnosticReportPerformerComponent copy() {
469        DiagnosticReportPerformerComponent dst = new DiagnosticReportPerformerComponent();
470        copyValues(dst);
471        dst.role = role == null ? null : role.copy();
472        dst.actor = actor == null ? null : actor.copy();
473        return dst;
474      }
475
476      @Override
477      public boolean equalsDeep(Base other_) {
478        if (!super.equalsDeep(other_))
479          return false;
480        if (!(other_ instanceof DiagnosticReportPerformerComponent))
481          return false;
482        DiagnosticReportPerformerComponent o = (DiagnosticReportPerformerComponent) other_;
483        return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true);
484      }
485
486      @Override
487      public boolean equalsShallow(Base other_) {
488        if (!super.equalsShallow(other_))
489          return false;
490        if (!(other_ instanceof DiagnosticReportPerformerComponent))
491          return false;
492        DiagnosticReportPerformerComponent o = (DiagnosticReportPerformerComponent) other_;
493        return true;
494      }
495
496      public boolean isEmpty() {
497        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, actor);
498      }
499
500  public String fhirType() {
501    return "DiagnosticReport.performer";
502
503  }
504
505  }
506
507    @Block()
508    public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement {
509        /**
510         * 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.
511         */
512        @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
513        @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." )
514        protected StringType comment;
515
516        /**
517         * Reference to the image source.
518         */
519        @Child(name = "link", type = {Media.class}, order=2, min=1, max=1, modifier=false, summary=true)
520        @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." )
521        protected Reference link;
522
523        /**
524         * The actual object that is the target of the reference (Reference to the image source.)
525         */
526        protected Media linkTarget;
527
528        private static final long serialVersionUID = 935791940L;
529
530    /**
531     * Constructor
532     */
533      public DiagnosticReportImageComponent() {
534        super();
535      }
536
537    /**
538     * Constructor
539     */
540      public DiagnosticReportImageComponent(Reference link) {
541        super();
542        this.link = link;
543      }
544
545        /**
546         * @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
547         */
548        public StringType getCommentElement() { 
549          if (this.comment == null)
550            if (Configuration.errorOnAutoCreate())
551              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment");
552            else if (Configuration.doAutoCreate())
553              this.comment = new StringType(); // bb
554          return this.comment;
555        }
556
557        public boolean hasCommentElement() { 
558          return this.comment != null && !this.comment.isEmpty();
559        }
560
561        public boolean hasComment() { 
562          return this.comment != null && !this.comment.isEmpty();
563        }
564
565        /**
566         * @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
567         */
568        public DiagnosticReportImageComponent setCommentElement(StringType value) { 
569          this.comment = value;
570          return this;
571        }
572
573        /**
574         * @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.
575         */
576        public String getComment() { 
577          return this.comment == null ? null : this.comment.getValue();
578        }
579
580        /**
581         * @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.
582         */
583        public DiagnosticReportImageComponent setComment(String value) { 
584          if (Utilities.noString(value))
585            this.comment = null;
586          else {
587            if (this.comment == null)
588              this.comment = new StringType();
589            this.comment.setValue(value);
590          }
591          return this;
592        }
593
594        /**
595         * @return {@link #link} (Reference to the image source.)
596         */
597        public Reference getLink() { 
598          if (this.link == null)
599            if (Configuration.errorOnAutoCreate())
600              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link");
601            else if (Configuration.doAutoCreate())
602              this.link = new Reference(); // cc
603          return this.link;
604        }
605
606        public boolean hasLink() { 
607          return this.link != null && !this.link.isEmpty();
608        }
609
610        /**
611         * @param value {@link #link} (Reference to the image source.)
612         */
613        public DiagnosticReportImageComponent setLink(Reference value)  { 
614          this.link = value;
615          return this;
616        }
617
618        /**
619         * @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.)
620         */
621        public Media getLinkTarget() { 
622          if (this.linkTarget == null)
623            if (Configuration.errorOnAutoCreate())
624              throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link");
625            else if (Configuration.doAutoCreate())
626              this.linkTarget = new Media(); // aa
627          return this.linkTarget;
628        }
629
630        /**
631         * @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.)
632         */
633        public DiagnosticReportImageComponent setLinkTarget(Media value) { 
634          this.linkTarget = value;
635          return this;
636        }
637
638        protected void listChildren(List<Property> children) {
639          super.listChildren(children);
640          children.add(new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, 1, comment));
641          children.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, 1, link));
642        }
643
644        @Override
645        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
646          switch (_hash) {
647          case 950398559: /*comment*/  return new Property("comment", "string", "A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.", 0, 1, comment);
648          case 3321850: /*link*/  return new Property("link", "Reference(Media)", "Reference to the image source.", 0, 1, link);
649          default: return super.getNamedProperty(_hash, _name, _checkValid);
650          }
651
652        }
653
654      @Override
655      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
656        switch (hash) {
657        case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType
658        case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference
659        default: return super.getProperty(hash, name, checkValid);
660        }
661
662      }
663
664      @Override
665      public Base setProperty(int hash, String name, Base value) throws FHIRException {
666        switch (hash) {
667        case 950398559: // comment
668          this.comment = castToString(value); // StringType
669          return value;
670        case 3321850: // link
671          this.link = castToReference(value); // Reference
672          return value;
673        default: return super.setProperty(hash, name, value);
674        }
675
676      }
677
678      @Override
679      public Base setProperty(String name, Base value) throws FHIRException {
680        if (name.equals("comment")) {
681          this.comment = castToString(value); // StringType
682        } else if (name.equals("link")) {
683          this.link = castToReference(value); // Reference
684        } else
685          return super.setProperty(name, value);
686        return value;
687      }
688
689      @Override
690      public Base makeProperty(int hash, String name) throws FHIRException {
691        switch (hash) {
692        case 950398559:  return getCommentElement();
693        case 3321850:  return getLink(); 
694        default: return super.makeProperty(hash, name);
695        }
696
697      }
698
699      @Override
700      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
701        switch (hash) {
702        case 950398559: /*comment*/ return new String[] {"string"};
703        case 3321850: /*link*/ return new String[] {"Reference"};
704        default: return super.getTypesForProperty(hash, name);
705        }
706
707      }
708
709      @Override
710      public Base addChild(String name) throws FHIRException {
711        if (name.equals("comment")) {
712          throw new FHIRException("Cannot call addChild on a singleton property DiagnosticReport.comment");
713        }
714        else if (name.equals("link")) {
715          this.link = new Reference();
716          return this.link;
717        }
718        else
719          return super.addChild(name);
720      }
721
722      public DiagnosticReportImageComponent copy() {
723        DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent();
724        copyValues(dst);
725        dst.comment = comment == null ? null : comment.copy();
726        dst.link = link == null ? null : link.copy();
727        return dst;
728      }
729
730      @Override
731      public boolean equalsDeep(Base other_) {
732        if (!super.equalsDeep(other_))
733          return false;
734        if (!(other_ instanceof DiagnosticReportImageComponent))
735          return false;
736        DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other_;
737        return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true);
738      }
739
740      @Override
741      public boolean equalsShallow(Base other_) {
742        if (!super.equalsShallow(other_))
743          return false;
744        if (!(other_ instanceof DiagnosticReportImageComponent))
745          return false;
746        DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other_;
747        return compareValues(comment, o.comment, true);
748      }
749
750      public boolean isEmpty() {
751        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(comment, link);
752      }
753
754  public String fhirType() {
755    return "DiagnosticReport.image";
756
757  }
758
759  }
760
761    /**
762     * Identifiers assigned to this report by the performer or other systems.
763     */
764    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
765    @Description(shortDefinition="Business identifier for report", formalDefinition="Identifiers assigned to this report by the performer or other systems." )
766    protected List<Identifier> identifier;
767
768    /**
769     * Details concerning a test or procedure requested.
770     */
771    @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)
772    @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test or procedure requested." )
773    protected List<Reference> basedOn;
774    /**
775     * The actual objects that are the target of the reference (Details concerning a test or procedure requested.)
776     */
777    protected List<Resource> basedOnTarget;
778
779
780    /**
781     * The status of the diagnostic report as a whole.
782     */
783    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
784    @Description(shortDefinition="registered | partial | preliminary | final +", formalDefinition="The status of the diagnostic report as a whole." )
785    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-report-status")
786    protected Enumeration<DiagnosticReportStatus> status;
787
788    /**
789     * 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.
790     */
791    @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true)
792    @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." )
793    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/diagnostic-service-sections")
794    protected CodeableConcept category;
795
796    /**
797     * A code or name that describes this diagnostic report.
798     */
799    @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true)
800    @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." )
801    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-codes")
802    protected CodeableConcept code;
803
804    /**
805     * 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.
806     */
807    @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true)
808    @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." )
809    protected Reference subject;
810
811    /**
812     * 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.)
813     */
814    protected Resource subjectTarget;
815
816    /**
817     * The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport per is about.
818     */
819    @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=6, min=0, max=1, modifier=false, summary=true)
820    @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." )
821    protected Reference context;
822
823    /**
824     * 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.)
825     */
826    protected Resource contextTarget;
827
828    /**
829     * 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.
830     */
831    @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=7, min=0, max=1, modifier=false, summary=true)
832    @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." )
833    protected Type effective;
834
835    /**
836     * The date and time that this version of the report was released from the source diagnostic service.
837     */
838    @Child(name = "issued", type = {InstantType.class}, order=8, min=0, max=1, modifier=false, summary=true)
839    @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." )
840    protected InstantType issued;
841
842    /**
843     * Indicates who or what participated in producing the report.
844     */
845    @Child(name = "performer", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
846    @Description(shortDefinition="Participants in producing the report", formalDefinition="Indicates who or what participated in producing the report." )
847    protected List<DiagnosticReportPerformerComponent> performer;
848
849    /**
850     * Details about the specimens on which this diagnostic report is based.
851     */
852    @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
853    @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." )
854    protected List<Reference> specimen;
855    /**
856     * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.)
857     */
858    protected List<Specimen> specimenTarget;
859
860
861    /**
862     * 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").
863     */
864    @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
865    @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\")." )
866    protected List<Reference> result;
867    /**
868     * 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").)
869     */
870    protected List<Observation> resultTarget;
871
872
873    /**
874     * 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.
875     */
876    @Child(name = "imagingStudy", type = {ImagingStudy.class, ImagingManifest.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
877    @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." )
878    protected List<Reference> imagingStudy;
879    /**
880     * 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.)
881     */
882    protected List<Resource> imagingStudyTarget;
883
884
885    /**
886     * 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).
887     */
888    @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
889    @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)." )
890    protected List<DiagnosticReportImageComponent> image;
891
892    /**
893     * Concise and clinically contextualized impression / summary of the diagnostic report.
894     */
895    @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
896    @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized impression / summary of the diagnostic report." )
897    protected StringType conclusion;
898
899    /**
900     * Codes for the conclusion.
901     */
902    @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
903    @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." )
904    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/clinical-findings")
905    protected List<CodeableConcept> codedDiagnosis;
906
907    /**
908     * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.
909     */
910    @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
911    @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." )
912    protected List<Attachment> presentedForm;
913
914    private static final long serialVersionUID = 989012294L;
915
916  /**
917   * Constructor
918   */
919    public DiagnosticReport() {
920      super();
921    }
922
923  /**
924   * Constructor
925   */
926    public DiagnosticReport(Enumeration<DiagnosticReportStatus> status, CodeableConcept code) {
927      super();
928      this.status = status;
929      this.code = code;
930    }
931
932    /**
933     * @return {@link #identifier} (Identifiers assigned to this report by the performer or other systems.)
934     */
935    public List<Identifier> getIdentifier() { 
936      if (this.identifier == null)
937        this.identifier = new ArrayList<Identifier>();
938      return this.identifier;
939    }
940
941    /**
942     * @return Returns a reference to <code>this</code> for easy method chaining
943     */
944    public DiagnosticReport setIdentifier(List<Identifier> theIdentifier) { 
945      this.identifier = theIdentifier;
946      return this;
947    }
948
949    public boolean hasIdentifier() { 
950      if (this.identifier == null)
951        return false;
952      for (Identifier item : this.identifier)
953        if (!item.isEmpty())
954          return true;
955      return false;
956    }
957
958    public Identifier addIdentifier() { //3
959      Identifier t = new Identifier();
960      if (this.identifier == null)
961        this.identifier = new ArrayList<Identifier>();
962      this.identifier.add(t);
963      return t;
964    }
965
966    public DiagnosticReport addIdentifier(Identifier t) { //3
967      if (t == null)
968        return this;
969      if (this.identifier == null)
970        this.identifier = new ArrayList<Identifier>();
971      this.identifier.add(t);
972      return this;
973    }
974
975    /**
976     * @return The first repetition of repeating field {@link #identifier}, creating it if it does not already exist
977     */
978    public Identifier getIdentifierFirstRep() { 
979      if (getIdentifier().isEmpty()) {
980        addIdentifier();
981      }
982      return getIdentifier().get(0);
983    }
984
985    /**
986     * @return {@link #basedOn} (Details concerning a test or procedure requested.)
987     */
988    public List<Reference> getBasedOn() { 
989      if (this.basedOn == null)
990        this.basedOn = new ArrayList<Reference>();
991      return this.basedOn;
992    }
993
994    /**
995     * @return Returns a reference to <code>this</code> for easy method chaining
996     */
997    public DiagnosticReport setBasedOn(List<Reference> theBasedOn) { 
998      this.basedOn = theBasedOn;
999      return this;
1000    }
1001
1002    public boolean hasBasedOn() { 
1003      if (this.basedOn == null)
1004        return false;
1005      for (Reference item : this.basedOn)
1006        if (!item.isEmpty())
1007          return true;
1008      return false;
1009    }
1010
1011    public Reference addBasedOn() { //3
1012      Reference t = new Reference();
1013      if (this.basedOn == null)
1014        this.basedOn = new ArrayList<Reference>();
1015      this.basedOn.add(t);
1016      return t;
1017    }
1018
1019    public DiagnosticReport addBasedOn(Reference t) { //3
1020      if (t == null)
1021        return this;
1022      if (this.basedOn == null)
1023        this.basedOn = new ArrayList<Reference>();
1024      this.basedOn.add(t);
1025      return this;
1026    }
1027
1028    /**
1029     * @return The first repetition of repeating field {@link #basedOn}, creating it if it does not already exist
1030     */
1031    public Reference getBasedOnFirstRep() { 
1032      if (getBasedOn().isEmpty()) {
1033        addBasedOn();
1034      }
1035      return getBasedOn().get(0);
1036    }
1037
1038    /**
1039     * @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
1040     */
1041    public Enumeration<DiagnosticReportStatus> getStatusElement() { 
1042      if (this.status == null)
1043        if (Configuration.errorOnAutoCreate())
1044          throw new Error("Attempt to auto-create DiagnosticReport.status");
1045        else if (Configuration.doAutoCreate())
1046          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory()); // bb
1047      return this.status;
1048    }
1049
1050    public boolean hasStatusElement() { 
1051      return this.status != null && !this.status.isEmpty();
1052    }
1053
1054    public boolean hasStatus() { 
1055      return this.status != null && !this.status.isEmpty();
1056    }
1057
1058    /**
1059     * @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
1060     */
1061    public DiagnosticReport setStatusElement(Enumeration<DiagnosticReportStatus> value) { 
1062      this.status = value;
1063      return this;
1064    }
1065
1066    /**
1067     * @return The status of the diagnostic report as a whole.
1068     */
1069    public DiagnosticReportStatus getStatus() { 
1070      return this.status == null ? null : this.status.getValue();
1071    }
1072
1073    /**
1074     * @param value The status of the diagnostic report as a whole.
1075     */
1076    public DiagnosticReport setStatus(DiagnosticReportStatus value) { 
1077        if (this.status == null)
1078          this.status = new Enumeration<DiagnosticReportStatus>(new DiagnosticReportStatusEnumFactory());
1079        this.status.setValue(value);
1080      return this;
1081    }
1082
1083    /**
1084     * @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.)
1085     */
1086    public CodeableConcept getCategory() { 
1087      if (this.category == null)
1088        if (Configuration.errorOnAutoCreate())
1089          throw new Error("Attempt to auto-create DiagnosticReport.category");
1090        else if (Configuration.doAutoCreate())
1091          this.category = new CodeableConcept(); // cc
1092      return this.category;
1093    }
1094
1095    public boolean hasCategory() { 
1096      return this.category != null && !this.category.isEmpty();
1097    }
1098
1099    /**
1100     * @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.)
1101     */
1102    public DiagnosticReport setCategory(CodeableConcept value)  { 
1103      this.category = value;
1104      return this;
1105    }
1106
1107    /**
1108     * @return {@link #code} (A code or name that describes this diagnostic report.)
1109     */
1110    public CodeableConcept getCode() { 
1111      if (this.code == null)
1112        if (Configuration.errorOnAutoCreate())
1113          throw new Error("Attempt to auto-create DiagnosticReport.code");
1114        else if (Configuration.doAutoCreate())
1115          this.code = new CodeableConcept(); // cc
1116      return this.code;
1117    }
1118
1119    public boolean hasCode() { 
1120      return this.code != null && !this.code.isEmpty();
1121    }
1122
1123    /**
1124     * @param value {@link #code} (A code or name that describes this diagnostic report.)
1125     */
1126    public DiagnosticReport setCode(CodeableConcept value)  { 
1127      this.code = value;
1128      return this;
1129    }
1130
1131    /**
1132     * @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.)
1133     */
1134    public Reference getSubject() { 
1135      if (this.subject == null)
1136        if (Configuration.errorOnAutoCreate())
1137          throw new Error("Attempt to auto-create DiagnosticReport.subject");
1138        else if (Configuration.doAutoCreate())
1139          this.subject = new Reference(); // cc
1140      return this.subject;
1141    }
1142
1143    public boolean hasSubject() { 
1144      return this.subject != null && !this.subject.isEmpty();
1145    }
1146
1147    /**
1148     * @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.)
1149     */
1150    public DiagnosticReport setSubject(Reference value)  { 
1151      this.subject = value;
1152      return this;
1153    }
1154
1155    /**
1156     * @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.)
1157     */
1158    public Resource getSubjectTarget() { 
1159      return this.subjectTarget;
1160    }
1161
1162    /**
1163     * @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.)
1164     */
1165    public DiagnosticReport setSubjectTarget(Resource value) { 
1166      this.subjectTarget = value;
1167      return this;
1168    }
1169
1170    /**
1171     * @return {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport per is about.)
1172     */
1173    public Reference getContext() { 
1174      if (this.context == null)
1175        if (Configuration.errorOnAutoCreate())
1176          throw new Error("Attempt to auto-create DiagnosticReport.context");
1177        else if (Configuration.doAutoCreate())
1178          this.context = new Reference(); // cc
1179      return this.context;
1180    }
1181
1182    public boolean hasContext() { 
1183      return this.context != null && !this.context.isEmpty();
1184    }
1185
1186    /**
1187     * @param value {@link #context} (The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport per is about.)
1188     */
1189    public DiagnosticReport setContext(Reference value)  { 
1190      this.context = value;
1191      return this;
1192    }
1193
1194    /**
1195     * @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.)
1196     */
1197    public Resource getContextTarget() { 
1198      return this.contextTarget;
1199    }
1200
1201    /**
1202     * @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.)
1203     */
1204    public DiagnosticReport setContextTarget(Resource value) { 
1205      this.contextTarget = value;
1206      return this;
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 Type getEffective() { 
1213      return this.effective;
1214    }
1215
1216    /**
1217     * @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.)
1218     */
1219    public DateTimeType getEffectiveDateTimeType() throws FHIRException { 
1220      if (this.effective == null)
1221        return null;
1222      if (!(this.effective instanceof DateTimeType))
1223        throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered");
1224      return (DateTimeType) this.effective;
1225    }
1226
1227    public boolean hasEffectiveDateTimeType() {
1228        return this.effective instanceof DateTimeType;
1229    }
1230
1231    /**
1232     * @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.)
1233     */
1234    public Period getEffectivePeriod() throws FHIRException { 
1235      if (this.effective == null)
1236        return null;
1237      if (!(this.effective instanceof Period))
1238        throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered");
1239      return (Period) this.effective;
1240    }
1241
1242    public boolean hasEffectivePeriod() {
1243        return this.effective instanceof Period;
1244    }
1245
1246    public boolean hasEffective() { 
1247      return this.effective != null && !this.effective.isEmpty();
1248    }
1249
1250    /**
1251     * @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.)
1252     */
1253    public DiagnosticReport setEffective(Type value) throws FHIRFormatError { 
1254      if (value != null && !(value instanceof DateTimeType || value instanceof Period))
1255        throw new FHIRFormatError("Not the right type for DiagnosticReport.effective[x]: "+value.fhirType());
1256      this.effective = value;
1257      return this;
1258    }
1259
1260    /**
1261     * @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
1262     */
1263    public InstantType getIssuedElement() { 
1264      if (this.issued == null)
1265        if (Configuration.errorOnAutoCreate())
1266          throw new Error("Attempt to auto-create DiagnosticReport.issued");
1267        else if (Configuration.doAutoCreate())
1268          this.issued = new InstantType(); // bb
1269      return this.issued;
1270    }
1271
1272    public boolean hasIssuedElement() { 
1273      return this.issued != null && !this.issued.isEmpty();
1274    }
1275
1276    public boolean hasIssued() { 
1277      return this.issued != null && !this.issued.isEmpty();
1278    }
1279
1280    /**
1281     * @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
1282     */
1283    public DiagnosticReport setIssuedElement(InstantType value) { 
1284      this.issued = value;
1285      return this;
1286    }
1287
1288    /**
1289     * @return The date and time that this version of the report was released from the source diagnostic service.
1290     */
1291    public Date getIssued() { 
1292      return this.issued == null ? null : this.issued.getValue();
1293    }
1294
1295    /**
1296     * @param value The date and time that this version of the report was released from the source diagnostic service.
1297     */
1298    public DiagnosticReport setIssued(Date value) { 
1299      if (value == null)
1300        this.issued = null;
1301      else {
1302        if (this.issued == null)
1303          this.issued = new InstantType();
1304        this.issued.setValue(value);
1305      }
1306      return this;
1307    }
1308
1309    /**
1310     * @return {@link #performer} (Indicates who or what participated in producing the report.)
1311     */
1312    public List<DiagnosticReportPerformerComponent> getPerformer() { 
1313      if (this.performer == null)
1314        this.performer = new ArrayList<DiagnosticReportPerformerComponent>();
1315      return this.performer;
1316    }
1317
1318    /**
1319     * @return Returns a reference to <code>this</code> for easy method chaining
1320     */
1321    public DiagnosticReport setPerformer(List<DiagnosticReportPerformerComponent> thePerformer) { 
1322      this.performer = thePerformer;
1323      return this;
1324    }
1325
1326    public boolean hasPerformer() { 
1327      if (this.performer == null)
1328        return false;
1329      for (DiagnosticReportPerformerComponent item : this.performer)
1330        if (!item.isEmpty())
1331          return true;
1332      return false;
1333    }
1334
1335    public DiagnosticReportPerformerComponent addPerformer() { //3
1336      DiagnosticReportPerformerComponent t = new DiagnosticReportPerformerComponent();
1337      if (this.performer == null)
1338        this.performer = new ArrayList<DiagnosticReportPerformerComponent>();
1339      this.performer.add(t);
1340      return t;
1341    }
1342
1343    public DiagnosticReport addPerformer(DiagnosticReportPerformerComponent t) { //3
1344      if (t == null)
1345        return this;
1346      if (this.performer == null)
1347        this.performer = new ArrayList<DiagnosticReportPerformerComponent>();
1348      this.performer.add(t);
1349      return this;
1350    }
1351
1352    /**
1353     * @return The first repetition of repeating field {@link #performer}, creating it if it does not already exist
1354     */
1355    public DiagnosticReportPerformerComponent getPerformerFirstRep() { 
1356      if (getPerformer().isEmpty()) {
1357        addPerformer();
1358      }
1359      return getPerformer().get(0);
1360    }
1361
1362    /**
1363     * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.)
1364     */
1365    public List<Reference> getSpecimen() { 
1366      if (this.specimen == null)
1367        this.specimen = new ArrayList<Reference>();
1368      return this.specimen;
1369    }
1370
1371    /**
1372     * @return Returns a reference to <code>this</code> for easy method chaining
1373     */
1374    public DiagnosticReport setSpecimen(List<Reference> theSpecimen) { 
1375      this.specimen = theSpecimen;
1376      return this;
1377    }
1378
1379    public boolean hasSpecimen() { 
1380      if (this.specimen == null)
1381        return false;
1382      for (Reference item : this.specimen)
1383        if (!item.isEmpty())
1384          return true;
1385      return false;
1386    }
1387
1388    public Reference addSpecimen() { //3
1389      Reference t = new Reference();
1390      if (this.specimen == null)
1391        this.specimen = new ArrayList<Reference>();
1392      this.specimen.add(t);
1393      return t;
1394    }
1395
1396    public DiagnosticReport addSpecimen(Reference t) { //3
1397      if (t == null)
1398        return this;
1399      if (this.specimen == null)
1400        this.specimen = new ArrayList<Reference>();
1401      this.specimen.add(t);
1402      return this;
1403    }
1404
1405    /**
1406     * @return The first repetition of repeating field {@link #specimen}, creating it if it does not already exist
1407     */
1408    public Reference getSpecimenFirstRep() { 
1409      if (getSpecimen().isEmpty()) {
1410        addSpecimen();
1411      }
1412      return getSpecimen().get(0);
1413    }
1414
1415    /**
1416     * @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").)
1417     */
1418    public List<Reference> getResult() { 
1419      if (this.result == null)
1420        this.result = new ArrayList<Reference>();
1421      return this.result;
1422    }
1423
1424    /**
1425     * @return Returns a reference to <code>this</code> for easy method chaining
1426     */
1427    public DiagnosticReport setResult(List<Reference> theResult) { 
1428      this.result = theResult;
1429      return this;
1430    }
1431
1432    public boolean hasResult() { 
1433      if (this.result == null)
1434        return false;
1435      for (Reference item : this.result)
1436        if (!item.isEmpty())
1437          return true;
1438      return false;
1439    }
1440
1441    public Reference addResult() { //3
1442      Reference t = new Reference();
1443      if (this.result == null)
1444        this.result = new ArrayList<Reference>();
1445      this.result.add(t);
1446      return t;
1447    }
1448
1449    public DiagnosticReport addResult(Reference t) { //3
1450      if (t == null)
1451        return this;
1452      if (this.result == null)
1453        this.result = new ArrayList<Reference>();
1454      this.result.add(t);
1455      return this;
1456    }
1457
1458    /**
1459     * @return The first repetition of repeating field {@link #result}, creating it if it does not already exist
1460     */
1461    public Reference getResultFirstRep() { 
1462      if (getResult().isEmpty()) {
1463        addResult();
1464      }
1465      return getResult().get(0);
1466    }
1467
1468    /**
1469     * @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.)
1470     */
1471    public List<Reference> getImagingStudy() { 
1472      if (this.imagingStudy == null)
1473        this.imagingStudy = new ArrayList<Reference>();
1474      return this.imagingStudy;
1475    }
1476
1477    /**
1478     * @return Returns a reference to <code>this</code> for easy method chaining
1479     */
1480    public DiagnosticReport setImagingStudy(List<Reference> theImagingStudy) { 
1481      this.imagingStudy = theImagingStudy;
1482      return this;
1483    }
1484
1485    public boolean hasImagingStudy() { 
1486      if (this.imagingStudy == null)
1487        return false;
1488      for (Reference item : this.imagingStudy)
1489        if (!item.isEmpty())
1490          return true;
1491      return false;
1492    }
1493
1494    public Reference addImagingStudy() { //3
1495      Reference t = new Reference();
1496      if (this.imagingStudy == null)
1497        this.imagingStudy = new ArrayList<Reference>();
1498      this.imagingStudy.add(t);
1499      return t;
1500    }
1501
1502    public DiagnosticReport addImagingStudy(Reference t) { //3
1503      if (t == null)
1504        return this;
1505      if (this.imagingStudy == null)
1506        this.imagingStudy = new ArrayList<Reference>();
1507      this.imagingStudy.add(t);
1508      return this;
1509    }
1510
1511    /**
1512     * @return The first repetition of repeating field {@link #imagingStudy}, creating it if it does not already exist
1513     */
1514    public Reference getImagingStudyFirstRep() { 
1515      if (getImagingStudy().isEmpty()) {
1516        addImagingStudy();
1517      }
1518      return getImagingStudy().get(0);
1519    }
1520
1521    /**
1522     * @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).)
1523     */
1524    public List<DiagnosticReportImageComponent> getImage() { 
1525      if (this.image == null)
1526        this.image = new ArrayList<DiagnosticReportImageComponent>();
1527      return this.image;
1528    }
1529
1530    /**
1531     * @return Returns a reference to <code>this</code> for easy method chaining
1532     */
1533    public DiagnosticReport setImage(List<DiagnosticReportImageComponent> theImage) { 
1534      this.image = theImage;
1535      return this;
1536    }
1537
1538    public boolean hasImage() { 
1539      if (this.image == null)
1540        return false;
1541      for (DiagnosticReportImageComponent item : this.image)
1542        if (!item.isEmpty())
1543          return true;
1544      return false;
1545    }
1546
1547    public DiagnosticReportImageComponent addImage() { //3
1548      DiagnosticReportImageComponent t = new DiagnosticReportImageComponent();
1549      if (this.image == null)
1550        this.image = new ArrayList<DiagnosticReportImageComponent>();
1551      this.image.add(t);
1552      return t;
1553    }
1554
1555    public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3
1556      if (t == null)
1557        return this;
1558      if (this.image == null)
1559        this.image = new ArrayList<DiagnosticReportImageComponent>();
1560      this.image.add(t);
1561      return this;
1562    }
1563
1564    /**
1565     * @return The first repetition of repeating field {@link #image}, creating it if it does not already exist
1566     */
1567    public DiagnosticReportImageComponent getImageFirstRep() { 
1568      if (getImage().isEmpty()) {
1569        addImage();
1570      }
1571      return getImage().get(0);
1572    }
1573
1574    /**
1575     * @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
1576     */
1577    public StringType getConclusionElement() { 
1578      if (this.conclusion == null)
1579        if (Configuration.errorOnAutoCreate())
1580          throw new Error("Attempt to auto-create DiagnosticReport.conclusion");
1581        else if (Configuration.doAutoCreate())
1582          this.conclusion = new StringType(); // bb
1583      return this.conclusion;
1584    }
1585
1586    public boolean hasConclusionElement() { 
1587      return this.conclusion != null && !this.conclusion.isEmpty();
1588    }
1589
1590    public boolean hasConclusion() { 
1591      return this.conclusion != null && !this.conclusion.isEmpty();
1592    }
1593
1594    /**
1595     * @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
1596     */
1597    public DiagnosticReport setConclusionElement(StringType value) { 
1598      this.conclusion = value;
1599      return this;
1600    }
1601
1602    /**
1603     * @return Concise and clinically contextualized impression / summary of the diagnostic report.
1604     */
1605    public String getConclusion() { 
1606      return this.conclusion == null ? null : this.conclusion.getValue();
1607    }
1608
1609    /**
1610     * @param value Concise and clinically contextualized impression / summary of the diagnostic report.
1611     */
1612    public DiagnosticReport setConclusion(String value) { 
1613      if (Utilities.noString(value))
1614        this.conclusion = null;
1615      else {
1616        if (this.conclusion == null)
1617          this.conclusion = new StringType();
1618        this.conclusion.setValue(value);
1619      }
1620      return this;
1621    }
1622
1623    /**
1624     * @return {@link #codedDiagnosis} (Codes for the conclusion.)
1625     */
1626    public List<CodeableConcept> getCodedDiagnosis() { 
1627      if (this.codedDiagnosis == null)
1628        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1629      return this.codedDiagnosis;
1630    }
1631
1632    /**
1633     * @return Returns a reference to <code>this</code> for easy method chaining
1634     */
1635    public DiagnosticReport setCodedDiagnosis(List<CodeableConcept> theCodedDiagnosis) { 
1636      this.codedDiagnosis = theCodedDiagnosis;
1637      return this;
1638    }
1639
1640    public boolean hasCodedDiagnosis() { 
1641      if (this.codedDiagnosis == null)
1642        return false;
1643      for (CodeableConcept item : this.codedDiagnosis)
1644        if (!item.isEmpty())
1645          return true;
1646      return false;
1647    }
1648
1649    public CodeableConcept addCodedDiagnosis() { //3
1650      CodeableConcept t = new CodeableConcept();
1651      if (this.codedDiagnosis == null)
1652        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1653      this.codedDiagnosis.add(t);
1654      return t;
1655    }
1656
1657    public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3
1658      if (t == null)
1659        return this;
1660      if (this.codedDiagnosis == null)
1661        this.codedDiagnosis = new ArrayList<CodeableConcept>();
1662      this.codedDiagnosis.add(t);
1663      return this;
1664    }
1665
1666    /**
1667     * @return The first repetition of repeating field {@link #codedDiagnosis}, creating it if it does not already exist
1668     */
1669    public CodeableConcept getCodedDiagnosisFirstRep() { 
1670      if (getCodedDiagnosis().isEmpty()) {
1671        addCodedDiagnosis();
1672      }
1673      return getCodedDiagnosis().get(0);
1674    }
1675
1676    /**
1677     * @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.)
1678     */
1679    public List<Attachment> getPresentedForm() { 
1680      if (this.presentedForm == null)
1681        this.presentedForm = new ArrayList<Attachment>();
1682      return this.presentedForm;
1683    }
1684
1685    /**
1686     * @return Returns a reference to <code>this</code> for easy method chaining
1687     */
1688    public DiagnosticReport setPresentedForm(List<Attachment> thePresentedForm) { 
1689      this.presentedForm = thePresentedForm;
1690      return this;
1691    }
1692
1693    public boolean hasPresentedForm() { 
1694      if (this.presentedForm == null)
1695        return false;
1696      for (Attachment item : this.presentedForm)
1697        if (!item.isEmpty())
1698          return true;
1699      return false;
1700    }
1701
1702    public Attachment addPresentedForm() { //3
1703      Attachment t = new Attachment();
1704      if (this.presentedForm == null)
1705        this.presentedForm = new ArrayList<Attachment>();
1706      this.presentedForm.add(t);
1707      return t;
1708    }
1709
1710    public DiagnosticReport addPresentedForm(Attachment t) { //3
1711      if (t == null)
1712        return this;
1713      if (this.presentedForm == null)
1714        this.presentedForm = new ArrayList<Attachment>();
1715      this.presentedForm.add(t);
1716      return this;
1717    }
1718
1719    /**
1720     * @return The first repetition of repeating field {@link #presentedForm}, creating it if it does not already exist
1721     */
1722    public Attachment getPresentedFormFirstRep() { 
1723      if (getPresentedForm().isEmpty()) {
1724        addPresentedForm();
1725      }
1726      return getPresentedForm().get(0);
1727    }
1728
1729      protected void listChildren(List<Property> children) {
1730        super.listChildren(children);
1731        children.add(new Property("identifier", "Identifier", "Identifiers assigned to this report by the performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier));
1732        children.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));
1733        children.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, 1, status));
1734        children.add(new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, 1, category));
1735        children.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code));
1736        children.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, 1, subject));
1737        children.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, 1, context));
1738        children.add(new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective));
1739        children.add(new Property("issued", "instant", "The date and time that this version of the report was released from the source diagnostic service.", 0, 1, issued));
1740        children.add(new Property("performer", "", "Indicates who or what participated in producing the report.", 0, java.lang.Integer.MAX_VALUE, performer));
1741        children.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen));
1742        children.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));
1743        children.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));
1744        children.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));
1745        children.add(new Property("conclusion", "string", "Concise and clinically contextualized impression / summary of the diagnostic report.", 0, 1, conclusion));
1746        children.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis));
1747        children.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm));
1748      }
1749
1750      @Override
1751      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1752        switch (_hash) {
1753        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifiers assigned to this report by the performer or other systems.", 0, java.lang.Integer.MAX_VALUE, identifier);
1754        case -332612366: /*basedOn*/  return new Property("basedOn", "Reference(CarePlan|ImmunizationRecommendation|MedicationRequest|NutritionOrder|ProcedureRequest|ReferralRequest)", "Details concerning a test or procedure requested.", 0, java.lang.Integer.MAX_VALUE, basedOn);
1755        case -892481550: /*status*/  return new Property("status", "code", "The status of the diagnostic report as a whole.", 0, 1, status);
1756        case 50511102: /*category*/  return new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, 1, category);
1757        case 3059181: /*code*/  return new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, 1, code);
1758        case -1867885268: /*subject*/  return new Property("subject", "Reference(Patient|Group|Device|Location)", "The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.", 0, 1, subject);
1759        case 951530927: /*context*/  return new Property("context", "Reference(Encounter|EpisodeOfCare)", "The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport per is about.", 0, 1, context);
1760        case 247104889: /*effective[x]*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1761        case -1468651097: /*effective*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1762        case -275306910: /*effectiveDateTime*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1763        case -403934648: /*effectivePeriod*/  return new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.", 0, 1, effective);
1764        case -1179159893: /*issued*/  return new Property("issued", "instant", "The date and time that this version of the report was released from the source diagnostic service.", 0, 1, issued);
1765        case 481140686: /*performer*/  return new Property("performer", "", "Indicates who or what participated in producing the report.", 0, java.lang.Integer.MAX_VALUE, performer);
1766        case -2132868344: /*specimen*/  return new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen);
1767        case -934426595: /*result*/  return 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);
1768        case -814900911: /*imagingStudy*/  return 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);
1769        case 100313435: /*image*/  return 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);
1770        case -1731259873: /*conclusion*/  return new Property("conclusion", "string", "Concise and clinically contextualized impression / summary of the diagnostic report.", 0, 1, conclusion);
1771        case -1364269926: /*codedDiagnosis*/  return new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis);
1772        case 230090366: /*presentedForm*/  return new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm);
1773        default: return super.getNamedProperty(_hash, _name, _checkValid);
1774        }
1775
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 singleton property 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 singleton property 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 singleton property 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}