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