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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
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(PrimitiveType<?> code) throws FHIRException {
164          if (code == null)
165            return null;
166          if (code.isEmpty())
167            return new Enumeration<TestReportActionResult>(this, TestReportActionResult.NULL, code);
168          String codeString = ((PrimitiveType) code).asStringValue();
169          if (codeString == null || "".equals(codeString))
170            return new Enumeration<TestReportActionResult>(this, TestReportActionResult.NULL, code);
171        if ("pass".equals(codeString))
172          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.PASS, code);
173        if ("skip".equals(codeString))
174          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.SKIP, code);
175        if ("fail".equals(codeString))
176          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.FAIL, code);
177        if ("warning".equals(codeString))
178          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.WARNING, code);
179        if ("error".equals(codeString))
180          return new Enumeration<TestReportActionResult>(this, TestReportActionResult.ERROR, code);
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(PrimitiveType<?> code) throws FHIRException {
284          if (code == null)
285            return null;
286          if (code.isEmpty())
287            return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.NULL, code);
288          String codeString = ((PrimitiveType) code).asStringValue();
289          if (codeString == null || "".equals(codeString))
290            return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.NULL, code);
291        if ("test-engine".equals(codeString))
292          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.TESTENGINE, code);
293        if ("client".equals(codeString))
294          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.CLIENT, code);
295        if ("server".equals(codeString))
296          return new Enumeration<TestReportParticipantType>(this, TestReportParticipantType.SERVER, code);
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(PrimitiveType<?> code) throws FHIRException {
396          if (code == null)
397            return null;
398          if (code.isEmpty())
399            return new Enumeration<TestReportResult>(this, TestReportResult.NULL, code);
400          String codeString = ((PrimitiveType) code).asStringValue();
401          if (codeString == null || "".equals(codeString))
402            return new Enumeration<TestReportResult>(this, TestReportResult.NULL, code);
403        if ("pass".equals(codeString))
404          return new Enumeration<TestReportResult>(this, TestReportResult.PASS, code);
405        if ("fail".equals(codeString))
406          return new Enumeration<TestReportResult>(this, TestReportResult.FAIL, code);
407        if ("pending".equals(codeString))
408          return new Enumeration<TestReportResult>(this, TestReportResult.PENDING, code);
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(PrimitiveType<?> code) throws FHIRException {
532          if (code == null)
533            return null;
534          if (code.isEmpty())
535            return new Enumeration<TestReportStatus>(this, TestReportStatus.NULL, code);
536          String codeString = ((PrimitiveType) code).asStringValue();
537          if (codeString == null || "".equals(codeString))
538            return new Enumeration<TestReportStatus>(this, TestReportStatus.NULL, code);
539        if ("completed".equals(codeString))
540          return new Enumeration<TestReportStatus>(this, TestReportStatus.COMPLETED, code);
541        if ("in-progress".equals(codeString))
542          return new Enumeration<TestReportStatus>(this, TestReportStatus.INPROGRESS, code);
543        if ("waiting".equals(codeString))
544          return new Enumeration<TestReportStatus>(this, TestReportStatus.WAITING, code);
545        if ("stopped".equals(codeString))
546          return new Enumeration<TestReportStatus>(this, TestReportStatus.STOPPED, code);
547        if ("entered-in-error".equals(codeString))
548          return new Enumeration<TestReportStatus>(this, TestReportStatus.ENTEREDINERROR, code);
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 singleton property TestReport.participant.type");
837        }
838        else if (name.equals("uri")) {
839          throw new FHIRException("Cannot call addChild on a singleton property TestReport.participant.uri");
840        }
841        else if (name.equals("display")) {
842          throw new FHIRException("Cannot call addChild on a singleton property 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 (Utilities.noString(value))
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 singleton property TestReport.setup.action.operation.result");
1561        }
1562        else if (name.equals("message")) {
1563          throw new FHIRException("Cannot call addChild on a singleton property TestReport.setup.action.operation.message");
1564        }
1565        else if (name.equals("detail")) {
1566          throw new FHIRException("Cannot call addChild on a singleton property 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        /**
1644         * Links or references providing traceability to the testing requirements for this assert.
1645         */
1646        @Child(name = "requirement", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1647        @Description(shortDefinition="Links or references to the testing requirements", formalDefinition="Links or references providing traceability to the testing requirements for this assert." )
1648        protected List<SetupActionAssertRequirementComponent> requirement;
1649
1650        private static final long serialVersionUID = -132618689L;
1651
1652    /**
1653     * Constructor
1654     */
1655      public SetupActionAssertComponent() {
1656        super();
1657      }
1658
1659    /**
1660     * Constructor
1661     */
1662      public SetupActionAssertComponent(TestReportActionResult result) {
1663        super();
1664        this.setResult(result);
1665      }
1666
1667        /**
1668         * @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
1669         */
1670        public Enumeration<TestReportActionResult> getResultElement() { 
1671          if (this.result == null)
1672            if (Configuration.errorOnAutoCreate())
1673              throw new Error("Attempt to auto-create SetupActionAssertComponent.result");
1674            else if (Configuration.doAutoCreate())
1675              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory()); // bb
1676          return this.result;
1677        }
1678
1679        public boolean hasResultElement() { 
1680          return this.result != null && !this.result.isEmpty();
1681        }
1682
1683        public boolean hasResult() { 
1684          return this.result != null && !this.result.isEmpty();
1685        }
1686
1687        /**
1688         * @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
1689         */
1690        public SetupActionAssertComponent setResultElement(Enumeration<TestReportActionResult> value) { 
1691          this.result = value;
1692          return this;
1693        }
1694
1695        /**
1696         * @return The result of this assertion.
1697         */
1698        public TestReportActionResult getResult() { 
1699          return this.result == null ? null : this.result.getValue();
1700        }
1701
1702        /**
1703         * @param value The result of this assertion.
1704         */
1705        public SetupActionAssertComponent setResult(TestReportActionResult value) { 
1706            if (this.result == null)
1707              this.result = new Enumeration<TestReportActionResult>(new TestReportActionResultEnumFactory());
1708            this.result.setValue(value);
1709          return this;
1710        }
1711
1712        /**
1713         * @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
1714         */
1715        public MarkdownType getMessageElement() { 
1716          if (this.message == null)
1717            if (Configuration.errorOnAutoCreate())
1718              throw new Error("Attempt to auto-create SetupActionAssertComponent.message");
1719            else if (Configuration.doAutoCreate())
1720              this.message = new MarkdownType(); // bb
1721          return this.message;
1722        }
1723
1724        public boolean hasMessageElement() { 
1725          return this.message != null && !this.message.isEmpty();
1726        }
1727
1728        public boolean hasMessage() { 
1729          return this.message != null && !this.message.isEmpty();
1730        }
1731
1732        /**
1733         * @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
1734         */
1735        public SetupActionAssertComponent setMessageElement(MarkdownType value) { 
1736          this.message = value;
1737          return this;
1738        }
1739
1740        /**
1741         * @return An explanatory message associated with the result.
1742         */
1743        public String getMessage() { 
1744          return this.message == null ? null : this.message.getValue();
1745        }
1746
1747        /**
1748         * @param value An explanatory message associated with the result.
1749         */
1750        public SetupActionAssertComponent setMessage(String value) { 
1751          if (Utilities.noString(value))
1752            this.message = null;
1753          else {
1754            if (this.message == null)
1755              this.message = new MarkdownType();
1756            this.message.setValue(value);
1757          }
1758          return this;
1759        }
1760
1761        /**
1762         * @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
1763         */
1764        public StringType getDetailElement() { 
1765          if (this.detail == null)
1766            if (Configuration.errorOnAutoCreate())
1767              throw new Error("Attempt to auto-create SetupActionAssertComponent.detail");
1768            else if (Configuration.doAutoCreate())
1769              this.detail = new StringType(); // bb
1770          return this.detail;
1771        }
1772
1773        public boolean hasDetailElement() { 
1774          return this.detail != null && !this.detail.isEmpty();
1775        }
1776
1777        public boolean hasDetail() { 
1778          return this.detail != null && !this.detail.isEmpty();
1779        }
1780
1781        /**
1782         * @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
1783         */
1784        public SetupActionAssertComponent setDetailElement(StringType value) { 
1785          this.detail = value;
1786          return this;
1787        }
1788
1789        /**
1790         * @return A link to further details on the result.
1791         */
1792        public String getDetail() { 
1793          return this.detail == null ? null : this.detail.getValue();
1794        }
1795
1796        /**
1797         * @param value A link to further details on the result.
1798         */
1799        public SetupActionAssertComponent setDetail(String value) { 
1800          if (Utilities.noString(value))
1801            this.detail = null;
1802          else {
1803            if (this.detail == null)
1804              this.detail = new StringType();
1805            this.detail.setValue(value);
1806          }
1807          return this;
1808        }
1809
1810        /**
1811         * @return {@link #requirement} (Links or references providing traceability to the testing requirements for this assert.)
1812         */
1813        public List<SetupActionAssertRequirementComponent> getRequirement() { 
1814          if (this.requirement == null)
1815            this.requirement = new ArrayList<SetupActionAssertRequirementComponent>();
1816          return this.requirement;
1817        }
1818
1819        /**
1820         * @return Returns a reference to <code>this</code> for easy method chaining
1821         */
1822        public SetupActionAssertComponent setRequirement(List<SetupActionAssertRequirementComponent> theRequirement) { 
1823          this.requirement = theRequirement;
1824          return this;
1825        }
1826
1827        public boolean hasRequirement() { 
1828          if (this.requirement == null)
1829            return false;
1830          for (SetupActionAssertRequirementComponent item : this.requirement)
1831            if (!item.isEmpty())
1832              return true;
1833          return false;
1834        }
1835
1836        public SetupActionAssertRequirementComponent addRequirement() { //3
1837          SetupActionAssertRequirementComponent t = new SetupActionAssertRequirementComponent();
1838          if (this.requirement == null)
1839            this.requirement = new ArrayList<SetupActionAssertRequirementComponent>();
1840          this.requirement.add(t);
1841          return t;
1842        }
1843
1844        public SetupActionAssertComponent addRequirement(SetupActionAssertRequirementComponent t) { //3
1845          if (t == null)
1846            return this;
1847          if (this.requirement == null)
1848            this.requirement = new ArrayList<SetupActionAssertRequirementComponent>();
1849          this.requirement.add(t);
1850          return this;
1851        }
1852
1853        /**
1854         * @return The first repetition of repeating field {@link #requirement}, creating it if it does not already exist {3}
1855         */
1856        public SetupActionAssertRequirementComponent getRequirementFirstRep() { 
1857          if (getRequirement().isEmpty()) {
1858            addRequirement();
1859          }
1860          return getRequirement().get(0);
1861        }
1862
1863        protected void listChildren(List<Property> children) {
1864          super.listChildren(children);
1865          children.add(new Property("result", "code", "The result of this assertion.", 0, 1, result));
1866          children.add(new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message));
1867          children.add(new Property("detail", "string", "A link to further details on the result.", 0, 1, detail));
1868          children.add(new Property("requirement", "", "Links or references providing traceability to the testing requirements for this assert.", 0, java.lang.Integer.MAX_VALUE, requirement));
1869        }
1870
1871        @Override
1872        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1873          switch (_hash) {
1874          case -934426595: /*result*/  return new Property("result", "code", "The result of this assertion.", 0, 1, result);
1875          case 954925063: /*message*/  return new Property("message", "markdown", "An explanatory message associated with the result.", 0, 1, message);
1876          case -1335224239: /*detail*/  return new Property("detail", "string", "A link to further details on the result.", 0, 1, detail);
1877          case 363387971: /*requirement*/  return new Property("requirement", "", "Links or references providing traceability to the testing requirements for this assert.", 0, java.lang.Integer.MAX_VALUE, requirement);
1878          default: return super.getNamedProperty(_hash, _name, _checkValid);
1879          }
1880
1881        }
1882
1883      @Override
1884      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1885        switch (hash) {
1886        case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportActionResult>
1887        case 954925063: /*message*/ return this.message == null ? new Base[0] : new Base[] {this.message}; // MarkdownType
1888        case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // StringType
1889        case 363387971: /*requirement*/ return this.requirement == null ? new Base[0] : this.requirement.toArray(new Base[this.requirement.size()]); // SetupActionAssertRequirementComponent
1890        default: return super.getProperty(hash, name, checkValid);
1891        }
1892
1893      }
1894
1895      @Override
1896      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1897        switch (hash) {
1898        case -934426595: // result
1899          value = new TestReportActionResultEnumFactory().fromType(TypeConvertor.castToCode(value));
1900          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1901          return value;
1902        case 954925063: // message
1903          this.message = TypeConvertor.castToMarkdown(value); // MarkdownType
1904          return value;
1905        case -1335224239: // detail
1906          this.detail = TypeConvertor.castToString(value); // StringType
1907          return value;
1908        case 363387971: // requirement
1909          this.getRequirement().add((SetupActionAssertRequirementComponent) value); // SetupActionAssertRequirementComponent
1910          return value;
1911        default: return super.setProperty(hash, name, value);
1912        }
1913
1914      }
1915
1916      @Override
1917      public Base setProperty(String name, Base value) throws FHIRException {
1918        if (name.equals("result")) {
1919          value = new TestReportActionResultEnumFactory().fromType(TypeConvertor.castToCode(value));
1920          this.result = (Enumeration) value; // Enumeration<TestReportActionResult>
1921        } else if (name.equals("message")) {
1922          this.message = TypeConvertor.castToMarkdown(value); // MarkdownType
1923        } else if (name.equals("detail")) {
1924          this.detail = TypeConvertor.castToString(value); // StringType
1925        } else if (name.equals("requirement")) {
1926          this.getRequirement().add((SetupActionAssertRequirementComponent) value);
1927        } else
1928          return super.setProperty(name, value);
1929        return value;
1930      }
1931
1932      @Override
1933      public Base makeProperty(int hash, String name) throws FHIRException {
1934        switch (hash) {
1935        case -934426595:  return getResultElement();
1936        case 954925063:  return getMessageElement();
1937        case -1335224239:  return getDetailElement();
1938        case 363387971:  return addRequirement(); 
1939        default: return super.makeProperty(hash, name);
1940        }
1941
1942      }
1943
1944      @Override
1945      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1946        switch (hash) {
1947        case -934426595: /*result*/ return new String[] {"code"};
1948        case 954925063: /*message*/ return new String[] {"markdown"};
1949        case -1335224239: /*detail*/ return new String[] {"string"};
1950        case 363387971: /*requirement*/ return new String[] {};
1951        default: return super.getTypesForProperty(hash, name);
1952        }
1953
1954      }
1955
1956      @Override
1957      public Base addChild(String name) throws FHIRException {
1958        if (name.equals("result")) {
1959          throw new FHIRException("Cannot call addChild on a singleton property TestReport.setup.action.assert.result");
1960        }
1961        else if (name.equals("message")) {
1962          throw new FHIRException("Cannot call addChild on a singleton property TestReport.setup.action.assert.message");
1963        }
1964        else if (name.equals("detail")) {
1965          throw new FHIRException("Cannot call addChild on a singleton property TestReport.setup.action.assert.detail");
1966        }
1967        else if (name.equals("requirement")) {
1968          return addRequirement();
1969        }
1970        else
1971          return super.addChild(name);
1972      }
1973
1974      public SetupActionAssertComponent copy() {
1975        SetupActionAssertComponent dst = new SetupActionAssertComponent();
1976        copyValues(dst);
1977        return dst;
1978      }
1979
1980      public void copyValues(SetupActionAssertComponent dst) {
1981        super.copyValues(dst);
1982        dst.result = result == null ? null : result.copy();
1983        dst.message = message == null ? null : message.copy();
1984        dst.detail = detail == null ? null : detail.copy();
1985        if (requirement != null) {
1986          dst.requirement = new ArrayList<SetupActionAssertRequirementComponent>();
1987          for (SetupActionAssertRequirementComponent i : requirement)
1988            dst.requirement.add(i.copy());
1989        };
1990      }
1991
1992      @Override
1993      public boolean equalsDeep(Base other_) {
1994        if (!super.equalsDeep(other_))
1995          return false;
1996        if (!(other_ instanceof SetupActionAssertComponent))
1997          return false;
1998        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
1999        return compareDeep(result, o.result, true) && compareDeep(message, o.message, true) && compareDeep(detail, o.detail, true)
2000           && compareDeep(requirement, o.requirement, true);
2001      }
2002
2003      @Override
2004      public boolean equalsShallow(Base other_) {
2005        if (!super.equalsShallow(other_))
2006          return false;
2007        if (!(other_ instanceof SetupActionAssertComponent))
2008          return false;
2009        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
2010        return compareValues(result, o.result, true) && compareValues(message, o.message, true) && compareValues(detail, o.detail, true)
2011          ;
2012      }
2013
2014      public boolean isEmpty() {
2015        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(result, message, detail
2016          , requirement);
2017      }
2018
2019  public String fhirType() {
2020    return "TestReport.setup.action.assert";
2021
2022  }
2023
2024  }
2025
2026    @Block()
2027    public static class SetupActionAssertRequirementComponent extends BackboneElement implements IBaseBackboneElement {
2028        /**
2029         * Link or reference providing traceability to the testing requirement for this test.
2030         */
2031        @Child(name = "link", type = {UriType.class, CanonicalType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2032        @Description(shortDefinition="Link or reference to the testing requirement", formalDefinition="Link or reference providing traceability to the testing requirement for this test." )
2033        protected DataType link;
2034
2035        private static final long serialVersionUID = -91187948L;
2036
2037    /**
2038     * Constructor
2039     */
2040      public SetupActionAssertRequirementComponent() {
2041        super();
2042      }
2043
2044        /**
2045         * @return {@link #link} (Link or reference providing traceability to the testing requirement for this test.)
2046         */
2047        public DataType getLink() { 
2048          return this.link;
2049        }
2050
2051        /**
2052         * @return {@link #link} (Link or reference providing traceability to the testing requirement for this test.)
2053         */
2054        public UriType getLinkUriType() throws FHIRException { 
2055          if (this.link == null)
2056            this.link = new UriType();
2057          if (!(this.link instanceof UriType))
2058            throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.link.getClass().getName()+" was encountered");
2059          return (UriType) this.link;
2060        }
2061
2062        public boolean hasLinkUriType() { 
2063          return this != null && this.link instanceof UriType;
2064        }
2065
2066        /**
2067         * @return {@link #link} (Link or reference providing traceability to the testing requirement for this test.)
2068         */
2069        public CanonicalType getLinkCanonicalType() throws FHIRException { 
2070          if (this.link == null)
2071            this.link = new CanonicalType();
2072          if (!(this.link instanceof CanonicalType))
2073            throw new FHIRException("Type mismatch: the type CanonicalType was expected, but "+this.link.getClass().getName()+" was encountered");
2074          return (CanonicalType) this.link;
2075        }
2076
2077        public boolean hasLinkCanonicalType() { 
2078          return this != null && this.link instanceof CanonicalType;
2079        }
2080
2081        public boolean hasLink() { 
2082          return this.link != null && !this.link.isEmpty();
2083        }
2084
2085        /**
2086         * @param value {@link #link} (Link or reference providing traceability to the testing requirement for this test.)
2087         */
2088        public SetupActionAssertRequirementComponent setLink(DataType value) { 
2089          if (value != null && !(value instanceof UriType || value instanceof CanonicalType))
2090            throw new FHIRException("Not the right type for TestReport.setup.action.assert.requirement.link[x]: "+value.fhirType());
2091          this.link = value;
2092          return this;
2093        }
2094
2095        protected void listChildren(List<Property> children) {
2096          super.listChildren(children);
2097          children.add(new Property("link[x]", "uri|canonical(Requirements)", "Link or reference providing traceability to the testing requirement for this test.", 0, 1, link));
2098        }
2099
2100        @Override
2101        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2102          switch (_hash) {
2103          case 177076806: /*link[x]*/  return new Property("link[x]", "uri|canonical(Requirements)", "Link or reference providing traceability to the testing requirement for this test.", 0, 1, link);
2104          case 3321850: /*link*/  return new Property("link[x]", "uri|canonical(Requirements)", "Link or reference providing traceability to the testing requirement for this test.", 0, 1, link);
2105          case 177070866: /*linkUri*/  return new Property("link[x]", "uri", "Link or reference providing traceability to the testing requirement for this test.", 0, 1, link);
2106          case -2064880102: /*linkCanonical*/  return new Property("link[x]", "canonical(Requirements)", "Link or reference providing traceability to the testing requirement for this test.", 0, 1, link);
2107          default: return super.getNamedProperty(_hash, _name, _checkValid);
2108          }
2109
2110        }
2111
2112      @Override
2113      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2114        switch (hash) {
2115        case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // DataType
2116        default: return super.getProperty(hash, name, checkValid);
2117        }
2118
2119      }
2120
2121      @Override
2122      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2123        switch (hash) {
2124        case 3321850: // link
2125          this.link = TypeConvertor.castToType(value); // DataType
2126          return value;
2127        default: return super.setProperty(hash, name, value);
2128        }
2129
2130      }
2131
2132      @Override
2133      public Base setProperty(String name, Base value) throws FHIRException {
2134        if (name.equals("link[x]")) {
2135          this.link = TypeConvertor.castToType(value); // DataType
2136        } else
2137          return super.setProperty(name, value);
2138        return value;
2139      }
2140
2141      @Override
2142      public Base makeProperty(int hash, String name) throws FHIRException {
2143        switch (hash) {
2144        case 177076806:  return getLink();
2145        case 3321850:  return getLink();
2146        default: return super.makeProperty(hash, name);
2147        }
2148
2149      }
2150
2151      @Override
2152      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2153        switch (hash) {
2154        case 3321850: /*link*/ return new String[] {"uri", "canonical"};
2155        default: return super.getTypesForProperty(hash, name);
2156        }
2157
2158      }
2159
2160      @Override
2161      public Base addChild(String name) throws FHIRException {
2162        if (name.equals("linkUri")) {
2163          this.link = new UriType();
2164          return this.link;
2165        }
2166        else if (name.equals("linkCanonical")) {
2167          this.link = new CanonicalType();
2168          return this.link;
2169        }
2170        else
2171          return super.addChild(name);
2172      }
2173
2174      public SetupActionAssertRequirementComponent copy() {
2175        SetupActionAssertRequirementComponent dst = new SetupActionAssertRequirementComponent();
2176        copyValues(dst);
2177        return dst;
2178      }
2179
2180      public void copyValues(SetupActionAssertRequirementComponent dst) {
2181        super.copyValues(dst);
2182        dst.link = link == null ? null : link.copy();
2183      }
2184
2185      @Override
2186      public boolean equalsDeep(Base other_) {
2187        if (!super.equalsDeep(other_))
2188          return false;
2189        if (!(other_ instanceof SetupActionAssertRequirementComponent))
2190          return false;
2191        SetupActionAssertRequirementComponent o = (SetupActionAssertRequirementComponent) other_;
2192        return compareDeep(link, o.link, true);
2193      }
2194
2195      @Override
2196      public boolean equalsShallow(Base other_) {
2197        if (!super.equalsShallow(other_))
2198          return false;
2199        if (!(other_ instanceof SetupActionAssertRequirementComponent))
2200          return false;
2201        SetupActionAssertRequirementComponent o = (SetupActionAssertRequirementComponent) other_;
2202        return true;
2203      }
2204
2205      public boolean isEmpty() {
2206        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(link);
2207      }
2208
2209  public String fhirType() {
2210    return "TestReport.setup.action.assert.requirement";
2211
2212  }
2213
2214  }
2215
2216    @Block()
2217    public static class TestReportTestComponent extends BackboneElement implements IBaseBackboneElement {
2218        /**
2219         * The name of this test used for tracking/logging purposes by test engines.
2220         */
2221        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2222        @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." )
2223        protected StringType name;
2224
2225        /**
2226         * A short description of the test used by test engines for tracking and reporting purposes.
2227         */
2228        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2229        @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." )
2230        protected StringType description;
2231
2232        /**
2233         * Action would contain either an operation or an assertion.
2234         */
2235        @Child(name = "action", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2236        @Description(shortDefinition="A test operation or assert that was performed", formalDefinition="Action would contain either an operation or an assertion." )
2237        protected List<TestActionComponent> action;
2238
2239        private static final long serialVersionUID = -865006110L;
2240
2241    /**
2242     * Constructor
2243     */
2244      public TestReportTestComponent() {
2245        super();
2246      }
2247
2248    /**
2249     * Constructor
2250     */
2251      public TestReportTestComponent(TestActionComponent action) {
2252        super();
2253        this.addAction(action);
2254      }
2255
2256        /**
2257         * @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
2258         */
2259        public StringType getNameElement() { 
2260          if (this.name == null)
2261            if (Configuration.errorOnAutoCreate())
2262              throw new Error("Attempt to auto-create TestReportTestComponent.name");
2263            else if (Configuration.doAutoCreate())
2264              this.name = new StringType(); // bb
2265          return this.name;
2266        }
2267
2268        public boolean hasNameElement() { 
2269          return this.name != null && !this.name.isEmpty();
2270        }
2271
2272        public boolean hasName() { 
2273          return this.name != null && !this.name.isEmpty();
2274        }
2275
2276        /**
2277         * @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
2278         */
2279        public TestReportTestComponent setNameElement(StringType value) { 
2280          this.name = value;
2281          return this;
2282        }
2283
2284        /**
2285         * @return The name of this test used for tracking/logging purposes by test engines.
2286         */
2287        public String getName() { 
2288          return this.name == null ? null : this.name.getValue();
2289        }
2290
2291        /**
2292         * @param value The name of this test used for tracking/logging purposes by test engines.
2293         */
2294        public TestReportTestComponent setName(String value) { 
2295          if (Utilities.noString(value))
2296            this.name = null;
2297          else {
2298            if (this.name == null)
2299              this.name = new StringType();
2300            this.name.setValue(value);
2301          }
2302          return this;
2303        }
2304
2305        /**
2306         * @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
2307         */
2308        public StringType getDescriptionElement() { 
2309          if (this.description == null)
2310            if (Configuration.errorOnAutoCreate())
2311              throw new Error("Attempt to auto-create TestReportTestComponent.description");
2312            else if (Configuration.doAutoCreate())
2313              this.description = new StringType(); // bb
2314          return this.description;
2315        }
2316
2317        public boolean hasDescriptionElement() { 
2318          return this.description != null && !this.description.isEmpty();
2319        }
2320
2321        public boolean hasDescription() { 
2322          return this.description != null && !this.description.isEmpty();
2323        }
2324
2325        /**
2326         * @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
2327         */
2328        public TestReportTestComponent setDescriptionElement(StringType value) { 
2329          this.description = value;
2330          return this;
2331        }
2332
2333        /**
2334         * @return A short description of the test used by test engines for tracking and reporting purposes.
2335         */
2336        public String getDescription() { 
2337          return this.description == null ? null : this.description.getValue();
2338        }
2339
2340        /**
2341         * @param value A short description of the test used by test engines for tracking and reporting purposes.
2342         */
2343        public TestReportTestComponent setDescription(String value) { 
2344          if (Utilities.noString(value))
2345            this.description = null;
2346          else {
2347            if (this.description == null)
2348              this.description = new StringType();
2349            this.description.setValue(value);
2350          }
2351          return this;
2352        }
2353
2354        /**
2355         * @return {@link #action} (Action would contain either an operation or an assertion.)
2356         */
2357        public List<TestActionComponent> getAction() { 
2358          if (this.action == null)
2359            this.action = new ArrayList<TestActionComponent>();
2360          return this.action;
2361        }
2362
2363        /**
2364         * @return Returns a reference to <code>this</code> for easy method chaining
2365         */
2366        public TestReportTestComponent setAction(List<TestActionComponent> theAction) { 
2367          this.action = theAction;
2368          return this;
2369        }
2370
2371        public boolean hasAction() { 
2372          if (this.action == null)
2373            return false;
2374          for (TestActionComponent item : this.action)
2375            if (!item.isEmpty())
2376              return true;
2377          return false;
2378        }
2379
2380        public TestActionComponent addAction() { //3
2381          TestActionComponent t = new TestActionComponent();
2382          if (this.action == null)
2383            this.action = new ArrayList<TestActionComponent>();
2384          this.action.add(t);
2385          return t;
2386        }
2387
2388        public TestReportTestComponent addAction(TestActionComponent t) { //3
2389          if (t == null)
2390            return this;
2391          if (this.action == null)
2392            this.action = new ArrayList<TestActionComponent>();
2393          this.action.add(t);
2394          return this;
2395        }
2396
2397        /**
2398         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
2399         */
2400        public TestActionComponent getActionFirstRep() { 
2401          if (getAction().isEmpty()) {
2402            addAction();
2403          }
2404          return getAction().get(0);
2405        }
2406
2407        protected void listChildren(List<Property> children) {
2408          super.listChildren(children);
2409          children.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name));
2410          children.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description));
2411          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
2412        }
2413
2414        @Override
2415        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2416          switch (_hash) {
2417          case 3373707: /*name*/  return new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name);
2418          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);
2419          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
2420          default: return super.getNamedProperty(_hash, _name, _checkValid);
2421          }
2422
2423        }
2424
2425      @Override
2426      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2427        switch (hash) {
2428        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
2429        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2430        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent
2431        default: return super.getProperty(hash, name, checkValid);
2432        }
2433
2434      }
2435
2436      @Override
2437      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2438        switch (hash) {
2439        case 3373707: // name
2440          this.name = TypeConvertor.castToString(value); // StringType
2441          return value;
2442        case -1724546052: // description
2443          this.description = TypeConvertor.castToString(value); // StringType
2444          return value;
2445        case -1422950858: // action
2446          this.getAction().add((TestActionComponent) value); // TestActionComponent
2447          return value;
2448        default: return super.setProperty(hash, name, value);
2449        }
2450
2451      }
2452
2453      @Override
2454      public Base setProperty(String name, Base value) throws FHIRException {
2455        if (name.equals("name")) {
2456          this.name = TypeConvertor.castToString(value); // StringType
2457        } else if (name.equals("description")) {
2458          this.description = TypeConvertor.castToString(value); // StringType
2459        } else if (name.equals("action")) {
2460          this.getAction().add((TestActionComponent) value);
2461        } else
2462          return super.setProperty(name, value);
2463        return value;
2464      }
2465
2466      @Override
2467      public Base makeProperty(int hash, String name) throws FHIRException {
2468        switch (hash) {
2469        case 3373707:  return getNameElement();
2470        case -1724546052:  return getDescriptionElement();
2471        case -1422950858:  return addAction(); 
2472        default: return super.makeProperty(hash, name);
2473        }
2474
2475      }
2476
2477      @Override
2478      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2479        switch (hash) {
2480        case 3373707: /*name*/ return new String[] {"string"};
2481        case -1724546052: /*description*/ return new String[] {"string"};
2482        case -1422950858: /*action*/ return new String[] {};
2483        default: return super.getTypesForProperty(hash, name);
2484        }
2485
2486      }
2487
2488      @Override
2489      public Base addChild(String name) throws FHIRException {
2490        if (name.equals("name")) {
2491          throw new FHIRException("Cannot call addChild on a singleton property TestReport.test.name");
2492        }
2493        else if (name.equals("description")) {
2494          throw new FHIRException("Cannot call addChild on a singleton property TestReport.test.description");
2495        }
2496        else if (name.equals("action")) {
2497          return addAction();
2498        }
2499        else
2500          return super.addChild(name);
2501      }
2502
2503      public TestReportTestComponent copy() {
2504        TestReportTestComponent dst = new TestReportTestComponent();
2505        copyValues(dst);
2506        return dst;
2507      }
2508
2509      public void copyValues(TestReportTestComponent dst) {
2510        super.copyValues(dst);
2511        dst.name = name == null ? null : name.copy();
2512        dst.description = description == null ? null : description.copy();
2513        if (action != null) {
2514          dst.action = new ArrayList<TestActionComponent>();
2515          for (TestActionComponent i : action)
2516            dst.action.add(i.copy());
2517        };
2518      }
2519
2520      @Override
2521      public boolean equalsDeep(Base other_) {
2522        if (!super.equalsDeep(other_))
2523          return false;
2524        if (!(other_ instanceof TestReportTestComponent))
2525          return false;
2526        TestReportTestComponent o = (TestReportTestComponent) other_;
2527        return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(action, o.action, true)
2528          ;
2529      }
2530
2531      @Override
2532      public boolean equalsShallow(Base other_) {
2533        if (!super.equalsShallow(other_))
2534          return false;
2535        if (!(other_ instanceof TestReportTestComponent))
2536          return false;
2537        TestReportTestComponent o = (TestReportTestComponent) other_;
2538        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
2539      }
2540
2541      public boolean isEmpty() {
2542        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, action
2543          );
2544      }
2545
2546  public String fhirType() {
2547    return "TestReport.test";
2548
2549  }
2550
2551  }
2552
2553    @Block()
2554    public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement {
2555        /**
2556         * An operation would involve a REST request to a server.
2557         */
2558        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
2559        @Description(shortDefinition="The operation performed", formalDefinition="An operation would involve a REST request to a server." )
2560        protected SetupActionOperationComponent operation;
2561
2562        /**
2563         * The results of the assertion performed on the previous operations.
2564         */
2565        @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false)
2566        @Description(shortDefinition="The assertion performed", formalDefinition="The results of the assertion performed on the previous operations." )
2567        protected SetupActionAssertComponent assert_;
2568
2569        private static final long serialVersionUID = -252088305L;
2570
2571    /**
2572     * Constructor
2573     */
2574      public TestActionComponent() {
2575        super();
2576      }
2577
2578        /**
2579         * @return {@link #operation} (An operation would involve a REST request to a server.)
2580         */
2581        public SetupActionOperationComponent getOperation() { 
2582          if (this.operation == null)
2583            if (Configuration.errorOnAutoCreate())
2584              throw new Error("Attempt to auto-create TestActionComponent.operation");
2585            else if (Configuration.doAutoCreate())
2586              this.operation = new SetupActionOperationComponent(); // cc
2587          return this.operation;
2588        }
2589
2590        public boolean hasOperation() { 
2591          return this.operation != null && !this.operation.isEmpty();
2592        }
2593
2594        /**
2595         * @param value {@link #operation} (An operation would involve a REST request to a server.)
2596         */
2597        public TestActionComponent setOperation(SetupActionOperationComponent value) { 
2598          this.operation = value;
2599          return this;
2600        }
2601
2602        /**
2603         * @return {@link #assert_} (The results of the assertion performed on the previous operations.)
2604         */
2605        public SetupActionAssertComponent getAssert() { 
2606          if (this.assert_ == null)
2607            if (Configuration.errorOnAutoCreate())
2608              throw new Error("Attempt to auto-create TestActionComponent.assert_");
2609            else if (Configuration.doAutoCreate())
2610              this.assert_ = new SetupActionAssertComponent(); // cc
2611          return this.assert_;
2612        }
2613
2614        public boolean hasAssert() { 
2615          return this.assert_ != null && !this.assert_.isEmpty();
2616        }
2617
2618        /**
2619         * @param value {@link #assert_} (The results of the assertion performed on the previous operations.)
2620         */
2621        public TestActionComponent setAssert(SetupActionAssertComponent value) { 
2622          this.assert_ = value;
2623          return this;
2624        }
2625
2626        protected void listChildren(List<Property> children) {
2627          super.listChildren(children);
2628          children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
2629          children.add(new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_));
2630        }
2631
2632        @Override
2633        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2634          switch (_hash) {
2635          case 1662702951: /*operation*/  return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
2636          case -1408208058: /*assert*/  return new Property("assert", "@TestReport.setup.action.assert", "The results of the assertion performed on the previous operations.", 0, 1, assert_);
2637          default: return super.getNamedProperty(_hash, _name, _checkValid);
2638          }
2639
2640        }
2641
2642      @Override
2643      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2644        switch (hash) {
2645        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
2646        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
2647        default: return super.getProperty(hash, name, checkValid);
2648        }
2649
2650      }
2651
2652      @Override
2653      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2654        switch (hash) {
2655        case 1662702951: // operation
2656          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2657          return value;
2658        case -1408208058: // assert
2659          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
2660          return value;
2661        default: return super.setProperty(hash, name, value);
2662        }
2663
2664      }
2665
2666      @Override
2667      public Base setProperty(String name, Base value) throws FHIRException {
2668        if (name.equals("operation")) {
2669          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
2670        } else if (name.equals("assert")) {
2671          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
2672        } else
2673          return super.setProperty(name, value);
2674        return value;
2675      }
2676
2677      @Override
2678      public Base makeProperty(int hash, String name) throws FHIRException {
2679        switch (hash) {
2680        case 1662702951:  return getOperation();
2681        case -1408208058:  return getAssert();
2682        default: return super.makeProperty(hash, name);
2683        }
2684
2685      }
2686
2687      @Override
2688      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2689        switch (hash) {
2690        case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"};
2691        case -1408208058: /*assert*/ return new String[] {"@TestReport.setup.action.assert"};
2692        default: return super.getTypesForProperty(hash, name);
2693        }
2694
2695      }
2696
2697      @Override
2698      public Base addChild(String name) throws FHIRException {
2699        if (name.equals("operation")) {
2700          this.operation = new SetupActionOperationComponent();
2701          return this.operation;
2702        }
2703        else if (name.equals("assert")) {
2704          this.assert_ = new SetupActionAssertComponent();
2705          return this.assert_;
2706        }
2707        else
2708          return super.addChild(name);
2709      }
2710
2711      public TestActionComponent copy() {
2712        TestActionComponent dst = new TestActionComponent();
2713        copyValues(dst);
2714        return dst;
2715      }
2716
2717      public void copyValues(TestActionComponent dst) {
2718        super.copyValues(dst);
2719        dst.operation = operation == null ? null : operation.copy();
2720        dst.assert_ = assert_ == null ? null : assert_.copy();
2721      }
2722
2723      @Override
2724      public boolean equalsDeep(Base other_) {
2725        if (!super.equalsDeep(other_))
2726          return false;
2727        if (!(other_ instanceof TestActionComponent))
2728          return false;
2729        TestActionComponent o = (TestActionComponent) other_;
2730        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
2731      }
2732
2733      @Override
2734      public boolean equalsShallow(Base other_) {
2735        if (!super.equalsShallow(other_))
2736          return false;
2737        if (!(other_ instanceof TestActionComponent))
2738          return false;
2739        TestActionComponent o = (TestActionComponent) other_;
2740        return true;
2741      }
2742
2743      public boolean isEmpty() {
2744        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
2745      }
2746
2747  public String fhirType() {
2748    return "TestReport.test.action";
2749
2750  }
2751
2752  }
2753
2754    @Block()
2755    public static class TestReportTeardownComponent extends BackboneElement implements IBaseBackboneElement {
2756        /**
2757         * The teardown action will only contain an operation.
2758         */
2759        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2760        @Description(shortDefinition="One or more teardown operations performed", formalDefinition="The teardown action will only contain an operation." )
2761        protected List<TeardownActionComponent> action;
2762
2763        private static final long serialVersionUID = 1168638089L;
2764
2765    /**
2766     * Constructor
2767     */
2768      public TestReportTeardownComponent() {
2769        super();
2770      }
2771
2772    /**
2773     * Constructor
2774     */
2775      public TestReportTeardownComponent(TeardownActionComponent action) {
2776        super();
2777        this.addAction(action);
2778      }
2779
2780        /**
2781         * @return {@link #action} (The teardown action will only contain an operation.)
2782         */
2783        public List<TeardownActionComponent> getAction() { 
2784          if (this.action == null)
2785            this.action = new ArrayList<TeardownActionComponent>();
2786          return this.action;
2787        }
2788
2789        /**
2790         * @return Returns a reference to <code>this</code> for easy method chaining
2791         */
2792        public TestReportTeardownComponent setAction(List<TeardownActionComponent> theAction) { 
2793          this.action = theAction;
2794          return this;
2795        }
2796
2797        public boolean hasAction() { 
2798          if (this.action == null)
2799            return false;
2800          for (TeardownActionComponent item : this.action)
2801            if (!item.isEmpty())
2802              return true;
2803          return false;
2804        }
2805
2806        public TeardownActionComponent addAction() { //3
2807          TeardownActionComponent t = new TeardownActionComponent();
2808          if (this.action == null)
2809            this.action = new ArrayList<TeardownActionComponent>();
2810          this.action.add(t);
2811          return t;
2812        }
2813
2814        public TestReportTeardownComponent addAction(TeardownActionComponent t) { //3
2815          if (t == null)
2816            return this;
2817          if (this.action == null)
2818            this.action = new ArrayList<TeardownActionComponent>();
2819          this.action.add(t);
2820          return this;
2821        }
2822
2823        /**
2824         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist {3}
2825         */
2826        public TeardownActionComponent getActionFirstRep() { 
2827          if (getAction().isEmpty()) {
2828            addAction();
2829          }
2830          return getAction().get(0);
2831        }
2832
2833        protected void listChildren(List<Property> children) {
2834          super.listChildren(children);
2835          children.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action));
2836        }
2837
2838        @Override
2839        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2840          switch (_hash) {
2841          case -1422950858: /*action*/  return new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action);
2842          default: return super.getNamedProperty(_hash, _name, _checkValid);
2843          }
2844
2845        }
2846
2847      @Override
2848      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2849        switch (hash) {
2850        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent
2851        default: return super.getProperty(hash, name, checkValid);
2852        }
2853
2854      }
2855
2856      @Override
2857      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2858        switch (hash) {
2859        case -1422950858: // action
2860          this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent
2861          return value;
2862        default: return super.setProperty(hash, name, value);
2863        }
2864
2865      }
2866
2867      @Override
2868      public Base setProperty(String name, Base value) throws FHIRException {
2869        if (name.equals("action")) {
2870          this.getAction().add((TeardownActionComponent) value);
2871        } else
2872          return super.setProperty(name, value);
2873        return value;
2874      }
2875
2876      @Override
2877      public Base makeProperty(int hash, String name) throws FHIRException {
2878        switch (hash) {
2879        case -1422950858:  return addAction(); 
2880        default: return super.makeProperty(hash, name);
2881        }
2882
2883      }
2884
2885      @Override
2886      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2887        switch (hash) {
2888        case -1422950858: /*action*/ return new String[] {};
2889        default: return super.getTypesForProperty(hash, name);
2890        }
2891
2892      }
2893
2894      @Override
2895      public Base addChild(String name) throws FHIRException {
2896        if (name.equals("action")) {
2897          return addAction();
2898        }
2899        else
2900          return super.addChild(name);
2901      }
2902
2903      public TestReportTeardownComponent copy() {
2904        TestReportTeardownComponent dst = new TestReportTeardownComponent();
2905        copyValues(dst);
2906        return dst;
2907      }
2908
2909      public void copyValues(TestReportTeardownComponent dst) {
2910        super.copyValues(dst);
2911        if (action != null) {
2912          dst.action = new ArrayList<TeardownActionComponent>();
2913          for (TeardownActionComponent i : action)
2914            dst.action.add(i.copy());
2915        };
2916      }
2917
2918      @Override
2919      public boolean equalsDeep(Base other_) {
2920        if (!super.equalsDeep(other_))
2921          return false;
2922        if (!(other_ instanceof TestReportTeardownComponent))
2923          return false;
2924        TestReportTeardownComponent o = (TestReportTeardownComponent) other_;
2925        return compareDeep(action, o.action, true);
2926      }
2927
2928      @Override
2929      public boolean equalsShallow(Base other_) {
2930        if (!super.equalsShallow(other_))
2931          return false;
2932        if (!(other_ instanceof TestReportTeardownComponent))
2933          return false;
2934        TestReportTeardownComponent o = (TestReportTeardownComponent) other_;
2935        return true;
2936      }
2937
2938      public boolean isEmpty() {
2939        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
2940      }
2941
2942  public String fhirType() {
2943    return "TestReport.teardown";
2944
2945  }
2946
2947  }
2948
2949    @Block()
2950    public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement {
2951        /**
2952         * An operation would involve a REST request to a server.
2953         */
2954        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=1, max=1, modifier=false, summary=false)
2955        @Description(shortDefinition="The teardown operation performed", formalDefinition="An operation would involve a REST request to a server." )
2956        protected SetupActionOperationComponent operation;
2957
2958        private static final long serialVersionUID = -1099598054L;
2959
2960    /**
2961     * Constructor
2962     */
2963      public TeardownActionComponent() {
2964        super();
2965      }
2966
2967    /**
2968     * Constructor
2969     */
2970      public TeardownActionComponent(SetupActionOperationComponent operation) {
2971        super();
2972        this.setOperation(operation);
2973      }
2974
2975        /**
2976         * @return {@link #operation} (An operation would involve a REST request to a server.)
2977         */
2978        public SetupActionOperationComponent getOperation() { 
2979          if (this.operation == null)
2980            if (Configuration.errorOnAutoCreate())
2981              throw new Error("Attempt to auto-create TeardownActionComponent.operation");
2982            else if (Configuration.doAutoCreate())
2983              this.operation = new SetupActionOperationComponent(); // cc
2984          return this.operation;
2985        }
2986
2987        public boolean hasOperation() { 
2988          return this.operation != null && !this.operation.isEmpty();
2989        }
2990
2991        /**
2992         * @param value {@link #operation} (An operation would involve a REST request to a server.)
2993         */
2994        public TeardownActionComponent setOperation(SetupActionOperationComponent value) { 
2995          this.operation = value;
2996          return this;
2997        }
2998
2999        protected void listChildren(List<Property> children) {
3000          super.listChildren(children);
3001          children.add(new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
3002        }
3003
3004        @Override
3005        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3006          switch (_hash) {
3007          case 1662702951: /*operation*/  return new Property("operation", "@TestReport.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
3008          default: return super.getNamedProperty(_hash, _name, _checkValid);
3009          }
3010
3011        }
3012
3013      @Override
3014      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3015        switch (hash) {
3016        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
3017        default: return super.getProperty(hash, name, checkValid);
3018        }
3019
3020      }
3021
3022      @Override
3023      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3024        switch (hash) {
3025        case 1662702951: // operation
3026          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
3027          return value;
3028        default: return super.setProperty(hash, name, value);
3029        }
3030
3031      }
3032
3033      @Override
3034      public Base setProperty(String name, Base value) throws FHIRException {
3035        if (name.equals("operation")) {
3036          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
3037        } else
3038          return super.setProperty(name, value);
3039        return value;
3040      }
3041
3042      @Override
3043      public Base makeProperty(int hash, String name) throws FHIRException {
3044        switch (hash) {
3045        case 1662702951:  return getOperation();
3046        default: return super.makeProperty(hash, name);
3047        }
3048
3049      }
3050
3051      @Override
3052      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3053        switch (hash) {
3054        case 1662702951: /*operation*/ return new String[] {"@TestReport.setup.action.operation"};
3055        default: return super.getTypesForProperty(hash, name);
3056        }
3057
3058      }
3059
3060      @Override
3061      public Base addChild(String name) throws FHIRException {
3062        if (name.equals("operation")) {
3063          this.operation = new SetupActionOperationComponent();
3064          return this.operation;
3065        }
3066        else
3067          return super.addChild(name);
3068      }
3069
3070      public TeardownActionComponent copy() {
3071        TeardownActionComponent dst = new TeardownActionComponent();
3072        copyValues(dst);
3073        return dst;
3074      }
3075
3076      public void copyValues(TeardownActionComponent dst) {
3077        super.copyValues(dst);
3078        dst.operation = operation == null ? null : operation.copy();
3079      }
3080
3081      @Override
3082      public boolean equalsDeep(Base other_) {
3083        if (!super.equalsDeep(other_))
3084          return false;
3085        if (!(other_ instanceof TeardownActionComponent))
3086          return false;
3087        TeardownActionComponent o = (TeardownActionComponent) other_;
3088        return compareDeep(operation, o.operation, true);
3089      }
3090
3091      @Override
3092      public boolean equalsShallow(Base other_) {
3093        if (!super.equalsShallow(other_))
3094          return false;
3095        if (!(other_ instanceof TeardownActionComponent))
3096          return false;
3097        TeardownActionComponent o = (TeardownActionComponent) other_;
3098        return true;
3099      }
3100
3101      public boolean isEmpty() {
3102        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation);
3103      }
3104
3105  public String fhirType() {
3106    return "TestReport.teardown.action";
3107
3108  }
3109
3110  }
3111
3112    /**
3113     * Identifier for the TestReport assigned for external purposes outside the context of FHIR.
3114     */
3115    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
3116    @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestReport assigned for external purposes outside the context of FHIR." )
3117    protected Identifier identifier;
3118
3119    /**
3120     * A free text natural language name identifying the executed TestReport.
3121     */
3122    @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
3123    @Description(shortDefinition="Informal name of the executed TestReport", formalDefinition="A free text natural language name identifying the executed TestReport." )
3124    protected StringType name;
3125
3126    /**
3127     * The current state of this test report.
3128     */
3129    @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true)
3130    @Description(shortDefinition="completed | in-progress | waiting | stopped | entered-in-error", formalDefinition="The current state of this test report." )
3131    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-status-codes")
3132    protected Enumeration<TestReportStatus> status;
3133
3134    /**
3135     * Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.
3136     */
3137    @Child(name = "testScript", type = {CanonicalType.class}, order=3, min=1, max=1, modifier=false, summary=true)
3138    @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`." )
3139    protected CanonicalType testScript;
3140
3141    /**
3142     * The overall result from the execution of the TestScript.
3143     */
3144    @Child(name = "result", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true)
3145    @Description(shortDefinition="pass | fail | pending", formalDefinition="The overall result from the execution of the TestScript." )
3146    @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/report-result-codes")
3147    protected Enumeration<TestReportResult> result;
3148
3149    /**
3150     * The final score (percentage of tests passed) resulting from the execution of the TestScript.
3151     */
3152    @Child(name = "score", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true)
3153    @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." )
3154    protected DecimalType score;
3155
3156    /**
3157     * Name of the tester producing this report (Organization or individual).
3158     */
3159    @Child(name = "tester", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
3160    @Description(shortDefinition="Name of the tester producing this report (Organization or individual)", formalDefinition="Name of the tester producing this report (Organization or individual)." )
3161    protected StringType tester;
3162
3163    /**
3164     * When the TestScript was executed and this TestReport was generated.
3165     */
3166    @Child(name = "issued", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true)
3167    @Description(shortDefinition="When the TestScript was executed and this TestReport was generated", formalDefinition="When the TestScript was executed and this TestReport was generated." )
3168    protected DateTimeType issued;
3169
3170    /**
3171     * A participant in the test execution, either the execution engine, a client, or a server.
3172     */
3173    @Child(name = "participant", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3174    @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." )
3175    protected List<TestReportParticipantComponent> participant;
3176
3177    /**
3178     * The results of the series of required setup operations before the tests were executed.
3179     */
3180    @Child(name = "setup", type = {}, order=9, min=0, max=1, modifier=false, summary=false)
3181    @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." )
3182    protected TestReportSetupComponent setup;
3183
3184    /**
3185     * A test executed from the test script.
3186     */
3187    @Child(name = "test", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3188    @Description(shortDefinition="A test executed from the test script", formalDefinition="A test executed from the test script." )
3189    protected List<TestReportTestComponent> test;
3190
3191    /**
3192     * The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).
3193     */
3194    @Child(name = "teardown", type = {}, order=11, min=0, max=1, modifier=false, summary=false)
3195    @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)." )
3196    protected TestReportTeardownComponent teardown;
3197
3198    private static final long serialVersionUID = -1863229334L;
3199
3200  /**
3201   * Constructor
3202   */
3203    public TestReport() {
3204      super();
3205    }
3206
3207  /**
3208   * Constructor
3209   */
3210    public TestReport(TestReportStatus status, String testScript, TestReportResult result) {
3211      super();
3212      this.setStatus(status);
3213      this.setTestScript(testScript);
3214      this.setResult(result);
3215    }
3216
3217    /**
3218     * @return {@link #identifier} (Identifier for the TestReport assigned for external purposes outside the context of FHIR.)
3219     */
3220    public Identifier getIdentifier() { 
3221      if (this.identifier == null)
3222        if (Configuration.errorOnAutoCreate())
3223          throw new Error("Attempt to auto-create TestReport.identifier");
3224        else if (Configuration.doAutoCreate())
3225          this.identifier = new Identifier(); // cc
3226      return this.identifier;
3227    }
3228
3229    public boolean hasIdentifier() { 
3230      return this.identifier != null && !this.identifier.isEmpty();
3231    }
3232
3233    /**
3234     * @param value {@link #identifier} (Identifier for the TestReport assigned for external purposes outside the context of FHIR.)
3235     */
3236    public TestReport setIdentifier(Identifier value) { 
3237      this.identifier = value;
3238      return this;
3239    }
3240
3241    /**
3242     * @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
3243     */
3244    public StringType getNameElement() { 
3245      if (this.name == null)
3246        if (Configuration.errorOnAutoCreate())
3247          throw new Error("Attempt to auto-create TestReport.name");
3248        else if (Configuration.doAutoCreate())
3249          this.name = new StringType(); // bb
3250      return this.name;
3251    }
3252
3253    public boolean hasNameElement() { 
3254      return this.name != null && !this.name.isEmpty();
3255    }
3256
3257    public boolean hasName() { 
3258      return this.name != null && !this.name.isEmpty();
3259    }
3260
3261    /**
3262     * @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
3263     */
3264    public TestReport setNameElement(StringType value) { 
3265      this.name = value;
3266      return this;
3267    }
3268
3269    /**
3270     * @return A free text natural language name identifying the executed TestReport.
3271     */
3272    public String getName() { 
3273      return this.name == null ? null : this.name.getValue();
3274    }
3275
3276    /**
3277     * @param value A free text natural language name identifying the executed TestReport.
3278     */
3279    public TestReport setName(String value) { 
3280      if (Utilities.noString(value))
3281        this.name = null;
3282      else {
3283        if (this.name == null)
3284          this.name = new StringType();
3285        this.name.setValue(value);
3286      }
3287      return this;
3288    }
3289
3290    /**
3291     * @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
3292     */
3293    public Enumeration<TestReportStatus> getStatusElement() { 
3294      if (this.status == null)
3295        if (Configuration.errorOnAutoCreate())
3296          throw new Error("Attempt to auto-create TestReport.status");
3297        else if (Configuration.doAutoCreate())
3298          this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory()); // bb
3299      return this.status;
3300    }
3301
3302    public boolean hasStatusElement() { 
3303      return this.status != null && !this.status.isEmpty();
3304    }
3305
3306    public boolean hasStatus() { 
3307      return this.status != null && !this.status.isEmpty();
3308    }
3309
3310    /**
3311     * @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
3312     */
3313    public TestReport setStatusElement(Enumeration<TestReportStatus> value) { 
3314      this.status = value;
3315      return this;
3316    }
3317
3318    /**
3319     * @return The current state of this test report.
3320     */
3321    public TestReportStatus getStatus() { 
3322      return this.status == null ? null : this.status.getValue();
3323    }
3324
3325    /**
3326     * @param value The current state of this test report.
3327     */
3328    public TestReport setStatus(TestReportStatus value) { 
3329        if (this.status == null)
3330          this.status = new Enumeration<TestReportStatus>(new TestReportStatusEnumFactory());
3331        this.status.setValue(value);
3332      return this;
3333    }
3334
3335    /**
3336     * @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
3337     */
3338    public CanonicalType getTestScriptElement() { 
3339      if (this.testScript == null)
3340        if (Configuration.errorOnAutoCreate())
3341          throw new Error("Attempt to auto-create TestReport.testScript");
3342        else if (Configuration.doAutoCreate())
3343          this.testScript = new CanonicalType(); // bb
3344      return this.testScript;
3345    }
3346
3347    public boolean hasTestScriptElement() { 
3348      return this.testScript != null && !this.testScript.isEmpty();
3349    }
3350
3351    public boolean hasTestScript() { 
3352      return this.testScript != null && !this.testScript.isEmpty();
3353    }
3354
3355    /**
3356     * @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
3357     */
3358    public TestReport setTestScriptElement(CanonicalType value) { 
3359      this.testScript = value;
3360      return this;
3361    }
3362
3363    /**
3364     * @return Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.
3365     */
3366    public String getTestScript() { 
3367      return this.testScript == null ? null : this.testScript.getValue();
3368    }
3369
3370    /**
3371     * @param value Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.
3372     */
3373    public TestReport setTestScript(String value) { 
3374        if (this.testScript == null)
3375          this.testScript = new CanonicalType();
3376        this.testScript.setValue(value);
3377      return this;
3378    }
3379
3380    /**
3381     * @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
3382     */
3383    public Enumeration<TestReportResult> getResultElement() { 
3384      if (this.result == null)
3385        if (Configuration.errorOnAutoCreate())
3386          throw new Error("Attempt to auto-create TestReport.result");
3387        else if (Configuration.doAutoCreate())
3388          this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory()); // bb
3389      return this.result;
3390    }
3391
3392    public boolean hasResultElement() { 
3393      return this.result != null && !this.result.isEmpty();
3394    }
3395
3396    public boolean hasResult() { 
3397      return this.result != null && !this.result.isEmpty();
3398    }
3399
3400    /**
3401     * @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
3402     */
3403    public TestReport setResultElement(Enumeration<TestReportResult> value) { 
3404      this.result = value;
3405      return this;
3406    }
3407
3408    /**
3409     * @return The overall result from the execution of the TestScript.
3410     */
3411    public TestReportResult getResult() { 
3412      return this.result == null ? null : this.result.getValue();
3413    }
3414
3415    /**
3416     * @param value The overall result from the execution of the TestScript.
3417     */
3418    public TestReport setResult(TestReportResult value) { 
3419        if (this.result == null)
3420          this.result = new Enumeration<TestReportResult>(new TestReportResultEnumFactory());
3421        this.result.setValue(value);
3422      return this;
3423    }
3424
3425    /**
3426     * @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
3427     */
3428    public DecimalType getScoreElement() { 
3429      if (this.score == null)
3430        if (Configuration.errorOnAutoCreate())
3431          throw new Error("Attempt to auto-create TestReport.score");
3432        else if (Configuration.doAutoCreate())
3433          this.score = new DecimalType(); // bb
3434      return this.score;
3435    }
3436
3437    public boolean hasScoreElement() { 
3438      return this.score != null && !this.score.isEmpty();
3439    }
3440
3441    public boolean hasScore() { 
3442      return this.score != null && !this.score.isEmpty();
3443    }
3444
3445    /**
3446     * @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
3447     */
3448    public TestReport setScoreElement(DecimalType value) { 
3449      this.score = value;
3450      return this;
3451    }
3452
3453    /**
3454     * @return The final score (percentage of tests passed) resulting from the execution of the TestScript.
3455     */
3456    public BigDecimal getScore() { 
3457      return this.score == null ? null : this.score.getValue();
3458    }
3459
3460    /**
3461     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3462     */
3463    public TestReport setScore(BigDecimal value) { 
3464      if (value == null)
3465        this.score = null;
3466      else {
3467        if (this.score == null)
3468          this.score = new DecimalType();
3469        this.score.setValue(value);
3470      }
3471      return this;
3472    }
3473
3474    /**
3475     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3476     */
3477    public TestReport setScore(long value) { 
3478          this.score = new DecimalType();
3479        this.score.setValue(value);
3480      return this;
3481    }
3482
3483    /**
3484     * @param value The final score (percentage of tests passed) resulting from the execution of the TestScript.
3485     */
3486    public TestReport setScore(double value) { 
3487          this.score = new DecimalType();
3488        this.score.setValue(value);
3489      return this;
3490    }
3491
3492    /**
3493     * @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
3494     */
3495    public StringType getTesterElement() { 
3496      if (this.tester == null)
3497        if (Configuration.errorOnAutoCreate())
3498          throw new Error("Attempt to auto-create TestReport.tester");
3499        else if (Configuration.doAutoCreate())
3500          this.tester = new StringType(); // bb
3501      return this.tester;
3502    }
3503
3504    public boolean hasTesterElement() { 
3505      return this.tester != null && !this.tester.isEmpty();
3506    }
3507
3508    public boolean hasTester() { 
3509      return this.tester != null && !this.tester.isEmpty();
3510    }
3511
3512    /**
3513     * @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
3514     */
3515    public TestReport setTesterElement(StringType value) { 
3516      this.tester = value;
3517      return this;
3518    }
3519
3520    /**
3521     * @return Name of the tester producing this report (Organization or individual).
3522     */
3523    public String getTester() { 
3524      return this.tester == null ? null : this.tester.getValue();
3525    }
3526
3527    /**
3528     * @param value Name of the tester producing this report (Organization or individual).
3529     */
3530    public TestReport setTester(String value) { 
3531      if (Utilities.noString(value))
3532        this.tester = null;
3533      else {
3534        if (this.tester == null)
3535          this.tester = new StringType();
3536        this.tester.setValue(value);
3537      }
3538      return this;
3539    }
3540
3541    /**
3542     * @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
3543     */
3544    public DateTimeType getIssuedElement() { 
3545      if (this.issued == null)
3546        if (Configuration.errorOnAutoCreate())
3547          throw new Error("Attempt to auto-create TestReport.issued");
3548        else if (Configuration.doAutoCreate())
3549          this.issued = new DateTimeType(); // bb
3550      return this.issued;
3551    }
3552
3553    public boolean hasIssuedElement() { 
3554      return this.issued != null && !this.issued.isEmpty();
3555    }
3556
3557    public boolean hasIssued() { 
3558      return this.issued != null && !this.issued.isEmpty();
3559    }
3560
3561    /**
3562     * @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
3563     */
3564    public TestReport setIssuedElement(DateTimeType value) { 
3565      this.issued = value;
3566      return this;
3567    }
3568
3569    /**
3570     * @return When the TestScript was executed and this TestReport was generated.
3571     */
3572    public Date getIssued() { 
3573      return this.issued == null ? null : this.issued.getValue();
3574    }
3575
3576    /**
3577     * @param value When the TestScript was executed and this TestReport was generated.
3578     */
3579    public TestReport setIssued(Date value) { 
3580      if (value == null)
3581        this.issued = null;
3582      else {
3583        if (this.issued == null)
3584          this.issued = new DateTimeType();
3585        this.issued.setValue(value);
3586      }
3587      return this;
3588    }
3589
3590    /**
3591     * @return {@link #participant} (A participant in the test execution, either the execution engine, a client, or a server.)
3592     */
3593    public List<TestReportParticipantComponent> getParticipant() { 
3594      if (this.participant == null)
3595        this.participant = new ArrayList<TestReportParticipantComponent>();
3596      return this.participant;
3597    }
3598
3599    /**
3600     * @return Returns a reference to <code>this</code> for easy method chaining
3601     */
3602    public TestReport setParticipant(List<TestReportParticipantComponent> theParticipant) { 
3603      this.participant = theParticipant;
3604      return this;
3605    }
3606
3607    public boolean hasParticipant() { 
3608      if (this.participant == null)
3609        return false;
3610      for (TestReportParticipantComponent item : this.participant)
3611        if (!item.isEmpty())
3612          return true;
3613      return false;
3614    }
3615
3616    public TestReportParticipantComponent addParticipant() { //3
3617      TestReportParticipantComponent t = new TestReportParticipantComponent();
3618      if (this.participant == null)
3619        this.participant = new ArrayList<TestReportParticipantComponent>();
3620      this.participant.add(t);
3621      return t;
3622    }
3623
3624    public TestReport addParticipant(TestReportParticipantComponent t) { //3
3625      if (t == null)
3626        return this;
3627      if (this.participant == null)
3628        this.participant = new ArrayList<TestReportParticipantComponent>();
3629      this.participant.add(t);
3630      return this;
3631    }
3632
3633    /**
3634     * @return The first repetition of repeating field {@link #participant}, creating it if it does not already exist {3}
3635     */
3636    public TestReportParticipantComponent getParticipantFirstRep() { 
3637      if (getParticipant().isEmpty()) {
3638        addParticipant();
3639      }
3640      return getParticipant().get(0);
3641    }
3642
3643    /**
3644     * @return {@link #setup} (The results of the series of required setup operations before the tests were executed.)
3645     */
3646    public TestReportSetupComponent getSetup() { 
3647      if (this.setup == null)
3648        if (Configuration.errorOnAutoCreate())
3649          throw new Error("Attempt to auto-create TestReport.setup");
3650        else if (Configuration.doAutoCreate())
3651          this.setup = new TestReportSetupComponent(); // cc
3652      return this.setup;
3653    }
3654
3655    public boolean hasSetup() { 
3656      return this.setup != null && !this.setup.isEmpty();
3657    }
3658
3659    /**
3660     * @param value {@link #setup} (The results of the series of required setup operations before the tests were executed.)
3661     */
3662    public TestReport setSetup(TestReportSetupComponent value) { 
3663      this.setup = value;
3664      return this;
3665    }
3666
3667    /**
3668     * @return {@link #test} (A test executed from the test script.)
3669     */
3670    public List<TestReportTestComponent> getTest() { 
3671      if (this.test == null)
3672        this.test = new ArrayList<TestReportTestComponent>();
3673      return this.test;
3674    }
3675
3676    /**
3677     * @return Returns a reference to <code>this</code> for easy method chaining
3678     */
3679    public TestReport setTest(List<TestReportTestComponent> theTest) { 
3680      this.test = theTest;
3681      return this;
3682    }
3683
3684    public boolean hasTest() { 
3685      if (this.test == null)
3686        return false;
3687      for (TestReportTestComponent item : this.test)
3688        if (!item.isEmpty())
3689          return true;
3690      return false;
3691    }
3692
3693    public TestReportTestComponent addTest() { //3
3694      TestReportTestComponent t = new TestReportTestComponent();
3695      if (this.test == null)
3696        this.test = new ArrayList<TestReportTestComponent>();
3697      this.test.add(t);
3698      return t;
3699    }
3700
3701    public TestReport addTest(TestReportTestComponent t) { //3
3702      if (t == null)
3703        return this;
3704      if (this.test == null)
3705        this.test = new ArrayList<TestReportTestComponent>();
3706      this.test.add(t);
3707      return this;
3708    }
3709
3710    /**
3711     * @return The first repetition of repeating field {@link #test}, creating it if it does not already exist {3}
3712     */
3713    public TestReportTestComponent getTestFirstRep() { 
3714      if (getTest().isEmpty()) {
3715        addTest();
3716      }
3717      return getTest().get(0);
3718    }
3719
3720    /**
3721     * @return {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).)
3722     */
3723    public TestReportTeardownComponent getTeardown() { 
3724      if (this.teardown == null)
3725        if (Configuration.errorOnAutoCreate())
3726          throw new Error("Attempt to auto-create TestReport.teardown");
3727        else if (Configuration.doAutoCreate())
3728          this.teardown = new TestReportTeardownComponent(); // cc
3729      return this.teardown;
3730    }
3731
3732    public boolean hasTeardown() { 
3733      return this.teardown != null && !this.teardown.isEmpty();
3734    }
3735
3736    /**
3737     * @param value {@link #teardown} (The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).)
3738     */
3739    public TestReport setTeardown(TestReportTeardownComponent value) { 
3740      this.teardown = value;
3741      return this;
3742    }
3743
3744      protected void listChildren(List<Property> children) {
3745        super.listChildren(children);
3746        children.add(new Property("identifier", "Identifier", "Identifier for the TestReport assigned for external purposes outside the context of FHIR.", 0, 1, identifier));
3747        children.add(new Property("name", "string", "A free text natural language name identifying the executed TestReport.", 0, 1, name));
3748        children.add(new Property("status", "code", "The current state of this test report.", 0, 1, status));
3749        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));
3750        children.add(new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result));
3751        children.add(new Property("score", "decimal", "The final score (percentage of tests passed) resulting from the execution of the TestScript.", 0, 1, score));
3752        children.add(new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester));
3753        children.add(new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued));
3754        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));
3755        children.add(new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup));
3756        children.add(new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test));
3757        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));
3758      }
3759
3760      @Override
3761      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3762        switch (_hash) {
3763        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "Identifier for the TestReport assigned for external purposes outside the context of FHIR.", 0, 1, identifier);
3764        case 3373707: /*name*/  return new Property("name", "string", "A free text natural language name identifying the executed TestReport.", 0, 1, name);
3765        case -892481550: /*status*/  return new Property("status", "code", "The current state of this test report.", 0, 1, status);
3766        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);
3767        case -934426595: /*result*/  return new Property("result", "code", "The overall result from the execution of the TestScript.", 0, 1, result);
3768        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);
3769        case -877169473: /*tester*/  return new Property("tester", "string", "Name of the tester producing this report (Organization or individual).", 0, 1, tester);
3770        case -1179159893: /*issued*/  return new Property("issued", "dateTime", "When the TestScript was executed and this TestReport was generated.", 0, 1, issued);
3771        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);
3772        case 109329021: /*setup*/  return new Property("setup", "", "The results of the series of required setup operations before the tests were executed.", 0, 1, setup);
3773        case 3556498: /*test*/  return new Property("test", "", "A test executed from the test script.", 0, java.lang.Integer.MAX_VALUE, test);
3774        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);
3775        default: return super.getNamedProperty(_hash, _name, _checkValid);
3776        }
3777
3778      }
3779
3780      @Override
3781      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3782        switch (hash) {
3783        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
3784        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3785        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<TestReportStatus>
3786        case 1712049149: /*testScript*/ return this.testScript == null ? new Base[0] : new Base[] {this.testScript}; // CanonicalType
3787        case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Enumeration<TestReportResult>
3788        case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType
3789        case -877169473: /*tester*/ return this.tester == null ? new Base[0] : new Base[] {this.tester}; // StringType
3790        case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType
3791        case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // TestReportParticipantComponent
3792        case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestReportSetupComponent
3793        case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestReportTestComponent
3794        case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestReportTeardownComponent
3795        default: return super.getProperty(hash, name, checkValid);
3796        }
3797
3798      }
3799
3800      @Override
3801      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3802        switch (hash) {
3803        case -1618432855: // identifier
3804          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
3805          return value;
3806        case 3373707: // name
3807          this.name = TypeConvertor.castToString(value); // StringType
3808          return value;
3809        case -892481550: // status
3810          value = new TestReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3811          this.status = (Enumeration) value; // Enumeration<TestReportStatus>
3812          return value;
3813        case 1712049149: // testScript
3814          this.testScript = TypeConvertor.castToCanonical(value); // CanonicalType
3815          return value;
3816        case -934426595: // result
3817          value = new TestReportResultEnumFactory().fromType(TypeConvertor.castToCode(value));
3818          this.result = (Enumeration) value; // Enumeration<TestReportResult>
3819          return value;
3820        case 109264530: // score
3821          this.score = TypeConvertor.castToDecimal(value); // DecimalType
3822          return value;
3823        case -877169473: // tester
3824          this.tester = TypeConvertor.castToString(value); // StringType
3825          return value;
3826        case -1179159893: // issued
3827          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
3828          return value;
3829        case 767422259: // participant
3830          this.getParticipant().add((TestReportParticipantComponent) value); // TestReportParticipantComponent
3831          return value;
3832        case 109329021: // setup
3833          this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent
3834          return value;
3835        case 3556498: // test
3836          this.getTest().add((TestReportTestComponent) value); // TestReportTestComponent
3837          return value;
3838        case -1663474172: // teardown
3839          this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent
3840          return value;
3841        default: return super.setProperty(hash, name, value);
3842        }
3843
3844      }
3845
3846      @Override
3847      public Base setProperty(String name, Base value) throws FHIRException {
3848        if (name.equals("identifier")) {
3849          this.identifier = TypeConvertor.castToIdentifier(value); // Identifier
3850        } else if (name.equals("name")) {
3851          this.name = TypeConvertor.castToString(value); // StringType
3852        } else if (name.equals("status")) {
3853          value = new TestReportStatusEnumFactory().fromType(TypeConvertor.castToCode(value));
3854          this.status = (Enumeration) value; // Enumeration<TestReportStatus>
3855        } else if (name.equals("testScript")) {
3856          this.testScript = TypeConvertor.castToCanonical(value); // CanonicalType
3857        } else if (name.equals("result")) {
3858          value = new TestReportResultEnumFactory().fromType(TypeConvertor.castToCode(value));
3859          this.result = (Enumeration) value; // Enumeration<TestReportResult>
3860        } else if (name.equals("score")) {
3861          this.score = TypeConvertor.castToDecimal(value); // DecimalType
3862        } else if (name.equals("tester")) {
3863          this.tester = TypeConvertor.castToString(value); // StringType
3864        } else if (name.equals("issued")) {
3865          this.issued = TypeConvertor.castToDateTime(value); // DateTimeType
3866        } else if (name.equals("participant")) {
3867          this.getParticipant().add((TestReportParticipantComponent) value);
3868        } else if (name.equals("setup")) {
3869          this.setup = (TestReportSetupComponent) value; // TestReportSetupComponent
3870        } else if (name.equals("test")) {
3871          this.getTest().add((TestReportTestComponent) value);
3872        } else if (name.equals("teardown")) {
3873          this.teardown = (TestReportTeardownComponent) value; // TestReportTeardownComponent
3874        } else
3875          return super.setProperty(name, value);
3876        return value;
3877      }
3878
3879      @Override
3880      public Base makeProperty(int hash, String name) throws FHIRException {
3881        switch (hash) {
3882        case -1618432855:  return getIdentifier();
3883        case 3373707:  return getNameElement();
3884        case -892481550:  return getStatusElement();
3885        case 1712049149:  return getTestScriptElement();
3886        case -934426595:  return getResultElement();
3887        case 109264530:  return getScoreElement();
3888        case -877169473:  return getTesterElement();
3889        case -1179159893:  return getIssuedElement();
3890        case 767422259:  return addParticipant(); 
3891        case 109329021:  return getSetup();
3892        case 3556498:  return addTest(); 
3893        case -1663474172:  return getTeardown();
3894        default: return super.makeProperty(hash, name);
3895        }
3896
3897      }
3898
3899      @Override
3900      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3901        switch (hash) {
3902        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
3903        case 3373707: /*name*/ return new String[] {"string"};
3904        case -892481550: /*status*/ return new String[] {"code"};
3905        case 1712049149: /*testScript*/ return new String[] {"canonical"};
3906        case -934426595: /*result*/ return new String[] {"code"};
3907        case 109264530: /*score*/ return new String[] {"decimal"};
3908        case -877169473: /*tester*/ return new String[] {"string"};
3909        case -1179159893: /*issued*/ return new String[] {"dateTime"};
3910        case 767422259: /*participant*/ return new String[] {};
3911        case 109329021: /*setup*/ return new String[] {};
3912        case 3556498: /*test*/ return new String[] {};
3913        case -1663474172: /*teardown*/ return new String[] {};
3914        default: return super.getTypesForProperty(hash, name);
3915        }
3916
3917      }
3918
3919      @Override
3920      public Base addChild(String name) throws FHIRException {
3921        if (name.equals("identifier")) {
3922          this.identifier = new Identifier();
3923          return this.identifier;
3924        }
3925        else if (name.equals("name")) {
3926          throw new FHIRException("Cannot call addChild on a singleton property TestReport.name");
3927        }
3928        else if (name.equals("status")) {
3929          throw new FHIRException("Cannot call addChild on a singleton property TestReport.status");
3930        }
3931        else if (name.equals("testScript")) {
3932          throw new FHIRException("Cannot call addChild on a singleton property TestReport.testScript");
3933        }
3934        else if (name.equals("result")) {
3935          throw new FHIRException("Cannot call addChild on a singleton property TestReport.result");
3936        }
3937        else if (name.equals("score")) {
3938          throw new FHIRException("Cannot call addChild on a singleton property TestReport.score");
3939        }
3940        else if (name.equals("tester")) {
3941          throw new FHIRException("Cannot call addChild on a singleton property TestReport.tester");
3942        }
3943        else if (name.equals("issued")) {
3944          throw new FHIRException("Cannot call addChild on a singleton property TestReport.issued");
3945        }
3946        else if (name.equals("participant")) {
3947          return addParticipant();
3948        }
3949        else if (name.equals("setup")) {
3950          this.setup = new TestReportSetupComponent();
3951          return this.setup;
3952        }
3953        else if (name.equals("test")) {
3954          return addTest();
3955        }
3956        else if (name.equals("teardown")) {
3957          this.teardown = new TestReportTeardownComponent();
3958          return this.teardown;
3959        }
3960        else
3961          return super.addChild(name);
3962      }
3963
3964  public String fhirType() {
3965    return "TestReport";
3966
3967  }
3968
3969      public TestReport copy() {
3970        TestReport dst = new TestReport();
3971        copyValues(dst);
3972        return dst;
3973      }
3974
3975      public void copyValues(TestReport dst) {
3976        super.copyValues(dst);
3977        dst.identifier = identifier == null ? null : identifier.copy();
3978        dst.name = name == null ? null : name.copy();
3979        dst.status = status == null ? null : status.copy();
3980        dst.testScript = testScript == null ? null : testScript.copy();
3981        dst.result = result == null ? null : result.copy();
3982        dst.score = score == null ? null : score.copy();
3983        dst.tester = tester == null ? null : tester.copy();
3984        dst.issued = issued == null ? null : issued.copy();
3985        if (participant != null) {
3986          dst.participant = new ArrayList<TestReportParticipantComponent>();
3987          for (TestReportParticipantComponent i : participant)
3988            dst.participant.add(i.copy());
3989        };
3990        dst.setup = setup == null ? null : setup.copy();
3991        if (test != null) {
3992          dst.test = new ArrayList<TestReportTestComponent>();
3993          for (TestReportTestComponent i : test)
3994            dst.test.add(i.copy());
3995        };
3996        dst.teardown = teardown == null ? null : teardown.copy();
3997      }
3998
3999      protected TestReport typedCopy() {
4000        return copy();
4001      }
4002
4003      @Override
4004      public boolean equalsDeep(Base other_) {
4005        if (!super.equalsDeep(other_))
4006          return false;
4007        if (!(other_ instanceof TestReport))
4008          return false;
4009        TestReport o = (TestReport) other_;
4010        return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true)
4011           && compareDeep(testScript, o.testScript, true) && compareDeep(result, o.result, true) && compareDeep(score, o.score, true)
4012           && compareDeep(tester, o.tester, true) && compareDeep(issued, o.issued, true) && compareDeep(participant, o.participant, true)
4013           && compareDeep(setup, o.setup, true) && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true)
4014          ;
4015      }
4016
4017      @Override
4018      public boolean equalsShallow(Base other_) {
4019        if (!super.equalsShallow(other_))
4020          return false;
4021        if (!(other_ instanceof TestReport))
4022          return false;
4023        TestReport o = (TestReport) other_;
4024        return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(testScript, o.testScript, true)
4025           && compareValues(result, o.result, true) && compareValues(score, o.score, true) && compareValues(tester, o.tester, true)
4026           && compareValues(issued, o.issued, true);
4027      }
4028
4029      public boolean isEmpty() {
4030        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, name, status
4031          , testScript, result, score, tester, issued, participant, setup, test, teardown
4032          );
4033      }
4034
4035  @Override
4036  public ResourceType getResourceType() {
4037    return ResourceType.TestReport;
4038   }
4039
4040 /**
4041   * Search parameter: <b>identifier</b>
4042   * <p>
4043   * Description: <b>An external identifier for the test report</b><br>
4044   * Type: <b>token</b><br>
4045   * Path: <b>TestReport.identifier</b><br>
4046   * </p>
4047   */
4048  @SearchParamDefinition(name="identifier", path="TestReport.identifier", description="An external identifier for the test report", type="token" )
4049  public static final String SP_IDENTIFIER = "identifier";
4050 /**
4051   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
4052   * <p>
4053   * Description: <b>An external identifier for the test report</b><br>
4054   * Type: <b>token</b><br>
4055   * Path: <b>TestReport.identifier</b><br>
4056   * </p>
4057   */
4058  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
4059
4060 /**
4061   * Search parameter: <b>issued</b>
4062   * <p>
4063   * Description: <b>The test report generation date</b><br>
4064   * Type: <b>date</b><br>
4065   * Path: <b>TestReport.issued</b><br>
4066   * </p>
4067   */
4068  @SearchParamDefinition(name="issued", path="TestReport.issued", description="The test report generation date", type="date" )
4069  public static final String SP_ISSUED = "issued";
4070 /**
4071   * <b>Fluent Client</b> search parameter constant for <b>issued</b>
4072   * <p>
4073   * Description: <b>The test report generation date</b><br>
4074   * Type: <b>date</b><br>
4075   * Path: <b>TestReport.issued</b><br>
4076   * </p>
4077   */
4078  public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED);
4079
4080 /**
4081   * Search parameter: <b>participant</b>
4082   * <p>
4083   * Description: <b>The reference to a participant in the test execution</b><br>
4084   * Type: <b>uri</b><br>
4085   * Path: <b>TestReport.participant.uri</b><br>
4086   * </p>
4087   */
4088  @SearchParamDefinition(name="participant", path="TestReport.participant.uri", description="The reference to a participant in the test execution", type="uri" )
4089  public static final String SP_PARTICIPANT = "participant";
4090 /**
4091   * <b>Fluent Client</b> search parameter constant for <b>participant</b>
4092   * <p>
4093   * Description: <b>The reference to a participant in the test execution</b><br>
4094   * Type: <b>uri</b><br>
4095   * Path: <b>TestReport.participant.uri</b><br>
4096   * </p>
4097   */
4098  public static final ca.uhn.fhir.rest.gclient.UriClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_PARTICIPANT);
4099
4100 /**
4101   * Search parameter: <b>result</b>
4102   * <p>
4103   * Description: <b>The result disposition of the test execution</b><br>
4104   * Type: <b>token</b><br>
4105   * Path: <b>TestReport.result</b><br>
4106   * </p>
4107   */
4108  @SearchParamDefinition(name="result", path="TestReport.result", description="The result disposition of the test execution", type="token" )
4109  public static final String SP_RESULT = "result";
4110 /**
4111   * <b>Fluent Client</b> search parameter constant for <b>result</b>
4112   * <p>
4113   * Description: <b>The result disposition of the test execution</b><br>
4114   * Type: <b>token</b><br>
4115   * Path: <b>TestReport.result</b><br>
4116   * </p>
4117   */
4118  public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESULT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESULT);
4119
4120 /**
4121   * Search parameter: <b>status</b>
4122   * <p>
4123   * Description: <b>The current status of the test report</b><br>
4124   * Type: <b>token</b><br>
4125   * Path: <b>TestReport.status</b><br>
4126   * </p>
4127   */
4128  @SearchParamDefinition(name="status", path="TestReport.status", description="The current status of the test report", type="token" )
4129  public static final String SP_STATUS = "status";
4130 /**
4131   * <b>Fluent Client</b> search parameter constant for <b>status</b>
4132   * <p>
4133   * Description: <b>The current status of the test report</b><br>
4134   * Type: <b>token</b><br>
4135   * Path: <b>TestReport.status</b><br>
4136   * </p>
4137   */
4138  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
4139
4140 /**
4141   * Search parameter: <b>tester</b>
4142   * <p>
4143   * Description: <b>The name of the testing organization</b><br>
4144   * Type: <b>string</b><br>
4145   * Path: <b>TestReport.tester</b><br>
4146   * </p>
4147   */
4148  @SearchParamDefinition(name="tester", path="TestReport.tester", description="The name of the testing organization", type="string" )
4149  public static final String SP_TESTER = "tester";
4150 /**
4151   * <b>Fluent Client</b> search parameter constant for <b>tester</b>
4152   * <p>
4153   * Description: <b>The name of the testing organization</b><br>
4154   * Type: <b>string</b><br>
4155   * Path: <b>TestReport.tester</b><br>
4156   * </p>
4157   */
4158  public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTER);
4159
4160 /**
4161   * Search parameter: <b>testscript</b>
4162   * <p>
4163   * Description: <b>The test script executed to produce this report</b><br>
4164   * Type: <b>reference</b><br>
4165   * Path: <b>TestReport.testScript</b><br>
4166   * </p>
4167   */
4168  @SearchParamDefinition(name="testscript", path="TestReport.testScript", description="The test script executed to produce this report", type="reference", target={TestScript.class } )
4169  public static final String SP_TESTSCRIPT = "testscript";
4170 /**
4171   * <b>Fluent Client</b> search parameter constant for <b>testscript</b>
4172   * <p>
4173   * Description: <b>The test script executed to produce this report</b><br>
4174   * Type: <b>reference</b><br>
4175   * Path: <b>TestReport.testScript</b><br>
4176   * </p>
4177   */
4178  public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TESTSCRIPT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TESTSCRIPT);
4179
4180/**
4181   * Constant for fluent queries to be used to add include statements. Specifies
4182   * the path value of "<b>TestReport:testscript</b>".
4183   */
4184  public static final ca.uhn.fhir.model.api.Include INCLUDE_TESTSCRIPT = new ca.uhn.fhir.model.api.Include("TestReport:testscript").toLocked();
4185
4186
4187}
4188