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