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