001package org.hl7.fhir.r4.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034
035// Generated on Tue, May 12, 2020 07:26+1000 for FHIR v4.0.1
036
037import java.util.*;
038
039import java.math.*;
040import org.hl7.fhir.utilities.Utilities;
041import ca.uhn.fhir.model.api.annotation.ResourceDef;
042import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.ChildOrder;
045import ca.uhn.fhir.model.api.annotation.Description;
046import ca.uhn.fhir.model.api.annotation.Block;
047import org.hl7.fhir.instance.model.api.*;
048import org.hl7.fhir.exceptions.FHIRException;
049/**
050 * A summary of information based on the results of executing a TestScript.
051 */
052@ResourceDef(name="TestReport", profile="http://hl7.org/fhir/StructureDefinition/TestReport")
053public class TestReport extends DomainResource {
054
055    public enum TestReportStatus {
056        /**
057         * All test operations have completed.
058         */
059        COMPLETED, 
060        /**
061         * A test operations is currently executing.
062         */
063        INPROGRESS, 
064        /**
065         * A test operation is waiting for an external client request.
066         */
067        WAITING, 
068        /**
069         * The test script execution was manually stopped.
070         */
071        STOPPED, 
072        /**
073         * This test report was entered or created in error.
074         */
075        ENTEREDINERROR, 
076        /**
077         * added to help the parsers with the generic types
078         */
079        NULL;
080        public static TestReportStatus fromCode(String codeString) throws FHIRException {
081            if (codeString == null || "".equals(codeString))
082                return null;
083        if ("completed".equals(codeString))
084          return COMPLETED;
085        if ("in-progress".equals(codeString))
086          return INPROGRESS;
087        if ("waiting".equals(codeString))
088          return WAITING;
089        if ("stopped".equals(codeString))
090          return STOPPED;
091        if ("entered-in-error".equals(codeString))
092          return ENTEREDINERROR;
093        if (Configuration.isAcceptInvalidEnums())
094          return null;
095        else
096          throw new FHIRException("Unknown TestReportStatus code '"+codeString+"'");
097        }
098        public String toCode() {
099          switch (this) {
100            case COMPLETED: return "completed";
101            case INPROGRESS: return "in-progress";
102            case WAITING: return "waiting";
103            case STOPPED: return "stopped";
104            case ENTEREDINERROR: return "entered-in-error";
105            default: return "?";
106          }
107        }
108        public String getSystem() {
109          switch (this) {
110            case COMPLETED: return "http://hl7.org/fhir/report-status-codes";
111            case INPROGRESS: return "http://hl7.org/fhir/report-status-codes";
112            case WAITING: return "http://hl7.org/fhir/report-status-codes";
113            case STOPPED: return "http://hl7.org/fhir/report-status-codes";
114            case ENTEREDINERROR: return "http://hl7.org/fhir/report-status-codes";
115            default: return "?";
116          }
117        }
118        public String getDefinition() {
119          switch (this) {
120            case COMPLETED: return "All test operations have completed.";
121            case INPROGRESS: return "A test operations is currently executing.";
122            case WAITING: return "A test operation is waiting for an external client request.";
123            case STOPPED: return "The test script execution was manually stopped.";
124            case ENTEREDINERROR: return "This test report was entered or created in error.";
125            default: return "?";
126          }
127        }
128        public String getDisplay() {
129          switch (this) {
130            case COMPLETED: return "Completed";
131            case INPROGRESS: return "In Progress";
132            case WAITING: return "Waiting";
133            case STOPPED: return "Stopped";
134            case ENTEREDINERROR: return "Entered In Error";
135            default: return "?";
136          }
137        }
138    }
139
140  public static class TestReportStatusEnumFactory implements EnumFactory<TestReportStatus> {
141    public TestReportStatus fromCode(String codeString) throws IllegalArgumentException {
142      if (codeString == null || "".equals(codeString))
143            if (codeString == null || "".equals(codeString))
144                return null;
145        if ("completed".equals(codeString))
146          return TestReportStatus.COMPLETED;
147        if ("in-progress".equals(codeString))
148          return TestReportStatus.INPROGRESS;
149        if ("waiting".equals(codeString))
150          return TestReportStatus.WAITING;
151        if ("stopped".equals(codeString))
152          return TestReportStatus.STOPPED;
153        if ("entered-in-error".equals(codeString))
154          return TestReportStatus.ENTEREDINERROR;
155        throw new IllegalArgumentException("Unknown TestReportStatus code '"+codeString+"'");
156        }
157        public Enumeration<TestReportStatus> fromType(Base code) throws FHIRException {
158          if (code == null)
159            return null;
160          if (code.isEmpty())
161            return new Enumeration<TestReportStatus>(this);
162          String codeString = ((PrimitiveType) code).asStringValue();
163          if (codeString == null || "".equals(codeString))
164            return null;
165        if ("completed".equals(codeString))
166          return new Enumeration<TestReportStatus>(this, TestReportStatus.COMPLETED);
167        if ("in-progress".equals(codeString))
168          return new Enumeration<TestReportStatus>(this, TestReportStatus.INPROGRESS);
169        if ("waiting".equals(codeString))
170          return new Enumeration<TestReportStatus>(this, TestReportStatus.WAITING);
171        if ("stopped".equals(codeString))
172          return new Enumeration<TestReportStatus>(this, TestReportStatus.STOPPED);
173        if ("entered-in-error".equals(codeString))
174          return new Enumeration<TestReportStatus>(this, TestReportStatus.ENTEREDINERROR);
175        throw new FHIRException("Unknown TestReportStatus code '"+codeString+"'");
176        }
177    public String toCode(TestReportStatus code) {
178      if (code == TestReportStatus.COMPLETED)
179        return "completed";
180      if (code == TestReportStatus.INPROGRESS)
181        return "in-progress";
182      if (code == TestReportStatus.WAITING)
183        return "waiting";
184      if (code == TestReportStatus.STOPPED)
185        return "stopped";
186      if (code == TestReportStatus.ENTEREDINERROR)
187        return "entered-in-error";
188      return "?";
189      }
190    public String toSystem(TestReportStatus code) {
191      return code.getSystem();
192      }
193    }
194
195    public enum TestReportResult {
196        /**
197         * All test operations successfully passed all asserts.
198         */
199        PASS, 
200        /**
201         * One or more test operations failed one or more asserts.
202         */
203        FAIL, 
204        /**
205         * One or more test operations is pending execution completion.
206         */
207        PENDING, 
208        /**
209         * added to help the parsers with the generic types
210         */
211        NULL;
212        public static TestReportResult fromCode(String codeString) throws FHIRException {
213            if (codeString == null || "".equals(codeString))
214                return null;
215        if ("pass".equals(codeString))
216          return PASS;
217        if ("fail".equals(codeString))
218          return FAIL;
219        if ("pending".equals(codeString))
220          return PENDING;
221        if (Configuration.isAcceptInvalidEnums())
222          return null;
223        else
224          throw new FHIRException("Unknown TestReportResult code '"+codeString+"'");
225        }
226        public String toCode() {
227          switch (this) {
228            case PASS: return "pass";
229            case FAIL: return "fail";
230            case PENDING: return "pending";
231            default: return "?";
232          }
233        }
234        public String getSystem() {
235          switch (this) {
236            case PASS: return "http://hl7.org/fhir/report-result-codes";
237            case FAIL: return "http://hl7.org/fhir/report-result-codes";
238            case PENDING: return "http://hl7.org/fhir/report-result-codes";
239            default: return "?";
240          }
241        }
242        public String getDefinition() {
243          switch (this) {
244            case PASS: return "All test operations successfully passed all asserts.";
245            case FAIL: return "One or more test operations failed one or more asserts.";
246            case PENDING: return "One or more test operations is pending execution completion.";
247            default: return "?";
248          }
249        }
250        public String getDisplay() {
251          switch (this) {
252            case PASS: return "Pass";
253            case FAIL: return "Fail";
254            case PENDING: return "Pending";
255            default: return "?";
256          }
257        }
258    }
259
260  public static class TestReportResultEnumFactory implements EnumFactory<TestReportResult> {
261    public TestReportResult fromCode(String codeString) throws IllegalArgumentException {
262      if (codeString == null || "".equals(codeString))
263            if (codeString == null || "".equals(codeString))
264                return null;
265        if ("pass".equals(codeString))
266          return TestReportResult.PASS;
267        if ("fail".equals(codeString))
268          return TestReportResult.FAIL;
269        if ("pending".equals(codeString))
270          return TestReportResult.PENDING;
271        throw new IllegalArgumentException("Unknown TestReportResult code '"+codeString+"'");
272        }
273        public Enumeration<TestReportResult> fromType(Base code) throws FHIRException {
274          if (code == null)
275            return null;
276          if (code.isEmpty())
277            return new Enumeration<TestReportResult>(this);
278          String codeString = ((PrimitiveType) code).asStringValue();
279          if (codeString == null || "".equals(codeString))
280            return null;
281        if ("pass".equals(codeString))
282          return new Enumeration<TestReportResult>(this, TestReportResult.PASS);
283        if ("fail".equals(codeString))
284          return new Enumeration<TestReportResult>(this, TestReportResult.FAIL);
285        if ("pending".equals(codeString))
286          return new Enumeration<TestReportResult>(this, TestReportResult.PENDING);
287        throw new FHIRException("Unknown TestReportResult code '"+codeString+"'");
288        }
289    public String toCode(TestReportResult code) {
290      if (code == TestReportResult.PASS)
291        return "pass";
292      if (code == TestReportResult.FAIL)
293        return "fail";
294      if (code == TestReportResult.PENDING)
295        return "pending";
296      return "?";
297      }
298    public String toSystem(TestReportResult code) {
299      return code.getSystem();
300      }
301    }
302
303    public enum TestReportParticipantType {
304        /**
305         * The test execution engine.
306         */
307        TESTENGINE, 
308        /**
309         * A FHIR Client.
310         */
311        CLIENT, 
312        /**
313         * A FHIR Server.
314         */
315        SERVER, 
316        /**
317         * added to help the parsers with the generic types
318         */
319        NULL;
320        public static TestReportParticipantType fromCode(String codeString) throws FHIRException {
321            if (codeString == null || "".equals(codeString))
322                return null;
323        if ("test-engine".equals(codeString))
324          return TESTENGINE;
325        if ("client".equals(codeString))
326          return CLIENT;
327        if ("server".equals(codeString))
328          return SERVER;
329        if (Configuration.isAcceptInvalidEnums())
330          return null;
331        else
332          throw new FHIRException("Unknown TestReportParticipantType code '"+codeString+"'");
333        }
334        public String toCode() {
335          switch (this) {
336            case TESTENGINE: return "test-engine";
337            case CLIENT: return "client";
338            case SERVER: return "server";
339            default: return "?";
340          }
341        }
342        public String getSystem() {
343          switch (this) {
344            case TESTENGINE: return "http://hl7.org/fhir/report-participant-type";
345            case CLIENT: return "http://hl7.org/fhir/report-participant-type";
346            case SERVER: return "http://hl7.org/fhir/report-participant-type";
347            default: return "?";
348          }
349        }
350        public String getDefinition() {
351          switch (this) {
352            case TESTENGINE: return "The test execution engine.";
353            case CLIENT: return "A FHIR Client.";
354            case SERVER: return "A FHIR Server.";
355            default: return "?";
356          }
357        }
358        public String getDisplay() {
359          switch (this) {
360            case TESTENGINE: return "Test Engine";
361            case CLIENT: return "Client";
362            case SERVER: return "Server";
363            default: return "?";
364          }
365        }
366    }
367
368  public static class TestReportParticipantTypeEnumFactory implements EnumFactory<TestReportParticipantType> {
369    public TestReportParticipantType fromCode(String codeString) throws IllegalArgumentException {
370      if (codeString == null || "".equals(codeString))
371            if (codeString == null || "".equals(codeString))
372                return null;
373        if ("test-engine".equals(codeString))
374          return TestReportParticipantType.TESTENGINE;
375        if ("client".equals(codeString))
376          return TestReportParticipantType.CLIENT;
377        if ("server".equals(codeString))
378          return TestReportParticipantType.SERVER;
379        throw new IllegalArgumentException("Unknown TestReportParticipantType code '"+codeString+"'");
380        }
381        public Enumeration<TestReportParticipantType> fromType(Base code) throws FHIRException {
382          if (code == null)
383            return null;
384          if (code.isEmpty())
385            return new Enumeration<TestReportParticipantType>(this);
386          String codeString = ((PrimitiveType) code).asStringValue();
387          if (codeString == null || "".equals(codeString))
388            return null;
389        if ("test-engine".equals(codeString))
390          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.TESTENGINE);
391        if ("client".equals(codeString))
392          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.CLIENT);
393        if ("server".equals(codeString))
394          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.SERVER);
395        throw new FHIRException("Unknown TestReportParticipantType code '"+codeString+"'");
396        }
397    public String toCode(TestReportParticipantType code) {
398      if (code == TestReportParticipantType.TESTENGINE)
399        return "test-engine";
400      if (code == TestReportParticipantType.CLIENT)
401        return "client";
402      if (code == TestReportParticipantType.SERVER)
403        return "server";
404      return "?";
405      }
406    public String toSystem(TestReportParticipantType code) {
407      return code.getSystem();
408      }
409    }
410
411    public enum TestReportActionResult {
412        /**
413         * The action was successful.
414         */
415        PASS, 
416        /**
417         * The action was skipped.
418         */
419        SKIP, 
420        /**
421         * The action failed.
422         */
423        FAIL, 
424        /**
425         * The action passed but with warnings.
426         */
427        WARNING, 
428        /**
429         * The action encountered a fatal error and the engine was unable to process.
430         */
431        ERROR, 
432        /**
433         * added to help the parsers with the generic types
434         */
435        NULL;
436        public static TestReportActionResult fromCode(String codeString) throws FHIRException {
437            if (codeString == null || "".equals(codeString))
438                return null;
439        if ("pass".equals(codeString))
440          return PASS;
441        if ("skip".equals(codeString))
442          return SKIP;
443        if ("fail".equals(codeString))
444          return FAIL;
445        if ("warning".equals(codeString))
446          return WARNING;
447        if ("error".equals(codeString))
448          return ERROR;
449        if (Configuration.isAcceptInvalidEnums())
450          return null;
451        else
452          throw new FHIRException("Unknown TestReportActionResult code '"+codeString+"'");
453        }
454        public String toCode() {
455          switch (this) {
456            case PASS: return "pass";
457            case SKIP: return "skip";
458            case FAIL: return "fail";
459            case WARNING: return "warning";
460            case ERROR: return "error";
461            default: return "?";
462          }
463        }
464        public String getSystem() {
465          switch (this) {
466            case PASS: return "http://hl7.org/fhir/report-action-result-codes";
467            case SKIP: return "http://hl7.org/fhir/report-action-result-codes";
468            case FAIL: return "http://hl7.org/fhir/report-action-result-codes";
469            case WARNING: return "http://hl7.org/fhir/report-action-result-codes";
470            case ERROR: return "http://hl7.org/fhir/report-action-result-codes";
471            default: return "?";
472          }
473        }
474        public String getDefinition() {
475          switch (this) {
476            case PASS: return "The action was successful.";
477            case SKIP: return "The action was skipped.";
478            case FAIL: return "The action failed.";
479            case WARNING: return "The action passed but with warnings.";
480            case ERROR: return "The action encountered a fatal error and the engine was unable to process.";
481            default: return "?";
482          }
483        }
484        public String getDisplay() {
485          switch (this) {
486            case PASS: return "Pass";
487            case SKIP: return "Skip";
488            case FAIL: return "Fail";
489            case WARNING: return "Warning";
490            case ERROR: return "Error";
491            default: return "?";
492          }
493        }
494    }
495
496  public static class TestReportActionResultEnumFactory implements EnumFactory<TestReportActionResult> {
497    public TestReportActionResult fromCode(String codeString) throws IllegalArgumentException {
498      if (codeString == null || "".equals(codeString))
499            if (codeString == null || "".equals(codeString))
500                return null;
501        if ("pass".equals(codeString))
502          return TestReportActionResult.PASS;
503        if ("skip".equals(codeString))
504          return TestReportActionResult.SKIP;
505        if ("fail".equals(codeString))
506          return TestReportActionResult.FAIL;
507        if ("warning".equals(codeString))
508          return TestReportActionResult.WARNING;
509        if ("error".equals(codeString))
510          return TestReportActionResult.ERROR;
511        throw new IllegalArgumentException("Unknown TestReportActionResult code '"+codeString+"'");
512        }
513        public Enumeration<TestReportActionResult> fromType(Base code) throws FHIRException {
514          if (code == null)
515            return null;
516          if (code.isEmpty())
517            return new Enumeration<TestReportActionResult>(this);
518          String codeString = ((PrimitiveType) code).asStringValue();
519          if (codeString == null || "".equals(codeString))
520            return null;
521        if ("pass".equals(codeString))
522          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.PASS);
523        if ("skip".equals(codeString))
524          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.SKIP);
525        if ("fail".equals(codeString))
526          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.FAIL);
527        if ("warning".equals(codeString))
528          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.WARNING);
529        if ("error".equals(codeString))
530          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.ERROR);
531        throw new FHIRException("Unknown TestReportActionResult code '"+codeString+"'");
532        }
533    public String toCode(TestReportActionResult code) {
534      if (code == TestReportActionResult.PASS)
535        return "pass";
536      if (code == TestReportActionResult.SKIP)
537        return "skip";
538      if (code == TestReportActionResult.FAIL)
539        return "fail";
540      if (code == TestReportActionResult.WARNING)
541        return "warning";
542      if (code == TestReportActionResult.ERROR)
543        return "error";
544      return "?";
545      }
546    public String toSystem(TestReportActionResult code) {
547      return code.getSystem();
548      }
549    }
550
551    @Block()
552    public static class TestReportParticipantComponent extends BackboneElement implements IBaseBackboneElement {
553        /**
554         * The type of participant.
555         */
556        @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
557        @Description(shortDefinition="test-engine | client | server", formalDefinition="The type of participant." )
558        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-participant-type")
559        protected Enumeration<TestReportParticipantType> type;
560
561        /**
562         * The uri of the participant. An absolute URL is preferred.
563         */
564        @Child(name = "uri", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false)
565        @Description(shortDefinition="The uri of the participant. An absolute URL is preferred", formalDefinition="The uri of the participant. An absolute URL is preferred." )
566        protected UriType uri;
567
568        /**
569         * The display name of the participant.
570         */
571        @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
572        @Description(shortDefinition="The display name of the participant", formalDefinition="The display name of the participant." )
573        protected StringType display;
574
575        private static final long serialVersionUID = 577488357L;
576
577    /**
578     * Constructor
579     */
580      public TestReportParticipantComponent() {
581        super();
582      }
583
584    /**
585     * Constructor
586     */
587      public TestReportParticipantComponent(Enumeration<TestReportParticipantType> type, UriType uri) {
588        super();
589        this.type = type;
590        this.uri = uri;
591      }
592
593        /**
594         * @return {@link #type} (The type of participant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
595         */
596        public Enumeration<TestReportParticipantType> getTypeElement() { 
597          if (this.type == null)
598            if (Configuration.errorOnAutoCreate())
599              throw new Error("Attempt to auto-create TestReportParticipantComponent.type");
600            else if (Configuration.doAutoCreate())
601              this.type = new Enumeration<TestReportParticipantType>(new TestReportParticipantTypeEnumFactory()); // bb
602          return this.type;
603        }
604
605        public boolean hasTypeElement() { 
606          return this.type != null && !this.type.isEmpty();
607        }
608
609        public boolean hasType() { 
610          return this.type != null && !this.type.isEmpty();
611        }
612
613        /**
614         * @param value {@link #type} (The type of participant.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
615         */
616        public TestReportParticipantComponent setTypeElement(Enumeration<TestReportParticipantType> value) { 
617          this.type = value;
618          return this;
619        }
620
621        /**
622         * @return The type of participant.
623         */
624        public TestReportParticipantType getType() { 
625          return this.type == null ? null : this.type.getValue();
626        }
627
628        /**
629         * @param value The type of participant.
630         */
631        public TestReportParticipantComponent setType(TestReportParticipantType value) { 
632            if (this.type == null)
633              this.type = new Enumeration<TestReportParticipantType>(new TestReportParticipantTypeEnumFactory());
634            this.type.setValue(value);
635          return this;
636        }
637
638        /**
639         * @return {@link #uri} (The uri of the participant. An absolute URL is preferred.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
640         */
641        public UriType getUriElement() { 
642          if (this.uri == null)
643            if (Configuration.errorOnAutoCreate())
644              throw new Error("Attempt to auto-create TestReportParticipantComponent.uri");
645            else if (Configuration.doAutoCreate())
646              this.uri = new UriType(); // bb
647          return this.uri;
648        }
649
650        public boolean hasUriElement() { 
651          return this.uri != null && !this.uri.isEmpty();
652        }
653
654        public boolean hasUri() { 
655          return this.uri != null && !this.uri.isEmpty();
656        }
657
658        /**
659         * @param value {@link #uri} (The uri of the participant. An absolute URL is preferred.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value
660         */
661        public TestReportParticipantComponent setUriElement(UriType value) { 
662          this.uri = value;
663          return this;
664        }
665
666        /**
667         * @return The uri of the participant. An absolute URL is preferred.
668         */
669        public String getUri() { 
670          return this.uri == null ? null : this.uri.getValue();
671        }
672
673        /**
674         * @param value The uri of the participant. An absolute URL is preferred.
675         */
676        public TestReportParticipantComponent setUri(String value) { 
677            if (this.uri == null)
678              this.uri = new UriType();
679            this.uri.setValue(value);
680          return this;
681        }
682
683        /**
684         * @return {@link #display} (The display name of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
685         */
686        public StringType getDisplayElement() { 
687          if (this.display == null)
688            if (Configuration.errorOnAutoCreate())
689              throw new Error("Attempt to auto-create TestReportParticipantComponent.display");
690            else if (Configuration.doAutoCreate())
691              this.display = new StringType(); // bb
692          return this.display;
693        }
694
695        public boolean hasDisplayElement() { 
696          return this.display != null && !this.display.isEmpty();
697        }
698
699        public boolean hasDisplay() { 
700          return this.display != null && !this.display.isEmpty();
701        }
702
703        /**
704         * @param value {@link #display} (The display name of the participant.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value
705         */
706        public TestReportParticipantComponent setDisplayElement(StringType value) { 
707          this.display = value;
708          return this;
709        }
710
711        /**
712         * @return The display name of the participant.
713         */
714        public String getDisplay() { 
715          return this.display == null ? null : this.display.getValue();
716        }
717
718        /**
719         * @param value The display name of the participant.
720         */
721        public TestReportParticipantComponent setDisplay(String value) { 
722          if (Utilities.noString(value))
723            this.display = null;
724          else {
725            if (this.display == null)
726              this.display = new StringType();
727            this.display.setValue(value);
728          }
729          return this;
730        }
731
732        protected void listChildren(List<Property> children) {
733          super.listChildren(children);
734          children.add(new Property("type", "code", "The type of participant.", 0, 1, type));
735          children.add(new Property("uri", "uri", "The uri of the participant. An absolute URL is preferred.", 0, 1, uri));
736          children.add(new Property("display", "string", "The display name of the participant.", 0, 1, display));
737        }
738
739        @Override
740        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
741          switch (_hash) {
742          case 3575610: /*type*/  return new Property("type", "code", "The type of participant.", 0, 1, type);
743          case 116076: /*uri*/  return new Property("uri", "uri", "The uri of the participant. An absolute URL is preferred.", 0, 1, uri);
744          case 1671764162: /*display*/  return new Property("display", "string", "The display name of the participant.", 0, 1, display);
745          default: return super.getNamedProperty(_hash, _name, _checkValid);
746          }
747
748        }
749
750      @Override
751      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
752        switch (hash) {
753        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<TestReportParticipantType>
754        case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType
755        case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType
756        default: return super.getProperty(hash, name, checkValid);
757        }
758
759      }
760
761      @Override
762      public Base setProperty(int hash, String name, Base value) throws FHIRException {
763        switch (hash) {
764        case 3575610: // type
765          value = new TestReportParticipantTypeEnumFactory().fromType(castToCode(value));
766          this.type = (Enumeration) value; // Enumeration<TestReportParticipantType>
767          return value;
768        case 116076: // uri
769          this.uri = castToUri(value); // UriType
770          return value;
771        case 1671764162: // display
772          this.display = castToString(value); // StringType
773          return value;
774        default: return super.setProperty(hash, name, value);
775        }
776
777      }
778
779      @Override
780      public Base setProperty(String name, Base value) throws FHIRException {
781        if (name.equals("type")) {
782          value = new TestReportParticipantTypeEnumFactory().fromType(castToCode(value));
783          this.type = (Enumeration) value; // Enumeration<TestReportParticipantType>
784        } else if (name.equals("uri")) {
785          this.uri = castToUri(value); // UriType
786        } else if (name.equals("display")) {
787          this.display = castToString(value); // StringType
788        } else
789          return super.setProperty(name, value);
790        return value;
791      }
792
793      @Override
794      public Base makeProperty(int hash, String name) throws FHIRException {
795        switch (hash) {
796        case 3575610:  return getTypeElement();
797        case 116076:  return getUriElement();
798        case 1671764162:  return getDisplayElement();
799        default: return super.makeProperty(hash, name);
800        }
801
802      }
803
804      @Override
805      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
806        switch (hash) {
807        case 3575610: /*type*/ return new String[] {"code"};
808        case 116076: /*uri*/ return new String[] {"uri"};
809        case 1671764162: /*display*/ return new String[] {"string"};
810        default: return super.getTypesForProperty(hash, name);
811        }
812
813      }
814
815      @Override
816      public Base addChild(String name) throws FHIRException {
817        if (name.equals("type")) {
818          throw new FHIRException("Cannot call addChild on a primitive type TestReport.type");
819        }
820        else if (name.equals("uri")) {
821          throw new FHIRException("Cannot call addChild on a primitive type TestReport.uri");
822        }
823        else if (name.equals("display")) {
824          throw new FHIRException("Cannot call addChild on a primitive type TestReport.display");
825        }
826        else
827          return super.addChild(name);
828      }
829
830      public TestReportParticipantComponent copy() {
831        TestReportParticipantComponent dst = new TestReportParticipantComponent();
832        copyValues(dst);
833        return dst;
834      }
835
836      public void copyValues(TestReportParticipantComponent dst) {
837        super.copyValues(dst);
838        dst.type = type == null ? null : type.copy();
839        dst.uri = uri == null ? null : uri.copy();
840        dst.display = display == null ? null : display.copy();
841      }
842
843      @Override
844      public boolean equalsDeep(Base other_) {
845        if (!super.equalsDeep(other_))
846          return false;
847        if (!(other_ instanceof TestReportParticipantComponent))
848          return false;
849        TestReportParticipantComponent o = (TestReportParticipantComponent) other_;
850        return compareDeep(type, o.type, true) && compareDeep(uri, o.uri, true) && compareDeep(display, o.display, true)
851          ;
852      }
853
854      @Override
855      public boolean equalsShallow(Base other_) {
856        if (!super.equalsShallow(other_))
857          return false;
858        if (!(other_ instanceof TestReportParticipantComponent))
859          return false;
860        TestReportParticipantComponent o = (TestReportParticipantComponent) other_;
861        return compareValues(type, o.type, true) && compareValues(uri, o.uri, true) && compareValues(display, o.display, true)
862          ;
863      }
864
865      public boolean isEmpty() {
866        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, uri, display);
867      }
868
869  public String fhirType() {
870    return "TestReport.participant";
871
872  }
873
874  }
875
876    @Block()
877    public static class TestReportSetupComponent extends BackboneElement implements IBaseBackboneElement {
878        /**
879         * Action would contain either an operation or an assertion.
880         */
881        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
882        @Description(shortDefinition="A setup operation or assert that was executed", formalDefinition="Action would contain either an operation or an assertion." )
883        protected List<SetupActionComponent> action;
884
885        private static final long serialVersionUID = -123374486L;
886
887    /**
888     * Constructor
889     */
890      public TestReportSetupComponent() {
891        super();
892      }
893
894        /**
895         * @return {@link #action} (Action would contain either an operation or an assertion.)
896         */
897        public List<SetupActionComponent> getAction() { 
898          if (this.action == null)
899            this.action = new ArrayList<SetupActionComponent>();
900          return this.action;
901        }
902
903        /**
904         * @return Returns a reference to <code>this</code> for easy method chaining
905         */
906        public TestReportSetupComponent setAction(List<SetupActionComponent> theAction) { 
907          this.action = theAction;
908          return this;
909        }
910
911        public boolean hasAction() { 
912          if (this.action == null)
913            return false;
914          for (SetupActionComponent item : this.action)
915            if (!item.isEmpty())
916              return true;
917          return false;
918        }
919
920        public SetupActionComponent addAction() { //3
921          SetupActionComponent t = new SetupActionComponent();
922          if (this.action == null)
923            this.action = new ArrayList<SetupActionComponent>();
924          this.action.add(t);
925          return t;
926        }
927
928        public TestReportSetupComponent addAction(SetupActionComponent t) { //3
929          if (t == null)
930            return this;
931          if (this.action == null)
932            this.action = new ArrayList<SetupActionComponent>();
933          this.action.add(t);
934          return this;
935        }
936
937        /**
938         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
939         */
940        public SetupActionComponent getActionFirstRep() { 
941          if (getAction().isEmpty()) {
942            addAction();
943          }
944          return getAction().get(0);
945        }
946
947        protected void listChildren(List<Property> children) {
948          super.listChildren(children);
949          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
950        }
951
952        @Override
953        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
954          switch (_hash) {
955          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
956          default: return super.getNamedProperty(_hash, _name, _checkValid);
957          }
958
959        }
960
961      @Override
962      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
963        switch (hash) {
964        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent
965        default: return super.getProperty(hash, name, checkValid);
966        }
967
968      }
969
970      @Override
971      public Base setProperty(int hash, String name, Base value) throws FHIRException {
972        switch (hash) {
973        case -1422950858: // action
974          this.getAction().add((SetupActionComponent) value); // SetupActionComponent
975          return value;
976        default: return super.setProperty(hash, name, value);
977        }
978
979      }
980
981      @Override
982      public Base setProperty(String name, Base value) throws FHIRException {
983        if (name.equals("action")) {
984          this.getAction().add((SetupActionComponent) value);
985        } else
986          return super.setProperty(name, value);
987        return value;
988      }
989
990      @Override
991      public Base makeProperty(int hash, String name) throws FHIRException {
992        switch (hash) {
993        case -1422950858:  return addAction(); 
994        default: return super.makeProperty(hash, name);
995        }
996
997      }
998
999      @Override
1000      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1001        switch (hash) {
1002        case -1422950858: /*action*/ return new String[] {};
1003        default: return super.getTypesForProperty(hash, name);
1004        }
1005
1006      }
1007
1008      @Override
1009      public Base addChild(String name) throws FHIRException {
1010        if (name.equals("action")) {
1011          return addAction();
1012        }
1013        else
1014          return super.addChild(name);
1015      }
1016
1017      public TestReportSetupComponent copy() {
1018        TestReportSetupComponent dst = new TestReportSetupComponent();
1019        copyValues(dst);
1020        return dst;
1021      }
1022
1023      public void copyValues(TestReportSetupComponent dst) {
1024        super.copyValues(dst);
1025        if (action != null) {
1026          dst.action = new ArrayList<SetupActionComponent>();
1027          for (SetupActionComponent i : action)
1028            dst.action.add(i.copy());
1029        };
1030      }
1031
1032      @Override
1033      public boolean equalsDeep(Base other_) {
1034        if (!super.equalsDeep(other_))
1035          return false;
1036        if (!(other_ instanceof TestReportSetupComponent))
1037          return false;
1038        TestReportSetupComponent o = (TestReportSetupComponent) other_;
1039        return compareDeep(action, o.action, true);
1040      }
1041
1042      @Override
1043      public boolean equalsShallow(Base other_) {
1044        if (!super.equalsShallow(other_))
1045          return false;
1046        if (!(other_ instanceof TestReportSetupComponent))
1047          return false;
1048        TestReportSetupComponent o = (TestReportSetupComponent) other_;
1049        return true;
1050      }
1051
1052      public boolean isEmpty() {
1053        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
1054      }
1055
1056  public String fhirType() {
1057    return "TestReport.setup";
1058
1059  }
1060
1061  }
1062
1063    @Block()
1064    public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement {
1065        /**
1066         * The operation performed.
1067         */
1068        @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
1069        @Description(shortDefinition="The operation to perform", formalDefinition="The operation performed." )
1070        protected SetupActionOperationComponent operation;
1071
1072        /**
1073         * The results of the assertion performed on the previous operations.
1074         */
1075        @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
1076        @Description(shortDefinition="The assertion to perform", formalDefinition="The results of the assertion performed on the previous operations." )
1077        protected SetupActionAssertComponent assert_;
1078
1079        private static final long serialVersionUID = -252088305L;
1080
1081    /**
1082     * Constructor
1083     */
1084      public SetupActionComponent() {
1085        super();
1086      }
1087
1088        /**
1089         * @return {@link #operation} (The operation performed.)
1090         */
1091        public SetupActionOperationComponent getOperation() { 
1092          if (this.operation == null)
1093            if (Configuration.errorOnAutoCreate())
1094              throw new Error("Attempt to auto-create SetupActionComponent.operation");
1095            else if (Configuration.doAutoCreate())
1096              this.operation = new SetupActionOperationComponent(); // cc
1097          return this.operation;
1098        }
1099
1100        public boolean hasOperation() { 
1101          return this.operation != null && !this.operation.isEmpty();
1102        }
1103
1104        /**
1105         * @param value {@link #operation} (The operation performed.)
1106         */
1107        public SetupActionComponent setOperation(SetupActionOperationComponent value) { 
1108          this.operation = value;
1109          return this;
1110        }
1111
1112        /**
1113         * @return {@link #assert_} (The results of the assertion performed on the previous operations.)
1114         */
1115        public SetupActionAssertComponent getAssert() { 
1116          if (this.assert_ == null)
1117            if (Configuration.errorOnAutoCreate())
1118              throw new Error("Attempt to auto-create SetupActionComponent.assert_");
1119            else if (Configuration.doAutoCreate())
1120              this.assert_ = new SetupActionAssertComponent(); // cc
1121          return this.assert_;
1122        }
1123
1124        public boolean hasAssert() { 
1125          return this.assert_ != null && !this.assert_.isEmpty();
1126        }
1127
1128        /**
1129         * @param value {@link #assert_} (The results of the assertion performed on the previous operations.)
1130         */
1131        public SetupActionComponent setAssert(SetupActionAssertComponent value) { 
1132          this.assert_ = value;
1133          return this;
1134        }
1135
1136        protected void listChildren(List<Property> children) {
1137          super.listChildren(children);
1138          children.add(new Property("operation", "", "The operation performed.", 0, 1, operation));
1139          children.add(new Property("assert", "", "The results of the assertion performed on the previous operations.", 0, 1, assert_));
1140        }
1141
1142        @Override
1143        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1144          switch (_hash) {
1145          case 1662702951: /*operation*/  return new Property("operation", "", "The operation performed.", 0, 1, operation);
1146          case -1408208058: /*assert*/  return new Property("assert", "", "The results of the assertion performed on the previous operations.", 0, 1, assert_);
1147          default: return super.getNamedProperty(_hash, _name, _checkValid);
1148          }
1149
1150        }
1151
1152      @Override
1153      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1154        switch (hash) {
1155        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
1156        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
1157        default: return super.getProperty(hash, name, checkValid);
1158        }
1159
1160      }
1161
1162      @Override
1163      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1164        switch (hash) {
1165        case 1662702951: // operation
1166          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
1167          return value;
1168        case -1408208058: // assert
1169          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
1170          return value;
1171        default: return super.setProperty(hash, name, value);
1172        }
1173
1174      }
1175
1176      @Override
1177      public Base setProperty(String name, Base value) throws FHIRException {
1178        if (name.equals("operation")) {
1179          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
1180        } else if (name.equals("assert")) {
1181          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
1182        } else
1183          return super.setProperty(name, value);
1184        return value;
1185      }
1186
1187      @Override
1188      public Base makeProperty(int hash, String name) throws FHIRException {
1189        switch (hash) {
1190        case 1662702951:  return getOperation(); 
1191        case -1408208058:  return getAssert(); 
1192        default: return super.makeProperty(hash, name);
1193        }
1194
1195      }
1196
1197      @Override
1198      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1199        switch (hash) {
1200        case 1662702951: /*operation*/ return new String[] {};
1201        case -1408208058: /*assert*/ return new String[] {};
1202        default: return super.getTypesForProperty(hash, name);
1203        }
1204
1205      }
1206
1207      @Override
1208      public Base addChild(String name) throws FHIRException {
1209        if (name.equals("operation")) {
1210          this.operation = new SetupActionOperationComponent();
1211          return this.operation;
1212        }
1213        else if (name.equals("assert")) {
1214          this.assert_ = new SetupActionAssertComponent();
1215          return this.assert_;
1216        }
1217        else
1218          return super.addChild(name);
1219      }
1220
1221      public SetupActionComponent copy() {
1222        SetupActionComponent dst = new SetupActionComponent();
1223        copyValues(dst);
1224        return dst;
1225      }
1226
1227      public void copyValues(SetupActionComponent dst) {
1228        super.copyValues(dst);
1229        dst.operation = operation == null ? null : operation.copy();
1230        dst.assert_ = assert_ == null ? null : assert_.copy();
1231      }
1232
1233      @Override
1234      public boolean equalsDeep(Base other_) {
1235        if (!super.equalsDeep(other_))
1236          return false;
1237        if (!(other_ instanceof SetupActionComponent))
1238          return false;
1239        SetupActionComponent o = (SetupActionComponent) other_;
1240        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
1241      }
1242
1243      @Override
1244      public boolean equalsShallow(Base other_) {
1245        if (!super.equalsShallow(other_))
1246          return false;
1247        if (!(other_ instanceof SetupActionComponent))
1248          return false;
1249        SetupActionComponent o = (SetupActionComponent) other_;
1250        return true;
1251      }
1252
1253      public boolean isEmpty() {
1254        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
1255      }
1256
1257  public String fhirType() {
1258    return "TestReport.setup.action";
1259
1260  }
1261
1262  }
1263
1264    @Block()
1265    public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement {
1266        /**
1267         * The result of this operation.
1268         */
1269        @Child(name = "result", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1270        @Description(shortDefinition="pass | skip | fail | warning | error", formalDefinition="The result of this operation." )
1271        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-action-result-codes")
1272        protected Enumeration<TestReportActionResult> result;
1273
1274        /**
1275         * An explanatory message associated with the result.
1276         */
1277        @Child(name = "message", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1278        @Description(shortDefinition="A message associated with the result", formalDefinition="An explanatory message associated with the result." )
1279        protected MarkdownType message;
1280
1281        /**
1282         * A link to further details on the result.
1283         */
1284        @Child(name = "detail", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1285        @Description(shortDefinition="A link to further details on the result", formalDefinition="A link to further details on the result." )
1286        protected UriType detail;
1287
1288        private static final long serialVersionUID = 269088798L;
1289
1290    /**
1291     * Constructor
1292     */
1293      public SetupActionOperationComponent() {
1294        super();
1295      }
1296
1297    /**
1298     * Constructor
1299     */
1300      public SetupActionOperationComponent(Enumeration<TestReportActionResult> result) {
1301        super();
1302        this.result = result;
1303      }
1304
1305        /**
1306         * @return {@link #result} (The result of this operation.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
1307         */
1308        public Enumeration<TestReportActionResult> getResultElement() { 
1309          if (this.result == null)
1310            if (Configuration.errorOnAutoCreate())
1311              throw new Error("Attempt to auto-create SetupActionOperationComponent.result");
1312            else if (Configuration.doAutoCreate())
1313              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); // bb
1314          return this.result;
1315        }
1316
1317        public boolean hasResultElement() { 
1318          return this.result != null && !this.result.isEmpty();
1319        }
1320
1321        public boolean hasResult() { 
1322          return this.result != null && !this.result.isEmpty();
1323        }
1324
1325        /**
1326         * @param value {@link #result} (The result of this operation.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
1327         */
1328        public SetupActionOperationComponent setResultElement(Enumeration<TestReportActionResult> value) { 
1329          this.result = value;
1330          return this;
1331        }
1332
1333        /**
1334         * @return The result of this operation.
1335         */
1336        public TestReportActionResult getResult() { 
1337          return this.result == null ? null : this.result.getValue();
1338        }
1339
1340        /**
1341         * @param value The result of this operation.
1342         */
1343        public SetupActionOperationComponent setResult(TestReportActionResult value) { 
1344            if (this.result == null)
1345              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory());
1346            this.result.setValue(value);
1347          return this;
1348        }
1349
1350        /**
1351         * @return {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
1352         */
1353        public MarkdownType getMessageElement() { 
1354          if (this.message == null)
1355            if (Configuration.errorOnAutoCreate())
1356              throw new Error("Attempt to auto-create SetupActionOperationComponent.message");
1357            else if (Configuration.doAutoCreate())
1358              this.message = new MarkdownType(); // bb
1359          return this.message;
1360        }
1361
1362        public boolean hasMessageElement() { 
1363          return this.message != null && !this.message.isEmpty();
1364        }
1365
1366        public boolean hasMessage() { 
1367          return this.message != null && !this.message.isEmpty();
1368        }
1369
1370        /**
1371         * @param value {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
1372         */
1373        public SetupActionOperationComponent setMessageElement(MarkdownType value) { 
1374          this.message = value;
1375          return this;
1376        }
1377
1378        /**
1379         * @return An explanatory message associated with the result.
1380         */
1381        public String getMessage() { 
1382          return this.message == null ? null : this.message.getValue();
1383        }
1384
1385        /**
1386         * @param value An explanatory message associated with the result.
1387         */
1388        public SetupActionOperationComponent setMessage(String value) { 
1389          if (value == null)
1390            this.message = null;
1391          else {
1392            if (this.message == null)
1393              this.message = new MarkdownType();
1394            this.message.setValue(value);
1395          }
1396          return this;
1397        }
1398
1399        /**
1400         * @return {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value
1401         */
1402        public UriType getDetailElement() { 
1403          if (this.detail == null)
1404            if (Configuration.errorOnAutoCreate())
1405              throw new Error("Attempt to auto-create SetupActionOperationComponent.detail");
1406            else if (Configuration.doAutoCreate())
1407              this.detail = new UriType(); // bb
1408          return this.detail;
1409        }
1410
1411        public boolean hasDetailElement() { 
1412          return this.detail != null && !this.detail.isEmpty();
1413        }
1414
1415        public boolean hasDetail() { 
1416          return this.detail != null && !this.detail.isEmpty();
1417        }
1418
1419        /**
1420         * @param value {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value
1421         */
1422        public SetupActionOperationComponent setDetailElement(UriType value) { 
1423          this.detail = value;
1424          return this;
1425        }
1426
1427        /**
1428         * @return A link to further details on the result.
1429         */
1430        public String getDetail() { 
1431          return this.detail == null ? null : this.detail.getValue();
1432        }
1433
1434        /**
1435         * @param value A link to further details on the result.
1436         */
1437        public SetupActionOperationComponent setDetail(String value) { 
1438          if (Utilities.noString(value))
1439            this.detail = null;
1440          else {
1441            if (this.detail == null)
1442              this.detail = new UriType();
1443            this.detail.setValue(value);
1444          }
1445          return this;
1446        }
1447
1448        protected void listChildren(List<Property> children) {
1449          super.listChildren(children);
1450          children.add(new Property("result", "code", "The result of this operation.", 0, 1, result));
1451          children.add(new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message));
1452          children.add(new Property("detail", "uri", "A link to further details on the result.", 0, 1, detail));
1453        }
1454
1455        @Override
1456        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1457          switch (_hash) {
1458          case -934426595: /*result*/  return new Property("result", "code", "The result of this operation.", 0, 1, result);
1459          case 954925063: /*message*/  return new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message);
1460          case -1335224239: /*detail*/  return new Property("detail", "uri", "A link to further details on the result.", 0, 1, detail);
1461          default: return super.getNamedProperty(_hash, _name, _checkValid);
1462          }
1463
1464        }
1465
1466      @Override
1467      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1468        switch (hash) {
1469        case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportActionResult>
1470        case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // MarkdownType
1471        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // UriType
1472        default: return super.getProperty(hash, name, checkValid);
1473        }
1474
1475      }
1476
1477      @Override
1478      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1479        switch (hash) {
1480        case -934426595: // result
1481          value = new TestReportActionResultEnumFactory().fromType(castToCode(value));
1482          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1483          return value;
1484        case 954925063: // message
1485          this.message = castToMarkdown(value); // MarkdownType
1486          return value;
1487        case -1335224239: // detail
1488          this.detail = castToUri(value); // UriType
1489          return value;
1490        default: return super.setProperty(hash, name, value);
1491        }
1492
1493      }
1494
1495      @Override
1496      public Base setProperty(String name, Base value) throws FHIRException {
1497        if (name.equals("result")) {
1498          value = new TestReportActionResultEnumFactory().fromType(castToCode(value));
1499          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1500        } else if (name.equals("message")) {
1501          this.message = castToMarkdown(value); // MarkdownType
1502        } else if (name.equals("detail")) {
1503          this.detail = castToUri(value); // UriType
1504        } else
1505          return super.setProperty(name, value);
1506        return value;
1507      }
1508
1509      @Override
1510      public Base makeProperty(int hash, String name) throws FHIRException {
1511        switch (hash) {
1512        case -934426595:  return getResultElement();
1513        case 954925063:  return getMessageElement();
1514        case -1335224239:  return getDetailElement();
1515        default: return super.makeProperty(hash, name);
1516        }
1517
1518      }
1519
1520      @Override
1521      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1522        switch (hash) {
1523        case -934426595: /*result*/ return new String[] {"code"};
1524        case 954925063: /*message*/ return new String[] {"markdown"};
1525        case -1335224239: /*detail*/ return new String[] {"uri"};
1526        default: return super.getTypesForProperty(hash, name);
1527        }
1528
1529      }
1530
1531      @Override
1532      public Base addChild(String name) throws FHIRException {
1533        if (name.equals("result")) {
1534          throw new FHIRException("Cannot call addChild on a primitive type TestReport.result");
1535        }
1536        else if (name.equals("message")) {
1537          throw new FHIRException("Cannot call addChild on a primitive type TestReport.message");
1538        }
1539        else if (name.equals("detail")) {
1540          throw new FHIRException("Cannot call addChild on a primitive type TestReport.detail");
1541        }
1542        else
1543          return super.addChild(name);
1544      }
1545
1546      public SetupActionOperationComponent copy() {
1547        SetupActionOperationComponent dst = new SetupActionOperationComponent();
1548        copyValues(dst);
1549        return dst;
1550      }
1551
1552      public void copyValues(SetupActionOperationComponent dst) {
1553        super.copyValues(dst);
1554        dst.result = result == null ? null : result.copy();
1555        dst.message = message == null ? null : message.copy();
1556        dst.detail = detail == null ? null : detail.copy();
1557      }
1558
1559      @Override
1560      public boolean equalsDeep(Base other_) {
1561        if (!super.equalsDeep(other_))
1562          return false;
1563        if (!(other_ instanceof SetupActionOperationComponent))
1564          return false;
1565        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
1566        return compareDeep(result, o.result, true) && compareDeep(message, o.message, true) && compareDeep(detail, o.detail, true)
1567          ;
1568      }
1569
1570      @Override
1571      public boolean equalsShallow(Base other_) {
1572        if (!super.equalsShallow(other_))
1573          return false;
1574        if (!(other_ instanceof SetupActionOperationComponent))
1575          return false;
1576        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
1577        return compareValues(result, o.result, true) && compareValues(message, o.message, true) && compareValues(detail, o.detail, true)
1578          ;
1579      }
1580
1581      public boolean isEmpty() {
1582        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(result, message, detail
1583          );
1584      }
1585
1586  public String fhirType() {
1587    return "TestReport.setup.action.operation";
1588
1589  }
1590
1591  }
1592
1593    @Block()
1594    public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement {
1595        /**
1596         * The result of this assertion.
1597         */
1598        @Child(name = "result", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1599        @Description(shortDefinition="pass | skip | fail | warning | error", formalDefinition="The result of this assertion." )
1600        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-action-result-codes")
1601        protected Enumeration<TestReportActionResult> result;
1602
1603        /**
1604         * An explanatory message associated with the result.
1605         */
1606        @Child(name = "message", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1607        @Description(shortDefinition="A message associated with the result", formalDefinition="An explanatory message associated with the result." )
1608        protected MarkdownType message;
1609
1610        /**
1611         * A link to further details on the result.
1612         */
1613        @Child(name = "detail", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1614        @Description(shortDefinition="A link to further details on the result", formalDefinition="A link to further details on the result." )
1615        protected StringType detail;
1616
1617        private static final long serialVersionUID = 467968193L;
1618
1619    /**
1620     * Constructor
1621     */
1622      public SetupActionAssertComponent() {
1623        super();
1624      }
1625
1626    /**
1627     * Constructor
1628     */
1629      public SetupActionAssertComponent(Enumeration<TestReportActionResult> result) {
1630        super();
1631        this.result = result;
1632      }
1633
1634        /**
1635         * @return {@link #result} (The result of this assertion.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
1636         */
1637        public Enumeration<TestReportActionResult> getResultElement() { 
1638          if (this.result == null)
1639            if (Configuration.errorOnAutoCreate())
1640              throw new Error("Attempt to auto-create SetupActionAssertComponent.result");
1641            else if (Configuration.doAutoCreate())
1642              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); // bb
1643          return this.result;
1644        }
1645
1646        public boolean hasResultElement() { 
1647          return this.result != null && !this.result.isEmpty();
1648        }
1649
1650        public boolean hasResult() { 
1651          return this.result != null && !this.result.isEmpty();
1652        }
1653
1654        /**
1655         * @param value {@link #result} (The result of this assertion.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
1656         */
1657        public SetupActionAssertComponent setResultElement(Enumeration<TestReportActionResult> value) { 
1658          this.result = value;
1659          return this;
1660        }
1661
1662        /**
1663         * @return The result of this assertion.
1664         */
1665        public TestReportActionResult getResult() { 
1666          return this.result == null ? null : this.result.getValue();
1667        }
1668
1669        /**
1670         * @param value The result of this assertion.
1671         */
1672        public SetupActionAssertComponent setResult(TestReportActionResult value) { 
1673            if (this.result == null)
1674              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory());
1675            this.result.setValue(value);
1676          return this;
1677        }
1678
1679        /**
1680         * @return {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
1681         */
1682        public MarkdownType getMessageElement() { 
1683          if (this.message == null)
1684            if (Configuration.errorOnAutoCreate())
1685              throw new Error("Attempt to auto-create SetupActionAssertComponent.message");
1686            else if (Configuration.doAutoCreate())
1687              this.message = new MarkdownType(); // bb
1688          return this.message;
1689        }
1690
1691        public boolean hasMessageElement() { 
1692          return this.message != null && !this.message.isEmpty();
1693        }
1694
1695        public boolean hasMessage() { 
1696          return this.message != null && !this.message.isEmpty();
1697        }
1698
1699        /**
1700         * @param value {@link #message} (An explanatory message associated with the result.). This is the underlying object with id, value and extensions. The accessor "getMessage" gives direct access to the value
1701         */
1702        public SetupActionAssertComponent setMessageElement(MarkdownType value) { 
1703          this.message = value;
1704          return this;
1705        }
1706
1707        /**
1708         * @return An explanatory message associated with the result.
1709         */
1710        public String getMessage() { 
1711          return this.message == null ? null : this.message.getValue();
1712        }
1713
1714        /**
1715         * @param value An explanatory message associated with the result.
1716         */
1717        public SetupActionAssertComponent setMessage(String value) { 
1718          if (value == null)
1719            this.message = null;
1720          else {
1721            if (this.message == null)
1722              this.message = new MarkdownType();
1723            this.message.setValue(value);
1724          }
1725          return this;
1726        }
1727
1728        /**
1729         * @return {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value
1730         */
1731        public StringType getDetailElement() { 
1732          if (this.detail == null)
1733            if (Configuration.errorOnAutoCreate())
1734              throw new Error("Attempt to auto-create SetupActionAssertComponent.detail");
1735            else if (Configuration.doAutoCreate())
1736              this.detail = new StringType(); // bb
1737          return this.detail;
1738        }
1739
1740        public boolean hasDetailElement() { 
1741          return this.detail != null && !this.detail.isEmpty();
1742        }
1743
1744        public boolean hasDetail() { 
1745          return this.detail != null && !this.detail.isEmpty();
1746        }
1747
1748        /**
1749         * @param value {@link #detail} (A link to further details on the result.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value
1750         */
1751        public SetupActionAssertComponent setDetailElement(StringType value) { 
1752          this.detail = value;
1753          return this;
1754        }
1755
1756        /**
1757         * @return A link to further details on the result.
1758         */
1759        public String getDetail() { 
1760          return this.detail == null ? null : this.detail.getValue();
1761        }
1762
1763        /**
1764         * @param value A link to further details on the result.
1765         */
1766        public SetupActionAssertComponent setDetail(String value) { 
1767          if (Utilities.noString(value))
1768            this.detail = null;
1769          else {
1770            if (this.detail == null)
1771              this.detail = new StringType();
1772            this.detail.setValue(value);
1773          }
1774          return this;
1775        }
1776
1777        protected void listChildren(List<Property> children) {
1778          super.listChildren(children);
1779          children.add(new Property("result", "code", "The result of this assertion.", 0, 1, result));
1780          children.add(new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message));
1781          children.add(new Property("detail", "string", "A link to further details on the result.", 0, 1, detail));
1782        }
1783
1784        @Override
1785        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1786          switch (_hash) {
1787          case -934426595: /*result*/  return new Property("result", "code", "The result of this assertion.", 0, 1, result);
1788          case 954925063: /*message*/  return new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message);
1789          case -1335224239: /*detail*/  return new Property("detail", "string", "A link to further details on the result.", 0, 1, detail);
1790          default: return super.getNamedProperty(_hash, _name, _checkValid);
1791          }
1792
1793        }
1794
1795      @Override
1796      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1797        switch (hash) {
1798        case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportActionResult>
1799        case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // MarkdownType
1800        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // StringType
1801        default: return super.getProperty(hash, name, checkValid);
1802        }
1803
1804      }
1805
1806      @Override
1807      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1808        switch (hash) {
1809        case -934426595: // result
1810          value = new TestReportActionResultEnumFactory().fromType(castToCode(value));
1811          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1812          return value;
1813        case 954925063: // message
1814          this.message = castToMarkdown(value); // MarkdownType
1815          return value;
1816        case -1335224239: // detail
1817          this.detail = castToString(value); // StringType
1818          return value;
1819        default: return super.setProperty(hash, name, value);
1820        }
1821
1822      }
1823
1824      @Override
1825      public Base setProperty(String name, Base value) throws FHIRException {
1826        if (name.equals("result")) {
1827          value = new TestReportActionResultEnumFactory().fromType(castToCode(value));
1828          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1829        } else if (name.equals("message")) {
1830          this.message = castToMarkdown(value); // MarkdownType
1831        } else if (name.equals("detail")) {
1832          this.detail = castToString(value); // StringType
1833        } else
1834          return super.setProperty(name, value);
1835        return value;
1836      }
1837
1838      @Override
1839      public Base makeProperty(int hash, String name) throws FHIRException {
1840        switch (hash) {
1841        case -934426595:  return getResultElement();
1842        case 954925063:  return getMessageElement();
1843        case -1335224239:  return getDetailElement();
1844        default: return super.makeProperty(hash, name);
1845        }
1846
1847      }
1848
1849      @Override
1850      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1851        switch (hash) {
1852        case -934426595: /*result*/ return new String[] {"code"};
1853        case 954925063: /*message*/ return new String[] {"markdown"};
1854        case -1335224239: /*detail*/ return new String[] {"string"};
1855        default: return super.getTypesForProperty(hash, name);
1856        }
1857
1858      }
1859
1860      @Override
1861      public Base addChild(String name) throws FHIRException {
1862        if (name.equals("result")) {
1863          throw new FHIRException("Cannot call addChild on a primitive type TestReport.result");
1864        }
1865        else if (name.equals("message")) {
1866          throw new FHIRException("Cannot call addChild on a primitive type TestReport.message");
1867        }
1868        else if (name.equals("detail")) {
1869          throw new FHIRException("Cannot call addChild on a primitive type TestReport.detail");
1870        }
1871        else
1872          return super.addChild(name);
1873      }
1874
1875      public SetupActionAssertComponent copy() {
1876        SetupActionAssertComponent dst = new SetupActionAssertComponent();
1877        copyValues(dst);
1878        return dst;
1879      }
1880
1881      public void copyValues(SetupActionAssertComponent dst) {
1882        super.copyValues(dst);
1883        dst.result = result == null ? null : result.copy();
1884        dst.message = message == null ? null : message.copy();
1885        dst.detail = detail == null ? null : detail.copy();
1886      }
1887
1888      @Override
1889      public boolean equalsDeep(Base other_) {
1890        if (!super.equalsDeep(other_))
1891          return false;
1892        if (!(other_ instanceof SetupActionAssertComponent))
1893          return false;
1894        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
1895        return compareDeep(result, o.result, true) && compareDeep(message, o.message, true) && compareDeep(detail, o.detail, true)
1896          ;
1897      }
1898
1899      @Override
1900      public boolean equalsShallow(Base other_) {
1901        if (!super.equalsShallow(other_))
1902          return false;
1903        if (!(other_ instanceof SetupActionAssertComponent))
1904          return false;
1905        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
1906        return compareValues(result, o.result, true) && compareValues(message, o.message, true) && compareValues(detail, o.detail, true)
1907          ;
1908      }
1909
1910      public boolean isEmpty() {
1911        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(result, message, detail
1912          );
1913      }
1914
1915  public String fhirType() {
1916    return "TestReport.setup.action.assert";
1917
1918  }
1919
1920  }
1921
1922    @Block()
1923    public static class TestReportTestComponent extends BackboneElement implements IBaseBackboneElement {
1924        /**
1925         * The name of this test used for tracking/logging purposes by test engines.
1926         */
1927        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1928        @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." )
1929        protected StringType name;
1930
1931        /**
1932         * A short description of the test used by test engines for tracking and reporting purposes.
1933         */
1934        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1935        @Description(shortDefinition="Tracking/reporting short description of the test", formalDefinition="A short description of the test used by test engines for tracking and reporting purposes." )
1936        protected StringType description;
1937
1938        /**
1939         * Action would contain either an operation or an assertion.
1940         */
1941        @Child(name = "action", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1942        @Description(shortDefinition="A test operation or assert that was performed", formalDefinition="Action would contain either an operation or an assertion." )
1943        protected List<TestActionComponent> action;
1944
1945        private static final long serialVersionUID = -865006110L;
1946
1947    /**
1948     * Constructor
1949     */
1950      public TestReportTestComponent() {
1951        super();
1952      }
1953
1954        /**
1955         * @return {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1956         */
1957        public StringType getNameElement() { 
1958          if (this.name == null)
1959            if (Configuration.errorOnAutoCreate())
1960              throw new Error("Attempt to auto-create TestReportTestComponent.name");
1961            else if (Configuration.doAutoCreate())
1962              this.name = new StringType(); // bb
1963          return this.name;
1964        }
1965
1966        public boolean hasNameElement() { 
1967          return this.name != null && !this.name.isEmpty();
1968        }
1969
1970        public boolean hasName() { 
1971          return this.name != null && !this.name.isEmpty();
1972        }
1973
1974        /**
1975         * @param value {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
1976         */
1977        public TestReportTestComponent setNameElement(StringType value) { 
1978          this.name = value;
1979          return this;
1980        }
1981
1982        /**
1983         * @return The name of this test used for tracking/logging purposes by test engines.
1984         */
1985        public String getName() { 
1986          return this.name == null ? null : this.name.getValue();
1987        }
1988
1989        /**
1990         * @param value The name of this test used for tracking/logging purposes by test engines.
1991         */
1992        public TestReportTestComponent setName(String value) { 
1993          if (Utilities.noString(value))
1994            this.name = null;
1995          else {
1996            if (this.name == null)
1997              this.name = new StringType();
1998            this.name.setValue(value);
1999          }
2000          return this;
2001        }
2002
2003        /**
2004         * @return {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2005         */
2006        public StringType getDescriptionElement() { 
2007          if (this.description == null)
2008            if (Configuration.errorOnAutoCreate())
2009              throw new Error("Attempt to auto-create TestReportTestComponent.description");
2010            else if (Configuration.doAutoCreate())
2011              this.description = new StringType(); // bb
2012          return this.description;
2013        }
2014
2015        public boolean hasDescriptionElement() { 
2016          return this.description != null && !this.description.isEmpty();
2017        }
2018
2019        public boolean hasDescription() { 
2020          return this.description != null && !this.description.isEmpty();
2021        }
2022
2023        /**
2024         * @param value {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2025         */
2026        public TestReportTestComponent setDescriptionElement(StringType value) { 
2027          this.description = value;
2028          return this;
2029        }
2030
2031        /**
2032         * @return A short description of the test used by test engines for tracking and reporting purposes.
2033         */
2034        public String getDescription() { 
2035          return this.description == null ? null : this.description.getValue();
2036        }
2037
2038        /**
2039         * @param value A short description of the test used by test engines for tracking and reporting purposes.
2040         */
2041        public TestReportTestComponent setDescription(String value) { 
2042          if (Utilities.noString(value))
2043            this.description = null;
2044          else {
2045            if (this.description == null)
2046              this.description = new StringType();
2047            this.description.setValue(value);
2048          }
2049          return this;
2050        }
2051
2052        /**
2053         * @return {@link #action} (Action would contain either an operation or an assertion.)
2054         */
2055        public List<TestActionComponent> getAction() { 
2056          if (this.action == null)
2057            this.action = new ArrayList<TestActionComponent>();
2058          return this.action;
2059        }
2060
2061        /**
2062         * @return Returns a reference to <code>this</code> for easy method chaining
2063         */
2064        public TestReportTestComponent setAction(List<TestActionComponent> theAction) { 
2065          this.action = theAction;
2066          return this;
2067        }
2068
2069        public boolean hasAction() { 
2070          if (this.action == null)
2071            return false;
2072          for (TestActionComponent item : this.action)
2073            if (!item.isEmpty())
2074              return true;
2075          return false;
2076        }
2077
2078        public TestActionComponent addAction() { //3
2079          TestActionComponent t = new TestActionComponent();
2080          if (this.action == null)
2081            this.action = new ArrayList<TestActionComponent>();
2082          this.action.add(t);
2083          return t;
2084        }
2085
2086        public TestReportTestComponent addAction(TestActionComponent t) { //3
2087          if (t == null)
2088            return this;
2089          if (this.action == null)
2090            this.action = new ArrayList<TestActionComponent>();
2091          this.action.add(t);
2092          return this;
2093        }
2094
2095        /**
2096         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
2097         */
2098        public TestActionComponent getActionFirstRep() { 
2099          if (getAction().isEmpty()) {
2100            addAction();
2101          }
2102          return getAction().get(0);
2103        }
2104
2105        protected void listChildren(List<Property> children) {
2106          super.listChildren(children);
2107          children.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name));
2108          children.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description));
2109          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
2110        }
2111
2112        @Override
2113        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2114          switch (_hash) {
2115          case 3373707: /*name*/  return new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name);
2116          case -1724546052: /*description*/  return new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description);
2117          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
2118          default: return super.getNamedProperty(_hash, _name, _checkValid);
2119          }
2120
2121        }
2122
2123      @Override
2124      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2125        switch (hash) {
2126        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2127        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2128        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent
2129        default: return super.getProperty(hash, name, checkValid);
2130        }
2131
2132      }
2133
2134      @Override
2135      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2136        switch (hash) {
2137        case 3373707: // name
2138          this.name = castToString(value); // StringType
2139          return value;
2140        case -1724546052: // description
2141          this.description = castToString(value); // StringType
2142          return value;
2143        case -1422950858: // action
2144          this.getAction().add((TestActionComponent) value); // TestActionComponent
2145          return value;
2146        default: return super.setProperty(hash, name, value);
2147        }
2148
2149      }
2150
2151      @Override
2152      public Base setProperty(String name, Base value) throws FHIRException {
2153        if (name.equals("name")) {
2154          this.name = castToString(value); // StringType
2155        } else if (name.equals("description")) {
2156          this.description = castToString(value); // StringType
2157        } else if (name.equals("action")) {
2158          this.getAction().add((TestActionComponent) value);
2159        } else
2160          return super.setProperty(name, value);
2161        return value;
2162      }
2163
2164      @Override
2165      public Base makeProperty(int hash, String name) throws FHIRException {
2166        switch (hash) {
2167        case 3373707:  return getNameElement();
2168        case -1724546052:  return getDescriptionElement();
2169        case -1422950858:  return addAction(); 
2170        default: return super.makeProperty(hash, name);
2171        }
2172
2173      }
2174
2175      @Override
2176      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2177        switch (hash) {
2178        case 3373707: /*name*/ return new String[] {"string"};
2179        case -1724546052: /*description*/ return new String[] {"string"};
2180        case -1422950858: /*action*/ return new String[] {};
2181        default: return super.getTypesForProperty(hash, name);
2182        }
2183
2184      }
2185
2186      @Override
2187      public Base addChild(String name) throws FHIRException {
2188        if (name.equals("name")) {
2189          throw new FHIRException("Cannot call addChild on a primitive type TestReport.name");
2190        }
2191        else if (name.equals("description")) {
2192          throw new FHIRException("Cannot call addChild on a primitive type TestReport.description");
2193        }
2194        else if (name.equals("action")) {
2195          return addAction();
2196        }
2197        else
2198          return super.addChild(name);
2199      }
2200
2201      public TestReportTestComponent copy() {
2202        TestReportTestComponent dst = new TestReportTestComponent();
2203        copyValues(dst);
2204        return dst;
2205      }
2206
2207      public void copyValues(TestReportTestComponent dst) {
2208        super.copyValues(dst);
2209        dst.name = name == null ? null : name.copy();
2210        dst.description = description == null ? null : description.copy();
2211        if (action != null) {
2212          dst.action = new ArrayList<TestActionComponent>();
2213          for (TestActionComponent i : action)
2214            dst.action.add(i.copy());
2215        };
2216      }
2217
2218      @Override
2219      public boolean equalsDeep(Base other_) {
2220        if (!super.equalsDeep(other_))
2221          return false;
2222        if (!(other_ instanceof TestReportTestComponent))
2223          return false;
2224        TestReportTestComponent o = (TestReportTestComponent) other_;
2225        return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(action, o.action, true)
2226          ;
2227      }
2228
2229      @Override
2230      public boolean equalsShallow(Base other_) {
2231        if (!super.equalsShallow(other_))
2232          return false;
2233        if (!(other_ instanceof TestReportTestComponent))
2234          return false;
2235        TestReportTestComponent o = (TestReportTestComponent) other_;
2236        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2237      }
2238
2239      public boolean isEmpty() {
2240        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, action
2241          );
2242      }
2243
2244  public String fhirType() {
2245    return "TestReport.test";
2246
2247  }
2248
2249  }
2250
2251    @Block()
2252    public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement {
2253        /**
2254         * An operation would involve a REST request to a server.
2255         */
2256        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
2257        @Description(shortDefinition="The operation performed", formalDefinition="An operation would involve a REST request to a server." )
2258        protected SetupActionOperationComponent operation;
2259
2260        /**
2261         * The results of the assertion performed on the previous operations.
2262         */
2263        @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false)
2264        @Description(shortDefinition="The assertion performed", formalDefinition="The results of the assertion performed on the previous operations." )
2265        protected SetupActionAssertComponent assert_;
2266
2267        private static final long serialVersionUID = -252088305L;
2268
2269    /**
2270     * Constructor
2271     */
2272      public TestActionComponent() {
2273        super();
2274      }
2275
2276        /**
2277         * @return {@link #operation} (An operation would involve a REST request to a server.)
2278         */
2279        public SetupActionOperationComponent getOperation() { 
2280          if (this.operation == null)
2281            if (Configuration.errorOnAutoCreate())
2282              throw new Error("Attempt to auto-create TestActionComponent.operation");
2283            else if (Configuration.doAutoCreate())
2284              this.operation = new SetupActionOperationComponent(); // cc
2285          return this.operation;
2286        }
2287
2288        public boolean hasOperation() { 
2289          return this.operation != null && !this.operation.isEmpty();
2290        }
2291
2292        /**
2293         * @param value {@link #operation} (An operation would involve a REST request to a server.)
2294         */
2295        public TestActionComponent setOperation(SetupActionOperationComponent value) { 
2296          this.operation = value;
2297          return this;
2298        }
2299
2300        /**
2301         * @return {@link #assert_} (The results of the assertion performed on the previous operations.)
2302         */
2303        public SetupActionAssertComponent getAssert() { 
2304          if (this.assert_ == null)
2305            if (Configuration.errorOnAutoCreate())
2306              throw new Error("Attempt to auto-create TestActionComponent.assert_");
2307            else if (Configuration.doAutoCreate())
2308              this.assert_ = new SetupActionAssertComponent(); // cc
2309          return this.assert_;
2310        }
2311
2312        public boolean hasAssert() { 
2313          return this.assert_ != null && !this.assert_.isEmpty();
2314        }
2315
2316        /**
2317         * @param value {@link #assert_} (The results of the assertion performed on the previous operations.)
2318         */
2319        public TestActionComponent setAssert(SetupActionAssertComponent value) { 
2320          this.assert_ = value;
2321          return this;
2322        }
2323
2324        protected void listChildren(List<Property> children) {
2325          super.listChildren(children);
2326          children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
2327          children.add(new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_));
2328        }
2329
2330        @Override
2331        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2332          switch (_hash) {
2333          case 1662702951: /*operation*/  return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
2334          case -1408208058: /*assert*/  return new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_);
2335          default: return super.getNamedProperty(_hash, _name, _checkValid);
2336          }
2337
2338        }
2339
2340      @Override
2341      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2342        switch (hash) {
2343        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
2344        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
2345        default: return super.getProperty(hash, name, checkValid);
2346        }
2347
2348      }
2349
2350      @Override
2351      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2352        switch (hash) {
2353        case 1662702951: // operation
2354          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2355          return value;
2356        case -1408208058: // assert
2357          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
2358          return value;
2359        default: return super.setProperty(hash, name, value);
2360        }
2361
2362      }
2363
2364      @Override
2365      public Base setProperty(String name, Base value) throws FHIRException {
2366        if (name.equals("operation")) {
2367          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2368        } else if (name.equals("assert")) {
2369          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
2370        } else
2371          return super.setProperty(name, value);
2372        return value;
2373      }
2374
2375      @Override
2376      public Base makeProperty(int hash, String name) throws FHIRException {
2377        switch (hash) {
2378        case 1662702951:  return getOperation(); 
2379        case -1408208058:  return getAssert(); 
2380        default: return super.makeProperty(hash, name);
2381        }
2382
2383      }
2384
2385      @Override
2386      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2387        switch (hash) {
2388        case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"};
2389        case -1408208058: /*assert*/ return new String[] {"@TestReport.setup.action.assert"};
2390        default: return super.getTypesForProperty(hash, name);
2391        }
2392
2393      }
2394
2395      @Override
2396      public Base addChild(String name) throws FHIRException {
2397        if (name.equals("operation")) {
2398          this.operation = new SetupActionOperationComponent();
2399          return this.operation;
2400        }
2401        else if (name.equals("assert")) {
2402          this.assert_ = new SetupActionAssertComponent();
2403          return this.assert_;
2404        }
2405        else
2406          return super.addChild(name);
2407      }
2408
2409      public TestActionComponent copy() {
2410        TestActionComponent dst = new TestActionComponent();
2411        copyValues(dst);
2412        return dst;
2413      }
2414
2415      public void copyValues(TestActionComponent dst) {
2416        super.copyValues(dst);
2417        dst.operation = operation == null ? null : operation.copy();
2418        dst.assert_ = assert_ == null ? null : assert_.copy();
2419      }
2420
2421      @Override
2422      public boolean equalsDeep(Base other_) {
2423        if (!super.equalsDeep(other_))
2424          return false;
2425        if (!(other_ instanceof TestActionComponent))
2426          return false;
2427        TestActionComponent o = (TestActionComponent) other_;
2428        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
2429      }
2430
2431      @Override
2432      public boolean equalsShallow(Base other_) {
2433        if (!super.equalsShallow(other_))
2434          return false;
2435        if (!(other_ instanceof TestActionComponent))
2436          return false;
2437        TestActionComponent o = (TestActionComponent) other_;
2438        return true;
2439      }
2440
2441      public boolean isEmpty() {
2442        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
2443      }
2444
2445  public String fhirType() {
2446    return "TestReport.test.action";
2447
2448  }
2449
2450  }
2451
2452    @Block()
2453    public static class TestReportTeardownComponent extends BackboneElement implements IBaseBackboneElement {
2454        /**
2455         * The teardown action will only contain an operation.
2456         */
2457        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2458        @Description(shortDefinition="One or more teardown operations performed", formalDefinition="The teardown action will only contain an operation." )
2459        protected List<TeardownActionComponent> action;
2460
2461        private static final long serialVersionUID = 1168638089L;
2462
2463    /**
2464     * Constructor
2465     */
2466      public TestReportTeardownComponent() {
2467        super();
2468      }
2469
2470        /**
2471         * @return {@link #action} (The teardown action will only contain an operation.)
2472         */
2473        public List<TeardownActionComponent> getAction() { 
2474          if (this.action == null)
2475            this.action = new ArrayList<TeardownActionComponent>();
2476          return this.action;
2477        }
2478
2479        /**
2480         * @return Returns a reference to <code>this</code> for easy method chaining
2481         */
2482        public TestReportTeardownComponent setAction(List<TeardownActionComponent> theAction) { 
2483          this.action = theAction;
2484          return this;
2485        }
2486
2487        public boolean hasAction() { 
2488          if (this.action == null)
2489            return false;
2490          for (TeardownActionComponent item : this.action)
2491            if (!item.isEmpty())
2492              return true;
2493          return false;
2494        }
2495
2496        public TeardownActionComponent addAction() { //3
2497          TeardownActionComponent t = new TeardownActionComponent();
2498          if (this.action == null)
2499            this.action = new ArrayList<TeardownActionComponent>();
2500          this.action.add(t);
2501          return t;
2502        }
2503
2504        public TestReportTeardownComponent addAction(TeardownActionComponent t) { //3
2505          if (t == null)
2506            return this;
2507          if (this.action == null)
2508            this.action = new ArrayList<TeardownActionComponent>();
2509          this.action.add(t);
2510          return this;
2511        }
2512
2513        /**
2514         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
2515         */
2516        public TeardownActionComponent getActionFirstRep() { 
2517          if (getAction().isEmpty()) {
2518            addAction();
2519          }
2520          return getAction().get(0);
2521        }
2522
2523        protected void listChildren(List<Property> children) {
2524          super.listChildren(children);
2525          children.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action));
2526        }
2527
2528        @Override
2529        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2530          switch (_hash) {
2531          case -1422950858: /*action*/  return new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action);
2532          default: return super.getNamedProperty(_hash, _name, _checkValid);
2533          }
2534
2535        }
2536
2537      @Override
2538      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2539        switch (hash) {
2540        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent
2541        default: return super.getProperty(hash, name, checkValid);
2542        }
2543
2544      }
2545
2546      @Override
2547      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2548        switch (hash) {
2549        case -1422950858: // action
2550          this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent
2551          return value;
2552        default: return super.setProperty(hash, name, value);
2553        }
2554
2555      }
2556
2557      @Override
2558      public Base setProperty(String name, Base value) throws FHIRException {
2559        if (name.equals("action")) {
2560          this.getAction().add((TeardownActionComponent) value);
2561        } else
2562          return super.setProperty(name, value);
2563        return value;
2564      }
2565
2566      @Override
2567      public Base makeProperty(int hash, String name) throws FHIRException {
2568        switch (hash) {
2569        case -1422950858:  return addAction(); 
2570        default: return super.makeProperty(hash, name);
2571        }
2572
2573      }
2574
2575      @Override
2576      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2577        switch (hash) {
2578        case -1422950858: /*action*/ return new String[] {};
2579        default: return super.getTypesForProperty(hash, name);
2580        }
2581
2582      }
2583
2584      @Override
2585      public Base addChild(String name) throws FHIRException {
2586        if (name.equals("action")) {
2587          return addAction();
2588        }
2589        else
2590          return super.addChild(name);
2591      }
2592
2593      public TestReportTeardownComponent copy() {
2594        TestReportTeardownComponent dst = new TestReportTeardownComponent();
2595        copyValues(dst);
2596        return dst;
2597      }
2598
2599      public void copyValues(TestReportTeardownComponent dst) {
2600        super.copyValues(dst);
2601        if (action != null) {
2602          dst.action = new ArrayList<TeardownActionComponent>();
2603          for (TeardownActionComponent i : action)
2604            dst.action.add(i.copy());
2605        };
2606      }
2607
2608      @Override
2609      public boolean equalsDeep(Base other_) {
2610        if (!super.equalsDeep(other_))
2611          return false;
2612        if (!(other_ instanceof TestReportTeardownComponent))
2613          return false;
2614        TestReportTeardownComponent o = (TestReportTeardownComponent) other_;
2615        return compareDeep(action, o.action, true);
2616      }
2617
2618      @Override
2619      public boolean equalsShallow(Base other_) {
2620        if (!super.equalsShallow(other_))
2621          return false;
2622        if (!(other_ instanceof TestReportTeardownComponent))
2623          return false;
2624        TestReportTeardownComponent o = (TestReportTeardownComponent) other_;
2625        return true;
2626      }
2627
2628      public boolean isEmpty() {
2629        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
2630      }
2631
2632  public String fhirType() {
2633    return "TestReport.teardown";
2634
2635  }
2636
2637  }
2638
2639    @Block()
2640    public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement {
2641        /**
2642         * An operation would involve a REST request to a server.
2643         */
2644        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=1, max=1, modifier=false, summary=false)
2645        @Description(shortDefinition="The teardown operation performed", formalDefinition="An operation would involve a REST request to a server." )
2646        protected SetupActionOperationComponent operation;
2647
2648        private static final long serialVersionUID = -1099598054L;
2649
2650    /**
2651     * Constructor
2652     */
2653      public TeardownActionComponent() {
2654        super();
2655      }
2656
2657    /**
2658     * Constructor
2659     */
2660      public TeardownActionComponent(SetupActionOperationComponent operation) {
2661        super();
2662        this.operation = operation;
2663      }
2664
2665        /**
2666         * @return {@link #operation} (An operation would involve a REST request to a server.)
2667         */
2668        public SetupActionOperationComponent getOperation() { 
2669          if (this.operation == null)
2670            if (Configuration.errorOnAutoCreate())
2671              throw new Error("Attempt to auto-create TeardownActionComponent.operation");
2672            else if (Configuration.doAutoCreate())
2673              this.operation = new SetupActionOperationComponent(); // cc
2674          return this.operation;
2675        }
2676
2677        public boolean hasOperation() { 
2678          return this.operation != null && !this.operation.isEmpty();
2679        }
2680
2681        /**
2682         * @param value {@link #operation} (An operation would involve a REST request to a server.)
2683         */
2684        public TeardownActionComponent setOperation(SetupActionOperationComponent value) { 
2685          this.operation = value;
2686          return this;
2687        }
2688
2689        protected void listChildren(List<Property> children) {
2690          super.listChildren(children);
2691          children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
2692        }
2693
2694        @Override
2695        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2696          switch (_hash) {
2697          case 1662702951: /*operation*/  return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
2698          default: return super.getNamedProperty(_hash, _name, _checkValid);
2699          }
2700
2701        }
2702
2703      @Override
2704      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2705        switch (hash) {
2706        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
2707        default: return super.getProperty(hash, name, checkValid);
2708        }
2709
2710      }
2711
2712      @Override
2713      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2714        switch (hash) {
2715        case 1662702951: // operation
2716          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2717          return value;
2718        default: return super.setProperty(hash, name, value);
2719        }
2720
2721      }
2722
2723      @Override
2724      public Base setProperty(String name, Base value) throws FHIRException {
2725        if (name.equals("operation")) {
2726          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2727        } else
2728          return super.setProperty(name, value);
2729        return value;
2730      }
2731
2732      @Override
2733      public Base makeProperty(int hash, String name) throws FHIRException {
2734        switch (hash) {
2735        case 1662702951:  return getOperation(); 
2736        default: return super.makeProperty(hash, name);
2737        }
2738
2739      }
2740
2741      @Override
2742      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2743        switch (hash) {
2744        case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"};
2745        default: return super.getTypesForProperty(hash, name);
2746        }
2747
2748      }
2749
2750      @Override
2751      public Base addChild(String name) throws FHIRException {
2752        if (name.equals("operation")) {
2753          this.operation = new SetupActionOperationComponent();
2754          return this.operation;
2755        }
2756        else
2757          return super.addChild(name);
2758      }
2759
2760      public TeardownActionComponent copy() {
2761        TeardownActionComponent dst = new TeardownActionComponent();
2762        copyValues(dst);
2763        return dst;
2764      }
2765
2766      public void copyValues(TeardownActionComponent dst) {
2767        super.copyValues(dst);
2768        dst.operation = operation == null ? null : operation.copy();
2769      }
2770
2771      @Override
2772      public boolean equalsDeep(Base other_) {
2773        if (!super.equalsDeep(other_))
2774          return false;
2775        if (!(other_ instanceof TeardownActionComponent))
2776          return false;
2777        TeardownActionComponent o = (TeardownActionComponent) other_;
2778        return compareDeep(operation, o.operation, true);
2779      }
2780
2781      @Override
2782      public boolean equalsShallow(Base other_) {
2783        if (!super.equalsShallow(other_))
2784          return false;
2785        if (!(other_ instanceof TeardownActionComponent))
2786          return false;
2787        TeardownActionComponent o = (TeardownActionComponent) other_;
2788        return true;
2789      }
2790
2791      public boolean isEmpty() {
2792        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation);
2793      }
2794
2795  public String fhirType() {
2796    return "TestReport.teardown.action";
2797
2798  }
2799
2800  }
2801
2802    /**
2803     * Identifier for the TestScript assigned for external purposes outside the context of FHIR.
2804     */
2805    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
2806    @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestScript assigned for external purposes outside the context of FHIR." )
2807    protected Identifier identifier;
2808
2809    /**
2810     * A free text natural language name identifying the executed TestScript.
2811     */
2812    @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
2813    @Description(shortDefinition="Informal name of the executed TestScript", formalDefinition="A free text natural language name identifying the executed TestScript." )
2814    protected StringType name;
2815
2816    /**
2817     * The current state of this test report.
2818     */
2819    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
2820    @Description(shortDefinition="completed | in-progress | waiting | stopped | entered-in-error", formalDefinition="The current state of this test report." )
2821    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-status-codes")
2822    protected Enumeration<TestReportStatus> status;
2823
2824    /**
2825     * Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.
2826     */
2827    @Child(name = "testScript", type = {TestScript.class}, order=3, min=1, max=1, modifier=false, summary=true)
2828    @Description(shortDefinition="Reference to the  version-specific TestScript that was executed to produce this TestReport", formalDefinition="Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`." )
2829    protected Reference testScript;
2830
2831    /**
2832     * The actual object that is the target of the reference (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.)
2833     */
2834    protected TestScript testScriptTarget;
2835
2836    /**
2837     * The overall result from the execution of the TestScript.
2838     */
2839    @Child(name = "result", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
2840    @Description(shortDefinition="pass | fail | pending", formalDefinition="The overall result from the execution of the TestScript." )
2841    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-result-codes")
2842    protected Enumeration<TestReportResult> result;
2843
2844    /**
2845     * The final score (percentage of tests passed) resulting from the execution of the TestScript.
2846     */
2847    @Child(name = "score", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true)
2848    @Description(shortDefinition="The final score (percentage of tests passed) resulting from the execution of the TestScript", formalDefinition="The final score (percentage of tests passed) resulting from the execution of the TestScript." )
2849    protected DecimalType score;
2850
2851    /**
2852     * Name of the tester producing this report (Organization or individual).
2853     */
2854    @Child(name = "tester", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
2855    @Description(shortDefinition="Name of the tester producing this report (Organization or individual)", formalDefinition="Name of the tester producing this report (Organization or individual)." )
2856    protected StringType tester;
2857
2858    /**
2859     * When the TestScript was executed and this TestReport was generated.
2860     */
2861    @Child(name = "issued", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
2862    @Description(shortDefinition="When the TestScript was executed and this TestReport was generated", formalDefinition="When the TestScript was executed and this TestReport was generated." )
2863    protected DateTimeType issued;
2864
2865    /**
2866     * A participant in the test execution, either the execution engine, a client, or a server.
2867     */
2868    @Child(name = "participant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2869    @Description(shortDefinition="A participant in the test execution, either the execution engine, a client, or a server", formalDefinition="A participant in the test execution, either the execution engine, a client, or a server." )
2870    protected List<TestReportParticipantComponent> participant;
2871
2872    /**
2873     * The results of the series of required setup operations before the tests were executed.
2874     */
2875    @Child(name = "setup", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
2876    @Description(shortDefinition="The results of the series of required setup operations before the tests were executed", formalDefinition="The results of the series of required setup operations before the tests were executed." )
2877    protected TestReportSetupComponent setup;
2878
2879    /**
2880     * A test executed from the test script.
2881     */
2882    @Child(name = "test", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2883    @Description(shortDefinition="A test executed from the test script", formalDefinition="A test executed from the test script." )
2884    protected List<TestReportTestComponent> test;
2885
2886    /**
2887     * The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).
2888     */
2889    @Child(name = "teardown", type = {}, order=11, min=0, max=1, modifier=false, summary=false)
2890    @Description(shortDefinition="The results of running the series of required clean up steps", formalDefinition="The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise)." )
2891    protected TestReportTeardownComponent teardown;
2892
2893    private static final long serialVersionUID = 79474516L;
2894
2895  /**
2896   * Constructor
2897   */
2898    public TestReport() {
2899      super();
2900    }
2901
2902  /**
2903   * Constructor
2904   */
2905    public TestReport(Enumeration<TestReportStatus> status, Reference testScript, Enumeration<TestReportResult> result) {
2906      super();
2907      this.status = status;
2908      this.testScript = testScript;
2909      this.result = result;
2910    }
2911
2912    /**
2913     * @return {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.)
2914     */
2915    public Identifier getIdentifier() { 
2916      if (this.identifier == null)
2917        if (Configuration.errorOnAutoCreate())
2918          throw new Error("Attempt to auto-create TestReport.identifier");
2919        else if (Configuration.doAutoCreate())
2920          this.identifier = new Identifier(); // cc
2921      return this.identifier;
2922    }
2923
2924    public boolean hasIdentifier() { 
2925      return this.identifier != null && !this.identifier.isEmpty();
2926    }
2927
2928    /**
2929     * @param value {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.)
2930     */
2931    public TestReport setIdentifier(Identifier value) { 
2932      this.identifier = value;
2933      return this;
2934    }
2935
2936    /**
2937     * @return {@link #name} (A free text natural language name identifying the executed TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2938     */
2939    public StringType getNameElement() { 
2940      if (this.name == null)
2941        if (Configuration.errorOnAutoCreate())
2942          throw new Error("Attempt to auto-create TestReport.name");
2943        else if (Configuration.doAutoCreate())
2944          this.name = new StringType(); // bb
2945      return this.name;
2946    }
2947
2948    public boolean hasNameElement() { 
2949      return this.name != null && !this.name.isEmpty();
2950    }
2951
2952    public boolean hasName() { 
2953      return this.name != null && !this.name.isEmpty();
2954    }
2955
2956    /**
2957     * @param value {@link #name} (A free text natural language name identifying the executed TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2958     */
2959    public TestReport setNameElement(StringType value) { 
2960      this.name = value;
2961      return this;
2962    }
2963
2964    /**
2965     * @return A free text natural language name identifying the executed TestScript.
2966     */
2967    public String getName() { 
2968      return this.name == null ? null : this.name.getValue();
2969    }
2970
2971    /**
2972     * @param value A free text natural language name identifying the executed TestScript.
2973     */
2974    public TestReport setName(String value) { 
2975      if (Utilities.noString(value))
2976        this.name = null;
2977      else {
2978        if (this.name == null)
2979          this.name = new StringType();
2980        this.name.setValue(value);
2981      }
2982      return this;
2983    }
2984
2985    /**
2986     * @return {@link #status} (The current state of this test report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
2987     */
2988    public Enumeration<TestReportStatus> getStatusElement() { 
2989      if (this.status == null)
2990        if (Configuration.errorOnAutoCreate())
2991          throw new Error("Attempt to auto-create TestReport.status");
2992        else if (Configuration.doAutoCreate())
2993          this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory()); // bb
2994      return this.status;
2995    }
2996
2997    public boolean hasStatusElement() { 
2998      return this.status != null && !this.status.isEmpty();
2999    }
3000
3001    public boolean hasStatus() { 
3002      return this.status != null && !this.status.isEmpty();
3003    }
3004
3005    /**
3006     * @param value {@link #status} (The current state of this test report.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
3007     */
3008    public TestReport setStatusElement(Enumeration<TestReportStatus> value) { 
3009      this.status = value;
3010      return this;
3011    }
3012
3013    /**
3014     * @return The current state of this test report.
3015     */
3016    public TestReportStatus getStatus() { 
3017      return this.status == null ? null : this.status.getValue();
3018    }
3019
3020    /**
3021     * @param value The current state of this test report.
3022     */
3023    public TestReport setStatus(TestReportStatus value) { 
3024        if (this.status == null)
3025          this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory());
3026        this.status.setValue(value);
3027      return this;
3028    }
3029
3030    /**
3031     * @return {@link #testScript} (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.)
3032     */
3033    public Reference getTestScript() { 
3034      if (this.testScript == null)
3035        if (Configuration.errorOnAutoCreate())
3036          throw new Error("Attempt to auto-create TestReport.testScript");
3037        else if (Configuration.doAutoCreate())
3038          this.testScript = new Reference(); // cc
3039      return this.testScript;
3040    }
3041
3042    public boolean hasTestScript() { 
3043      return this.testScript != null && !this.testScript.isEmpty();
3044    }
3045
3046    /**
3047     * @param value {@link #testScript} (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.)
3048     */
3049    public TestReport setTestScript(Reference value) { 
3050      this.testScript = value;
3051      return this;
3052    }
3053
3054    /**
3055     * @return {@link #testScript} 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. (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.)
3056     */
3057    public TestScript getTestScriptTarget() { 
3058      if (this.testScriptTarget == null)
3059        if (Configuration.errorOnAutoCreate())
3060          throw new Error("Attempt to auto-create TestReport.testScript");
3061        else if (Configuration.doAutoCreate())
3062          this.testScriptTarget = new TestScript(); // aa
3063      return this.testScriptTarget;
3064    }
3065
3066    /**
3067     * @param value {@link #testScript} 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. (Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.)
3068     */
3069    public TestReport setTestScriptTarget(TestScript value) { 
3070      this.testScriptTarget = value;
3071      return this;
3072    }
3073
3074    /**
3075     * @return {@link #result} (The overall result from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
3076     */
3077    public Enumeration<TestReportResult> getResultElement() { 
3078      if (this.result == null)
3079        if (Configuration.errorOnAutoCreate())
3080          throw new Error("Attempt to auto-create TestReport.result");
3081        else if (Configuration.doAutoCreate())
3082          this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory()); // bb
3083      return this.result;
3084    }
3085
3086    public boolean hasResultElement() { 
3087      return this.result != null && !this.result.isEmpty();
3088    }
3089
3090    public boolean hasResult() { 
3091      return this.result != null && !this.result.isEmpty();
3092    }
3093
3094    /**
3095     * @param value {@link #result} (The overall result from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getResult" gives direct access to the value
3096     */
3097    public TestReport setResultElement(Enumeration<TestReportResult> value) { 
3098      this.result = value;
3099      return this;
3100    }
3101
3102    /**
3103     * @return The overall result from the execution of the TestScript.
3104     */
3105    public TestReportResult getResult() { 
3106      return this.result == null ? null : this.result.getValue();
3107    }
3108
3109    /**
3110     * @param value The overall result from the execution of the TestScript.
3111     */
3112    public TestReport setResult(TestReportResult value) { 
3113        if (this.result == null)
3114          this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory());
3115        this.result.setValue(value);
3116      return this;
3117    }
3118
3119    /**
3120     * @return {@link #score} (The final score (percentage of tests passed) resulting from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value
3121     */
3122    public DecimalType getScoreElement() { 
3123      if (this.score == null)
3124        if (Configuration.errorOnAutoCreate())
3125          throw new Error("Attempt to auto-create TestReport.score");
3126        else if (Configuration.doAutoCreate())
3127          this.score = new DecimalType(); // bb
3128      return this.score;
3129    }
3130
3131    public boolean hasScoreElement() { 
3132      return this.score != null && !this.score.isEmpty();
3133    }
3134
3135    public boolean hasScore() { 
3136      return this.score != null && !this.score.isEmpty();
3137    }
3138
3139    /**
3140     * @param value {@link #score} (The final score (percentage of tests passed) resulting from the execution of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value
3141     */
3142    public TestReport setScoreElement(DecimalType value) { 
3143      this.score = value;
3144      return this;
3145    }
3146
3147    /**
3148     * @return The final score (percentage of tests passed) resulting from the execution of the TestScript.
3149     */
3150    public BigDecimal getScore() { 
3151      return this.score == null ? null : this.score.getValue();
3152    }
3153
3154    /**
3155     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3156     */
3157    public TestReport setScore(BigDecimal value) { 
3158      if (value == null)
3159        this.score = null;
3160      else {
3161        if (this.score == null)
3162          this.score = new DecimalType();
3163        this.score.setValue(value);
3164      }
3165      return this;
3166    }
3167
3168    /**
3169     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3170     */
3171    public TestReport setScore(long value) { 
3172          this.score = new DecimalType();
3173        this.score.setValue(value);
3174      return this;
3175    }
3176
3177    /**
3178     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3179     */
3180    public TestReport setScore(double value) { 
3181          this.score = new DecimalType();
3182        this.score.setValue(value);
3183      return this;
3184    }
3185
3186    /**
3187     * @return {@link #tester} (Name of the tester producing this report (Organization or individual).). This is the underlying object with id, value and extensions. The accessor "getTester" gives direct access to the value
3188     */
3189    public StringType getTesterElement() { 
3190      if (this.tester == null)
3191        if (Configuration.errorOnAutoCreate())
3192          throw new Error("Attempt to auto-create TestReport.tester");
3193        else if (Configuration.doAutoCreate())
3194          this.tester = new StringType(); // bb
3195      return this.tester;
3196    }
3197
3198    public boolean hasTesterElement() { 
3199      return this.tester != null && !this.tester.isEmpty();
3200    }
3201
3202    public boolean hasTester() { 
3203      return this.tester != null && !this.tester.isEmpty();
3204    }
3205
3206    /**
3207     * @param value {@link #tester} (Name of the tester producing this report (Organization or individual).). This is the underlying object with id, value and extensions. The accessor "getTester" gives direct access to the value
3208     */
3209    public TestReport setTesterElement(StringType value) { 
3210      this.tester = value;
3211      return this;
3212    }
3213
3214    /**
3215     * @return Name of the tester producing this report (Organization or individual).
3216     */
3217    public String getTester() { 
3218      return this.tester == null ? null : this.tester.getValue();
3219    }
3220
3221    /**
3222     * @param value Name of the tester producing this report (Organization or individual).
3223     */
3224    public TestReport setTester(String value) { 
3225      if (Utilities.noString(value))
3226        this.tester = null;
3227      else {
3228        if (this.tester == null)
3229          this.tester = new StringType();
3230        this.tester.setValue(value);
3231      }
3232      return this;
3233    }
3234
3235    /**
3236     * @return {@link #issued} (When the TestScript was executed and this TestReport was generated.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
3237     */
3238    public DateTimeType getIssuedElement() { 
3239      if (this.issued == null)
3240        if (Configuration.errorOnAutoCreate())
3241          throw new Error("Attempt to auto-create TestReport.issued");
3242        else if (Configuration.doAutoCreate())
3243          this.issued = new DateTimeType(); // bb
3244      return this.issued;
3245    }
3246
3247    public boolean hasIssuedElement() { 
3248      return this.issued != null && !this.issued.isEmpty();
3249    }
3250
3251    public boolean hasIssued() { 
3252      return this.issued != null && !this.issued.isEmpty();
3253    }
3254
3255    /**
3256     * @param value {@link #issued} (When the TestScript was executed and this TestReport was generated.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value
3257     */
3258    public TestReport setIssuedElement(DateTimeType value) { 
3259      this.issued = value;
3260      return this;
3261    }
3262
3263    /**
3264     * @return When the TestScript was executed and this TestReport was generated.
3265     */
3266    public Date getIssued() { 
3267      return this.issued == null ? null : this.issued.getValue();
3268    }
3269
3270    /**
3271     * @param value When the TestScript was executed and this TestReport was generated.
3272     */
3273    public TestReport setIssued(Date value) { 
3274      if (value == null)
3275        this.issued = null;
3276      else {
3277        if (this.issued == null)
3278          this.issued = new DateTimeType();
3279        this.issued.setValue(value);
3280      }
3281      return this;
3282    }
3283
3284    /**
3285     * @return {@link #participant} (A participant in the test execution, either the execution engine, a client, or a server.)
3286     */
3287    public List<TestReportParticipantComponent> getParticipant() { 
3288      if (this.participant == null)
3289        this.participant = new ArrayList<TestReportParticipantComponent>();
3290      return this.participant;
3291    }
3292
3293    /**
3294     * @return Returns a reference to <code>this</code> for easy method chaining
3295     */
3296    public TestReport setParticipant(List<TestReportParticipantComponent> theParticipant) { 
3297      this.participant = theParticipant;
3298      return this;
3299    }
3300
3301    public boolean hasParticipant() { 
3302      if (this.participant == null)
3303        return false;
3304      for (TestReportParticipantComponent item : this.participant)
3305        if (!item.isEmpty())
3306          return true;
3307      return false;
3308    }
3309
3310    public TestReportParticipantComponent addParticipant() { //3
3311      TestReportParticipantComponent t = new TestReportParticipantComponent();
3312      if (this.participant == null)
3313        this.participant = new ArrayList<TestReportParticipantComponent>();
3314      this.participant.add(t);
3315      return t;
3316    }
3317
3318    public TestReport addParticipant(TestReportParticipantComponent t) { //3
3319      if (t == null)
3320        return this;
3321      if (this.participant == null)
3322        this.participant = new ArrayList<TestReportParticipantComponent>();
3323      this.participant.add(t);
3324      return this;
3325    }
3326
3327    /**
3328     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist
3329     */
3330    public TestReportParticipantComponent getParticipantFirstRep() { 
3331      if (getParticipant().isEmpty()) {
3332        addParticipant();
3333      }
3334      return getParticipant().get(0);
3335    }
3336
3337    /**
3338     * @return {@link #setup} (The results of the series of required setup operations before the tests were executed.)
3339     */
3340    public TestReportSetupComponent getSetup() { 
3341      if (this.setup == null)
3342        if (Configuration.errorOnAutoCreate())
3343          throw new Error("Attempt to auto-create TestReport.setup");
3344        else if (Configuration.doAutoCreate())
3345          this.setup = new TestReportSetupComponent(); // cc
3346      return this.setup;
3347    }
3348
3349    public boolean hasSetup() { 
3350      return this.setup != null && !this.setup.isEmpty();
3351    }
3352
3353    /**
3354     * @param value {@link #setup} (The results of the series of required setup operations before the tests were executed.)
3355     */
3356    public TestReport setSetup(TestReportSetupComponent value) { 
3357      this.setup = value;
3358      return this;
3359    }
3360
3361    /**
3362     * @return {@link #test} (A test executed from the test script.)
3363     */
3364    public List<TestReportTestComponent> getTest() { 
3365      if (this.test == null)
3366        this.test = new ArrayList<TestReportTestComponent>();
3367      return this.test;
3368    }
3369
3370    /**
3371     * @return Returns a reference to <code>this</code> for easy method chaining
3372     */
3373    public TestReport setTest(List<TestReportTestComponent> theTest) { 
3374      this.test = theTest;
3375      return this;
3376    }
3377
3378    public boolean hasTest() { 
3379      if (this.test == null)
3380        return false;
3381      for (TestReportTestComponent item : this.test)
3382        if (!item.isEmpty())
3383          return true;
3384      return false;
3385    }
3386
3387    public TestReportTestComponent addTest() { //3
3388      TestReportTestComponent t = new TestReportTestComponent();
3389      if (this.test == null)
3390        this.test = new ArrayList<TestReportTestComponent>();
3391      this.test.add(t);
3392      return t;
3393    }
3394
3395    public TestReport addTest(TestReportTestComponent t) { //3
3396      if (t == null)
3397        return this;
3398      if (this.test == null)
3399        this.test = new ArrayList<TestReportTestComponent>();
3400      this.test.add(t);
3401      return this;
3402    }
3403
3404    /**
3405     * @return The first repetition of repeating field {@link #test}, creating it if it does not already exist
3406     */
3407    public TestReportTestComponent getTestFirstRep() { 
3408      if (getTest().isEmpty()) {
3409        addTest();
3410      }
3411      return getTest().get(0);
3412    }
3413
3414    /**
3415     * @return {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).)
3416     */
3417    public TestReportTeardownComponent getTeardown() { 
3418      if (this.teardown == null)
3419        if (Configuration.errorOnAutoCreate())
3420          throw new Error("Attempt to auto-create TestReport.teardown");
3421        else if (Configuration.doAutoCreate())
3422          this.teardown = new TestReportTeardownComponent(); // cc
3423      return this.teardown;
3424    }
3425
3426    public boolean hasTeardown() { 
3427      return this.teardown != null && !this.teardown.isEmpty();
3428    }
3429
3430    /**
3431     * @param value {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).)
3432     */
3433    public TestReport setTeardown(TestReportTeardownComponent value) { 
3434      this.teardown = value;
3435      return this;
3436    }
3437
3438      protected void listChildren(List<Property> children) {
3439        super.listChildren(children);
3440        children.add(new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, 1, identifier));
3441        children.add(new Property("name", "string", "A free text natural language name identifying the executed TestScript.", 0, 1, name));
3442        children.add(new Property("status", "code", "The current state of this test report.", 0, 1, status));
3443        children.add(new Property("testScript", "Reference(TestScript)", "Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.", 0, 1, testScript));
3444        children.add(new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result));
3445        children.add(new Property("score", "decimal", "The final score (percentage of tests passed) resulting from the execution of the TestScript.", 0, 1, score));
3446        children.add(new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester));
3447        children.add(new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued));
3448        children.add(new Property("participant", "", "A participant in the test execution, either the execution engine, a client, or a server.", 0, java.lang.Integer.MAX_VALUE, participant));
3449        children.add(new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup));
3450        children.add(new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test));
3451        children.add(new Property("teardown", "", "The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).", 0, 1, teardown));
3452      }
3453
3454      @Override
3455      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3456        switch (_hash) {
3457        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, 1, identifier);
3458        case 3373707: /*name*/  return new Property("name", "string", "A free text natural language name identifying the executed TestScript.", 0, 1, name);
3459        case -892481550: /*status*/  return new Property("status", "code", "The current state of this test report.", 0, 1, status);
3460        case 1712049149: /*testScript*/  return new Property("testScript", "Reference(TestScript)", "Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.", 0, 1, testScript);
3461        case -934426595: /*result*/  return new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result);
3462        case 109264530: /*score*/  return new Property("score", "decimal", "The final score (percentage of tests passed) resulting from the execution of the TestScript.", 0, 1, score);
3463        case -877169473: /*tester*/  return new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester);
3464        case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued);
3465        case 767422259: /*participant*/  return new Property("participant", "", "A participant in the test execution, either the execution engine, a client, or a server.", 0, java.lang.Integer.MAX_VALUE, participant);
3466        case 109329021: /*setup*/  return new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup);
3467        case 3556498: /*test*/  return new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test);
3468        case -1663474172: /*teardown*/  return new Property("teardown", "", "The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).", 0, 1, teardown);
3469        default: return super.getNamedProperty(_hash, _name, _checkValid);
3470        }
3471
3472      }
3473
3474      @Override
3475      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3476        switch (hash) {
3477        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
3478        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3479        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<TestReportStatus>
3480        case 1712049149: /*testScript*/ return this.testScript == null ? new Base[0] : new Base[] {this.testScript}; // Reference
3481        case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportResult>
3482        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType
3483        case -877169473: /*tester*/ return this.tester == null ? new Base[0] : new Base[] {this.tester}; // StringType
3484        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
3485        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // TestReportParticipantComponent
3486        case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestReportSetupComponent
3487        case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestReportTestComponent
3488        case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestReportTeardownComponent
3489        default: return super.getProperty(hash, name, checkValid);
3490        }
3491
3492      }
3493
3494      @Override
3495      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3496        switch (hash) {
3497        case -1618432855: // identifier
3498          this.identifier = castToIdentifier(value); // Identifier
3499          return value;
3500        case 3373707: // name
3501          this.name = castToString(value); // StringType
3502          return value;
3503        case -892481550: // status
3504          value = new TestReportStatusEnumFactory().fromType(castToCode(value));
3505          this.status = (Enumeration) value; // Enumeration<TestReportStatus>
3506          return value;
3507        case 1712049149: // testScript
3508          this.testScript = castToReference(value); // Reference
3509          return value;
3510        case -934426595: // result
3511          value = new TestReportResultEnumFactory().fromType(castToCode(value));
3512          this.result = (Enumeration) value; // Enumeration<TestReportResult>
3513          return value;
3514        case 109264530: // score
3515          this.score = castToDecimal(value); // DecimalType
3516          return value;
3517        case -877169473: // tester
3518          this.tester = castToString(value); // StringType
3519          return value;
3520        case -1179159893: // issued
3521          this.issued = castToDateTime(value); // DateTimeType
3522          return value;
3523        case 767422259: // participant
3524          this.getParticipant().add((TestReportParticipantComponent) value); // TestReportParticipantComponent
3525          return value;
3526        case 109329021: // setup
3527          this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent
3528          return value;
3529        case 3556498: // test
3530          this.getTest().add((TestReportTestComponent) value); // TestReportTestComponent
3531          return value;
3532        case -1663474172: // teardown
3533          this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent
3534          return value;
3535        default: return super.setProperty(hash, name, value);
3536        }
3537
3538      }
3539
3540      @Override
3541      public Base setProperty(String name, Base value) throws FHIRException {
3542        if (name.equals("identifier")) {
3543          this.identifier = castToIdentifier(value); // Identifier
3544        } else if (name.equals("name")) {
3545          this.name = castToString(value); // StringType
3546        } else if (name.equals("status")) {
3547          value = new TestReportStatusEnumFactory().fromType(castToCode(value));
3548          this.status = (Enumeration) value; // Enumeration<TestReportStatus>
3549        } else if (name.equals("testScript")) {
3550          this.testScript = castToReference(value); // Reference
3551        } else if (name.equals("result")) {
3552          value = new TestReportResultEnumFactory().fromType(castToCode(value));
3553          this.result = (Enumeration) value; // Enumeration<TestReportResult>
3554        } else if (name.equals("score")) {
3555          this.score = castToDecimal(value); // DecimalType
3556        } else if (name.equals("tester")) {
3557          this.tester = castToString(value); // StringType
3558        } else if (name.equals("issued")) {
3559          this.issued = castToDateTime(value); // DateTimeType
3560        } else if (name.equals("participant")) {
3561          this.getParticipant().add((TestReportParticipantComponent) value);
3562        } else if (name.equals("setup")) {
3563          this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent
3564        } else if (name.equals("test")) {
3565          this.getTest().add((TestReportTestComponent) value);
3566        } else if (name.equals("teardown")) {
3567          this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent
3568        } else
3569          return super.setProperty(name, value);
3570        return value;
3571      }
3572
3573      @Override
3574      public Base makeProperty(int hash, String name) throws FHIRException {
3575        switch (hash) {
3576        case -1618432855:  return getIdentifier(); 
3577        case 3373707:  return getNameElement();
3578        case -892481550:  return getStatusElement();
3579        case 1712049149:  return getTestScript(); 
3580        case -934426595:  return getResultElement();
3581        case 109264530:  return getScoreElement();
3582        case -877169473:  return getTesterElement();
3583        case -1179159893:  return getIssuedElement();
3584        case 767422259:  return addParticipant(); 
3585        case 109329021:  return getSetup(); 
3586        case 3556498:  return addTest(); 
3587        case -1663474172:  return getTeardown(); 
3588        default: return super.makeProperty(hash, name);
3589        }
3590
3591      }
3592
3593      @Override
3594      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3595        switch (hash) {
3596        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3597        case 3373707: /*name*/ return new String[] {"string"};
3598        case -892481550: /*status*/ return new String[] {"code"};
3599        case 1712049149: /*testScript*/ return new String[] {"Reference"};
3600        case -934426595: /*result*/ return new String[] {"code"};
3601        case 109264530: /*score*/ return new String[] {"decimal"};
3602        case -877169473: /*tester*/ return new String[] {"string"};
3603        case -1179159893: /*issued*/ return new String[] {"dateTime"};
3604        case 767422259: /*participant*/ return new String[] {};
3605        case 109329021: /*setup*/ return new String[] {};
3606        case 3556498: /*test*/ return new String[] {};
3607        case -1663474172: /*teardown*/ return new String[] {};
3608        default: return super.getTypesForProperty(hash, name);
3609        }
3610
3611      }
3612
3613      @Override
3614      public Base addChild(String name) throws FHIRException {
3615        if (name.equals("identifier")) {
3616          this.identifier = new Identifier();
3617          return this.identifier;
3618        }
3619        else if (name.equals("name")) {
3620          throw new FHIRException("Cannot call addChild on a primitive type TestReport.name");
3621        }
3622        else if (name.equals("status")) {
3623          throw new FHIRException("Cannot call addChild on a primitive type TestReport.status");
3624        }
3625        else if (name.equals("testScript")) {
3626          this.testScript = new Reference();
3627          return this.testScript;
3628        }
3629        else if (name.equals("result")) {
3630          throw new FHIRException("Cannot call addChild on a primitive type TestReport.result");
3631        }
3632        else if (name.equals("score")) {
3633          throw new FHIRException("Cannot call addChild on a primitive type TestReport.score");
3634        }
3635        else if (name.equals("tester")) {
3636          throw new FHIRException("Cannot call addChild on a primitive type TestReport.tester");
3637        }
3638        else if (name.equals("issued")) {
3639          throw new FHIRException("Cannot call addChild on a primitive type TestReport.issued");
3640        }
3641        else if (name.equals("participant")) {
3642          return addParticipant();
3643        }
3644        else if (name.equals("setup")) {
3645          this.setup = new TestReportSetupComponent();
3646          return this.setup;
3647        }
3648        else if (name.equals("test")) {
3649          return addTest();
3650        }
3651        else if (name.equals("teardown")) {
3652          this.teardown = new TestReportTeardownComponent();
3653          return this.teardown;
3654        }
3655        else
3656          return super.addChild(name);
3657      }
3658
3659  public String fhirType() {
3660    return "TestReport";
3661
3662  }
3663
3664      public TestReport copy() {
3665        TestReport dst = new TestReport();
3666        copyValues(dst);
3667        return dst;
3668      }
3669
3670      public void copyValues(TestReport dst) {
3671        super.copyValues(dst);
3672        dst.identifier = identifier == null ? null : identifier.copy();
3673        dst.name = name == null ? null : name.copy();
3674        dst.status = status == null ? null : status.copy();
3675        dst.testScript = testScript == null ? null : testScript.copy();
3676        dst.result = result == null ? null : result.copy();
3677        dst.score = score == null ? null : score.copy();
3678        dst.tester = tester == null ? null : tester.copy();
3679        dst.issued = issued == null ? null : issued.copy();
3680        if (participant != null) {
3681          dst.participant = new ArrayList<TestReportParticipantComponent>();
3682          for (TestReportParticipantComponent i : participant)
3683            dst.participant.add(i.copy());
3684        };
3685        dst.setup = setup == null ? null : setup.copy();
3686        if (test != null) {
3687          dst.test = new ArrayList<TestReportTestComponent>();
3688          for (TestReportTestComponent i : test)
3689            dst.test.add(i.copy());
3690        };
3691        dst.teardown = teardown == null ? null : teardown.copy();
3692      }
3693
3694      protected TestReport typedCopy() {
3695        return copy();
3696      }
3697
3698      @Override
3699      public boolean equalsDeep(Base other_) {
3700        if (!super.equalsDeep(other_))
3701          return false;
3702        if (!(other_ instanceof TestReport))
3703          return false;
3704        TestReport o = (TestReport) other_;
3705        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true)
3706           && compareDeep(testScript, o.testScript, true) && compareDeep(result, o.result, true) && compareDeep(score, o.score, true)
3707           && compareDeep(tester, o.tester, true) && compareDeep(issued, o.issued, true) && compareDeep(participant, o.participant, true)
3708           && compareDeep(setup, o.setup, true) && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true)
3709          ;
3710      }
3711
3712      @Override
3713      public boolean equalsShallow(Base other_) {
3714        if (!super.equalsShallow(other_))
3715          return false;
3716        if (!(other_ instanceof TestReport))
3717          return false;
3718        TestReport o = (TestReport) other_;
3719        return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(result, o.result, true)
3720           && compareValues(score, o.score, true) && compareValues(tester, o.tester, true) && compareValues(issued, o.issued, true)
3721          ;
3722      }
3723
3724      public boolean isEmpty() {
3725        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, status
3726          , testScript, result, score, tester, issued, participant, setup, test, teardown
3727          );
3728      }
3729
3730  @Override
3731  public ResourceType getResourceType() {
3732    return ResourceType.TestReport;
3733   }
3734
3735 /**
3736   * Search parameter: <b>result</b>
3737   * <p>
3738   * Description: <b>The result disposition of the test execution</b><br>
3739   * Type: <b>token</b><br>
3740   * Path: <b>TestReport.result</b><br>
3741   * </p>
3742   */
3743  @SearchParamDefinition(name="result", path="TestReport.result", description="The result disposition of the test execution", type="token" )
3744  public static final String SP_RESULT = "result";
3745 /**
3746   * <b>Fluent Client</b> search parameter constant for <b>result</b>
3747   * <p>
3748   * Description: <b>The result disposition of the test execution</b><br>
3749   * Type: <b>token</b><br>
3750   * Path: <b>TestReport.result</b><br>
3751   * </p>
3752   */
3753  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESULT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESULT);
3754
3755 /**
3756   * Search parameter: <b>identifier</b>
3757   * <p>
3758   * Description: <b>An external identifier for the test report</b><br>
3759   * Type: <b>token</b><br>
3760   * Path: <b>TestReport.identifier</b><br>
3761   * </p>
3762   */
3763  @SearchParamDefinition(name="identifier", path="TestReport.identifier", description="An external identifier for the test report", type="token" )
3764  public static final String SP_IDENTIFIER = "identifier";
3765 /**
3766   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
3767   * <p>
3768   * Description: <b>An external identifier for the test report</b><br>
3769   * Type: <b>token</b><br>
3770   * Path: <b>TestReport.identifier</b><br>
3771   * </p>
3772   */
3773  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
3774
3775 /**
3776   * Search parameter: <b>tester</b>
3777   * <p>
3778   * Description: <b>The name of the testing organization</b><br>
3779   * Type: <b>string</b><br>
3780   * Path: <b>TestReport.tester</b><br>
3781   * </p>
3782   */
3783  @SearchParamDefinition(name="tester", path="TestReport.tester", description="The name of the testing organization", type="string" )
3784  public static final String SP_TESTER = "tester";
3785 /**
3786   * <b>Fluent Client</b> search parameter constant for <b>tester</b>
3787   * <p>
3788   * Description: <b>The name of the testing organization</b><br>
3789   * Type: <b>string</b><br>
3790   * Path: <b>TestReport.tester</b><br>
3791   * </p>
3792   */
3793  public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTER);
3794
3795 /**
3796   * Search parameter: <b>testscript</b>
3797   * <p>
3798   * Description: <b>The test script executed to produce this report</b><br>
3799   * Type: <b>reference</b><br>
3800   * Path: <b>TestReport.testScript</b><br>
3801   * </p>
3802   */
3803  @SearchParamDefinition(name="testscript", path="TestReport.testScript", description="The test script executed to produce this report", type="reference", target={TestScript.class } )
3804  public static final String SP_TESTSCRIPT = "testscript";
3805 /**
3806   * <b>Fluent Client</b> search parameter constant for <b>testscript</b>
3807   * <p>
3808   * Description: <b>The test script executed to produce this report</b><br>
3809   * Type: <b>reference</b><br>
3810   * Path: <b>TestReport.testScript</b><br>
3811   * </p>
3812   */
3813  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TESTSCRIPT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TESTSCRIPT);
3814
3815/**
3816   * Constant for fluent queries to be used to add include statements. Specifies
3817   * the path value of "<b>TestReport:testscript</b>".
3818   */
3819  public static final ca.uhn.fhir.model.api.Include INCLUDE_TESTSCRIPT = new ca.uhn.fhir.model.api.Include("TestReport:testscript").toLocked();
3820
3821 /**
3822   * Search parameter: <b>issued</b>
3823   * <p>
3824   * Description: <b>The test report generation date</b><br>
3825   * Type: <b>date</b><br>
3826   * Path: <b>TestReport.issued</b><br>
3827   * </p>
3828   */
3829  @SearchParamDefinition(name="issued", path="TestReport.issued", description="The test report generation date", type="date" )
3830  public static final String SP_ISSUED = "issued";
3831 /**
3832   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
3833   * <p>
3834   * Description: <b>The test report generation date</b><br>
3835   * Type: <b>date</b><br>
3836   * Path: <b>TestReport.issued</b><br>
3837   * </p>
3838   */
3839  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
3840
3841 /**
3842   * Search parameter: <b>participant</b>
3843   * <p>
3844   * Description: <b>The reference to a participant in the test execution</b><br>
3845   * Type: <b>uri</b><br>
3846   * Path: <b>TestReport.participant.uri</b><br>
3847   * </p>
3848   */
3849  @SearchParamDefinition(name="participant", path="TestReport.participant.uri", description="The reference to a participant in the test execution", type="uri" )
3850  public static final String SP_PARTICIPANT = "participant";
3851 /**
3852   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
3853   * <p>
3854   * Description: <b>The reference to a participant in the test execution</b><br>
3855   * Type: <b>uri</b><br>
3856   * Path: <b>TestReport.participant.uri</b><br>
3857   * </p>
3858   */
3859  public static final ca.uhn.fhir.rest.gclient.UriClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_PARTICIPANT);
3860
3861
3862}