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