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