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