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