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