001package org.hl7.fhir.r4.model;
002
003/*
004  Copyright (c) 2011+, HL7, Inc.
005  All rights reserved.
006  
007  Redistribution and use in source and binary forms, with or without modification, 
008  are permitted provided that the following conditions are met:
009  
010   * Redistributions of source code must retain the above copyright notice, this 
011     list of conditions and the following disclaimer.
012   * Redistributions in binary form must reproduce the above copyright notice, 
013     this list of conditions and the following disclaimer in the documentation 
014     and/or other materials provided with the distribution.
015   * Neither the name of HL7 nor the names of its contributors may be used to 
016     endorse or promote products derived from this software without specific 
017     prior written permission.
018  
019  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
020  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
021  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
022  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
023  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
024  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
025  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
026  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
027  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
028  POSSIBILITY OF SUCH DAMAGE.
029  
030*/
031
032// Generated on Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034import java.util.*;
035
036import org.hl7.fhir.utilities.Utilities;
037import org.hl7.fhir.r4.model.Enumerations.*;
038import ca.uhn.fhir.model.api.annotation.ResourceDef;
039import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
040import ca.uhn.fhir.model.api.annotation.Child;
041import ca.uhn.fhir.model.api.annotation.ChildOrder;
042import ca.uhn.fhir.model.api.annotation.Description;
043import ca.uhn.fhir.model.api.annotation.Block;
044import org.hl7.fhir.instance.model.api.*;
045import org.hl7.fhir.exceptions.FHIRException;
046/**
047 * A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.
048 */
049@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript")
050@ChildOrder(names={"url", "identifier", "version", "name", "title", "status", "experimental", "date", "publisher", "contact", "description", "useContext", "jurisdiction", "purpose", "copyright", "origin", "destination", "metadata", "fixture", "profile", "variable", "rule", "ruleset", "setup", "test", "teardown"})
051public class TestScript extends MetadataResource {
052
053    public enum AssertionDirectionType {
054        /**
055         * The assertion is evaluated on the response. This is the default value.
056         */
057        RESPONSE, 
058        /**
059         * The assertion is evaluated on the request.
060         */
061        REQUEST, 
062        /**
063         * added to help the parsers with the generic types
064         */
065        NULL;
066        public static AssertionDirectionType fromCode(String codeString) throws FHIRException {
067            if (codeString == null || "".equals(codeString))
068                return null;
069        if ("response".equals(codeString))
070          return RESPONSE;
071        if ("request".equals(codeString))
072          return REQUEST;
073        if (Configuration.isAcceptInvalidEnums())
074          return null;
075        else
076          throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
077        }
078        public String toCode() {
079          switch (this) {
080            case RESPONSE: return "response";
081            case REQUEST: return "request";
082            default: return "?";
083          }
084        }
085        public String getSystem() {
086          switch (this) {
087            case RESPONSE: return "http://hl7.org/fhir/assert-direction-codes";
088            case REQUEST: return "http://hl7.org/fhir/assert-direction-codes";
089            default: return "?";
090          }
091        }
092        public String getDefinition() {
093          switch (this) {
094            case RESPONSE: return "The assertion is evaluated on the response. This is the default value.";
095            case REQUEST: return "The assertion is evaluated on the request.";
096            default: return "?";
097          }
098        }
099        public String getDisplay() {
100          switch (this) {
101            case RESPONSE: return "response";
102            case REQUEST: return "request";
103            default: return "?";
104          }
105        }
106    }
107
108  public static class AssertionDirectionTypeEnumFactory implements EnumFactory<AssertionDirectionType> {
109    public AssertionDirectionType fromCode(String codeString) throws IllegalArgumentException {
110      if (codeString == null || "".equals(codeString))
111            if (codeString == null || "".equals(codeString))
112                return null;
113        if ("response".equals(codeString))
114          return AssertionDirectionType.RESPONSE;
115        if ("request".equals(codeString))
116          return AssertionDirectionType.REQUEST;
117        throw new IllegalArgumentException("Unknown AssertionDirectionType code '"+codeString+"'");
118        }
119        public Enumeration<AssertionDirectionType> fromType(Base code) throws FHIRException {
120          if (code == null)
121            return null;
122          if (code.isEmpty())
123            return new Enumeration<AssertionDirectionType>(this);
124          String codeString = ((PrimitiveType) code).asStringValue();
125          if (codeString == null || "".equals(codeString))
126            return null;
127        if ("response".equals(codeString))
128          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.RESPONSE);
129        if ("request".equals(codeString))
130          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.REQUEST);
131        throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
132        }
133    public String toCode(AssertionDirectionType code) {
134      if (code == AssertionDirectionType.RESPONSE)
135        return "response";
136      if (code == AssertionDirectionType.REQUEST)
137        return "request";
138      return "?";
139      }
140    public String toSystem(AssertionDirectionType code) {
141      return code.getSystem();
142      }
143    }
144
145    public enum AssertionOperatorType {
146        /**
147         * Default value. Equals comparison.
148         */
149        EQUALS, 
150        /**
151         * Not equals comparison.
152         */
153        NOTEQUALS, 
154        /**
155         * Compare value within a known set of values.
156         */
157        IN, 
158        /**
159         * Compare value not within a known set of values.
160         */
161        NOTIN, 
162        /**
163         * Compare value to be greater than a known value.
164         */
165        GREATERTHAN, 
166        /**
167         * Compare value to be less than a known value.
168         */
169        LESSTHAN, 
170        /**
171         * Compare value is empty.
172         */
173        EMPTY, 
174        /**
175         * Compare value is not empty.
176         */
177        NOTEMPTY, 
178        /**
179         * Compare value string contains a known value.
180         */
181        CONTAINS, 
182        /**
183         * Compare value string does not contain a known value.
184         */
185        NOTCONTAINS, 
186        /**
187         * Evaluate the FHIRPath expression as a boolean condition.
188         */
189        EVAL, 
190        /**
191         * added to help the parsers with the generic types
192         */
193        NULL;
194        public static AssertionOperatorType fromCode(String codeString) throws FHIRException {
195            if (codeString == null || "".equals(codeString))
196                return null;
197        if ("equals".equals(codeString))
198          return EQUALS;
199        if ("notEquals".equals(codeString))
200          return NOTEQUALS;
201        if ("in".equals(codeString))
202          return IN;
203        if ("notIn".equals(codeString))
204          return NOTIN;
205        if ("greaterThan".equals(codeString))
206          return GREATERTHAN;
207        if ("lessThan".equals(codeString))
208          return LESSTHAN;
209        if ("empty".equals(codeString))
210          return EMPTY;
211        if ("notEmpty".equals(codeString))
212          return NOTEMPTY;
213        if ("contains".equals(codeString))
214          return CONTAINS;
215        if ("notContains".equals(codeString))
216          return NOTCONTAINS;
217        if ("eval".equals(codeString))
218          return EVAL;
219        if (Configuration.isAcceptInvalidEnums())
220          return null;
221        else
222          throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
223        }
224        public String toCode() {
225          switch (this) {
226            case EQUALS: return "equals";
227            case NOTEQUALS: return "notEquals";
228            case IN: return "in";
229            case NOTIN: return "notIn";
230            case GREATERTHAN: return "greaterThan";
231            case LESSTHAN: return "lessThan";
232            case EMPTY: return "empty";
233            case NOTEMPTY: return "notEmpty";
234            case CONTAINS: return "contains";
235            case NOTCONTAINS: return "notContains";
236            case EVAL: return "eval";
237            default: return "?";
238          }
239        }
240        public String getSystem() {
241          switch (this) {
242            case EQUALS: return "http://hl7.org/fhir/assert-operator-codes";
243            case NOTEQUALS: return "http://hl7.org/fhir/assert-operator-codes";
244            case IN: return "http://hl7.org/fhir/assert-operator-codes";
245            case NOTIN: return "http://hl7.org/fhir/assert-operator-codes";
246            case GREATERTHAN: return "http://hl7.org/fhir/assert-operator-codes";
247            case LESSTHAN: return "http://hl7.org/fhir/assert-operator-codes";
248            case EMPTY: return "http://hl7.org/fhir/assert-operator-codes";
249            case NOTEMPTY: return "http://hl7.org/fhir/assert-operator-codes";
250            case CONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
251            case NOTCONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
252            case EVAL: return "http://hl7.org/fhir/assert-operator-codes";
253            default: return "?";
254          }
255        }
256        public String getDefinition() {
257          switch (this) {
258            case EQUALS: return "Default value. Equals comparison.";
259            case NOTEQUALS: return "Not equals comparison.";
260            case IN: return "Compare value within a known set of values.";
261            case NOTIN: return "Compare value not within a known set of values.";
262            case GREATERTHAN: return "Compare value to be greater than a known value.";
263            case LESSTHAN: return "Compare value to be less than a known value.";
264            case EMPTY: return "Compare value is empty.";
265            case NOTEMPTY: return "Compare value is not empty.";
266            case CONTAINS: return "Compare value string contains a known value.";
267            case NOTCONTAINS: return "Compare value string does not contain a known value.";
268            case EVAL: return "Evaluate the FHIRPath expression as a boolean condition.";
269            default: return "?";
270          }
271        }
272        public String getDisplay() {
273          switch (this) {
274            case EQUALS: return "equals";
275            case NOTEQUALS: return "notEquals";
276            case IN: return "in";
277            case NOTIN: return "notIn";
278            case GREATERTHAN: return "greaterThan";
279            case LESSTHAN: return "lessThan";
280            case EMPTY: return "empty";
281            case NOTEMPTY: return "notEmpty";
282            case CONTAINS: return "contains";
283            case NOTCONTAINS: return "notContains";
284            case EVAL: return "evaluate";
285            default: return "?";
286          }
287        }
288    }
289
290  public static class AssertionOperatorTypeEnumFactory implements EnumFactory<AssertionOperatorType> {
291    public AssertionOperatorType fromCode(String codeString) throws IllegalArgumentException {
292      if (codeString == null || "".equals(codeString))
293            if (codeString == null || "".equals(codeString))
294                return null;
295        if ("equals".equals(codeString))
296          return AssertionOperatorType.EQUALS;
297        if ("notEquals".equals(codeString))
298          return AssertionOperatorType.NOTEQUALS;
299        if ("in".equals(codeString))
300          return AssertionOperatorType.IN;
301        if ("notIn".equals(codeString))
302          return AssertionOperatorType.NOTIN;
303        if ("greaterThan".equals(codeString))
304          return AssertionOperatorType.GREATERTHAN;
305        if ("lessThan".equals(codeString))
306          return AssertionOperatorType.LESSTHAN;
307        if ("empty".equals(codeString))
308          return AssertionOperatorType.EMPTY;
309        if ("notEmpty".equals(codeString))
310          return AssertionOperatorType.NOTEMPTY;
311        if ("contains".equals(codeString))
312          return AssertionOperatorType.CONTAINS;
313        if ("notContains".equals(codeString))
314          return AssertionOperatorType.NOTCONTAINS;
315        if ("eval".equals(codeString))
316          return AssertionOperatorType.EVAL;
317        throw new IllegalArgumentException("Unknown AssertionOperatorType code '"+codeString+"'");
318        }
319        public Enumeration<AssertionOperatorType> fromType(Base code) throws FHIRException {
320          if (code == null)
321            return null;
322          if (code.isEmpty())
323            return new Enumeration<AssertionOperatorType>(this);
324          String codeString = ((PrimitiveType) code).asStringValue();
325          if (codeString == null || "".equals(codeString))
326            return null;
327        if ("equals".equals(codeString))
328          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EQUALS);
329        if ("notEquals".equals(codeString))
330          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEQUALS);
331        if ("in".equals(codeString))
332          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.IN);
333        if ("notIn".equals(codeString))
334          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTIN);
335        if ("greaterThan".equals(codeString))
336          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.GREATERTHAN);
337        if ("lessThan".equals(codeString))
338          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.LESSTHAN);
339        if ("empty".equals(codeString))
340          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EMPTY);
341        if ("notEmpty".equals(codeString))
342          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEMPTY);
343        if ("contains".equals(codeString))
344          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.CONTAINS);
345        if ("notContains".equals(codeString))
346          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTCONTAINS);
347        if ("eval".equals(codeString))
348          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EVAL);
349        throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
350        }
351    public String toCode(AssertionOperatorType code) {
352      if (code == AssertionOperatorType.EQUALS)
353        return "equals";
354      if (code == AssertionOperatorType.NOTEQUALS)
355        return "notEquals";
356      if (code == AssertionOperatorType.IN)
357        return "in";
358      if (code == AssertionOperatorType.NOTIN)
359        return "notIn";
360      if (code == AssertionOperatorType.GREATERTHAN)
361        return "greaterThan";
362      if (code == AssertionOperatorType.LESSTHAN)
363        return "lessThan";
364      if (code == AssertionOperatorType.EMPTY)
365        return "empty";
366      if (code == AssertionOperatorType.NOTEMPTY)
367        return "notEmpty";
368      if (code == AssertionOperatorType.CONTAINS)
369        return "contains";
370      if (code == AssertionOperatorType.NOTCONTAINS)
371        return "notContains";
372      if (code == AssertionOperatorType.EVAL)
373        return "eval";
374      return "?";
375      }
376    public String toSystem(AssertionOperatorType code) {
377      return code.getSystem();
378      }
379    }
380
381    public enum TestScriptRequestMethodCode {
382        /**
383         * HTTP DELETE operation
384         */
385        DELETE, 
386        /**
387         * HTTP GET operation
388         */
389        GET, 
390        /**
391         * HTTP OPTIONS operation
392         */
393        OPTIONS, 
394        /**
395         * HTTP PATCH operation
396         */
397        PATCH, 
398        /**
399         * HTTP POST operation
400         */
401        POST, 
402        /**
403         * HTTP PUT operation
404         */
405        PUT, 
406        /**
407         * added to help the parsers with the generic types
408         */
409        NULL;
410        public static TestScriptRequestMethodCode fromCode(String codeString) throws FHIRException {
411            if (codeString == null || "".equals(codeString))
412                return null;
413        if ("delete".equals(codeString))
414          return DELETE;
415        if ("get".equals(codeString))
416          return GET;
417        if ("options".equals(codeString))
418          return OPTIONS;
419        if ("patch".equals(codeString))
420          return PATCH;
421        if ("post".equals(codeString))
422          return POST;
423        if ("put".equals(codeString))
424          return PUT;
425        if (Configuration.isAcceptInvalidEnums())
426          return null;
427        else
428          throw new FHIRException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
429        }
430        public String toCode() {
431          switch (this) {
432            case DELETE: return "delete";
433            case GET: return "get";
434            case OPTIONS: return "options";
435            case PATCH: return "patch";
436            case POST: return "post";
437            case PUT: return "put";
438            default: return "?";
439          }
440        }
441        public String getSystem() {
442          switch (this) {
443            case DELETE: return "http://hl7.org/fhir/http-operations";
444            case GET: return "http://hl7.org/fhir/http-operations";
445            case OPTIONS: return "http://hl7.org/fhir/http-operations";
446            case PATCH: return "http://hl7.org/fhir/http-operations";
447            case POST: return "http://hl7.org/fhir/http-operations";
448            case PUT: return "http://hl7.org/fhir/http-operations";
449            default: return "?";
450          }
451        }
452        public String getDefinition() {
453          switch (this) {
454            case DELETE: return "HTTP DELETE operation";
455            case GET: return "HTTP GET operation";
456            case OPTIONS: return "HTTP OPTIONS operation";
457            case PATCH: return "HTTP PATCH operation";
458            case POST: return "HTTP POST operation";
459            case PUT: return "HTTP PUT operation";
460            default: return "?";
461          }
462        }
463        public String getDisplay() {
464          switch (this) {
465            case DELETE: return "DELETE";
466            case GET: return "GET";
467            case OPTIONS: return "OPTIONS";
468            case PATCH: return "PATCH";
469            case POST: return "POST";
470            case PUT: return "PUT";
471            default: return "?";
472          }
473        }
474    }
475
476  public static class TestScriptRequestMethodCodeEnumFactory implements EnumFactory<TestScriptRequestMethodCode> {
477    public TestScriptRequestMethodCode fromCode(String codeString) throws IllegalArgumentException {
478      if (codeString == null || "".equals(codeString))
479            if (codeString == null || "".equals(codeString))
480                return null;
481        if ("delete".equals(codeString))
482          return TestScriptRequestMethodCode.DELETE;
483        if ("get".equals(codeString))
484          return TestScriptRequestMethodCode.GET;
485        if ("options".equals(codeString))
486          return TestScriptRequestMethodCode.OPTIONS;
487        if ("patch".equals(codeString))
488          return TestScriptRequestMethodCode.PATCH;
489        if ("post".equals(codeString))
490          return TestScriptRequestMethodCode.POST;
491        if ("put".equals(codeString))
492          return TestScriptRequestMethodCode.PUT;
493        throw new IllegalArgumentException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
494        }
495        public Enumeration<TestScriptRequestMethodCode> fromType(Base code) throws FHIRException {
496          if (code == null)
497            return null;
498          if (code.isEmpty())
499            return new Enumeration<TestScriptRequestMethodCode>(this);
500          String codeString = ((PrimitiveType) code).asStringValue();
501          if (codeString == null || "".equals(codeString))
502            return null;
503        if ("delete".equals(codeString))
504          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.DELETE);
505        if ("get".equals(codeString))
506          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.GET);
507        if ("options".equals(codeString))
508          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.OPTIONS);
509        if ("patch".equals(codeString))
510          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.PATCH);
511        if ("post".equals(codeString))
512          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.POST);
513        if ("put".equals(codeString))
514          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.PUT);
515        throw new FHIRException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
516        }
517    public String toCode(TestScriptRequestMethodCode code) {
518      if (code == TestScriptRequestMethodCode.DELETE)
519        return "delete";
520      if (code == TestScriptRequestMethodCode.GET)
521        return "get";
522      if (code == TestScriptRequestMethodCode.OPTIONS)
523        return "options";
524      if (code == TestScriptRequestMethodCode.PATCH)
525        return "patch";
526      if (code == TestScriptRequestMethodCode.POST)
527        return "post";
528      if (code == TestScriptRequestMethodCode.PUT)
529        return "put";
530      return "?";
531      }
532    public String toSystem(TestScriptRequestMethodCode code) {
533      return code.getSystem();
534      }
535    }
536
537    public enum AssertionResponseTypes {
538        /**
539         * Response code is 200.
540         */
541        OKAY, 
542        /**
543         * Response code is 201.
544         */
545        CREATED, 
546        /**
547         * Response code is 204.
548         */
549        NOCONTENT, 
550        /**
551         * Response code is 304.
552         */
553        NOTMODIFIED, 
554        /**
555         * Response code is 400.
556         */
557        BAD, 
558        /**
559         * Response code is 403.
560         */
561        FORBIDDEN, 
562        /**
563         * Response code is 404.
564         */
565        NOTFOUND, 
566        /**
567         * Response code is 405.
568         */
569        METHODNOTALLOWED, 
570        /**
571         * Response code is 409.
572         */
573        CONFLICT, 
574        /**
575         * Response code is 410.
576         */
577        GONE, 
578        /**
579         * Response code is 412.
580         */
581        PRECONDITIONFAILED, 
582        /**
583         * Response code is 422.
584         */
585        UNPROCESSABLE, 
586        /**
587         * added to help the parsers with the generic types
588         */
589        NULL;
590        public static AssertionResponseTypes fromCode(String codeString) throws FHIRException {
591            if (codeString == null || "".equals(codeString))
592                return null;
593        if ("okay".equals(codeString))
594          return OKAY;
595        if ("created".equals(codeString))
596          return CREATED;
597        if ("noContent".equals(codeString))
598          return NOCONTENT;
599        if ("notModified".equals(codeString))
600          return NOTMODIFIED;
601        if ("bad".equals(codeString))
602          return BAD;
603        if ("forbidden".equals(codeString))
604          return FORBIDDEN;
605        if ("notFound".equals(codeString))
606          return NOTFOUND;
607        if ("methodNotAllowed".equals(codeString))
608          return METHODNOTALLOWED;
609        if ("conflict".equals(codeString))
610          return CONFLICT;
611        if ("gone".equals(codeString))
612          return GONE;
613        if ("preconditionFailed".equals(codeString))
614          return PRECONDITIONFAILED;
615        if ("unprocessable".equals(codeString))
616          return UNPROCESSABLE;
617        if (Configuration.isAcceptInvalidEnums())
618          return null;
619        else
620          throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
621        }
622        public String toCode() {
623          switch (this) {
624            case OKAY: return "okay";
625            case CREATED: return "created";
626            case NOCONTENT: return "noContent";
627            case NOTMODIFIED: return "notModified";
628            case BAD: return "bad";
629            case FORBIDDEN: return "forbidden";
630            case NOTFOUND: return "notFound";
631            case METHODNOTALLOWED: return "methodNotAllowed";
632            case CONFLICT: return "conflict";
633            case GONE: return "gone";
634            case PRECONDITIONFAILED: return "preconditionFailed";
635            case UNPROCESSABLE: return "unprocessable";
636            default: return "?";
637          }
638        }
639        public String getSystem() {
640          switch (this) {
641            case OKAY: return "http://hl7.org/fhir/assert-response-code-types";
642            case CREATED: return "http://hl7.org/fhir/assert-response-code-types";
643            case NOCONTENT: return "http://hl7.org/fhir/assert-response-code-types";
644            case NOTMODIFIED: return "http://hl7.org/fhir/assert-response-code-types";
645            case BAD: return "http://hl7.org/fhir/assert-response-code-types";
646            case FORBIDDEN: return "http://hl7.org/fhir/assert-response-code-types";
647            case NOTFOUND: return "http://hl7.org/fhir/assert-response-code-types";
648            case METHODNOTALLOWED: return "http://hl7.org/fhir/assert-response-code-types";
649            case CONFLICT: return "http://hl7.org/fhir/assert-response-code-types";
650            case GONE: return "http://hl7.org/fhir/assert-response-code-types";
651            case PRECONDITIONFAILED: return "http://hl7.org/fhir/assert-response-code-types";
652            case UNPROCESSABLE: return "http://hl7.org/fhir/assert-response-code-types";
653            default: return "?";
654          }
655        }
656        public String getDefinition() {
657          switch (this) {
658            case OKAY: return "Response code is 200.";
659            case CREATED: return "Response code is 201.";
660            case NOCONTENT: return "Response code is 204.";
661            case NOTMODIFIED: return "Response code is 304.";
662            case BAD: return "Response code is 400.";
663            case FORBIDDEN: return "Response code is 403.";
664            case NOTFOUND: return "Response code is 404.";
665            case METHODNOTALLOWED: return "Response code is 405.";
666            case CONFLICT: return "Response code is 409.";
667            case GONE: return "Response code is 410.";
668            case PRECONDITIONFAILED: return "Response code is 412.";
669            case UNPROCESSABLE: return "Response code is 422.";
670            default: return "?";
671          }
672        }
673        public String getDisplay() {
674          switch (this) {
675            case OKAY: return "okay";
676            case CREATED: return "created";
677            case NOCONTENT: return "noContent";
678            case NOTMODIFIED: return "notModified";
679            case BAD: return "bad";
680            case FORBIDDEN: return "forbidden";
681            case NOTFOUND: return "notFound";
682            case METHODNOTALLOWED: return "methodNotAllowed";
683            case CONFLICT: return "conflict";
684            case GONE: return "gone";
685            case PRECONDITIONFAILED: return "preconditionFailed";
686            case UNPROCESSABLE: return "unprocessable";
687            default: return "?";
688          }
689        }
690    }
691
692  public static class AssertionResponseTypesEnumFactory implements EnumFactory<AssertionResponseTypes> {
693    public AssertionResponseTypes fromCode(String codeString) throws IllegalArgumentException {
694      if (codeString == null || "".equals(codeString))
695            if (codeString == null || "".equals(codeString))
696                return null;
697        if ("okay".equals(codeString))
698          return AssertionResponseTypes.OKAY;
699        if ("created".equals(codeString))
700          return AssertionResponseTypes.CREATED;
701        if ("noContent".equals(codeString))
702          return AssertionResponseTypes.NOCONTENT;
703        if ("notModified".equals(codeString))
704          return AssertionResponseTypes.NOTMODIFIED;
705        if ("bad".equals(codeString))
706          return AssertionResponseTypes.BAD;
707        if ("forbidden".equals(codeString))
708          return AssertionResponseTypes.FORBIDDEN;
709        if ("notFound".equals(codeString))
710          return AssertionResponseTypes.NOTFOUND;
711        if ("methodNotAllowed".equals(codeString))
712          return AssertionResponseTypes.METHODNOTALLOWED;
713        if ("conflict".equals(codeString))
714          return AssertionResponseTypes.CONFLICT;
715        if ("gone".equals(codeString))
716          return AssertionResponseTypes.GONE;
717        if ("preconditionFailed".equals(codeString))
718          return AssertionResponseTypes.PRECONDITIONFAILED;
719        if ("unprocessable".equals(codeString))
720          return AssertionResponseTypes.UNPROCESSABLE;
721        throw new IllegalArgumentException("Unknown AssertionResponseTypes code '"+codeString+"'");
722        }
723        public Enumeration<AssertionResponseTypes> fromType(Base code) throws FHIRException {
724          if (code == null)
725            return null;
726          if (code.isEmpty())
727            return new Enumeration<AssertionResponseTypes>(this);
728          String codeString = ((PrimitiveType) code).asStringValue();
729          if (codeString == null || "".equals(codeString))
730            return null;
731        if ("okay".equals(codeString))
732          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.OKAY);
733        if ("created".equals(codeString))
734          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CREATED);
735        if ("noContent".equals(codeString))
736          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOCONTENT);
737        if ("notModified".equals(codeString))
738          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTMODIFIED);
739        if ("bad".equals(codeString))
740          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.BAD);
741        if ("forbidden".equals(codeString))
742          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.FORBIDDEN);
743        if ("notFound".equals(codeString))
744          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTFOUND);
745        if ("methodNotAllowed".equals(codeString))
746          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.METHODNOTALLOWED);
747        if ("conflict".equals(codeString))
748          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CONFLICT);
749        if ("gone".equals(codeString))
750          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.GONE);
751        if ("preconditionFailed".equals(codeString))
752          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.PRECONDITIONFAILED);
753        if ("unprocessable".equals(codeString))
754          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.UNPROCESSABLE);
755        throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
756        }
757    public String toCode(AssertionResponseTypes code) {
758      if (code == AssertionResponseTypes.OKAY)
759        return "okay";
760      if (code == AssertionResponseTypes.CREATED)
761        return "created";
762      if (code == AssertionResponseTypes.NOCONTENT)
763        return "noContent";
764      if (code == AssertionResponseTypes.NOTMODIFIED)
765        return "notModified";
766      if (code == AssertionResponseTypes.BAD)
767        return "bad";
768      if (code == AssertionResponseTypes.FORBIDDEN)
769        return "forbidden";
770      if (code == AssertionResponseTypes.NOTFOUND)
771        return "notFound";
772      if (code == AssertionResponseTypes.METHODNOTALLOWED)
773        return "methodNotAllowed";
774      if (code == AssertionResponseTypes.CONFLICT)
775        return "conflict";
776      if (code == AssertionResponseTypes.GONE)
777        return "gone";
778      if (code == AssertionResponseTypes.PRECONDITIONFAILED)
779        return "preconditionFailed";
780      if (code == AssertionResponseTypes.UNPROCESSABLE)
781        return "unprocessable";
782      return "?";
783      }
784    public String toSystem(AssertionResponseTypes code) {
785      return code.getSystem();
786      }
787    }
788
789    @Block()
790    public static class TestScriptOriginComponent extends BackboneElement implements IBaseBackboneElement {
791        /**
792         * Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
793         */
794        @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false)
795        @Description(shortDefinition="The index of the abstract origin server starting at 1", formalDefinition="Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1." )
796        protected IntegerType index;
797
798        /**
799         * The type of origin profile the test system supports.
800         */
801        @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
802        @Description(shortDefinition="FHIR-Client | FHIR-SDC-FormFiller", formalDefinition="The type of origin profile the test system supports." )
803        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-profile-origin-types")
804        protected Coding profile;
805
806        private static final long serialVersionUID = -1239935149L;
807
808    /**
809     * Constructor
810     */
811      public TestScriptOriginComponent() {
812        super();
813      }
814
815    /**
816     * Constructor
817     */
818      public TestScriptOriginComponent(IntegerType index, Coding profile) {
819        super();
820        this.index = index;
821        this.profile = profile;
822      }
823
824        /**
825         * @return {@link #index} (Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value
826         */
827        public IntegerType getIndexElement() { 
828          if (this.index == null)
829            if (Configuration.errorOnAutoCreate())
830              throw new Error("Attempt to auto-create TestScriptOriginComponent.index");
831            else if (Configuration.doAutoCreate())
832              this.index = new IntegerType(); // bb
833          return this.index;
834        }
835
836        public boolean hasIndexElement() { 
837          return this.index != null && !this.index.isEmpty();
838        }
839
840        public boolean hasIndex() { 
841          return this.index != null && !this.index.isEmpty();
842        }
843
844        /**
845         * @param value {@link #index} (Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value
846         */
847        public TestScriptOriginComponent setIndexElement(IntegerType value) { 
848          this.index = value;
849          return this;
850        }
851
852        /**
853         * @return Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
854         */
855        public int getIndex() { 
856          return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue();
857        }
858
859        /**
860         * @param value Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
861         */
862        public TestScriptOriginComponent setIndex(int value) { 
863            if (this.index == null)
864              this.index = new IntegerType();
865            this.index.setValue(value);
866          return this;
867        }
868
869        /**
870         * @return {@link #profile} (The type of origin profile the test system supports.)
871         */
872        public Coding getProfile() { 
873          if (this.profile == null)
874            if (Configuration.errorOnAutoCreate())
875              throw new Error("Attempt to auto-create TestScriptOriginComponent.profile");
876            else if (Configuration.doAutoCreate())
877              this.profile = new Coding(); // cc
878          return this.profile;
879        }
880
881        public boolean hasProfile() { 
882          return this.profile != null && !this.profile.isEmpty();
883        }
884
885        /**
886         * @param value {@link #profile} (The type of origin profile the test system supports.)
887         */
888        public TestScriptOriginComponent setProfile(Coding value) { 
889          this.profile = value;
890          return this;
891        }
892
893        protected void listChildren(List<Property> children) {
894          super.listChildren(children);
895          children.add(new Property("index", "integer", "Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.", 0, 1, index));
896          children.add(new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, 1, profile));
897        }
898
899        @Override
900        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
901          switch (_hash) {
902          case 100346066: /*index*/  return new Property("index", "integer", "Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.", 0, 1, index);
903          case -309425751: /*profile*/  return new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, 1, profile);
904          default: return super.getNamedProperty(_hash, _name, _checkValid);
905          }
906
907        }
908
909      @Override
910      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
911        switch (hash) {
912        case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType
913        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding
914        default: return super.getProperty(hash, name, checkValid);
915        }
916
917      }
918
919      @Override
920      public Base setProperty(int hash, String name, Base value) throws FHIRException {
921        switch (hash) {
922        case 100346066: // index
923          this.index = castToInteger(value); // IntegerType
924          return value;
925        case -309425751: // profile
926          this.profile = castToCoding(value); // Coding
927          return value;
928        default: return super.setProperty(hash, name, value);
929        }
930
931      }
932
933      @Override
934      public Base setProperty(String name, Base value) throws FHIRException {
935        if (name.equals("index")) {
936          this.index = castToInteger(value); // IntegerType
937        } else if (name.equals("profile")) {
938          this.profile = castToCoding(value); // Coding
939        } else
940          return super.setProperty(name, value);
941        return value;
942      }
943
944      @Override
945      public Base makeProperty(int hash, String name) throws FHIRException {
946        switch (hash) {
947        case 100346066:  return getIndexElement();
948        case -309425751:  return getProfile(); 
949        default: return super.makeProperty(hash, name);
950        }
951
952      }
953
954      @Override
955      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
956        switch (hash) {
957        case 100346066: /*index*/ return new String[] {"integer"};
958        case -309425751: /*profile*/ return new String[] {"Coding"};
959        default: return super.getTypesForProperty(hash, name);
960        }
961
962      }
963
964      @Override
965      public Base addChild(String name) throws FHIRException {
966        if (name.equals("index")) {
967          throw new FHIRException("Cannot call addChild on a primitive type TestScript.index");
968        }
969        else if (name.equals("profile")) {
970          this.profile = new Coding();
971          return this.profile;
972        }
973        else
974          return super.addChild(name);
975      }
976
977      public TestScriptOriginComponent copy() {
978        TestScriptOriginComponent dst = new TestScriptOriginComponent();
979        copyValues(dst);
980        dst.index = index == null ? null : index.copy();
981        dst.profile = profile == null ? null : profile.copy();
982        return dst;
983      }
984
985      @Override
986      public boolean equalsDeep(Base other_) {
987        if (!super.equalsDeep(other_))
988          return false;
989        if (!(other_ instanceof TestScriptOriginComponent))
990          return false;
991        TestScriptOriginComponent o = (TestScriptOriginComponent) other_;
992        return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true);
993      }
994
995      @Override
996      public boolean equalsShallow(Base other_) {
997        if (!super.equalsShallow(other_))
998          return false;
999        if (!(other_ instanceof TestScriptOriginComponent))
1000          return false;
1001        TestScriptOriginComponent o = (TestScriptOriginComponent) other_;
1002        return compareValues(index, o.index, true);
1003      }
1004
1005      public boolean isEmpty() {
1006        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(index, profile);
1007      }
1008
1009  public String fhirType() {
1010    return "TestScript.origin";
1011
1012  }
1013
1014  }
1015
1016    @Block()
1017    public static class TestScriptDestinationComponent extends BackboneElement implements IBaseBackboneElement {
1018        /**
1019         * Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1020         */
1021        @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1022        @Description(shortDefinition="The index of the abstract destination server starting at 1", formalDefinition="Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1." )
1023        protected IntegerType index;
1024
1025        /**
1026         * The type of destination profile the test system supports.
1027         */
1028        @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
1029        @Description(shortDefinition="FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor", formalDefinition="The type of destination profile the test system supports." )
1030        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-profile-destination-types")
1031        protected Coding profile;
1032
1033        private static final long serialVersionUID = -1239935149L;
1034
1035    /**
1036     * Constructor
1037     */
1038      public TestScriptDestinationComponent() {
1039        super();
1040      }
1041
1042    /**
1043     * Constructor
1044     */
1045      public TestScriptDestinationComponent(IntegerType index, Coding profile) {
1046        super();
1047        this.index = index;
1048        this.profile = profile;
1049      }
1050
1051        /**
1052         * @return {@link #index} (Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value
1053         */
1054        public IntegerType getIndexElement() { 
1055          if (this.index == null)
1056            if (Configuration.errorOnAutoCreate())
1057              throw new Error("Attempt to auto-create TestScriptDestinationComponent.index");
1058            else if (Configuration.doAutoCreate())
1059              this.index = new IntegerType(); // bb
1060          return this.index;
1061        }
1062
1063        public boolean hasIndexElement() { 
1064          return this.index != null && !this.index.isEmpty();
1065        }
1066
1067        public boolean hasIndex() { 
1068          return this.index != null && !this.index.isEmpty();
1069        }
1070
1071        /**
1072         * @param value {@link #index} (Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value
1073         */
1074        public TestScriptDestinationComponent setIndexElement(IntegerType value) { 
1075          this.index = value;
1076          return this;
1077        }
1078
1079        /**
1080         * @return Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1081         */
1082        public int getIndex() { 
1083          return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue();
1084        }
1085
1086        /**
1087         * @param value Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1088         */
1089        public TestScriptDestinationComponent setIndex(int value) { 
1090            if (this.index == null)
1091              this.index = new IntegerType();
1092            this.index.setValue(value);
1093          return this;
1094        }
1095
1096        /**
1097         * @return {@link #profile} (The type of destination profile the test system supports.)
1098         */
1099        public Coding getProfile() { 
1100          if (this.profile == null)
1101            if (Configuration.errorOnAutoCreate())
1102              throw new Error("Attempt to auto-create TestScriptDestinationComponent.profile");
1103            else if (Configuration.doAutoCreate())
1104              this.profile = new Coding(); // cc
1105          return this.profile;
1106        }
1107
1108        public boolean hasProfile() { 
1109          return this.profile != null && !this.profile.isEmpty();
1110        }
1111
1112        /**
1113         * @param value {@link #profile} (The type of destination profile the test system supports.)
1114         */
1115        public TestScriptDestinationComponent setProfile(Coding value) { 
1116          this.profile = value;
1117          return this;
1118        }
1119
1120        protected void listChildren(List<Property> children) {
1121          super.listChildren(children);
1122          children.add(new Property("index", "integer", "Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.", 0, 1, index));
1123          children.add(new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, 1, profile));
1124        }
1125
1126        @Override
1127        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1128          switch (_hash) {
1129          case 100346066: /*index*/  return new Property("index", "integer", "Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.", 0, 1, index);
1130          case -309425751: /*profile*/  return new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, 1, profile);
1131          default: return super.getNamedProperty(_hash, _name, _checkValid);
1132          }
1133
1134        }
1135
1136      @Override
1137      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1138        switch (hash) {
1139        case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType
1140        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding
1141        default: return super.getProperty(hash, name, checkValid);
1142        }
1143
1144      }
1145
1146      @Override
1147      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1148        switch (hash) {
1149        case 100346066: // index
1150          this.index = castToInteger(value); // IntegerType
1151          return value;
1152        case -309425751: // profile
1153          this.profile = castToCoding(value); // Coding
1154          return value;
1155        default: return super.setProperty(hash, name, value);
1156        }
1157
1158      }
1159
1160      @Override
1161      public Base setProperty(String name, Base value) throws FHIRException {
1162        if (name.equals("index")) {
1163          this.index = castToInteger(value); // IntegerType
1164        } else if (name.equals("profile")) {
1165          this.profile = castToCoding(value); // Coding
1166        } else
1167          return super.setProperty(name, value);
1168        return value;
1169      }
1170
1171      @Override
1172      public Base makeProperty(int hash, String name) throws FHIRException {
1173        switch (hash) {
1174        case 100346066:  return getIndexElement();
1175        case -309425751:  return getProfile(); 
1176        default: return super.makeProperty(hash, name);
1177        }
1178
1179      }
1180
1181      @Override
1182      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1183        switch (hash) {
1184        case 100346066: /*index*/ return new String[] {"integer"};
1185        case -309425751: /*profile*/ return new String[] {"Coding"};
1186        default: return super.getTypesForProperty(hash, name);
1187        }
1188
1189      }
1190
1191      @Override
1192      public Base addChild(String name) throws FHIRException {
1193        if (name.equals("index")) {
1194          throw new FHIRException("Cannot call addChild on a primitive type TestScript.index");
1195        }
1196        else if (name.equals("profile")) {
1197          this.profile = new Coding();
1198          return this.profile;
1199        }
1200        else
1201          return super.addChild(name);
1202      }
1203
1204      public TestScriptDestinationComponent copy() {
1205        TestScriptDestinationComponent dst = new TestScriptDestinationComponent();
1206        copyValues(dst);
1207        dst.index = index == null ? null : index.copy();
1208        dst.profile = profile == null ? null : profile.copy();
1209        return dst;
1210      }
1211
1212      @Override
1213      public boolean equalsDeep(Base other_) {
1214        if (!super.equalsDeep(other_))
1215          return false;
1216        if (!(other_ instanceof TestScriptDestinationComponent))
1217          return false;
1218        TestScriptDestinationComponent o = (TestScriptDestinationComponent) other_;
1219        return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true);
1220      }
1221
1222      @Override
1223      public boolean equalsShallow(Base other_) {
1224        if (!super.equalsShallow(other_))
1225          return false;
1226        if (!(other_ instanceof TestScriptDestinationComponent))
1227          return false;
1228        TestScriptDestinationComponent o = (TestScriptDestinationComponent) other_;
1229        return compareValues(index, o.index, true);
1230      }
1231
1232      public boolean isEmpty() {
1233        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(index, profile);
1234      }
1235
1236  public String fhirType() {
1237    return "TestScript.destination";
1238
1239  }
1240
1241  }
1242
1243    @Block()
1244    public static class TestScriptMetadataComponent extends BackboneElement implements IBaseBackboneElement {
1245        /**
1246         * A link to the FHIR specification that this test is covering.
1247         */
1248        @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1249        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="A link to the FHIR specification that this test is covering." )
1250        protected List<TestScriptMetadataLinkComponent> link;
1251
1252        /**
1253         * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
1254         */
1255        @Child(name = "capability", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1256        @Description(shortDefinition="Capabilities  that are assumed to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." )
1257        protected List<TestScriptMetadataCapabilityComponent> capability;
1258
1259        private static final long serialVersionUID = 745183328L;
1260
1261    /**
1262     * Constructor
1263     */
1264      public TestScriptMetadataComponent() {
1265        super();
1266      }
1267
1268        /**
1269         * @return {@link #link} (A link to the FHIR specification that this test is covering.)
1270         */
1271        public List<TestScriptMetadataLinkComponent> getLink() { 
1272          if (this.link == null)
1273            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1274          return this.link;
1275        }
1276
1277        /**
1278         * @return Returns a reference to <code>this</code> for easy method chaining
1279         */
1280        public TestScriptMetadataComponent setLink(List<TestScriptMetadataLinkComponent> theLink) { 
1281          this.link = theLink;
1282          return this;
1283        }
1284
1285        public boolean hasLink() { 
1286          if (this.link == null)
1287            return false;
1288          for (TestScriptMetadataLinkComponent item : this.link)
1289            if (!item.isEmpty())
1290              return true;
1291          return false;
1292        }
1293
1294        public TestScriptMetadataLinkComponent addLink() { //3
1295          TestScriptMetadataLinkComponent t = new TestScriptMetadataLinkComponent();
1296          if (this.link == null)
1297            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1298          this.link.add(t);
1299          return t;
1300        }
1301
1302        public TestScriptMetadataComponent addLink(TestScriptMetadataLinkComponent t) { //3
1303          if (t == null)
1304            return this;
1305          if (this.link == null)
1306            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1307          this.link.add(t);
1308          return this;
1309        }
1310
1311        /**
1312         * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
1313         */
1314        public TestScriptMetadataLinkComponent getLinkFirstRep() { 
1315          if (getLink().isEmpty()) {
1316            addLink();
1317          }
1318          return getLink().get(0);
1319        }
1320
1321        /**
1322         * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
1323         */
1324        public List<TestScriptMetadataCapabilityComponent> getCapability() { 
1325          if (this.capability == null)
1326            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1327          return this.capability;
1328        }
1329
1330        /**
1331         * @return Returns a reference to <code>this</code> for easy method chaining
1332         */
1333        public TestScriptMetadataComponent setCapability(List<TestScriptMetadataCapabilityComponent> theCapability) { 
1334          this.capability = theCapability;
1335          return this;
1336        }
1337
1338        public boolean hasCapability() { 
1339          if (this.capability == null)
1340            return false;
1341          for (TestScriptMetadataCapabilityComponent item : this.capability)
1342            if (!item.isEmpty())
1343              return true;
1344          return false;
1345        }
1346
1347        public TestScriptMetadataCapabilityComponent addCapability() { //3
1348          TestScriptMetadataCapabilityComponent t = new TestScriptMetadataCapabilityComponent();
1349          if (this.capability == null)
1350            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1351          this.capability.add(t);
1352          return t;
1353        }
1354
1355        public TestScriptMetadataComponent addCapability(TestScriptMetadataCapabilityComponent t) { //3
1356          if (t == null)
1357            return this;
1358          if (this.capability == null)
1359            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1360          this.capability.add(t);
1361          return this;
1362        }
1363
1364        /**
1365         * @return The first repetition of repeating field {@link #capability}, creating it if it does not already exist
1366         */
1367        public TestScriptMetadataCapabilityComponent getCapabilityFirstRep() { 
1368          if (getCapability().isEmpty()) {
1369            addCapability();
1370          }
1371          return getCapability().get(0);
1372        }
1373
1374        protected void listChildren(List<Property> children) {
1375          super.listChildren(children);
1376          children.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link));
1377          children.add(new Property("capability", "", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, capability));
1378        }
1379
1380        @Override
1381        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1382          switch (_hash) {
1383          case 3321850: /*link*/  return new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link);
1384          case -783669992: /*capability*/  return new Property("capability", "", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, capability);
1385          default: return super.getNamedProperty(_hash, _name, _checkValid);
1386          }
1387
1388        }
1389
1390      @Override
1391      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1392        switch (hash) {
1393        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // TestScriptMetadataLinkComponent
1394        case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // TestScriptMetadataCapabilityComponent
1395        default: return super.getProperty(hash, name, checkValid);
1396        }
1397
1398      }
1399
1400      @Override
1401      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1402        switch (hash) {
1403        case 3321850: // link
1404          this.getLink().add((TestScriptMetadataLinkComponent) value); // TestScriptMetadataLinkComponent
1405          return value;
1406        case -783669992: // capability
1407          this.getCapability().add((TestScriptMetadataCapabilityComponent) value); // TestScriptMetadataCapabilityComponent
1408          return value;
1409        default: return super.setProperty(hash, name, value);
1410        }
1411
1412      }
1413
1414      @Override
1415      public Base setProperty(String name, Base value) throws FHIRException {
1416        if (name.equals("link")) {
1417          this.getLink().add((TestScriptMetadataLinkComponent) value);
1418        } else if (name.equals("capability")) {
1419          this.getCapability().add((TestScriptMetadataCapabilityComponent) value);
1420        } else
1421          return super.setProperty(name, value);
1422        return value;
1423      }
1424
1425      @Override
1426      public Base makeProperty(int hash, String name) throws FHIRException {
1427        switch (hash) {
1428        case 3321850:  return addLink(); 
1429        case -783669992:  return addCapability(); 
1430        default: return super.makeProperty(hash, name);
1431        }
1432
1433      }
1434
1435      @Override
1436      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1437        switch (hash) {
1438        case 3321850: /*link*/ return new String[] {};
1439        case -783669992: /*capability*/ return new String[] {};
1440        default: return super.getTypesForProperty(hash, name);
1441        }
1442
1443      }
1444
1445      @Override
1446      public Base addChild(String name) throws FHIRException {
1447        if (name.equals("link")) {
1448          return addLink();
1449        }
1450        else if (name.equals("capability")) {
1451          return addCapability();
1452        }
1453        else
1454          return super.addChild(name);
1455      }
1456
1457      public TestScriptMetadataComponent copy() {
1458        TestScriptMetadataComponent dst = new TestScriptMetadataComponent();
1459        copyValues(dst);
1460        if (link != null) {
1461          dst.link = new ArrayList<TestScriptMetadataLinkComponent>();
1462          for (TestScriptMetadataLinkComponent i : link)
1463            dst.link.add(i.copy());
1464        };
1465        if (capability != null) {
1466          dst.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1467          for (TestScriptMetadataCapabilityComponent i : capability)
1468            dst.capability.add(i.copy());
1469        };
1470        return dst;
1471      }
1472
1473      @Override
1474      public boolean equalsDeep(Base other_) {
1475        if (!super.equalsDeep(other_))
1476          return false;
1477        if (!(other_ instanceof TestScriptMetadataComponent))
1478          return false;
1479        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other_;
1480        return compareDeep(link, o.link, true) && compareDeep(capability, o.capability, true);
1481      }
1482
1483      @Override
1484      public boolean equalsShallow(Base other_) {
1485        if (!super.equalsShallow(other_))
1486          return false;
1487        if (!(other_ instanceof TestScriptMetadataComponent))
1488          return false;
1489        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other_;
1490        return true;
1491      }
1492
1493      public boolean isEmpty() {
1494        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(link, capability);
1495      }
1496
1497  public String fhirType() {
1498    return "TestScript.metadata";
1499
1500  }
1501
1502  }
1503
1504    @Block()
1505    public static class TestScriptMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement {
1506        /**
1507         * URL to a particular requirement or feature within the FHIR specification.
1508         */
1509        @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1510        @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." )
1511        protected UriType url;
1512
1513        /**
1514         * Short description of the link.
1515         */
1516        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1517        @Description(shortDefinition="Short description", formalDefinition="Short description of the link." )
1518        protected StringType description;
1519
1520        private static final long serialVersionUID = 213372298L;
1521
1522    /**
1523     * Constructor
1524     */
1525      public TestScriptMetadataLinkComponent() {
1526        super();
1527      }
1528
1529    /**
1530     * Constructor
1531     */
1532      public TestScriptMetadataLinkComponent(UriType url) {
1533        super();
1534        this.url = url;
1535      }
1536
1537        /**
1538         * @return {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1539         */
1540        public UriType getUrlElement() { 
1541          if (this.url == null)
1542            if (Configuration.errorOnAutoCreate())
1543              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.url");
1544            else if (Configuration.doAutoCreate())
1545              this.url = new UriType(); // bb
1546          return this.url;
1547        }
1548
1549        public boolean hasUrlElement() { 
1550          return this.url != null && !this.url.isEmpty();
1551        }
1552
1553        public boolean hasUrl() { 
1554          return this.url != null && !this.url.isEmpty();
1555        }
1556
1557        /**
1558         * @param value {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
1559         */
1560        public TestScriptMetadataLinkComponent setUrlElement(UriType value) { 
1561          this.url = value;
1562          return this;
1563        }
1564
1565        /**
1566         * @return URL to a particular requirement or feature within the FHIR specification.
1567         */
1568        public String getUrl() { 
1569          return this.url == null ? null : this.url.getValue();
1570        }
1571
1572        /**
1573         * @param value URL to a particular requirement or feature within the FHIR specification.
1574         */
1575        public TestScriptMetadataLinkComponent setUrl(String value) { 
1576            if (this.url == null)
1577              this.url = new UriType();
1578            this.url.setValue(value);
1579          return this;
1580        }
1581
1582        /**
1583         * @return {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1584         */
1585        public StringType getDescriptionElement() { 
1586          if (this.description == null)
1587            if (Configuration.errorOnAutoCreate())
1588              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.description");
1589            else if (Configuration.doAutoCreate())
1590              this.description = new StringType(); // bb
1591          return this.description;
1592        }
1593
1594        public boolean hasDescriptionElement() { 
1595          return this.description != null && !this.description.isEmpty();
1596        }
1597
1598        public boolean hasDescription() { 
1599          return this.description != null && !this.description.isEmpty();
1600        }
1601
1602        /**
1603         * @param value {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1604         */
1605        public TestScriptMetadataLinkComponent setDescriptionElement(StringType value) { 
1606          this.description = value;
1607          return this;
1608        }
1609
1610        /**
1611         * @return Short description of the link.
1612         */
1613        public String getDescription() { 
1614          return this.description == null ? null : this.description.getValue();
1615        }
1616
1617        /**
1618         * @param value Short description of the link.
1619         */
1620        public TestScriptMetadataLinkComponent setDescription(String value) { 
1621          if (Utilities.noString(value))
1622            this.description = null;
1623          else {
1624            if (this.description == null)
1625              this.description = new StringType();
1626            this.description.setValue(value);
1627          }
1628          return this;
1629        }
1630
1631        protected void listChildren(List<Property> children) {
1632          super.listChildren(children);
1633          children.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, 1, url));
1634          children.add(new Property("description", "string", "Short description of the link.", 0, 1, description));
1635        }
1636
1637        @Override
1638        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1639          switch (_hash) {
1640          case 116079: /*url*/  return new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, 1, url);
1641          case -1724546052: /*description*/  return new Property("description", "string", "Short description of the link.", 0, 1, description);
1642          default: return super.getNamedProperty(_hash, _name, _checkValid);
1643          }
1644
1645        }
1646
1647      @Override
1648      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1649        switch (hash) {
1650        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1651        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1652        default: return super.getProperty(hash, name, checkValid);
1653        }
1654
1655      }
1656
1657      @Override
1658      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1659        switch (hash) {
1660        case 116079: // url
1661          this.url = castToUri(value); // UriType
1662          return value;
1663        case -1724546052: // description
1664          this.description = castToString(value); // StringType
1665          return value;
1666        default: return super.setProperty(hash, name, value);
1667        }
1668
1669      }
1670
1671      @Override
1672      public Base setProperty(String name, Base value) throws FHIRException {
1673        if (name.equals("url")) {
1674          this.url = castToUri(value); // UriType
1675        } else if (name.equals("description")) {
1676          this.description = castToString(value); // StringType
1677        } else
1678          return super.setProperty(name, value);
1679        return value;
1680      }
1681
1682      @Override
1683      public Base makeProperty(int hash, String name) throws FHIRException {
1684        switch (hash) {
1685        case 116079:  return getUrlElement();
1686        case -1724546052:  return getDescriptionElement();
1687        default: return super.makeProperty(hash, name);
1688        }
1689
1690      }
1691
1692      @Override
1693      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1694        switch (hash) {
1695        case 116079: /*url*/ return new String[] {"uri"};
1696        case -1724546052: /*description*/ return new String[] {"string"};
1697        default: return super.getTypesForProperty(hash, name);
1698        }
1699
1700      }
1701
1702      @Override
1703      public Base addChild(String name) throws FHIRException {
1704        if (name.equals("url")) {
1705          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
1706        }
1707        else if (name.equals("description")) {
1708          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
1709        }
1710        else
1711          return super.addChild(name);
1712      }
1713
1714      public TestScriptMetadataLinkComponent copy() {
1715        TestScriptMetadataLinkComponent dst = new TestScriptMetadataLinkComponent();
1716        copyValues(dst);
1717        dst.url = url == null ? null : url.copy();
1718        dst.description = description == null ? null : description.copy();
1719        return dst;
1720      }
1721
1722      @Override
1723      public boolean equalsDeep(Base other_) {
1724        if (!super.equalsDeep(other_))
1725          return false;
1726        if (!(other_ instanceof TestScriptMetadataLinkComponent))
1727          return false;
1728        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other_;
1729        return compareDeep(url, o.url, true) && compareDeep(description, o.description, true);
1730      }
1731
1732      @Override
1733      public boolean equalsShallow(Base other_) {
1734        if (!super.equalsShallow(other_))
1735          return false;
1736        if (!(other_ instanceof TestScriptMetadataLinkComponent))
1737          return false;
1738        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other_;
1739        return compareValues(url, o.url, true) && compareValues(description, o.description, true);
1740      }
1741
1742      public boolean isEmpty() {
1743        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, description);
1744      }
1745
1746  public String fhirType() {
1747    return "TestScript.metadata.link";
1748
1749  }
1750
1751  }
1752
1753    @Block()
1754    public static class TestScriptMetadataCapabilityComponent extends BackboneElement implements IBaseBackboneElement {
1755        /**
1756         * Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1757         */
1758        @Child(name = "required", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1759        @Description(shortDefinition="Are the capabilities required?", formalDefinition="Whether or not the test execution will require the given capabilities of the server in order for this test script to execute." )
1760        protected BooleanType required;
1761
1762        /**
1763         * Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1764         */
1765        @Child(name = "validated", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=false)
1766        @Description(shortDefinition="Are the capabilities validated?", formalDefinition="Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute." )
1767        protected BooleanType validated;
1768
1769        /**
1770         * Description of the capabilities that this test script is requiring the server to support.
1771         */
1772        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1773        @Description(shortDefinition="The expected capabilities of the server", formalDefinition="Description of the capabilities that this test script is requiring the server to support." )
1774        protected StringType description;
1775
1776        /**
1777         * Which origin server these requirements apply to.
1778         */
1779        @Child(name = "origin", type = {IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1780        @Description(shortDefinition="Which origin server these requirements apply to", formalDefinition="Which origin server these requirements apply to." )
1781        protected List<IntegerType> origin;
1782
1783        /**
1784         * Which server these requirements apply to.
1785         */
1786        @Child(name = "destination", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1787        @Description(shortDefinition="Which server these requirements apply to", formalDefinition="Which server these requirements apply to." )
1788        protected IntegerType destination;
1789
1790        /**
1791         * Links to the FHIR specification that describes this interaction and the resources involved in more detail.
1792         */
1793        @Child(name = "link", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1794        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="Links to the FHIR specification that describes this interaction and the resources involved in more detail." )
1795        protected List<UriType> link;
1796
1797        /**
1798         * Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.
1799         */
1800        @Child(name = "capabilities", type = {CanonicalType.class}, order=7, min=1, max=1, modifier=false, summary=false)
1801        @Description(shortDefinition="Required Capability Statement", formalDefinition="Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped." )
1802        protected CanonicalType capabilities;
1803
1804        private static final long serialVersionUID = -1368199288L;
1805
1806    /**
1807     * Constructor
1808     */
1809      public TestScriptMetadataCapabilityComponent() {
1810        super();
1811      }
1812
1813    /**
1814     * Constructor
1815     */
1816      public TestScriptMetadataCapabilityComponent(BooleanType required, BooleanType validated, CanonicalType capabilities) {
1817        super();
1818        this.required = required;
1819        this.validated = validated;
1820        this.capabilities = capabilities;
1821      }
1822
1823        /**
1824         * @return {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
1825         */
1826        public BooleanType getRequiredElement() { 
1827          if (this.required == null)
1828            if (Configuration.errorOnAutoCreate())
1829              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.required");
1830            else if (Configuration.doAutoCreate())
1831              this.required = new BooleanType(); // bb
1832          return this.required;
1833        }
1834
1835        public boolean hasRequiredElement() { 
1836          return this.required != null && !this.required.isEmpty();
1837        }
1838
1839        public boolean hasRequired() { 
1840          return this.required != null && !this.required.isEmpty();
1841        }
1842
1843        /**
1844         * @param value {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value
1845         */
1846        public TestScriptMetadataCapabilityComponent setRequiredElement(BooleanType value) { 
1847          this.required = value;
1848          return this;
1849        }
1850
1851        /**
1852         * @return Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1853         */
1854        public boolean getRequired() { 
1855          return this.required == null || this.required.isEmpty() ? false : this.required.getValue();
1856        }
1857
1858        /**
1859         * @param value Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1860         */
1861        public TestScriptMetadataCapabilityComponent setRequired(boolean value) { 
1862            if (this.required == null)
1863              this.required = new BooleanType();
1864            this.required.setValue(value);
1865          return this;
1866        }
1867
1868        /**
1869         * @return {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value
1870         */
1871        public BooleanType getValidatedElement() { 
1872          if (this.validated == null)
1873            if (Configuration.errorOnAutoCreate())
1874              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.validated");
1875            else if (Configuration.doAutoCreate())
1876              this.validated = new BooleanType(); // bb
1877          return this.validated;
1878        }
1879
1880        public boolean hasValidatedElement() { 
1881          return this.validated != null && !this.validated.isEmpty();
1882        }
1883
1884        public boolean hasValidated() { 
1885          return this.validated != null && !this.validated.isEmpty();
1886        }
1887
1888        /**
1889         * @param value {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value
1890         */
1891        public TestScriptMetadataCapabilityComponent setValidatedElement(BooleanType value) { 
1892          this.validated = value;
1893          return this;
1894        }
1895
1896        /**
1897         * @return Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1898         */
1899        public boolean getValidated() { 
1900          return this.validated == null || this.validated.isEmpty() ? false : this.validated.getValue();
1901        }
1902
1903        /**
1904         * @param value Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1905         */
1906        public TestScriptMetadataCapabilityComponent setValidated(boolean value) { 
1907            if (this.validated == null)
1908              this.validated = new BooleanType();
1909            this.validated.setValue(value);
1910          return this;
1911        }
1912
1913        /**
1914         * @return {@link #description} (Description of the capabilities that this test script is requiring the server to support.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1915         */
1916        public StringType getDescriptionElement() { 
1917          if (this.description == null)
1918            if (Configuration.errorOnAutoCreate())
1919              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.description");
1920            else if (Configuration.doAutoCreate())
1921              this.description = new StringType(); // bb
1922          return this.description;
1923        }
1924
1925        public boolean hasDescriptionElement() { 
1926          return this.description != null && !this.description.isEmpty();
1927        }
1928
1929        public boolean hasDescription() { 
1930          return this.description != null && !this.description.isEmpty();
1931        }
1932
1933        /**
1934         * @param value {@link #description} (Description of the capabilities that this test script is requiring the server to support.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
1935         */
1936        public TestScriptMetadataCapabilityComponent setDescriptionElement(StringType value) { 
1937          this.description = value;
1938          return this;
1939        }
1940
1941        /**
1942         * @return Description of the capabilities that this test script is requiring the server to support.
1943         */
1944        public String getDescription() { 
1945          return this.description == null ? null : this.description.getValue();
1946        }
1947
1948        /**
1949         * @param value Description of the capabilities that this test script is requiring the server to support.
1950         */
1951        public TestScriptMetadataCapabilityComponent setDescription(String value) { 
1952          if (Utilities.noString(value))
1953            this.description = null;
1954          else {
1955            if (this.description == null)
1956              this.description = new StringType();
1957            this.description.setValue(value);
1958          }
1959          return this;
1960        }
1961
1962        /**
1963         * @return {@link #origin} (Which origin server these requirements apply to.)
1964         */
1965        public List<IntegerType> getOrigin() { 
1966          if (this.origin == null)
1967            this.origin = new ArrayList<IntegerType>();
1968          return this.origin;
1969        }
1970
1971        /**
1972         * @return Returns a reference to <code>this</code> for easy method chaining
1973         */
1974        public TestScriptMetadataCapabilityComponent setOrigin(List<IntegerType> theOrigin) { 
1975          this.origin = theOrigin;
1976          return this;
1977        }
1978
1979        public boolean hasOrigin() { 
1980          if (this.origin == null)
1981            return false;
1982          for (IntegerType item : this.origin)
1983            if (!item.isEmpty())
1984              return true;
1985          return false;
1986        }
1987
1988        /**
1989         * @return {@link #origin} (Which origin server these requirements apply to.)
1990         */
1991        public IntegerType addOriginElement() {//2 
1992          IntegerType t = new IntegerType();
1993          if (this.origin == null)
1994            this.origin = new ArrayList<IntegerType>();
1995          this.origin.add(t);
1996          return t;
1997        }
1998
1999        /**
2000         * @param value {@link #origin} (Which origin server these requirements apply to.)
2001         */
2002        public TestScriptMetadataCapabilityComponent addOrigin(int value) { //1
2003          IntegerType t = new IntegerType();
2004          t.setValue(value);
2005          if (this.origin == null)
2006            this.origin = new ArrayList<IntegerType>();
2007          this.origin.add(t);
2008          return this;
2009        }
2010
2011        /**
2012         * @param value {@link #origin} (Which origin server these requirements apply to.)
2013         */
2014        public boolean hasOrigin(int value) { 
2015          if (this.origin == null)
2016            return false;
2017          for (IntegerType v : this.origin)
2018            if (v.getValue().equals(value)) // integer
2019              return true;
2020          return false;
2021        }
2022
2023        /**
2024         * @return {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
2025         */
2026        public IntegerType getDestinationElement() { 
2027          if (this.destination == null)
2028            if (Configuration.errorOnAutoCreate())
2029              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.destination");
2030            else if (Configuration.doAutoCreate())
2031              this.destination = new IntegerType(); // bb
2032          return this.destination;
2033        }
2034
2035        public boolean hasDestinationElement() { 
2036          return this.destination != null && !this.destination.isEmpty();
2037        }
2038
2039        public boolean hasDestination() { 
2040          return this.destination != null && !this.destination.isEmpty();
2041        }
2042
2043        /**
2044         * @param value {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
2045         */
2046        public TestScriptMetadataCapabilityComponent setDestinationElement(IntegerType value) { 
2047          this.destination = value;
2048          return this;
2049        }
2050
2051        /**
2052         * @return Which server these requirements apply to.
2053         */
2054        public int getDestination() { 
2055          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
2056        }
2057
2058        /**
2059         * @param value Which server these requirements apply to.
2060         */
2061        public TestScriptMetadataCapabilityComponent setDestination(int value) { 
2062            if (this.destination == null)
2063              this.destination = new IntegerType();
2064            this.destination.setValue(value);
2065          return this;
2066        }
2067
2068        /**
2069         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2070         */
2071        public List<UriType> getLink() { 
2072          if (this.link == null)
2073            this.link = new ArrayList<UriType>();
2074          return this.link;
2075        }
2076
2077        /**
2078         * @return Returns a reference to <code>this</code> for easy method chaining
2079         */
2080        public TestScriptMetadataCapabilityComponent setLink(List<UriType> theLink) { 
2081          this.link = theLink;
2082          return this;
2083        }
2084
2085        public boolean hasLink() { 
2086          if (this.link == null)
2087            return false;
2088          for (UriType item : this.link)
2089            if (!item.isEmpty())
2090              return true;
2091          return false;
2092        }
2093
2094        /**
2095         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2096         */
2097        public UriType addLinkElement() {//2 
2098          UriType t = new UriType();
2099          if (this.link == null)
2100            this.link = new ArrayList<UriType>();
2101          this.link.add(t);
2102          return t;
2103        }
2104
2105        /**
2106         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2107         */
2108        public TestScriptMetadataCapabilityComponent addLink(String value) { //1
2109          UriType t = new UriType();
2110          t.setValue(value);
2111          if (this.link == null)
2112            this.link = new ArrayList<UriType>();
2113          this.link.add(t);
2114          return this;
2115        }
2116
2117        /**
2118         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2119         */
2120        public boolean hasLink(String value) { 
2121          if (this.link == null)
2122            return false;
2123          for (UriType v : this.link)
2124            if (v.getValue().equals(value)) // uri
2125              return true;
2126          return false;
2127        }
2128
2129        /**
2130         * @return {@link #capabilities} (Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.). This is the underlying object with id, value and extensions. The accessor "getCapabilities" gives direct access to the value
2131         */
2132        public CanonicalType getCapabilitiesElement() { 
2133          if (this.capabilities == null)
2134            if (Configuration.errorOnAutoCreate())
2135              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.capabilities");
2136            else if (Configuration.doAutoCreate())
2137              this.capabilities = new CanonicalType(); // bb
2138          return this.capabilities;
2139        }
2140
2141        public boolean hasCapabilitiesElement() { 
2142          return this.capabilities != null && !this.capabilities.isEmpty();
2143        }
2144
2145        public boolean hasCapabilities() { 
2146          return this.capabilities != null && !this.capabilities.isEmpty();
2147        }
2148
2149        /**
2150         * @param value {@link #capabilities} (Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.). This is the underlying object with id, value and extensions. The accessor "getCapabilities" gives direct access to the value
2151         */
2152        public TestScriptMetadataCapabilityComponent setCapabilitiesElement(CanonicalType value) { 
2153          this.capabilities = value;
2154          return this;
2155        }
2156
2157        /**
2158         * @return Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.
2159         */
2160        public String getCapabilities() { 
2161          return this.capabilities == null ? null : this.capabilities.getValue();
2162        }
2163
2164        /**
2165         * @param value Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.
2166         */
2167        public TestScriptMetadataCapabilityComponent setCapabilities(String value) { 
2168            if (this.capabilities == null)
2169              this.capabilities = new CanonicalType();
2170            this.capabilities.setValue(value);
2171          return this;
2172        }
2173
2174        protected void listChildren(List<Property> children) {
2175          super.listChildren(children);
2176          children.add(new Property("required", "boolean", "Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.", 0, 1, required));
2177          children.add(new Property("validated", "boolean", "Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.", 0, 1, validated));
2178          children.add(new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, 1, description));
2179          children.add(new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin));
2180          children.add(new Property("destination", "integer", "Which server these requirements apply to.", 0, 1, destination));
2181          children.add(new Property("link", "uri", "Links to the FHIR specification that describes this interaction and the resources involved in more detail.", 0, java.lang.Integer.MAX_VALUE, link));
2182          children.add(new Property("capabilities", "canonical(CapabilityStatement)", "Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.", 0, 1, capabilities));
2183        }
2184
2185        @Override
2186        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2187          switch (_hash) {
2188          case -393139297: /*required*/  return new Property("required", "boolean", "Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.", 0, 1, required);
2189          case -1109784050: /*validated*/  return new Property("validated", "boolean", "Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.", 0, 1, validated);
2190          case -1724546052: /*description*/  return new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, 1, description);
2191          case -1008619738: /*origin*/  return new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin);
2192          case -1429847026: /*destination*/  return new Property("destination", "integer", "Which server these requirements apply to.", 0, 1, destination);
2193          case 3321850: /*link*/  return new Property("link", "uri", "Links to the FHIR specification that describes this interaction and the resources involved in more detail.", 0, java.lang.Integer.MAX_VALUE, link);
2194          case -1487597642: /*capabilities*/  return new Property("capabilities", "canonical(CapabilityStatement)", "Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.", 0, 1, capabilities);
2195          default: return super.getNamedProperty(_hash, _name, _checkValid);
2196          }
2197
2198        }
2199
2200      @Override
2201      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2202        switch (hash) {
2203        case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType
2204        case -1109784050: /*validated*/ return this.validated == null ? new Base[0] : new Base[] {this.validated}; // BooleanType
2205        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2206        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // IntegerType
2207        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType
2208        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // UriType
2209        case -1487597642: /*capabilities*/ return this.capabilities == null ? new Base[0] : new Base[] {this.capabilities}; // CanonicalType
2210        default: return super.getProperty(hash, name, checkValid);
2211        }
2212
2213      }
2214
2215      @Override
2216      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2217        switch (hash) {
2218        case -393139297: // required
2219          this.required = castToBoolean(value); // BooleanType
2220          return value;
2221        case -1109784050: // validated
2222          this.validated = castToBoolean(value); // BooleanType
2223          return value;
2224        case -1724546052: // description
2225          this.description = castToString(value); // StringType
2226          return value;
2227        case -1008619738: // origin
2228          this.getOrigin().add(castToInteger(value)); // IntegerType
2229          return value;
2230        case -1429847026: // destination
2231          this.destination = castToInteger(value); // IntegerType
2232          return value;
2233        case 3321850: // link
2234          this.getLink().add(castToUri(value)); // UriType
2235          return value;
2236        case -1487597642: // capabilities
2237          this.capabilities = castToCanonical(value); // CanonicalType
2238          return value;
2239        default: return super.setProperty(hash, name, value);
2240        }
2241
2242      }
2243
2244      @Override
2245      public Base setProperty(String name, Base value) throws FHIRException {
2246        if (name.equals("required")) {
2247          this.required = castToBoolean(value); // BooleanType
2248        } else if (name.equals("validated")) {
2249          this.validated = castToBoolean(value); // BooleanType
2250        } else if (name.equals("description")) {
2251          this.description = castToString(value); // StringType
2252        } else if (name.equals("origin")) {
2253          this.getOrigin().add(castToInteger(value));
2254        } else if (name.equals("destination")) {
2255          this.destination = castToInteger(value); // IntegerType
2256        } else if (name.equals("link")) {
2257          this.getLink().add(castToUri(value));
2258        } else if (name.equals("capabilities")) {
2259          this.capabilities = castToCanonical(value); // CanonicalType
2260        } else
2261          return super.setProperty(name, value);
2262        return value;
2263      }
2264
2265      @Override
2266      public Base makeProperty(int hash, String name) throws FHIRException {
2267        switch (hash) {
2268        case -393139297:  return getRequiredElement();
2269        case -1109784050:  return getValidatedElement();
2270        case -1724546052:  return getDescriptionElement();
2271        case -1008619738:  return addOriginElement();
2272        case -1429847026:  return getDestinationElement();
2273        case 3321850:  return addLinkElement();
2274        case -1487597642:  return getCapabilitiesElement();
2275        default: return super.makeProperty(hash, name);
2276        }
2277
2278      }
2279
2280      @Override
2281      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2282        switch (hash) {
2283        case -393139297: /*required*/ return new String[] {"boolean"};
2284        case -1109784050: /*validated*/ return new String[] {"boolean"};
2285        case -1724546052: /*description*/ return new String[] {"string"};
2286        case -1008619738: /*origin*/ return new String[] {"integer"};
2287        case -1429847026: /*destination*/ return new String[] {"integer"};
2288        case 3321850: /*link*/ return new String[] {"uri"};
2289        case -1487597642: /*capabilities*/ return new String[] {"canonical"};
2290        default: return super.getTypesForProperty(hash, name);
2291        }
2292
2293      }
2294
2295      @Override
2296      public Base addChild(String name) throws FHIRException {
2297        if (name.equals("required")) {
2298          throw new FHIRException("Cannot call addChild on a primitive type TestScript.required");
2299        }
2300        else if (name.equals("validated")) {
2301          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validated");
2302        }
2303        else if (name.equals("description")) {
2304          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
2305        }
2306        else if (name.equals("origin")) {
2307          throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin");
2308        }
2309        else if (name.equals("destination")) {
2310          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
2311        }
2312        else if (name.equals("link")) {
2313          throw new FHIRException("Cannot call addChild on a primitive type TestScript.link");
2314        }
2315        else if (name.equals("capabilities")) {
2316          throw new FHIRException("Cannot call addChild on a primitive type TestScript.capabilities");
2317        }
2318        else
2319          return super.addChild(name);
2320      }
2321
2322      public TestScriptMetadataCapabilityComponent copy() {
2323        TestScriptMetadataCapabilityComponent dst = new TestScriptMetadataCapabilityComponent();
2324        copyValues(dst);
2325        dst.required = required == null ? null : required.copy();
2326        dst.validated = validated == null ? null : validated.copy();
2327        dst.description = description == null ? null : description.copy();
2328        if (origin != null) {
2329          dst.origin = new ArrayList<IntegerType>();
2330          for (IntegerType i : origin)
2331            dst.origin.add(i.copy());
2332        };
2333        dst.destination = destination == null ? null : destination.copy();
2334        if (link != null) {
2335          dst.link = new ArrayList<UriType>();
2336          for (UriType i : link)
2337            dst.link.add(i.copy());
2338        };
2339        dst.capabilities = capabilities == null ? null : capabilities.copy();
2340        return dst;
2341      }
2342
2343      @Override
2344      public boolean equalsDeep(Base other_) {
2345        if (!super.equalsDeep(other_))
2346          return false;
2347        if (!(other_ instanceof TestScriptMetadataCapabilityComponent))
2348          return false;
2349        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other_;
2350        return compareDeep(required, o.required, true) && compareDeep(validated, o.validated, true) && compareDeep(description, o.description, true)
2351           && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(link, o.link, true)
2352           && compareDeep(capabilities, o.capabilities, true);
2353      }
2354
2355      @Override
2356      public boolean equalsShallow(Base other_) {
2357        if (!super.equalsShallow(other_))
2358          return false;
2359        if (!(other_ instanceof TestScriptMetadataCapabilityComponent))
2360          return false;
2361        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other_;
2362        return compareValues(required, o.required, true) && compareValues(validated, o.validated, true) && compareValues(description, o.description, true)
2363           && compareValues(origin, o.origin, true) && compareValues(destination, o.destination, true) && compareValues(link, o.link, true)
2364          ;
2365      }
2366
2367      public boolean isEmpty() {
2368        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(required, validated, description
2369          , origin, destination, link, capabilities);
2370      }
2371
2372  public String fhirType() {
2373    return "TestScript.metadata.capability";
2374
2375  }
2376
2377  }
2378
2379    @Block()
2380    public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement {
2381        /**
2382         * Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.
2383         */
2384        @Child(name = "autocreate", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2385        @Description(shortDefinition="Whether or not to implicitly create the fixture during setup", formalDefinition="Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section." )
2386        protected BooleanType autocreate;
2387
2388        /**
2389         * Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.
2390         */
2391        @Child(name = "autodelete", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=false)
2392        @Description(shortDefinition="Whether or not to implicitly delete the fixture during teardown", formalDefinition="Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section." )
2393        protected BooleanType autodelete;
2394
2395        /**
2396         * Reference to the resource (containing the contents of the resource needed for operations).
2397         */
2398        @Child(name = "resource", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false)
2399        @Description(shortDefinition="Reference of the resource", formalDefinition="Reference to the resource (containing the contents of the resource needed for operations)." )
2400        protected Reference resource;
2401
2402        /**
2403         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the resource needed for operations).)
2404         */
2405        protected Resource resourceTarget;
2406
2407        private static final long serialVersionUID = 1110683307L;
2408
2409    /**
2410     * Constructor
2411     */
2412      public TestScriptFixtureComponent() {
2413        super();
2414      }
2415
2416    /**
2417     * Constructor
2418     */
2419      public TestScriptFixtureComponent(BooleanType autocreate, BooleanType autodelete) {
2420        super();
2421        this.autocreate = autocreate;
2422        this.autodelete = autodelete;
2423      }
2424
2425        /**
2426         * @return {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value
2427         */
2428        public BooleanType getAutocreateElement() { 
2429          if (this.autocreate == null)
2430            if (Configuration.errorOnAutoCreate())
2431              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate");
2432            else if (Configuration.doAutoCreate())
2433              this.autocreate = new BooleanType(); // bb
2434          return this.autocreate;
2435        }
2436
2437        public boolean hasAutocreateElement() { 
2438          return this.autocreate != null && !this.autocreate.isEmpty();
2439        }
2440
2441        public boolean hasAutocreate() { 
2442          return this.autocreate != null && !this.autocreate.isEmpty();
2443        }
2444
2445        /**
2446         * @param value {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value
2447         */
2448        public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { 
2449          this.autocreate = value;
2450          return this;
2451        }
2452
2453        /**
2454         * @return Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.
2455         */
2456        public boolean getAutocreate() { 
2457          return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue();
2458        }
2459
2460        /**
2461         * @param value Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.
2462         */
2463        public TestScriptFixtureComponent setAutocreate(boolean value) { 
2464            if (this.autocreate == null)
2465              this.autocreate = new BooleanType();
2466            this.autocreate.setValue(value);
2467          return this;
2468        }
2469
2470        /**
2471         * @return {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value
2472         */
2473        public BooleanType getAutodeleteElement() { 
2474          if (this.autodelete == null)
2475            if (Configuration.errorOnAutoCreate())
2476              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete");
2477            else if (Configuration.doAutoCreate())
2478              this.autodelete = new BooleanType(); // bb
2479          return this.autodelete;
2480        }
2481
2482        public boolean hasAutodeleteElement() { 
2483          return this.autodelete != null && !this.autodelete.isEmpty();
2484        }
2485
2486        public boolean hasAutodelete() { 
2487          return this.autodelete != null && !this.autodelete.isEmpty();
2488        }
2489
2490        /**
2491         * @param value {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value
2492         */
2493        public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { 
2494          this.autodelete = value;
2495          return this;
2496        }
2497
2498        /**
2499         * @return Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.
2500         */
2501        public boolean getAutodelete() { 
2502          return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue();
2503        }
2504
2505        /**
2506         * @param value Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.
2507         */
2508        public TestScriptFixtureComponent setAutodelete(boolean value) { 
2509            if (this.autodelete == null)
2510              this.autodelete = new BooleanType();
2511            this.autodelete.setValue(value);
2512          return this;
2513        }
2514
2515        /**
2516         * @return {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
2517         */
2518        public Reference getResource() { 
2519          if (this.resource == null)
2520            if (Configuration.errorOnAutoCreate())
2521              throw new Error("Attempt to auto-create TestScriptFixtureComponent.resource");
2522            else if (Configuration.doAutoCreate())
2523              this.resource = new Reference(); // cc
2524          return this.resource;
2525        }
2526
2527        public boolean hasResource() { 
2528          return this.resource != null && !this.resource.isEmpty();
2529        }
2530
2531        /**
2532         * @param value {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
2533         */
2534        public TestScriptFixtureComponent setResource(Reference value) { 
2535          this.resource = value;
2536          return this;
2537        }
2538
2539        /**
2540         * @return {@link #resource} 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. (Reference to the resource (containing the contents of the resource needed for operations).)
2541         */
2542        public Resource getResourceTarget() { 
2543          return this.resourceTarget;
2544        }
2545
2546        /**
2547         * @param value {@link #resource} 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. (Reference to the resource (containing the contents of the resource needed for operations).)
2548         */
2549        public TestScriptFixtureComponent setResourceTarget(Resource value) { 
2550          this.resourceTarget = value;
2551          return this;
2552        }
2553
2554        protected void listChildren(List<Property> children) {
2555          super.listChildren(children);
2556          children.add(new Property("autocreate", "boolean", "Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.", 0, 1, autocreate));
2557          children.add(new Property("autodelete", "boolean", "Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.", 0, 1, autodelete));
2558          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, 1, resource));
2559        }
2560
2561        @Override
2562        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2563          switch (_hash) {
2564          case 73154411: /*autocreate*/  return new Property("autocreate", "boolean", "Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.", 0, 1, autocreate);
2565          case 89990170: /*autodelete*/  return new Property("autodelete", "boolean", "Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.", 0, 1, autodelete);
2566          case -341064690: /*resource*/  return new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, 1, resource);
2567          default: return super.getNamedProperty(_hash, _name, _checkValid);
2568          }
2569
2570        }
2571
2572      @Override
2573      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2574        switch (hash) {
2575        case 73154411: /*autocreate*/ return this.autocreate == null ? new Base[0] : new Base[] {this.autocreate}; // BooleanType
2576        case 89990170: /*autodelete*/ return this.autodelete == null ? new Base[0] : new Base[] {this.autodelete}; // BooleanType
2577        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
2578        default: return super.getProperty(hash, name, checkValid);
2579        }
2580
2581      }
2582
2583      @Override
2584      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2585        switch (hash) {
2586        case 73154411: // autocreate
2587          this.autocreate = castToBoolean(value); // BooleanType
2588          return value;
2589        case 89990170: // autodelete
2590          this.autodelete = castToBoolean(value); // BooleanType
2591          return value;
2592        case -341064690: // resource
2593          this.resource = castToReference(value); // Reference
2594          return value;
2595        default: return super.setProperty(hash, name, value);
2596        }
2597
2598      }
2599
2600      @Override
2601      public Base setProperty(String name, Base value) throws FHIRException {
2602        if (name.equals("autocreate")) {
2603          this.autocreate = castToBoolean(value); // BooleanType
2604        } else if (name.equals("autodelete")) {
2605          this.autodelete = castToBoolean(value); // BooleanType
2606        } else if (name.equals("resource")) {
2607          this.resource = castToReference(value); // Reference
2608        } else
2609          return super.setProperty(name, value);
2610        return value;
2611      }
2612
2613      @Override
2614      public Base makeProperty(int hash, String name) throws FHIRException {
2615        switch (hash) {
2616        case 73154411:  return getAutocreateElement();
2617        case 89990170:  return getAutodeleteElement();
2618        case -341064690:  return getResource(); 
2619        default: return super.makeProperty(hash, name);
2620        }
2621
2622      }
2623
2624      @Override
2625      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2626        switch (hash) {
2627        case 73154411: /*autocreate*/ return new String[] {"boolean"};
2628        case 89990170: /*autodelete*/ return new String[] {"boolean"};
2629        case -341064690: /*resource*/ return new String[] {"Reference"};
2630        default: return super.getTypesForProperty(hash, name);
2631        }
2632
2633      }
2634
2635      @Override
2636      public Base addChild(String name) throws FHIRException {
2637        if (name.equals("autocreate")) {
2638          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autocreate");
2639        }
2640        else if (name.equals("autodelete")) {
2641          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autodelete");
2642        }
2643        else if (name.equals("resource")) {
2644          this.resource = new Reference();
2645          return this.resource;
2646        }
2647        else
2648          return super.addChild(name);
2649      }
2650
2651      public TestScriptFixtureComponent copy() {
2652        TestScriptFixtureComponent dst = new TestScriptFixtureComponent();
2653        copyValues(dst);
2654        dst.autocreate = autocreate == null ? null : autocreate.copy();
2655        dst.autodelete = autodelete == null ? null : autodelete.copy();
2656        dst.resource = resource == null ? null : resource.copy();
2657        return dst;
2658      }
2659
2660      @Override
2661      public boolean equalsDeep(Base other_) {
2662        if (!super.equalsDeep(other_))
2663          return false;
2664        if (!(other_ instanceof TestScriptFixtureComponent))
2665          return false;
2666        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other_;
2667        return compareDeep(autocreate, o.autocreate, true) && compareDeep(autodelete, o.autodelete, true)
2668           && compareDeep(resource, o.resource, true);
2669      }
2670
2671      @Override
2672      public boolean equalsShallow(Base other_) {
2673        if (!super.equalsShallow(other_))
2674          return false;
2675        if (!(other_ instanceof TestScriptFixtureComponent))
2676          return false;
2677        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other_;
2678        return compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true)
2679          ;
2680      }
2681
2682      public boolean isEmpty() {
2683        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(autocreate, autodelete, resource
2684          );
2685      }
2686
2687  public String fhirType() {
2688    return "TestScript.fixture";
2689
2690  }
2691
2692  }
2693
2694    @Block()
2695    public static class TestScriptVariableComponent extends BackboneElement implements IBaseBackboneElement {
2696        /**
2697         * Descriptive name for this variable.
2698         */
2699        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2700        @Description(shortDefinition="Descriptive name for this variable", formalDefinition="Descriptive name for this variable." )
2701        protected StringType name;
2702
2703        /**
2704         * A default, hard-coded, or user-defined value for this variable.
2705         */
2706        @Child(name = "defaultValue", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2707        @Description(shortDefinition="Default, hard-coded, or user-defined value for this variable", formalDefinition="A default, hard-coded, or user-defined value for this variable." )
2708        protected StringType defaultValue;
2709
2710        /**
2711         * A free text natural language description of the variable and its purpose.
2712         */
2713        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2714        @Description(shortDefinition="Natural language description of the variable", formalDefinition="A free text natural language description of the variable and its purpose." )
2715        protected StringType description;
2716
2717        /**
2718         * The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
2719         */
2720        @Child(name = "expression", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2721        @Description(shortDefinition="The FHIRPath expression against the fixture body", formalDefinition="The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified." )
2722        protected StringType expression;
2723
2724        /**
2725         * Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2726         */
2727        @Child(name = "headerField", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2728        @Description(shortDefinition="HTTP header field name for source", formalDefinition="Will be used to grab the HTTP header field value from the headers that sourceId is pointing to." )
2729        protected StringType headerField;
2730
2731        /**
2732         * Displayable text string with hint help information to the user when entering a default value.
2733         */
2734        @Child(name = "hint", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2735        @Description(shortDefinition="Hint help text for default value to enter", formalDefinition="Displayable text string with hint help information to the user when entering a default value." )
2736        protected StringType hint;
2737
2738        /**
2739         * XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.
2740         */
2741        @Child(name = "path", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2742        @Description(shortDefinition="XPath or JSONPath against the fixture body", formalDefinition="XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified." )
2743        protected StringType path;
2744
2745        /**
2746         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
2747         */
2748        @Child(name = "sourceId", type = {IdType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2749        @Description(shortDefinition="Fixture Id of source expression or headerField within this variable", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable." )
2750        protected IdType sourceId;
2751
2752        private static final long serialVersionUID = -1592325432L;
2753
2754    /**
2755     * Constructor
2756     */
2757      public TestScriptVariableComponent() {
2758        super();
2759      }
2760
2761    /**
2762     * Constructor
2763     */
2764      public TestScriptVariableComponent(StringType name) {
2765        super();
2766        this.name = name;
2767      }
2768
2769        /**
2770         * @return {@link #name} (Descriptive name for this variable.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2771         */
2772        public StringType getNameElement() { 
2773          if (this.name == null)
2774            if (Configuration.errorOnAutoCreate())
2775              throw new Error("Attempt to auto-create TestScriptVariableComponent.name");
2776            else if (Configuration.doAutoCreate())
2777              this.name = new StringType(); // bb
2778          return this.name;
2779        }
2780
2781        public boolean hasNameElement() { 
2782          return this.name != null && !this.name.isEmpty();
2783        }
2784
2785        public boolean hasName() { 
2786          return this.name != null && !this.name.isEmpty();
2787        }
2788
2789        /**
2790         * @param value {@link #name} (Descriptive name for this variable.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
2791         */
2792        public TestScriptVariableComponent setNameElement(StringType value) { 
2793          this.name = value;
2794          return this;
2795        }
2796
2797        /**
2798         * @return Descriptive name for this variable.
2799         */
2800        public String getName() { 
2801          return this.name == null ? null : this.name.getValue();
2802        }
2803
2804        /**
2805         * @param value Descriptive name for this variable.
2806         */
2807        public TestScriptVariableComponent setName(String value) { 
2808            if (this.name == null)
2809              this.name = new StringType();
2810            this.name.setValue(value);
2811          return this;
2812        }
2813
2814        /**
2815         * @return {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value
2816         */
2817        public StringType getDefaultValueElement() { 
2818          if (this.defaultValue == null)
2819            if (Configuration.errorOnAutoCreate())
2820              throw new Error("Attempt to auto-create TestScriptVariableComponent.defaultValue");
2821            else if (Configuration.doAutoCreate())
2822              this.defaultValue = new StringType(); // bb
2823          return this.defaultValue;
2824        }
2825
2826        public boolean hasDefaultValueElement() { 
2827          return this.defaultValue != null && !this.defaultValue.isEmpty();
2828        }
2829
2830        public boolean hasDefaultValue() { 
2831          return this.defaultValue != null && !this.defaultValue.isEmpty();
2832        }
2833
2834        /**
2835         * @param value {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value
2836         */
2837        public TestScriptVariableComponent setDefaultValueElement(StringType value) { 
2838          this.defaultValue = value;
2839          return this;
2840        }
2841
2842        /**
2843         * @return A default, hard-coded, or user-defined value for this variable.
2844         */
2845        public String getDefaultValue() { 
2846          return this.defaultValue == null ? null : this.defaultValue.getValue();
2847        }
2848
2849        /**
2850         * @param value A default, hard-coded, or user-defined value for this variable.
2851         */
2852        public TestScriptVariableComponent setDefaultValue(String value) { 
2853          if (Utilities.noString(value))
2854            this.defaultValue = null;
2855          else {
2856            if (this.defaultValue == null)
2857              this.defaultValue = new StringType();
2858            this.defaultValue.setValue(value);
2859          }
2860          return this;
2861        }
2862
2863        /**
2864         * @return {@link #description} (A free text natural language description of the variable and its purpose.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2865         */
2866        public StringType getDescriptionElement() { 
2867          if (this.description == null)
2868            if (Configuration.errorOnAutoCreate())
2869              throw new Error("Attempt to auto-create TestScriptVariableComponent.description");
2870            else if (Configuration.doAutoCreate())
2871              this.description = new StringType(); // bb
2872          return this.description;
2873        }
2874
2875        public boolean hasDescriptionElement() { 
2876          return this.description != null && !this.description.isEmpty();
2877        }
2878
2879        public boolean hasDescription() { 
2880          return this.description != null && !this.description.isEmpty();
2881        }
2882
2883        /**
2884         * @param value {@link #description} (A free text natural language description of the variable and its purpose.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
2885         */
2886        public TestScriptVariableComponent setDescriptionElement(StringType value) { 
2887          this.description = value;
2888          return this;
2889        }
2890
2891        /**
2892         * @return A free text natural language description of the variable and its purpose.
2893         */
2894        public String getDescription() { 
2895          return this.description == null ? null : this.description.getValue();
2896        }
2897
2898        /**
2899         * @param value A free text natural language description of the variable and its purpose.
2900         */
2901        public TestScriptVariableComponent setDescription(String value) { 
2902          if (Utilities.noString(value))
2903            this.description = null;
2904          else {
2905            if (this.description == null)
2906              this.description = new StringType();
2907            this.description.setValue(value);
2908          }
2909          return this;
2910        }
2911
2912        /**
2913         * @return {@link #expression} (The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
2914         */
2915        public StringType getExpressionElement() { 
2916          if (this.expression == null)
2917            if (Configuration.errorOnAutoCreate())
2918              throw new Error("Attempt to auto-create TestScriptVariableComponent.expression");
2919            else if (Configuration.doAutoCreate())
2920              this.expression = new StringType(); // bb
2921          return this.expression;
2922        }
2923
2924        public boolean hasExpressionElement() { 
2925          return this.expression != null && !this.expression.isEmpty();
2926        }
2927
2928        public boolean hasExpression() { 
2929          return this.expression != null && !this.expression.isEmpty();
2930        }
2931
2932        /**
2933         * @param value {@link #expression} (The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
2934         */
2935        public TestScriptVariableComponent setExpressionElement(StringType value) { 
2936          this.expression = value;
2937          return this;
2938        }
2939
2940        /**
2941         * @return The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
2942         */
2943        public String getExpression() { 
2944          return this.expression == null ? null : this.expression.getValue();
2945        }
2946
2947        /**
2948         * @param value The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
2949         */
2950        public TestScriptVariableComponent setExpression(String value) { 
2951          if (Utilities.noString(value))
2952            this.expression = null;
2953          else {
2954            if (this.expression == null)
2955              this.expression = new StringType();
2956            this.expression.setValue(value);
2957          }
2958          return this;
2959        }
2960
2961        /**
2962         * @return {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value
2963         */
2964        public StringType getHeaderFieldElement() { 
2965          if (this.headerField == null)
2966            if (Configuration.errorOnAutoCreate())
2967              throw new Error("Attempt to auto-create TestScriptVariableComponent.headerField");
2968            else if (Configuration.doAutoCreate())
2969              this.headerField = new StringType(); // bb
2970          return this.headerField;
2971        }
2972
2973        public boolean hasHeaderFieldElement() { 
2974          return this.headerField != null && !this.headerField.isEmpty();
2975        }
2976
2977        public boolean hasHeaderField() { 
2978          return this.headerField != null && !this.headerField.isEmpty();
2979        }
2980
2981        /**
2982         * @param value {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value
2983         */
2984        public TestScriptVariableComponent setHeaderFieldElement(StringType value) { 
2985          this.headerField = value;
2986          return this;
2987        }
2988
2989        /**
2990         * @return Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2991         */
2992        public String getHeaderField() { 
2993          return this.headerField == null ? null : this.headerField.getValue();
2994        }
2995
2996        /**
2997         * @param value Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2998         */
2999        public TestScriptVariableComponent setHeaderField(String value) { 
3000          if (Utilities.noString(value))
3001            this.headerField = null;
3002          else {
3003            if (this.headerField == null)
3004              this.headerField = new StringType();
3005            this.headerField.setValue(value);
3006          }
3007          return this;
3008        }
3009
3010        /**
3011         * @return {@link #hint} (Displayable text string with hint help information to the user when entering a default value.). This is the underlying object with id, value and extensions. The accessor "getHint" gives direct access to the value
3012         */
3013        public StringType getHintElement() { 
3014          if (this.hint == null)
3015            if (Configuration.errorOnAutoCreate())
3016              throw new Error("Attempt to auto-create TestScriptVariableComponent.hint");
3017            else if (Configuration.doAutoCreate())
3018              this.hint = new StringType(); // bb
3019          return this.hint;
3020        }
3021
3022        public boolean hasHintElement() { 
3023          return this.hint != null && !this.hint.isEmpty();
3024        }
3025
3026        public boolean hasHint() { 
3027          return this.hint != null && !this.hint.isEmpty();
3028        }
3029
3030        /**
3031         * @param value {@link #hint} (Displayable text string with hint help information to the user when entering a default value.). This is the underlying object with id, value and extensions. The accessor "getHint" gives direct access to the value
3032         */
3033        public TestScriptVariableComponent setHintElement(StringType value) { 
3034          this.hint = value;
3035          return this;
3036        }
3037
3038        /**
3039         * @return Displayable text string with hint help information to the user when entering a default value.
3040         */
3041        public String getHint() { 
3042          return this.hint == null ? null : this.hint.getValue();
3043        }
3044
3045        /**
3046         * @param value Displayable text string with hint help information to the user when entering a default value.
3047         */
3048        public TestScriptVariableComponent setHint(String value) { 
3049          if (Utilities.noString(value))
3050            this.hint = null;
3051          else {
3052            if (this.hint == null)
3053              this.hint = new StringType();
3054            this.hint.setValue(value);
3055          }
3056          return this;
3057        }
3058
3059        /**
3060         * @return {@link #path} (XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
3061         */
3062        public StringType getPathElement() { 
3063          if (this.path == null)
3064            if (Configuration.errorOnAutoCreate())
3065              throw new Error("Attempt to auto-create TestScriptVariableComponent.path");
3066            else if (Configuration.doAutoCreate())
3067              this.path = new StringType(); // bb
3068          return this.path;
3069        }
3070
3071        public boolean hasPathElement() { 
3072          return this.path != null && !this.path.isEmpty();
3073        }
3074
3075        public boolean hasPath() { 
3076          return this.path != null && !this.path.isEmpty();
3077        }
3078
3079        /**
3080         * @param value {@link #path} (XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
3081         */
3082        public TestScriptVariableComponent setPathElement(StringType value) { 
3083          this.path = value;
3084          return this;
3085        }
3086
3087        /**
3088         * @return XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.
3089         */
3090        public String getPath() { 
3091          return this.path == null ? null : this.path.getValue();
3092        }
3093
3094        /**
3095         * @param value XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.
3096         */
3097        public TestScriptVariableComponent setPath(String value) { 
3098          if (Utilities.noString(value))
3099            this.path = null;
3100          else {
3101            if (this.path == null)
3102              this.path = new StringType();
3103            this.path.setValue(value);
3104          }
3105          return this;
3106        }
3107
3108        /**
3109         * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
3110         */
3111        public IdType getSourceIdElement() { 
3112          if (this.sourceId == null)
3113            if (Configuration.errorOnAutoCreate())
3114              throw new Error("Attempt to auto-create TestScriptVariableComponent.sourceId");
3115            else if (Configuration.doAutoCreate())
3116              this.sourceId = new IdType(); // bb
3117          return this.sourceId;
3118        }
3119
3120        public boolean hasSourceIdElement() { 
3121          return this.sourceId != null && !this.sourceId.isEmpty();
3122        }
3123
3124        public boolean hasSourceId() { 
3125          return this.sourceId != null && !this.sourceId.isEmpty();
3126        }
3127
3128        /**
3129         * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
3130         */
3131        public TestScriptVariableComponent setSourceIdElement(IdType value) { 
3132          this.sourceId = value;
3133          return this;
3134        }
3135
3136        /**
3137         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
3138         */
3139        public String getSourceId() { 
3140          return this.sourceId == null ? null : this.sourceId.getValue();
3141        }
3142
3143        /**
3144         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
3145         */
3146        public TestScriptVariableComponent setSourceId(String value) { 
3147          if (Utilities.noString(value))
3148            this.sourceId = null;
3149          else {
3150            if (this.sourceId == null)
3151              this.sourceId = new IdType();
3152            this.sourceId.setValue(value);
3153          }
3154          return this;
3155        }
3156
3157        protected void listChildren(List<Property> children) {
3158          super.listChildren(children);
3159          children.add(new Property("name", "string", "Descriptive name for this variable.", 0, 1, name));
3160          children.add(new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, 1, defaultValue));
3161          children.add(new Property("description", "string", "A free text natural language description of the variable and its purpose.", 0, 1, description));
3162          children.add(new Property("expression", "string", "The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.", 0, 1, expression));
3163          children.add(new Property("headerField", "string", "Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.", 0, 1, headerField));
3164          children.add(new Property("hint", "string", "Displayable text string with hint help information to the user when entering a default value.", 0, 1, hint));
3165          children.add(new Property("path", "string", "XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.", 0, 1, path));
3166          children.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.", 0, 1, sourceId));
3167        }
3168
3169        @Override
3170        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3171          switch (_hash) {
3172          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this variable.", 0, 1, name);
3173          case -659125328: /*defaultValue*/  return new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, 1, defaultValue);
3174          case -1724546052: /*description*/  return new Property("description", "string", "A free text natural language description of the variable and its purpose.", 0, 1, description);
3175          case -1795452264: /*expression*/  return new Property("expression", "string", "The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.", 0, 1, expression);
3176          case 1160732269: /*headerField*/  return new Property("headerField", "string", "Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.", 0, 1, headerField);
3177          case 3202695: /*hint*/  return new Property("hint", "string", "Displayable text string with hint help information to the user when entering a default value.", 0, 1, hint);
3178          case 3433509: /*path*/  return new Property("path", "string", "XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.", 0, 1, path);
3179          case 1746327190: /*sourceId*/  return new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.", 0, 1, sourceId);
3180          default: return super.getNamedProperty(_hash, _name, _checkValid);
3181          }
3182
3183        }
3184
3185      @Override
3186      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3187        switch (hash) {
3188        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3189        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // StringType
3190        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3191        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
3192        case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType
3193        case 3202695: /*hint*/ return this.hint == null ? new Base[0] : new Base[] {this.hint}; // StringType
3194        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
3195        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
3196        default: return super.getProperty(hash, name, checkValid);
3197        }
3198
3199      }
3200
3201      @Override
3202      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3203        switch (hash) {
3204        case 3373707: // name
3205          this.name = castToString(value); // StringType
3206          return value;
3207        case -659125328: // defaultValue
3208          this.defaultValue = castToString(value); // StringType
3209          return value;
3210        case -1724546052: // description
3211          this.description = castToString(value); // StringType
3212          return value;
3213        case -1795452264: // expression
3214          this.expression = castToString(value); // StringType
3215          return value;
3216        case 1160732269: // headerField
3217          this.headerField = castToString(value); // StringType
3218          return value;
3219        case 3202695: // hint
3220          this.hint = castToString(value); // StringType
3221          return value;
3222        case 3433509: // path
3223          this.path = castToString(value); // StringType
3224          return value;
3225        case 1746327190: // sourceId
3226          this.sourceId = castToId(value); // IdType
3227          return value;
3228        default: return super.setProperty(hash, name, value);
3229        }
3230
3231      }
3232
3233      @Override
3234      public Base setProperty(String name, Base value) throws FHIRException {
3235        if (name.equals("name")) {
3236          this.name = castToString(value); // StringType
3237        } else if (name.equals("defaultValue")) {
3238          this.defaultValue = castToString(value); // StringType
3239        } else if (name.equals("description")) {
3240          this.description = castToString(value); // StringType
3241        } else if (name.equals("expression")) {
3242          this.expression = castToString(value); // StringType
3243        } else if (name.equals("headerField")) {
3244          this.headerField = castToString(value); // StringType
3245        } else if (name.equals("hint")) {
3246          this.hint = castToString(value); // StringType
3247        } else if (name.equals("path")) {
3248          this.path = castToString(value); // StringType
3249        } else if (name.equals("sourceId")) {
3250          this.sourceId = castToId(value); // IdType
3251        } else
3252          return super.setProperty(name, value);
3253        return value;
3254      }
3255
3256      @Override
3257      public Base makeProperty(int hash, String name) throws FHIRException {
3258        switch (hash) {
3259        case 3373707:  return getNameElement();
3260        case -659125328:  return getDefaultValueElement();
3261        case -1724546052:  return getDescriptionElement();
3262        case -1795452264:  return getExpressionElement();
3263        case 1160732269:  return getHeaderFieldElement();
3264        case 3202695:  return getHintElement();
3265        case 3433509:  return getPathElement();
3266        case 1746327190:  return getSourceIdElement();
3267        default: return super.makeProperty(hash, name);
3268        }
3269
3270      }
3271
3272      @Override
3273      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3274        switch (hash) {
3275        case 3373707: /*name*/ return new String[] {"string"};
3276        case -659125328: /*defaultValue*/ return new String[] {"string"};
3277        case -1724546052: /*description*/ return new String[] {"string"};
3278        case -1795452264: /*expression*/ return new String[] {"string"};
3279        case 1160732269: /*headerField*/ return new String[] {"string"};
3280        case 3202695: /*hint*/ return new String[] {"string"};
3281        case 3433509: /*path*/ return new String[] {"string"};
3282        case 1746327190: /*sourceId*/ return new String[] {"id"};
3283        default: return super.getTypesForProperty(hash, name);
3284        }
3285
3286      }
3287
3288      @Override
3289      public Base addChild(String name) throws FHIRException {
3290        if (name.equals("name")) {
3291          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
3292        }
3293        else if (name.equals("defaultValue")) {
3294          throw new FHIRException("Cannot call addChild on a primitive type TestScript.defaultValue");
3295        }
3296        else if (name.equals("description")) {
3297          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
3298        }
3299        else if (name.equals("expression")) {
3300          throw new FHIRException("Cannot call addChild on a primitive type TestScript.expression");
3301        }
3302        else if (name.equals("headerField")) {
3303          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
3304        }
3305        else if (name.equals("hint")) {
3306          throw new FHIRException("Cannot call addChild on a primitive type TestScript.hint");
3307        }
3308        else if (name.equals("path")) {
3309          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
3310        }
3311        else if (name.equals("sourceId")) {
3312          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
3313        }
3314        else
3315          return super.addChild(name);
3316      }
3317
3318      public TestScriptVariableComponent copy() {
3319        TestScriptVariableComponent dst = new TestScriptVariableComponent();
3320        copyValues(dst);
3321        dst.name = name == null ? null : name.copy();
3322        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
3323        dst.description = description == null ? null : description.copy();
3324        dst.expression = expression == null ? null : expression.copy();
3325        dst.headerField = headerField == null ? null : headerField.copy();
3326        dst.hint = hint == null ? null : hint.copy();
3327        dst.path = path == null ? null : path.copy();
3328        dst.sourceId = sourceId == null ? null : sourceId.copy();
3329        return dst;
3330      }
3331
3332      @Override
3333      public boolean equalsDeep(Base other_) {
3334        if (!super.equalsDeep(other_))
3335          return false;
3336        if (!(other_ instanceof TestScriptVariableComponent))
3337          return false;
3338        TestScriptVariableComponent o = (TestScriptVariableComponent) other_;
3339        return compareDeep(name, o.name, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(description, o.description, true)
3340           && compareDeep(expression, o.expression, true) && compareDeep(headerField, o.headerField, true)
3341           && compareDeep(hint, o.hint, true) && compareDeep(path, o.path, true) && compareDeep(sourceId, o.sourceId, true)
3342          ;
3343      }
3344
3345      @Override
3346      public boolean equalsShallow(Base other_) {
3347        if (!super.equalsShallow(other_))
3348          return false;
3349        if (!(other_ instanceof TestScriptVariableComponent))
3350          return false;
3351        TestScriptVariableComponent o = (TestScriptVariableComponent) other_;
3352        return compareValues(name, o.name, true) && compareValues(defaultValue, o.defaultValue, true) && compareValues(description, o.description, true)
3353           && compareValues(expression, o.expression, true) && compareValues(headerField, o.headerField, true)
3354           && compareValues(hint, o.hint, true) && compareValues(path, o.path, true) && compareValues(sourceId, o.sourceId, true)
3355          ;
3356      }
3357
3358      public boolean isEmpty() {
3359        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, defaultValue, description
3360          , expression, headerField, hint, path, sourceId);
3361      }
3362
3363  public String fhirType() {
3364    return "TestScript.variable";
3365
3366  }
3367
3368  }
3369
3370    @Block()
3371    public static class TestScriptRuleComponent extends BackboneElement implements IBaseBackboneElement {
3372        /**
3373         * Reference to the resource (containing the contents of the rule needed for assertions).
3374         */
3375        @Child(name = "resource", type = {Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
3376        @Description(shortDefinition="Assert rule resource reference", formalDefinition="Reference to the resource (containing the contents of the rule needed for assertions)." )
3377        protected Reference resource;
3378
3379        /**
3380         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the rule needed for assertions).)
3381         */
3382        protected Resource resourceTarget;
3383
3384        /**
3385         * Each rule template can take one or more parameters for rule evaluation.
3386         */
3387        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3388        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
3389        protected List<RuleParamComponent> param;
3390
3391        private static final long serialVersionUID = -1869267735L;
3392
3393    /**
3394     * Constructor
3395     */
3396      public TestScriptRuleComponent() {
3397        super();
3398      }
3399
3400    /**
3401     * Constructor
3402     */
3403      public TestScriptRuleComponent(Reference resource) {
3404        super();
3405        this.resource = resource;
3406      }
3407
3408        /**
3409         * @return {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).)
3410         */
3411        public Reference getResource() { 
3412          if (this.resource == null)
3413            if (Configuration.errorOnAutoCreate())
3414              throw new Error("Attempt to auto-create TestScriptRuleComponent.resource");
3415            else if (Configuration.doAutoCreate())
3416              this.resource = new Reference(); // cc
3417          return this.resource;
3418        }
3419
3420        public boolean hasResource() { 
3421          return this.resource != null && !this.resource.isEmpty();
3422        }
3423
3424        /**
3425         * @param value {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).)
3426         */
3427        public TestScriptRuleComponent setResource(Reference value) { 
3428          this.resource = value;
3429          return this;
3430        }
3431
3432        /**
3433         * @return {@link #resource} 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. (Reference to the resource (containing the contents of the rule needed for assertions).)
3434         */
3435        public Resource getResourceTarget() { 
3436          return this.resourceTarget;
3437        }
3438
3439        /**
3440         * @param value {@link #resource} 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. (Reference to the resource (containing the contents of the rule needed for assertions).)
3441         */
3442        public TestScriptRuleComponent setResourceTarget(Resource value) { 
3443          this.resourceTarget = value;
3444          return this;
3445        }
3446
3447        /**
3448         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
3449         */
3450        public List<RuleParamComponent> getParam() { 
3451          if (this.param == null)
3452            this.param = new ArrayList<RuleParamComponent>();
3453          return this.param;
3454        }
3455
3456        /**
3457         * @return Returns a reference to <code>this</code> for easy method chaining
3458         */
3459        public TestScriptRuleComponent setParam(List<RuleParamComponent> theParam) { 
3460          this.param = theParam;
3461          return this;
3462        }
3463
3464        public boolean hasParam() { 
3465          if (this.param == null)
3466            return false;
3467          for (RuleParamComponent item : this.param)
3468            if (!item.isEmpty())
3469              return true;
3470          return false;
3471        }
3472
3473        public RuleParamComponent addParam() { //3
3474          RuleParamComponent t = new RuleParamComponent();
3475          if (this.param == null)
3476            this.param = new ArrayList<RuleParamComponent>();
3477          this.param.add(t);
3478          return t;
3479        }
3480
3481        public TestScriptRuleComponent addParam(RuleParamComponent t) { //3
3482          if (t == null)
3483            return this;
3484          if (this.param == null)
3485            this.param = new ArrayList<RuleParamComponent>();
3486          this.param.add(t);
3487          return this;
3488        }
3489
3490        /**
3491         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
3492         */
3493        public RuleParamComponent getParamFirstRep() { 
3494          if (getParam().isEmpty()) {
3495            addParam();
3496          }
3497          return getParam().get(0);
3498        }
3499
3500        protected void listChildren(List<Property> children) {
3501          super.listChildren(children);
3502          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the rule needed for assertions).", 0, 1, resource));
3503          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
3504        }
3505
3506        @Override
3507        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3508          switch (_hash) {
3509          case -341064690: /*resource*/  return new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the rule needed for assertions).", 0, 1, resource);
3510          case 106436749: /*param*/  return new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param);
3511          default: return super.getNamedProperty(_hash, _name, _checkValid);
3512          }
3513
3514        }
3515
3516      @Override
3517      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3518        switch (hash) {
3519        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
3520        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // RuleParamComponent
3521        default: return super.getProperty(hash, name, checkValid);
3522        }
3523
3524      }
3525
3526      @Override
3527      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3528        switch (hash) {
3529        case -341064690: // resource
3530          this.resource = castToReference(value); // Reference
3531          return value;
3532        case 106436749: // param
3533          this.getParam().add((RuleParamComponent) value); // RuleParamComponent
3534          return value;
3535        default: return super.setProperty(hash, name, value);
3536        }
3537
3538      }
3539
3540      @Override
3541      public Base setProperty(String name, Base value) throws FHIRException {
3542        if (name.equals("resource")) {
3543          this.resource = castToReference(value); // Reference
3544        } else if (name.equals("param")) {
3545          this.getParam().add((RuleParamComponent) value);
3546        } else
3547          return super.setProperty(name, value);
3548        return value;
3549      }
3550
3551      @Override
3552      public Base makeProperty(int hash, String name) throws FHIRException {
3553        switch (hash) {
3554        case -341064690:  return getResource(); 
3555        case 106436749:  return addParam(); 
3556        default: return super.makeProperty(hash, name);
3557        }
3558
3559      }
3560
3561      @Override
3562      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3563        switch (hash) {
3564        case -341064690: /*resource*/ return new String[] {"Reference"};
3565        case 106436749: /*param*/ return new String[] {};
3566        default: return super.getTypesForProperty(hash, name);
3567        }
3568
3569      }
3570
3571      @Override
3572      public Base addChild(String name) throws FHIRException {
3573        if (name.equals("resource")) {
3574          this.resource = new Reference();
3575          return this.resource;
3576        }
3577        else if (name.equals("param")) {
3578          return addParam();
3579        }
3580        else
3581          return super.addChild(name);
3582      }
3583
3584      public TestScriptRuleComponent copy() {
3585        TestScriptRuleComponent dst = new TestScriptRuleComponent();
3586        copyValues(dst);
3587        dst.resource = resource == null ? null : resource.copy();
3588        if (param != null) {
3589          dst.param = new ArrayList<RuleParamComponent>();
3590          for (RuleParamComponent i : param)
3591            dst.param.add(i.copy());
3592        };
3593        return dst;
3594      }
3595
3596      @Override
3597      public boolean equalsDeep(Base other_) {
3598        if (!super.equalsDeep(other_))
3599          return false;
3600        if (!(other_ instanceof TestScriptRuleComponent))
3601          return false;
3602        TestScriptRuleComponent o = (TestScriptRuleComponent) other_;
3603        return compareDeep(resource, o.resource, true) && compareDeep(param, o.param, true);
3604      }
3605
3606      @Override
3607      public boolean equalsShallow(Base other_) {
3608        if (!super.equalsShallow(other_))
3609          return false;
3610        if (!(other_ instanceof TestScriptRuleComponent))
3611          return false;
3612        TestScriptRuleComponent o = (TestScriptRuleComponent) other_;
3613        return true;
3614      }
3615
3616      public boolean isEmpty() {
3617        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(resource, param);
3618      }
3619
3620  public String fhirType() {
3621    return "TestScript.rule";
3622
3623  }
3624
3625  }
3626
3627    @Block()
3628    public static class RuleParamComponent extends BackboneElement implements IBaseBackboneElement {
3629        /**
3630         * Descriptive name for this parameter that matches the external assert rule parameter name.
3631         */
3632        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3633        @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." )
3634        protected StringType name;
3635
3636        /**
3637         * The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3638         */
3639        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3640        @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The explicit or dynamic value for the parameter that will be passed on to the external rule template." )
3641        protected StringType value;
3642
3643        private static final long serialVersionUID = 395259392L;
3644
3645    /**
3646     * Constructor
3647     */
3648      public RuleParamComponent() {
3649        super();
3650      }
3651
3652    /**
3653     * Constructor
3654     */
3655      public RuleParamComponent(StringType name) {
3656        super();
3657        this.name = name;
3658      }
3659
3660        /**
3661         * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3662         */
3663        public StringType getNameElement() { 
3664          if (this.name == null)
3665            if (Configuration.errorOnAutoCreate())
3666              throw new Error("Attempt to auto-create RuleParamComponent.name");
3667            else if (Configuration.doAutoCreate())
3668              this.name = new StringType(); // bb
3669          return this.name;
3670        }
3671
3672        public boolean hasNameElement() { 
3673          return this.name != null && !this.name.isEmpty();
3674        }
3675
3676        public boolean hasName() { 
3677          return this.name != null && !this.name.isEmpty();
3678        }
3679
3680        /**
3681         * @param value {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
3682         */
3683        public RuleParamComponent setNameElement(StringType value) { 
3684          this.name = value;
3685          return this;
3686        }
3687
3688        /**
3689         * @return Descriptive name for this parameter that matches the external assert rule parameter name.
3690         */
3691        public String getName() { 
3692          return this.name == null ? null : this.name.getValue();
3693        }
3694
3695        /**
3696         * @param value Descriptive name for this parameter that matches the external assert rule parameter name.
3697         */
3698        public RuleParamComponent setName(String value) { 
3699            if (this.name == null)
3700              this.name = new StringType();
3701            this.name.setValue(value);
3702          return this;
3703        }
3704
3705        /**
3706         * @return {@link #value} (The explicit or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3707         */
3708        public StringType getValueElement() { 
3709          if (this.value == null)
3710            if (Configuration.errorOnAutoCreate())
3711              throw new Error("Attempt to auto-create RuleParamComponent.value");
3712            else if (Configuration.doAutoCreate())
3713              this.value = new StringType(); // bb
3714          return this.value;
3715        }
3716
3717        public boolean hasValueElement() { 
3718          return this.value != null && !this.value.isEmpty();
3719        }
3720
3721        public boolean hasValue() { 
3722          return this.value != null && !this.value.isEmpty();
3723        }
3724
3725        /**
3726         * @param value {@link #value} (The explicit or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3727         */
3728        public RuleParamComponent setValueElement(StringType value) { 
3729          this.value = value;
3730          return this;
3731        }
3732
3733        /**
3734         * @return The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3735         */
3736        public String getValue() { 
3737          return this.value == null ? null : this.value.getValue();
3738        }
3739
3740        /**
3741         * @param value The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3742         */
3743        public RuleParamComponent setValue(String value) { 
3744          if (Utilities.noString(value))
3745            this.value = null;
3746          else {
3747            if (this.value == null)
3748              this.value = new StringType();
3749            this.value.setValue(value);
3750          }
3751          return this;
3752        }
3753
3754        protected void listChildren(List<Property> children) {
3755          super.listChildren(children);
3756          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name));
3757          children.add(new Property("value", "string", "The explicit or dynamic value for the parameter that will be passed on to the external rule template.", 0, 1, value));
3758        }
3759
3760        @Override
3761        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3762          switch (_hash) {
3763          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name);
3764          case 111972721: /*value*/  return new Property("value", "string", "The explicit or dynamic value for the parameter that will be passed on to the external rule template.", 0, 1, value);
3765          default: return super.getNamedProperty(_hash, _name, _checkValid);
3766          }
3767
3768        }
3769
3770      @Override
3771      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3772        switch (hash) {
3773        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3774        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
3775        default: return super.getProperty(hash, name, checkValid);
3776        }
3777
3778      }
3779
3780      @Override
3781      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3782        switch (hash) {
3783        case 3373707: // name
3784          this.name = castToString(value); // StringType
3785          return value;
3786        case 111972721: // value
3787          this.value = castToString(value); // StringType
3788          return value;
3789        default: return super.setProperty(hash, name, value);
3790        }
3791
3792      }
3793
3794      @Override
3795      public Base setProperty(String name, Base value) throws FHIRException {
3796        if (name.equals("name")) {
3797          this.name = castToString(value); // StringType
3798        } else if (name.equals("value")) {
3799          this.value = castToString(value); // StringType
3800        } else
3801          return super.setProperty(name, value);
3802        return value;
3803      }
3804
3805      @Override
3806      public Base makeProperty(int hash, String name) throws FHIRException {
3807        switch (hash) {
3808        case 3373707:  return getNameElement();
3809        case 111972721:  return getValueElement();
3810        default: return super.makeProperty(hash, name);
3811        }
3812
3813      }
3814
3815      @Override
3816      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3817        switch (hash) {
3818        case 3373707: /*name*/ return new String[] {"string"};
3819        case 111972721: /*value*/ return new String[] {"string"};
3820        default: return super.getTypesForProperty(hash, name);
3821        }
3822
3823      }
3824
3825      @Override
3826      public Base addChild(String name) throws FHIRException {
3827        if (name.equals("name")) {
3828          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
3829        }
3830        else if (name.equals("value")) {
3831          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
3832        }
3833        else
3834          return super.addChild(name);
3835      }
3836
3837      public RuleParamComponent copy() {
3838        RuleParamComponent dst = new RuleParamComponent();
3839        copyValues(dst);
3840        dst.name = name == null ? null : name.copy();
3841        dst.value = value == null ? null : value.copy();
3842        return dst;
3843      }
3844
3845      @Override
3846      public boolean equalsDeep(Base other_) {
3847        if (!super.equalsDeep(other_))
3848          return false;
3849        if (!(other_ instanceof RuleParamComponent))
3850          return false;
3851        RuleParamComponent o = (RuleParamComponent) other_;
3852        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
3853      }
3854
3855      @Override
3856      public boolean equalsShallow(Base other_) {
3857        if (!super.equalsShallow(other_))
3858          return false;
3859        if (!(other_ instanceof RuleParamComponent))
3860          return false;
3861        RuleParamComponent o = (RuleParamComponent) other_;
3862        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
3863      }
3864
3865      public boolean isEmpty() {
3866        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
3867      }
3868
3869  public String fhirType() {
3870    return "TestScript.rule.param";
3871
3872  }
3873
3874  }
3875
3876    @Block()
3877    public static class TestScriptRulesetComponent extends BackboneElement implements IBaseBackboneElement {
3878        /**
3879         * Reference to the resource (containing the contents of the ruleset needed for assertions).
3880         */
3881        @Child(name = "resource", type = {Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
3882        @Description(shortDefinition="Assert ruleset resource reference", formalDefinition="Reference to the resource (containing the contents of the ruleset needed for assertions)." )
3883        protected Reference resource;
3884
3885        /**
3886         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the ruleset needed for assertions).)
3887         */
3888        protected Resource resourceTarget;
3889
3890        /**
3891         * The referenced rule within the external ruleset template.
3892         */
3893        @Child(name = "rule", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3894        @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." )
3895        protected List<RulesetRuleComponent> rule;
3896
3897        private static final long serialVersionUID = 1260261423L;
3898
3899    /**
3900     * Constructor
3901     */
3902      public TestScriptRulesetComponent() {
3903        super();
3904      }
3905
3906    /**
3907     * Constructor
3908     */
3909      public TestScriptRulesetComponent(Reference resource) {
3910        super();
3911        this.resource = resource;
3912      }
3913
3914        /**
3915         * @return {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).)
3916         */
3917        public Reference getResource() { 
3918          if (this.resource == null)
3919            if (Configuration.errorOnAutoCreate())
3920              throw new Error("Attempt to auto-create TestScriptRulesetComponent.resource");
3921            else if (Configuration.doAutoCreate())
3922              this.resource = new Reference(); // cc
3923          return this.resource;
3924        }
3925
3926        public boolean hasResource() { 
3927          return this.resource != null && !this.resource.isEmpty();
3928        }
3929
3930        /**
3931         * @param value {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).)
3932         */
3933        public TestScriptRulesetComponent setResource(Reference value) { 
3934          this.resource = value;
3935          return this;
3936        }
3937
3938        /**
3939         * @return {@link #resource} 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. (Reference to the resource (containing the contents of the ruleset needed for assertions).)
3940         */
3941        public Resource getResourceTarget() { 
3942          return this.resourceTarget;
3943        }
3944
3945        /**
3946         * @param value {@link #resource} 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. (Reference to the resource (containing the contents of the ruleset needed for assertions).)
3947         */
3948        public TestScriptRulesetComponent setResourceTarget(Resource value) { 
3949          this.resourceTarget = value;
3950          return this;
3951        }
3952
3953        /**
3954         * @return {@link #rule} (The referenced rule within the external ruleset template.)
3955         */
3956        public List<RulesetRuleComponent> getRule() { 
3957          if (this.rule == null)
3958            this.rule = new ArrayList<RulesetRuleComponent>();
3959          return this.rule;
3960        }
3961
3962        /**
3963         * @return Returns a reference to <code>this</code> for easy method chaining
3964         */
3965        public TestScriptRulesetComponent setRule(List<RulesetRuleComponent> theRule) { 
3966          this.rule = theRule;
3967          return this;
3968        }
3969
3970        public boolean hasRule() { 
3971          if (this.rule == null)
3972            return false;
3973          for (RulesetRuleComponent item : this.rule)
3974            if (!item.isEmpty())
3975              return true;
3976          return false;
3977        }
3978
3979        public RulesetRuleComponent addRule() { //3
3980          RulesetRuleComponent t = new RulesetRuleComponent();
3981          if (this.rule == null)
3982            this.rule = new ArrayList<RulesetRuleComponent>();
3983          this.rule.add(t);
3984          return t;
3985        }
3986
3987        public TestScriptRulesetComponent addRule(RulesetRuleComponent t) { //3
3988          if (t == null)
3989            return this;
3990          if (this.rule == null)
3991            this.rule = new ArrayList<RulesetRuleComponent>();
3992          this.rule.add(t);
3993          return this;
3994        }
3995
3996        /**
3997         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
3998         */
3999        public RulesetRuleComponent getRuleFirstRep() { 
4000          if (getRule().isEmpty()) {
4001            addRule();
4002          }
4003          return getRule().get(0);
4004        }
4005
4006        protected void listChildren(List<Property> children) {
4007          super.listChildren(children);
4008          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the ruleset needed for assertions).", 0, 1, resource));
4009          children.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule));
4010        }
4011
4012        @Override
4013        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4014          switch (_hash) {
4015          case -341064690: /*resource*/  return new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the ruleset needed for assertions).", 0, 1, resource);
4016          case 3512060: /*rule*/  return new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule);
4017          default: return super.getNamedProperty(_hash, _name, _checkValid);
4018          }
4019
4020        }
4021
4022      @Override
4023      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4024        switch (hash) {
4025        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
4026        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // RulesetRuleComponent
4027        default: return super.getProperty(hash, name, checkValid);
4028        }
4029
4030      }
4031
4032      @Override
4033      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4034        switch (hash) {
4035        case -341064690: // resource
4036          this.resource = castToReference(value); // Reference
4037          return value;
4038        case 3512060: // rule
4039          this.getRule().add((RulesetRuleComponent) value); // RulesetRuleComponent
4040          return value;
4041        default: return super.setProperty(hash, name, value);
4042        }
4043
4044      }
4045
4046      @Override
4047      public Base setProperty(String name, Base value) throws FHIRException {
4048        if (name.equals("resource")) {
4049          this.resource = castToReference(value); // Reference
4050        } else if (name.equals("rule")) {
4051          this.getRule().add((RulesetRuleComponent) value);
4052        } else
4053          return super.setProperty(name, value);
4054        return value;
4055      }
4056
4057      @Override
4058      public Base makeProperty(int hash, String name) throws FHIRException {
4059        switch (hash) {
4060        case -341064690:  return getResource(); 
4061        case 3512060:  return addRule(); 
4062        default: return super.makeProperty(hash, name);
4063        }
4064
4065      }
4066
4067      @Override
4068      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4069        switch (hash) {
4070        case -341064690: /*resource*/ return new String[] {"Reference"};
4071        case 3512060: /*rule*/ return new String[] {};
4072        default: return super.getTypesForProperty(hash, name);
4073        }
4074
4075      }
4076
4077      @Override
4078      public Base addChild(String name) throws FHIRException {
4079        if (name.equals("resource")) {
4080          this.resource = new Reference();
4081          return this.resource;
4082        }
4083        else if (name.equals("rule")) {
4084          return addRule();
4085        }
4086        else
4087          return super.addChild(name);
4088      }
4089
4090      public TestScriptRulesetComponent copy() {
4091        TestScriptRulesetComponent dst = new TestScriptRulesetComponent();
4092        copyValues(dst);
4093        dst.resource = resource == null ? null : resource.copy();
4094        if (rule != null) {
4095          dst.rule = new ArrayList<RulesetRuleComponent>();
4096          for (RulesetRuleComponent i : rule)
4097            dst.rule.add(i.copy());
4098        };
4099        return dst;
4100      }
4101
4102      @Override
4103      public boolean equalsDeep(Base other_) {
4104        if (!super.equalsDeep(other_))
4105          return false;
4106        if (!(other_ instanceof TestScriptRulesetComponent))
4107          return false;
4108        TestScriptRulesetComponent o = (TestScriptRulesetComponent) other_;
4109        return compareDeep(resource, o.resource, true) && compareDeep(rule, o.rule, true);
4110      }
4111
4112      @Override
4113      public boolean equalsShallow(Base other_) {
4114        if (!super.equalsShallow(other_))
4115          return false;
4116        if (!(other_ instanceof TestScriptRulesetComponent))
4117          return false;
4118        TestScriptRulesetComponent o = (TestScriptRulesetComponent) other_;
4119        return true;
4120      }
4121
4122      public boolean isEmpty() {
4123        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(resource, rule);
4124      }
4125
4126  public String fhirType() {
4127    return "TestScript.ruleset";
4128
4129  }
4130
4131  }
4132
4133    @Block()
4134    public static class RulesetRuleComponent extends BackboneElement implements IBaseBackboneElement {
4135        /**
4136         * Id of the referenced rule within the external ruleset template.
4137         */
4138        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4139        @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." )
4140        protected IdType ruleId;
4141
4142        /**
4143         * Each rule template can take one or more parameters for rule evaluation.
4144         */
4145        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4146        @Description(shortDefinition="Ruleset rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
4147        protected List<RulesetRuleParamComponent> param;
4148
4149        private static final long serialVersionUID = -1399866981L;
4150
4151    /**
4152     * Constructor
4153     */
4154      public RulesetRuleComponent() {
4155        super();
4156      }
4157
4158    /**
4159     * Constructor
4160     */
4161      public RulesetRuleComponent(IdType ruleId) {
4162        super();
4163        this.ruleId = ruleId;
4164      }
4165
4166        /**
4167         * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
4168         */
4169        public IdType getRuleIdElement() { 
4170          if (this.ruleId == null)
4171            if (Configuration.errorOnAutoCreate())
4172              throw new Error("Attempt to auto-create RulesetRuleComponent.ruleId");
4173            else if (Configuration.doAutoCreate())
4174              this.ruleId = new IdType(); // bb
4175          return this.ruleId;
4176        }
4177
4178        public boolean hasRuleIdElement() { 
4179          return this.ruleId != null && !this.ruleId.isEmpty();
4180        }
4181
4182        public boolean hasRuleId() { 
4183          return this.ruleId != null && !this.ruleId.isEmpty();
4184        }
4185
4186        /**
4187         * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
4188         */
4189        public RulesetRuleComponent setRuleIdElement(IdType value) { 
4190          this.ruleId = value;
4191          return this;
4192        }
4193
4194        /**
4195         * @return Id of the referenced rule within the external ruleset template.
4196         */
4197        public String getRuleId() { 
4198          return this.ruleId == null ? null : this.ruleId.getValue();
4199        }
4200
4201        /**
4202         * @param value Id of the referenced rule within the external ruleset template.
4203         */
4204        public RulesetRuleComponent setRuleId(String value) { 
4205            if (this.ruleId == null)
4206              this.ruleId = new IdType();
4207            this.ruleId.setValue(value);
4208          return this;
4209        }
4210
4211        /**
4212         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
4213         */
4214        public List<RulesetRuleParamComponent> getParam() { 
4215          if (this.param == null)
4216            this.param = new ArrayList<RulesetRuleParamComponent>();
4217          return this.param;
4218        }
4219
4220        /**
4221         * @return Returns a reference to <code>this</code> for easy method chaining
4222         */
4223        public RulesetRuleComponent setParam(List<RulesetRuleParamComponent> theParam) { 
4224          this.param = theParam;
4225          return this;
4226        }
4227
4228        public boolean hasParam() { 
4229          if (this.param == null)
4230            return false;
4231          for (RulesetRuleParamComponent item : this.param)
4232            if (!item.isEmpty())
4233              return true;
4234          return false;
4235        }
4236
4237        public RulesetRuleParamComponent addParam() { //3
4238          RulesetRuleParamComponent t = new RulesetRuleParamComponent();
4239          if (this.param == null)
4240            this.param = new ArrayList<RulesetRuleParamComponent>();
4241          this.param.add(t);
4242          return t;
4243        }
4244
4245        public RulesetRuleComponent addParam(RulesetRuleParamComponent t) { //3
4246          if (t == null)
4247            return this;
4248          if (this.param == null)
4249            this.param = new ArrayList<RulesetRuleParamComponent>();
4250          this.param.add(t);
4251          return this;
4252        }
4253
4254        /**
4255         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
4256         */
4257        public RulesetRuleParamComponent getParamFirstRep() { 
4258          if (getParam().isEmpty()) {
4259            addParam();
4260          }
4261          return getParam().get(0);
4262        }
4263
4264        protected void listChildren(List<Property> children) {
4265          super.listChildren(children);
4266          children.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId));
4267          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
4268        }
4269
4270        @Override
4271        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4272          switch (_hash) {
4273          case -919875273: /*ruleId*/  return new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId);
4274          case 106436749: /*param*/  return new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param);
4275          default: return super.getNamedProperty(_hash, _name, _checkValid);
4276          }
4277
4278        }
4279
4280      @Override
4281      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4282        switch (hash) {
4283        case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType
4284        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // RulesetRuleParamComponent
4285        default: return super.getProperty(hash, name, checkValid);
4286        }
4287
4288      }
4289
4290      @Override
4291      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4292        switch (hash) {
4293        case -919875273: // ruleId
4294          this.ruleId = castToId(value); // IdType
4295          return value;
4296        case 106436749: // param
4297          this.getParam().add((RulesetRuleParamComponent) value); // RulesetRuleParamComponent
4298          return value;
4299        default: return super.setProperty(hash, name, value);
4300        }
4301
4302      }
4303
4304      @Override
4305      public Base setProperty(String name, Base value) throws FHIRException {
4306        if (name.equals("ruleId")) {
4307          this.ruleId = castToId(value); // IdType
4308        } else if (name.equals("param")) {
4309          this.getParam().add((RulesetRuleParamComponent) value);
4310        } else
4311          return super.setProperty(name, value);
4312        return value;
4313      }
4314
4315      @Override
4316      public Base makeProperty(int hash, String name) throws FHIRException {
4317        switch (hash) {
4318        case -919875273:  return getRuleIdElement();
4319        case 106436749:  return addParam(); 
4320        default: return super.makeProperty(hash, name);
4321        }
4322
4323      }
4324
4325      @Override
4326      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4327        switch (hash) {
4328        case -919875273: /*ruleId*/ return new String[] {"id"};
4329        case 106436749: /*param*/ return new String[] {};
4330        default: return super.getTypesForProperty(hash, name);
4331        }
4332
4333      }
4334
4335      @Override
4336      public Base addChild(String name) throws FHIRException {
4337        if (name.equals("ruleId")) {
4338          throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId");
4339        }
4340        else if (name.equals("param")) {
4341          return addParam();
4342        }
4343        else
4344          return super.addChild(name);
4345      }
4346
4347      public RulesetRuleComponent copy() {
4348        RulesetRuleComponent dst = new RulesetRuleComponent();
4349        copyValues(dst);
4350        dst.ruleId = ruleId == null ? null : ruleId.copy();
4351        if (param != null) {
4352          dst.param = new ArrayList<RulesetRuleParamComponent>();
4353          for (RulesetRuleParamComponent i : param)
4354            dst.param.add(i.copy());
4355        };
4356        return dst;
4357      }
4358
4359      @Override
4360      public boolean equalsDeep(Base other_) {
4361        if (!super.equalsDeep(other_))
4362          return false;
4363        if (!(other_ instanceof RulesetRuleComponent))
4364          return false;
4365        RulesetRuleComponent o = (RulesetRuleComponent) other_;
4366        return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true);
4367      }
4368
4369      @Override
4370      public boolean equalsShallow(Base other_) {
4371        if (!super.equalsShallow(other_))
4372          return false;
4373        if (!(other_ instanceof RulesetRuleComponent))
4374          return false;
4375        RulesetRuleComponent o = (RulesetRuleComponent) other_;
4376        return compareValues(ruleId, o.ruleId, true);
4377      }
4378
4379      public boolean isEmpty() {
4380        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ruleId, param);
4381      }
4382
4383  public String fhirType() {
4384    return "TestScript.ruleset.rule";
4385
4386  }
4387
4388  }
4389
4390    @Block()
4391    public static class RulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement {
4392        /**
4393         * Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4394         */
4395        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4396        @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." )
4397        protected StringType name;
4398
4399        /**
4400         * The value for the parameter that will be passed on to the external ruleset rule template.
4401         */
4402        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4403        @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." )
4404        protected StringType value;
4405
4406        private static final long serialVersionUID = 395259392L;
4407
4408    /**
4409     * Constructor
4410     */
4411      public RulesetRuleParamComponent() {
4412        super();
4413      }
4414
4415    /**
4416     * Constructor
4417     */
4418      public RulesetRuleParamComponent(StringType name) {
4419        super();
4420        this.name = name;
4421      }
4422
4423        /**
4424         * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4425         */
4426        public StringType getNameElement() { 
4427          if (this.name == null)
4428            if (Configuration.errorOnAutoCreate())
4429              throw new Error("Attempt to auto-create RulesetRuleParamComponent.name");
4430            else if (Configuration.doAutoCreate())
4431              this.name = new StringType(); // bb
4432          return this.name;
4433        }
4434
4435        public boolean hasNameElement() { 
4436          return this.name != null && !this.name.isEmpty();
4437        }
4438
4439        public boolean hasName() { 
4440          return this.name != null && !this.name.isEmpty();
4441        }
4442
4443        /**
4444         * @param value {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4445         */
4446        public RulesetRuleParamComponent setNameElement(StringType value) { 
4447          this.name = value;
4448          return this;
4449        }
4450
4451        /**
4452         * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4453         */
4454        public String getName() { 
4455          return this.name == null ? null : this.name.getValue();
4456        }
4457
4458        /**
4459         * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4460         */
4461        public RulesetRuleParamComponent setName(String value) { 
4462            if (this.name == null)
4463              this.name = new StringType();
4464            this.name.setValue(value);
4465          return this;
4466        }
4467
4468        /**
4469         * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
4470         */
4471        public StringType getValueElement() { 
4472          if (this.value == null)
4473            if (Configuration.errorOnAutoCreate())
4474              throw new Error("Attempt to auto-create RulesetRuleParamComponent.value");
4475            else if (Configuration.doAutoCreate())
4476              this.value = new StringType(); // bb
4477          return this.value;
4478        }
4479
4480        public boolean hasValueElement() { 
4481          return this.value != null && !this.value.isEmpty();
4482        }
4483
4484        public boolean hasValue() { 
4485          return this.value != null && !this.value.isEmpty();
4486        }
4487
4488        /**
4489         * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
4490         */
4491        public RulesetRuleParamComponent setValueElement(StringType value) { 
4492          this.value = value;
4493          return this;
4494        }
4495
4496        /**
4497         * @return The value for the parameter that will be passed on to the external ruleset rule template.
4498         */
4499        public String getValue() { 
4500          return this.value == null ? null : this.value.getValue();
4501        }
4502
4503        /**
4504         * @param value The value for the parameter that will be passed on to the external ruleset rule template.
4505         */
4506        public RulesetRuleParamComponent setValue(String value) { 
4507          if (Utilities.noString(value))
4508            this.value = null;
4509          else {
4510            if (this.value == null)
4511              this.value = new StringType();
4512            this.value.setValue(value);
4513          }
4514          return this;
4515        }
4516
4517        protected void listChildren(List<Property> children) {
4518          super.listChildren(children);
4519          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, 1, name));
4520          children.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, 1, value));
4521        }
4522
4523        @Override
4524        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4525          switch (_hash) {
4526          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, 1, name);
4527          case 111972721: /*value*/  return new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, 1, value);
4528          default: return super.getNamedProperty(_hash, _name, _checkValid);
4529          }
4530
4531        }
4532
4533      @Override
4534      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4535        switch (hash) {
4536        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4537        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
4538        default: return super.getProperty(hash, name, checkValid);
4539        }
4540
4541      }
4542
4543      @Override
4544      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4545        switch (hash) {
4546        case 3373707: // name
4547          this.name = castToString(value); // StringType
4548          return value;
4549        case 111972721: // value
4550          this.value = castToString(value); // StringType
4551          return value;
4552        default: return super.setProperty(hash, name, value);
4553        }
4554
4555      }
4556
4557      @Override
4558      public Base setProperty(String name, Base value) throws FHIRException {
4559        if (name.equals("name")) {
4560          this.name = castToString(value); // StringType
4561        } else if (name.equals("value")) {
4562          this.value = castToString(value); // StringType
4563        } else
4564          return super.setProperty(name, value);
4565        return value;
4566      }
4567
4568      @Override
4569      public Base makeProperty(int hash, String name) throws FHIRException {
4570        switch (hash) {
4571        case 3373707:  return getNameElement();
4572        case 111972721:  return getValueElement();
4573        default: return super.makeProperty(hash, name);
4574        }
4575
4576      }
4577
4578      @Override
4579      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4580        switch (hash) {
4581        case 3373707: /*name*/ return new String[] {"string"};
4582        case 111972721: /*value*/ return new String[] {"string"};
4583        default: return super.getTypesForProperty(hash, name);
4584        }
4585
4586      }
4587
4588      @Override
4589      public Base addChild(String name) throws FHIRException {
4590        if (name.equals("name")) {
4591          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
4592        }
4593        else if (name.equals("value")) {
4594          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
4595        }
4596        else
4597          return super.addChild(name);
4598      }
4599
4600      public RulesetRuleParamComponent copy() {
4601        RulesetRuleParamComponent dst = new RulesetRuleParamComponent();
4602        copyValues(dst);
4603        dst.name = name == null ? null : name.copy();
4604        dst.value = value == null ? null : value.copy();
4605        return dst;
4606      }
4607
4608      @Override
4609      public boolean equalsDeep(Base other_) {
4610        if (!super.equalsDeep(other_))
4611          return false;
4612        if (!(other_ instanceof RulesetRuleParamComponent))
4613          return false;
4614        RulesetRuleParamComponent o = (RulesetRuleParamComponent) other_;
4615        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
4616      }
4617
4618      @Override
4619      public boolean equalsShallow(Base other_) {
4620        if (!super.equalsShallow(other_))
4621          return false;
4622        if (!(other_ instanceof RulesetRuleParamComponent))
4623          return false;
4624        RulesetRuleParamComponent o = (RulesetRuleParamComponent) other_;
4625        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
4626      }
4627
4628      public boolean isEmpty() {
4629        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
4630      }
4631
4632  public String fhirType() {
4633    return "TestScript.ruleset.rule.param";
4634
4635  }
4636
4637  }
4638
4639    @Block()
4640    public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement {
4641        /**
4642         * Action would contain either an operation or an assertion.
4643         */
4644        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4645        @Description(shortDefinition="A setup operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." )
4646        protected List<SetupActionComponent> action;
4647
4648        private static final long serialVersionUID = -123374486L;
4649
4650    /**
4651     * Constructor
4652     */
4653      public TestScriptSetupComponent() {
4654        super();
4655      }
4656
4657        /**
4658         * @return {@link #action} (Action would contain either an operation or an assertion.)
4659         */
4660        public List<SetupActionComponent> getAction() { 
4661          if (this.action == null)
4662            this.action = new ArrayList<SetupActionComponent>();
4663          return this.action;
4664        }
4665
4666        /**
4667         * @return Returns a reference to <code>this</code> for easy method chaining
4668         */
4669        public TestScriptSetupComponent setAction(List<SetupActionComponent> theAction) { 
4670          this.action = theAction;
4671          return this;
4672        }
4673
4674        public boolean hasAction() { 
4675          if (this.action == null)
4676            return false;
4677          for (SetupActionComponent item : this.action)
4678            if (!item.isEmpty())
4679              return true;
4680          return false;
4681        }
4682
4683        public SetupActionComponent addAction() { //3
4684          SetupActionComponent t = new SetupActionComponent();
4685          if (this.action == null)
4686            this.action = new ArrayList<SetupActionComponent>();
4687          this.action.add(t);
4688          return t;
4689        }
4690
4691        public TestScriptSetupComponent addAction(SetupActionComponent t) { //3
4692          if (t == null)
4693            return this;
4694          if (this.action == null)
4695            this.action = new ArrayList<SetupActionComponent>();
4696          this.action.add(t);
4697          return this;
4698        }
4699
4700        /**
4701         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
4702         */
4703        public SetupActionComponent getActionFirstRep() { 
4704          if (getAction().isEmpty()) {
4705            addAction();
4706          }
4707          return getAction().get(0);
4708        }
4709
4710        protected void listChildren(List<Property> children) {
4711          super.listChildren(children);
4712          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
4713        }
4714
4715        @Override
4716        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4717          switch (_hash) {
4718          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
4719          default: return super.getNamedProperty(_hash, _name, _checkValid);
4720          }
4721
4722        }
4723
4724      @Override
4725      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4726        switch (hash) {
4727        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent
4728        default: return super.getProperty(hash, name, checkValid);
4729        }
4730
4731      }
4732
4733      @Override
4734      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4735        switch (hash) {
4736        case -1422950858: // action
4737          this.getAction().add((SetupActionComponent) value); // SetupActionComponent
4738          return value;
4739        default: return super.setProperty(hash, name, value);
4740        }
4741
4742      }
4743
4744      @Override
4745      public Base setProperty(String name, Base value) throws FHIRException {
4746        if (name.equals("action")) {
4747          this.getAction().add((SetupActionComponent) value);
4748        } else
4749          return super.setProperty(name, value);
4750        return value;
4751      }
4752
4753      @Override
4754      public Base makeProperty(int hash, String name) throws FHIRException {
4755        switch (hash) {
4756        case -1422950858:  return addAction(); 
4757        default: return super.makeProperty(hash, name);
4758        }
4759
4760      }
4761
4762      @Override
4763      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4764        switch (hash) {
4765        case -1422950858: /*action*/ return new String[] {};
4766        default: return super.getTypesForProperty(hash, name);
4767        }
4768
4769      }
4770
4771      @Override
4772      public Base addChild(String name) throws FHIRException {
4773        if (name.equals("action")) {
4774          return addAction();
4775        }
4776        else
4777          return super.addChild(name);
4778      }
4779
4780      public TestScriptSetupComponent copy() {
4781        TestScriptSetupComponent dst = new TestScriptSetupComponent();
4782        copyValues(dst);
4783        if (action != null) {
4784          dst.action = new ArrayList<SetupActionComponent>();
4785          for (SetupActionComponent i : action)
4786            dst.action.add(i.copy());
4787        };
4788        return dst;
4789      }
4790
4791      @Override
4792      public boolean equalsDeep(Base other_) {
4793        if (!super.equalsDeep(other_))
4794          return false;
4795        if (!(other_ instanceof TestScriptSetupComponent))
4796          return false;
4797        TestScriptSetupComponent o = (TestScriptSetupComponent) other_;
4798        return compareDeep(action, o.action, true);
4799      }
4800
4801      @Override
4802      public boolean equalsShallow(Base other_) {
4803        if (!super.equalsShallow(other_))
4804          return false;
4805        if (!(other_ instanceof TestScriptSetupComponent))
4806          return false;
4807        TestScriptSetupComponent o = (TestScriptSetupComponent) other_;
4808        return true;
4809      }
4810
4811      public boolean isEmpty() {
4812        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
4813      }
4814
4815  public String fhirType() {
4816    return "TestScript.setup";
4817
4818  }
4819
4820  }
4821
4822    @Block()
4823    public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement {
4824        /**
4825         * The operation to perform.
4826         */
4827        @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
4828        @Description(shortDefinition="The setup operation to perform", formalDefinition="The operation to perform." )
4829        protected SetupActionOperationComponent operation;
4830
4831        /**
4832         * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
4833         */
4834        @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
4835        @Description(shortDefinition="The assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." )
4836        protected SetupActionAssertComponent assert_;
4837
4838        private static final long serialVersionUID = -252088305L;
4839
4840    /**
4841     * Constructor
4842     */
4843      public SetupActionComponent() {
4844        super();
4845      }
4846
4847        /**
4848         * @return {@link #operation} (The operation to perform.)
4849         */
4850        public SetupActionOperationComponent getOperation() { 
4851          if (this.operation == null)
4852            if (Configuration.errorOnAutoCreate())
4853              throw new Error("Attempt to auto-create SetupActionComponent.operation");
4854            else if (Configuration.doAutoCreate())
4855              this.operation = new SetupActionOperationComponent(); // cc
4856          return this.operation;
4857        }
4858
4859        public boolean hasOperation() { 
4860          return this.operation != null && !this.operation.isEmpty();
4861        }
4862
4863        /**
4864         * @param value {@link #operation} (The operation to perform.)
4865         */
4866        public SetupActionComponent setOperation(SetupActionOperationComponent value) { 
4867          this.operation = value;
4868          return this;
4869        }
4870
4871        /**
4872         * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
4873         */
4874        public SetupActionAssertComponent getAssert() { 
4875          if (this.assert_ == null)
4876            if (Configuration.errorOnAutoCreate())
4877              throw new Error("Attempt to auto-create SetupActionComponent.assert_");
4878            else if (Configuration.doAutoCreate())
4879              this.assert_ = new SetupActionAssertComponent(); // cc
4880          return this.assert_;
4881        }
4882
4883        public boolean hasAssert() { 
4884          return this.assert_ != null && !this.assert_.isEmpty();
4885        }
4886
4887        /**
4888         * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
4889         */
4890        public SetupActionComponent setAssert(SetupActionAssertComponent value) { 
4891          this.assert_ = value;
4892          return this;
4893        }
4894
4895        protected void listChildren(List<Property> children) {
4896          super.listChildren(children);
4897          children.add(new Property("operation", "", "The operation to perform.", 0, 1, operation));
4898          children.add(new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, 1, assert_));
4899        }
4900
4901        @Override
4902        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4903          switch (_hash) {
4904          case 1662702951: /*operation*/  return new Property("operation", "", "The operation to perform.", 0, 1, operation);
4905          case -1408208058: /*assert*/  return new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, 1, assert_);
4906          default: return super.getNamedProperty(_hash, _name, _checkValid);
4907          }
4908
4909        }
4910
4911      @Override
4912      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4913        switch (hash) {
4914        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
4915        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
4916        default: return super.getProperty(hash, name, checkValid);
4917        }
4918
4919      }
4920
4921      @Override
4922      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4923        switch (hash) {
4924        case 1662702951: // operation
4925          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
4926          return value;
4927        case -1408208058: // assert
4928          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
4929          return value;
4930        default: return super.setProperty(hash, name, value);
4931        }
4932
4933      }
4934
4935      @Override
4936      public Base setProperty(String name, Base value) throws FHIRException {
4937        if (name.equals("operation")) {
4938          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
4939        } else if (name.equals("assert")) {
4940          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
4941        } else
4942          return super.setProperty(name, value);
4943        return value;
4944      }
4945
4946      @Override
4947      public Base makeProperty(int hash, String name) throws FHIRException {
4948        switch (hash) {
4949        case 1662702951:  return getOperation(); 
4950        case -1408208058:  return getAssert(); 
4951        default: return super.makeProperty(hash, name);
4952        }
4953
4954      }
4955
4956      @Override
4957      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4958        switch (hash) {
4959        case 1662702951: /*operation*/ return new String[] {};
4960        case -1408208058: /*assert*/ return new String[] {};
4961        default: return super.getTypesForProperty(hash, name);
4962        }
4963
4964      }
4965
4966      @Override
4967      public Base addChild(String name) throws FHIRException {
4968        if (name.equals("operation")) {
4969          this.operation = new SetupActionOperationComponent();
4970          return this.operation;
4971        }
4972        else if (name.equals("assert")) {
4973          this.assert_ = new SetupActionAssertComponent();
4974          return this.assert_;
4975        }
4976        else
4977          return super.addChild(name);
4978      }
4979
4980      public SetupActionComponent copy() {
4981        SetupActionComponent dst = new SetupActionComponent();
4982        copyValues(dst);
4983        dst.operation = operation == null ? null : operation.copy();
4984        dst.assert_ = assert_ == null ? null : assert_.copy();
4985        return dst;
4986      }
4987
4988      @Override
4989      public boolean equalsDeep(Base other_) {
4990        if (!super.equalsDeep(other_))
4991          return false;
4992        if (!(other_ instanceof SetupActionComponent))
4993          return false;
4994        SetupActionComponent o = (SetupActionComponent) other_;
4995        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
4996      }
4997
4998      @Override
4999      public boolean equalsShallow(Base other_) {
5000        if (!super.equalsShallow(other_))
5001          return false;
5002        if (!(other_ instanceof SetupActionComponent))
5003          return false;
5004        SetupActionComponent o = (SetupActionComponent) other_;
5005        return true;
5006      }
5007
5008      public boolean isEmpty() {
5009        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
5010      }
5011
5012  public String fhirType() {
5013    return "TestScript.setup.action";
5014
5015  }
5016
5017  }
5018
5019    @Block()
5020    public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement {
5021        /**
5022         * Server interaction or operation type.
5023         */
5024        @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false)
5025        @Description(shortDefinition="The operation code type that will be executed", formalDefinition="Server interaction or operation type." )
5026        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-operation-codes")
5027        protected Coding type;
5028
5029        /**
5030         * The type of the resource.  See http://build.fhir.org/resourcelist.html.
5031         */
5032        @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5033        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://build.fhir.org/resourcelist.html." )
5034        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
5035        protected CodeType resource;
5036
5037        /**
5038         * The label would be used for tracking/logging purposes by test engines.
5039         */
5040        @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5041        @Description(shortDefinition="Tracking/logging operation label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
5042        protected StringType label;
5043
5044        /**
5045         * The description would be used by test engines for tracking and reporting purposes.
5046         */
5047        @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5048        @Description(shortDefinition="Tracking/reporting operation description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
5049        protected StringType description;
5050
5051        /**
5052         * The mime-type to use for RESTful operation in the 'Accept' header.
5053         */
5054        @Child(name = "accept", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5055        @Description(shortDefinition="Mime type to accept in the payload of the response, with charset etc.", formalDefinition="The mime-type to use for RESTful operation in the 'Accept' header." )
5056        protected CodeType accept;
5057
5058        /**
5059         * The mime-type to use for RESTful operation in the 'Content-Type' header.
5060         */
5061        @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5062        @Description(shortDefinition="Mime type of the request payload contents, with charset etc.", formalDefinition="The mime-type to use for RESTful operation in the 'Content-Type' header." )
5063        protected CodeType contentType;
5064
5065        /**
5066         * The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5067         */
5068        @Child(name = "destination", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=false)
5069        @Description(shortDefinition="Server responding to the request", formalDefinition="The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section." )
5070        protected IntegerType destination;
5071
5072        /**
5073         * Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.
5074         */
5075        @Child(name = "encodeRequestUrl", type = {BooleanType.class}, order=8, min=1, max=1, modifier=false, summary=false)
5076        @Description(shortDefinition="Whether or not to send the request url in encoded format", formalDefinition="Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths." )
5077        protected BooleanType encodeRequestUrl;
5078
5079        /**
5080         * The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5081         */
5082        @Child(name = "origin", type = {IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false)
5083        @Description(shortDefinition="Server initiating the request", formalDefinition="The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section." )
5084        protected IntegerType origin;
5085
5086        /**
5087         * Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5088         */
5089        @Child(name = "params", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
5090        @Description(shortDefinition="Explicitly defined path parameters", formalDefinition="Path plus parameters after [type].  Used to set parts of the request URL explicitly." )
5091        protected StringType params;
5092
5093        /**
5094         * Header elements would be used to set HTTP headers.
5095         */
5096        @Child(name = "requestHeader", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5097        @Description(shortDefinition="Each operation can have one or more header elements", formalDefinition="Header elements would be used to set HTTP headers." )
5098        protected List<SetupActionOperationRequestHeaderComponent> requestHeader;
5099
5100        /**
5101         * The fixture id (maybe new) to map to the request.
5102         */
5103        @Child(name = "requestId", type = {IdType.class}, order=12, min=0, max=1, modifier=false, summary=false)
5104        @Description(shortDefinition="Fixture Id of mapped request", formalDefinition="The fixture id (maybe new) to map to the request." )
5105        protected IdType requestId;
5106
5107        /**
5108         * The fixture id (maybe new) to map to the response.
5109         */
5110        @Child(name = "responseId", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=false)
5111        @Description(shortDefinition="Fixture Id of mapped response", formalDefinition="The fixture id (maybe new) to map to the response." )
5112        protected IdType responseId;
5113
5114        /**
5115         * The id of the fixture used as the body of a PUT or POST request.
5116         */
5117        @Child(name = "sourceId", type = {IdType.class}, order=14, min=0, max=1, modifier=false, summary=false)
5118        @Description(shortDefinition="Fixture Id of body for PUT and POST requests", formalDefinition="The id of the fixture used as the body of a PUT or POST request." )
5119        protected IdType sourceId;
5120
5121        /**
5122         * Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5123         */
5124        @Child(name = "targetId", type = {IdType.class}, order=15, min=0, max=1, modifier=false, summary=false)
5125        @Description(shortDefinition="Id of fixture used for extracting the [id],  [type], and [vid] for GET requests", formalDefinition="Id of fixture used for extracting the [id],  [type], and [vid] for GET requests." )
5126        protected IdType targetId;
5127
5128        /**
5129         * Complete request URL.
5130         */
5131        @Child(name = "url", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false)
5132        @Description(shortDefinition="Request URL", formalDefinition="Complete request URL." )
5133        protected StringType url;
5134
5135        private static final long serialVersionUID = 1998717374L;
5136
5137    /**
5138     * Constructor
5139     */
5140      public SetupActionOperationComponent() {
5141        super();
5142      }
5143
5144    /**
5145     * Constructor
5146     */
5147      public SetupActionOperationComponent(BooleanType encodeRequestUrl) {
5148        super();
5149        this.encodeRequestUrl = encodeRequestUrl;
5150      }
5151
5152        /**
5153         * @return {@link #type} (Server interaction or operation type.)
5154         */
5155        public Coding getType() { 
5156          if (this.type == null)
5157            if (Configuration.errorOnAutoCreate())
5158              throw new Error("Attempt to auto-create SetupActionOperationComponent.type");
5159            else if (Configuration.doAutoCreate())
5160              this.type = new Coding(); // cc
5161          return this.type;
5162        }
5163
5164        public boolean hasType() { 
5165          return this.type != null && !this.type.isEmpty();
5166        }
5167
5168        /**
5169         * @param value {@link #type} (Server interaction or operation type.)
5170         */
5171        public SetupActionOperationComponent setType(Coding value) { 
5172          this.type = value;
5173          return this;
5174        }
5175
5176        /**
5177         * @return {@link #resource} (The type of the resource.  See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
5178         */
5179        public CodeType getResourceElement() { 
5180          if (this.resource == null)
5181            if (Configuration.errorOnAutoCreate())
5182              throw new Error("Attempt to auto-create SetupActionOperationComponent.resource");
5183            else if (Configuration.doAutoCreate())
5184              this.resource = new CodeType(); // bb
5185          return this.resource;
5186        }
5187
5188        public boolean hasResourceElement() { 
5189          return this.resource != null && !this.resource.isEmpty();
5190        }
5191
5192        public boolean hasResource() { 
5193          return this.resource != null && !this.resource.isEmpty();
5194        }
5195
5196        /**
5197         * @param value {@link #resource} (The type of the resource.  See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
5198         */
5199        public SetupActionOperationComponent setResourceElement(CodeType value) { 
5200          this.resource = value;
5201          return this;
5202        }
5203
5204        /**
5205         * @return The type of the resource.  See http://build.fhir.org/resourcelist.html.
5206         */
5207        public String getResource() { 
5208          return this.resource == null ? null : this.resource.getValue();
5209        }
5210
5211        /**
5212         * @param value The type of the resource.  See http://build.fhir.org/resourcelist.html.
5213         */
5214        public SetupActionOperationComponent setResource(String value) { 
5215          if (Utilities.noString(value))
5216            this.resource = null;
5217          else {
5218            if (this.resource == null)
5219              this.resource = new CodeType();
5220            this.resource.setValue(value);
5221          }
5222          return this;
5223        }
5224
5225        /**
5226         * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
5227         */
5228        public StringType getLabelElement() { 
5229          if (this.label == null)
5230            if (Configuration.errorOnAutoCreate())
5231              throw new Error("Attempt to auto-create SetupActionOperationComponent.label");
5232            else if (Configuration.doAutoCreate())
5233              this.label = new StringType(); // bb
5234          return this.label;
5235        }
5236
5237        public boolean hasLabelElement() { 
5238          return this.label != null && !this.label.isEmpty();
5239        }
5240
5241        public boolean hasLabel() { 
5242          return this.label != null && !this.label.isEmpty();
5243        }
5244
5245        /**
5246         * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
5247         */
5248        public SetupActionOperationComponent setLabelElement(StringType value) { 
5249          this.label = value;
5250          return this;
5251        }
5252
5253        /**
5254         * @return The label would be used for tracking/logging purposes by test engines.
5255         */
5256        public String getLabel() { 
5257          return this.label == null ? null : this.label.getValue();
5258        }
5259
5260        /**
5261         * @param value The label would be used for tracking/logging purposes by test engines.
5262         */
5263        public SetupActionOperationComponent setLabel(String value) { 
5264          if (Utilities.noString(value))
5265            this.label = null;
5266          else {
5267            if (this.label == null)
5268              this.label = new StringType();
5269            this.label.setValue(value);
5270          }
5271          return this;
5272        }
5273
5274        /**
5275         * @return {@link #description} (The description would be 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
5276         */
5277        public StringType getDescriptionElement() { 
5278          if (this.description == null)
5279            if (Configuration.errorOnAutoCreate())
5280              throw new Error("Attempt to auto-create SetupActionOperationComponent.description");
5281            else if (Configuration.doAutoCreate())
5282              this.description = new StringType(); // bb
5283          return this.description;
5284        }
5285
5286        public boolean hasDescriptionElement() { 
5287          return this.description != null && !this.description.isEmpty();
5288        }
5289
5290        public boolean hasDescription() { 
5291          return this.description != null && !this.description.isEmpty();
5292        }
5293
5294        /**
5295         * @param value {@link #description} (The description would be 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
5296         */
5297        public SetupActionOperationComponent setDescriptionElement(StringType value) { 
5298          this.description = value;
5299          return this;
5300        }
5301
5302        /**
5303         * @return The description would be used by test engines for tracking and reporting purposes.
5304         */
5305        public String getDescription() { 
5306          return this.description == null ? null : this.description.getValue();
5307        }
5308
5309        /**
5310         * @param value The description would be used by test engines for tracking and reporting purposes.
5311         */
5312        public SetupActionOperationComponent setDescription(String value) { 
5313          if (Utilities.noString(value))
5314            this.description = null;
5315          else {
5316            if (this.description == null)
5317              this.description = new StringType();
5318            this.description.setValue(value);
5319          }
5320          return this;
5321        }
5322
5323        /**
5324         * @return {@link #accept} (The mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value
5325         */
5326        public CodeType getAcceptElement() { 
5327          if (this.accept == null)
5328            if (Configuration.errorOnAutoCreate())
5329              throw new Error("Attempt to auto-create SetupActionOperationComponent.accept");
5330            else if (Configuration.doAutoCreate())
5331              this.accept = new CodeType(); // bb
5332          return this.accept;
5333        }
5334
5335        public boolean hasAcceptElement() { 
5336          return this.accept != null && !this.accept.isEmpty();
5337        }
5338
5339        public boolean hasAccept() { 
5340          return this.accept != null && !this.accept.isEmpty();
5341        }
5342
5343        /**
5344         * @param value {@link #accept} (The mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value
5345         */
5346        public SetupActionOperationComponent setAcceptElement(CodeType value) { 
5347          this.accept = value;
5348          return this;
5349        }
5350
5351        /**
5352         * @return The mime-type to use for RESTful operation in the 'Accept' header.
5353         */
5354        public String getAccept() { 
5355          return this.accept == null ? null : this.accept.getValue();
5356        }
5357
5358        /**
5359         * @param value The mime-type to use for RESTful operation in the 'Accept' header.
5360         */
5361        public SetupActionOperationComponent setAccept(String value) { 
5362          if (Utilities.noString(value))
5363            this.accept = null;
5364          else {
5365            if (this.accept == null)
5366              this.accept = new CodeType();
5367            this.accept.setValue(value);
5368          }
5369          return this;
5370        }
5371
5372        /**
5373         * @return {@link #contentType} (The mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
5374         */
5375        public CodeType getContentTypeElement() { 
5376          if (this.contentType == null)
5377            if (Configuration.errorOnAutoCreate())
5378              throw new Error("Attempt to auto-create SetupActionOperationComponent.contentType");
5379            else if (Configuration.doAutoCreate())
5380              this.contentType = new CodeType(); // bb
5381          return this.contentType;
5382        }
5383
5384        public boolean hasContentTypeElement() { 
5385          return this.contentType != null && !this.contentType.isEmpty();
5386        }
5387
5388        public boolean hasContentType() { 
5389          return this.contentType != null && !this.contentType.isEmpty();
5390        }
5391
5392        /**
5393         * @param value {@link #contentType} (The mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
5394         */
5395        public SetupActionOperationComponent setContentTypeElement(CodeType value) { 
5396          this.contentType = value;
5397          return this;
5398        }
5399
5400        /**
5401         * @return The mime-type to use for RESTful operation in the 'Content-Type' header.
5402         */
5403        public String getContentType() { 
5404          return this.contentType == null ? null : this.contentType.getValue();
5405        }
5406
5407        /**
5408         * @param value The mime-type to use for RESTful operation in the 'Content-Type' header.
5409         */
5410        public SetupActionOperationComponent setContentType(String value) { 
5411          if (Utilities.noString(value))
5412            this.contentType = null;
5413          else {
5414            if (this.contentType == null)
5415              this.contentType = new CodeType();
5416            this.contentType.setValue(value);
5417          }
5418          return this;
5419        }
5420
5421        /**
5422         * @return {@link #destination} (The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
5423         */
5424        public IntegerType getDestinationElement() { 
5425          if (this.destination == null)
5426            if (Configuration.errorOnAutoCreate())
5427              throw new Error("Attempt to auto-create SetupActionOperationComponent.destination");
5428            else if (Configuration.doAutoCreate())
5429              this.destination = new IntegerType(); // bb
5430          return this.destination;
5431        }
5432
5433        public boolean hasDestinationElement() { 
5434          return this.destination != null && !this.destination.isEmpty();
5435        }
5436
5437        public boolean hasDestination() { 
5438          return this.destination != null && !this.destination.isEmpty();
5439        }
5440
5441        /**
5442         * @param value {@link #destination} (The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
5443         */
5444        public SetupActionOperationComponent setDestinationElement(IntegerType value) { 
5445          this.destination = value;
5446          return this;
5447        }
5448
5449        /**
5450         * @return The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5451         */
5452        public int getDestination() { 
5453          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
5454        }
5455
5456        /**
5457         * @param value The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5458         */
5459        public SetupActionOperationComponent setDestination(int value) { 
5460            if (this.destination == null)
5461              this.destination = new IntegerType();
5462            this.destination.setValue(value);
5463          return this;
5464        }
5465
5466        /**
5467         * @return {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value
5468         */
5469        public BooleanType getEncodeRequestUrlElement() { 
5470          if (this.encodeRequestUrl == null)
5471            if (Configuration.errorOnAutoCreate())
5472              throw new Error("Attempt to auto-create SetupActionOperationComponent.encodeRequestUrl");
5473            else if (Configuration.doAutoCreate())
5474              this.encodeRequestUrl = new BooleanType(); // bb
5475          return this.encodeRequestUrl;
5476        }
5477
5478        public boolean hasEncodeRequestUrlElement() { 
5479          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
5480        }
5481
5482        public boolean hasEncodeRequestUrl() { 
5483          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
5484        }
5485
5486        /**
5487         * @param value {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value
5488         */
5489        public SetupActionOperationComponent setEncodeRequestUrlElement(BooleanType value) { 
5490          this.encodeRequestUrl = value;
5491          return this;
5492        }
5493
5494        /**
5495         * @return Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.
5496         */
5497        public boolean getEncodeRequestUrl() { 
5498          return this.encodeRequestUrl == null || this.encodeRequestUrl.isEmpty() ? false : this.encodeRequestUrl.getValue();
5499        }
5500
5501        /**
5502         * @param value Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.
5503         */
5504        public SetupActionOperationComponent setEncodeRequestUrl(boolean value) { 
5505            if (this.encodeRequestUrl == null)
5506              this.encodeRequestUrl = new BooleanType();
5507            this.encodeRequestUrl.setValue(value);
5508          return this;
5509        }
5510
5511        /**
5512         * @return {@link #origin} (The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value
5513         */
5514        public IntegerType getOriginElement() { 
5515          if (this.origin == null)
5516            if (Configuration.errorOnAutoCreate())
5517              throw new Error("Attempt to auto-create SetupActionOperationComponent.origin");
5518            else if (Configuration.doAutoCreate())
5519              this.origin = new IntegerType(); // bb
5520          return this.origin;
5521        }
5522
5523        public boolean hasOriginElement() { 
5524          return this.origin != null && !this.origin.isEmpty();
5525        }
5526
5527        public boolean hasOrigin() { 
5528          return this.origin != null && !this.origin.isEmpty();
5529        }
5530
5531        /**
5532         * @param value {@link #origin} (The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value
5533         */
5534        public SetupActionOperationComponent setOriginElement(IntegerType value) { 
5535          this.origin = value;
5536          return this;
5537        }
5538
5539        /**
5540         * @return The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5541         */
5542        public int getOrigin() { 
5543          return this.origin == null || this.origin.isEmpty() ? 0 : this.origin.getValue();
5544        }
5545
5546        /**
5547         * @param value The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5548         */
5549        public SetupActionOperationComponent setOrigin(int value) { 
5550            if (this.origin == null)
5551              this.origin = new IntegerType();
5552            this.origin.setValue(value);
5553          return this;
5554        }
5555
5556        /**
5557         * @return {@link #params} (Path plus parameters after [type].  Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value
5558         */
5559        public StringType getParamsElement() { 
5560          if (this.params == null)
5561            if (Configuration.errorOnAutoCreate())
5562              throw new Error("Attempt to auto-create SetupActionOperationComponent.params");
5563            else if (Configuration.doAutoCreate())
5564              this.params = new StringType(); // bb
5565          return this.params;
5566        }
5567
5568        public boolean hasParamsElement() { 
5569          return this.params != null && !this.params.isEmpty();
5570        }
5571
5572        public boolean hasParams() { 
5573          return this.params != null && !this.params.isEmpty();
5574        }
5575
5576        /**
5577         * @param value {@link #params} (Path plus parameters after [type].  Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value
5578         */
5579        public SetupActionOperationComponent setParamsElement(StringType value) { 
5580          this.params = value;
5581          return this;
5582        }
5583
5584        /**
5585         * @return Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5586         */
5587        public String getParams() { 
5588          return this.params == null ? null : this.params.getValue();
5589        }
5590
5591        /**
5592         * @param value Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5593         */
5594        public SetupActionOperationComponent setParams(String value) { 
5595          if (Utilities.noString(value))
5596            this.params = null;
5597          else {
5598            if (this.params == null)
5599              this.params = new StringType();
5600            this.params.setValue(value);
5601          }
5602          return this;
5603        }
5604
5605        /**
5606         * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.)
5607         */
5608        public List<SetupActionOperationRequestHeaderComponent> getRequestHeader() { 
5609          if (this.requestHeader == null)
5610            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5611          return this.requestHeader;
5612        }
5613
5614        /**
5615         * @return Returns a reference to <code>this</code> for easy method chaining
5616         */
5617        public SetupActionOperationComponent setRequestHeader(List<SetupActionOperationRequestHeaderComponent> theRequestHeader) { 
5618          this.requestHeader = theRequestHeader;
5619          return this;
5620        }
5621
5622        public boolean hasRequestHeader() { 
5623          if (this.requestHeader == null)
5624            return false;
5625          for (SetupActionOperationRequestHeaderComponent item : this.requestHeader)
5626            if (!item.isEmpty())
5627              return true;
5628          return false;
5629        }
5630
5631        public SetupActionOperationRequestHeaderComponent addRequestHeader() { //3
5632          SetupActionOperationRequestHeaderComponent t = new SetupActionOperationRequestHeaderComponent();
5633          if (this.requestHeader == null)
5634            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5635          this.requestHeader.add(t);
5636          return t;
5637        }
5638
5639        public SetupActionOperationComponent addRequestHeader(SetupActionOperationRequestHeaderComponent t) { //3
5640          if (t == null)
5641            return this;
5642          if (this.requestHeader == null)
5643            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5644          this.requestHeader.add(t);
5645          return this;
5646        }
5647
5648        /**
5649         * @return The first repetition of repeating field {@link #requestHeader}, creating it if it does not already exist
5650         */
5651        public SetupActionOperationRequestHeaderComponent getRequestHeaderFirstRep() { 
5652          if (getRequestHeader().isEmpty()) {
5653            addRequestHeader();
5654          }
5655          return getRequestHeader().get(0);
5656        }
5657
5658        /**
5659         * @return {@link #requestId} (The fixture id (maybe new) to map to the request.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value
5660         */
5661        public IdType getRequestIdElement() { 
5662          if (this.requestId == null)
5663            if (Configuration.errorOnAutoCreate())
5664              throw new Error("Attempt to auto-create SetupActionOperationComponent.requestId");
5665            else if (Configuration.doAutoCreate())
5666              this.requestId = new IdType(); // bb
5667          return this.requestId;
5668        }
5669
5670        public boolean hasRequestIdElement() { 
5671          return this.requestId != null && !this.requestId.isEmpty();
5672        }
5673
5674        public boolean hasRequestId() { 
5675          return this.requestId != null && !this.requestId.isEmpty();
5676        }
5677
5678        /**
5679         * @param value {@link #requestId} (The fixture id (maybe new) to map to the request.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value
5680         */
5681        public SetupActionOperationComponent setRequestIdElement(IdType value) { 
5682          this.requestId = value;
5683          return this;
5684        }
5685
5686        /**
5687         * @return The fixture id (maybe new) to map to the request.
5688         */
5689        public String getRequestId() { 
5690          return this.requestId == null ? null : this.requestId.getValue();
5691        }
5692
5693        /**
5694         * @param value The fixture id (maybe new) to map to the request.
5695         */
5696        public SetupActionOperationComponent setRequestId(String value) { 
5697          if (Utilities.noString(value))
5698            this.requestId = null;
5699          else {
5700            if (this.requestId == null)
5701              this.requestId = new IdType();
5702            this.requestId.setValue(value);
5703          }
5704          return this;
5705        }
5706
5707        /**
5708         * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value
5709         */
5710        public IdType getResponseIdElement() { 
5711          if (this.responseId == null)
5712            if (Configuration.errorOnAutoCreate())
5713              throw new Error("Attempt to auto-create SetupActionOperationComponent.responseId");
5714            else if (Configuration.doAutoCreate())
5715              this.responseId = new IdType(); // bb
5716          return this.responseId;
5717        }
5718
5719        public boolean hasResponseIdElement() { 
5720          return this.responseId != null && !this.responseId.isEmpty();
5721        }
5722
5723        public boolean hasResponseId() { 
5724          return this.responseId != null && !this.responseId.isEmpty();
5725        }
5726
5727        /**
5728         * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value
5729         */
5730        public SetupActionOperationComponent setResponseIdElement(IdType value) { 
5731          this.responseId = value;
5732          return this;
5733        }
5734
5735        /**
5736         * @return The fixture id (maybe new) to map to the response.
5737         */
5738        public String getResponseId() { 
5739          return this.responseId == null ? null : this.responseId.getValue();
5740        }
5741
5742        /**
5743         * @param value The fixture id (maybe new) to map to the response.
5744         */
5745        public SetupActionOperationComponent setResponseId(String value) { 
5746          if (Utilities.noString(value))
5747            this.responseId = null;
5748          else {
5749            if (this.responseId == null)
5750              this.responseId = new IdType();
5751            this.responseId.setValue(value);
5752          }
5753          return this;
5754        }
5755
5756        /**
5757         * @return {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
5758         */
5759        public IdType getSourceIdElement() { 
5760          if (this.sourceId == null)
5761            if (Configuration.errorOnAutoCreate())
5762              throw new Error("Attempt to auto-create SetupActionOperationComponent.sourceId");
5763            else if (Configuration.doAutoCreate())
5764              this.sourceId = new IdType(); // bb
5765          return this.sourceId;
5766        }
5767
5768        public boolean hasSourceIdElement() { 
5769          return this.sourceId != null && !this.sourceId.isEmpty();
5770        }
5771
5772        public boolean hasSourceId() { 
5773          return this.sourceId != null && !this.sourceId.isEmpty();
5774        }
5775
5776        /**
5777         * @param value {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
5778         */
5779        public SetupActionOperationComponent setSourceIdElement(IdType value) { 
5780          this.sourceId = value;
5781          return this;
5782        }
5783
5784        /**
5785         * @return The id of the fixture used as the body of a PUT or POST request.
5786         */
5787        public String getSourceId() { 
5788          return this.sourceId == null ? null : this.sourceId.getValue();
5789        }
5790
5791        /**
5792         * @param value The id of the fixture used as the body of a PUT or POST request.
5793         */
5794        public SetupActionOperationComponent setSourceId(String value) { 
5795          if (Utilities.noString(value))
5796            this.sourceId = null;
5797          else {
5798            if (this.sourceId == null)
5799              this.sourceId = new IdType();
5800            this.sourceId.setValue(value);
5801          }
5802          return this;
5803        }
5804
5805        /**
5806         * @return {@link #targetId} (Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value
5807         */
5808        public IdType getTargetIdElement() { 
5809          if (this.targetId == null)
5810            if (Configuration.errorOnAutoCreate())
5811              throw new Error("Attempt to auto-create SetupActionOperationComponent.targetId");
5812            else if (Configuration.doAutoCreate())
5813              this.targetId = new IdType(); // bb
5814          return this.targetId;
5815        }
5816
5817        public boolean hasTargetIdElement() { 
5818          return this.targetId != null && !this.targetId.isEmpty();
5819        }
5820
5821        public boolean hasTargetId() { 
5822          return this.targetId != null && !this.targetId.isEmpty();
5823        }
5824
5825        /**
5826         * @param value {@link #targetId} (Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value
5827         */
5828        public SetupActionOperationComponent setTargetIdElement(IdType value) { 
5829          this.targetId = value;
5830          return this;
5831        }
5832
5833        /**
5834         * @return Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5835         */
5836        public String getTargetId() { 
5837          return this.targetId == null ? null : this.targetId.getValue();
5838        }
5839
5840        /**
5841         * @param value Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5842         */
5843        public SetupActionOperationComponent setTargetId(String value) { 
5844          if (Utilities.noString(value))
5845            this.targetId = null;
5846          else {
5847            if (this.targetId == null)
5848              this.targetId = new IdType();
5849            this.targetId.setValue(value);
5850          }
5851          return this;
5852        }
5853
5854        /**
5855         * @return {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5856         */
5857        public StringType getUrlElement() { 
5858          if (this.url == null)
5859            if (Configuration.errorOnAutoCreate())
5860              throw new Error("Attempt to auto-create SetupActionOperationComponent.url");
5861            else if (Configuration.doAutoCreate())
5862              this.url = new StringType(); // bb
5863          return this.url;
5864        }
5865
5866        public boolean hasUrlElement() { 
5867          return this.url != null && !this.url.isEmpty();
5868        }
5869
5870        public boolean hasUrl() { 
5871          return this.url != null && !this.url.isEmpty();
5872        }
5873
5874        /**
5875         * @param value {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5876         */
5877        public SetupActionOperationComponent setUrlElement(StringType value) { 
5878          this.url = value;
5879          return this;
5880        }
5881
5882        /**
5883         * @return Complete request URL.
5884         */
5885        public String getUrl() { 
5886          return this.url == null ? null : this.url.getValue();
5887        }
5888
5889        /**
5890         * @param value Complete request URL.
5891         */
5892        public SetupActionOperationComponent setUrl(String value) { 
5893          if (Utilities.noString(value))
5894            this.url = null;
5895          else {
5896            if (this.url == null)
5897              this.url = new StringType();
5898            this.url.setValue(value);
5899          }
5900          return this;
5901        }
5902
5903        protected void listChildren(List<Property> children) {
5904          super.listChildren(children);
5905          children.add(new Property("type", "Coding", "Server interaction or operation type.", 0, 1, type));
5906          children.add(new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource));
5907          children.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label));
5908          children.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description));
5909          children.add(new Property("accept", "code", "The mime-type to use for RESTful operation in the 'Accept' header.", 0, 1, accept));
5910          children.add(new Property("contentType", "code", "The mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType));
5911          children.add(new Property("destination", "integer", "The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.", 0, 1, destination));
5912          children.add(new Property("encodeRequestUrl", "boolean", "Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.", 0, 1, encodeRequestUrl));
5913          children.add(new Property("origin", "integer", "The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.", 0, 1, origin));
5914          children.add(new Property("params", "string", "Path plus parameters after [type].  Used to set parts of the request URL explicitly.", 0, 1, params));
5915          children.add(new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader));
5916          children.add(new Property("requestId", "id", "The fixture id (maybe new) to map to the request.", 0, 1, requestId));
5917          children.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, 1, responseId));
5918          children.add(new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, 1, sourceId));
5919          children.add(new Property("targetId", "id", "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.", 0, 1, targetId));
5920          children.add(new Property("url", "string", "Complete request URL.", 0, 1, url));
5921        }
5922
5923        @Override
5924        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5925          switch (_hash) {
5926          case 3575610: /*type*/  return new Property("type", "Coding", "Server interaction or operation type.", 0, 1, type);
5927          case -341064690: /*resource*/  return new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource);
5928          case 102727412: /*label*/  return new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label);
5929          case -1724546052: /*description*/  return new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description);
5930          case -1423461112: /*accept*/  return new Property("accept", "code", "The mime-type to use for RESTful operation in the 'Accept' header.", 0, 1, accept);
5931          case -389131437: /*contentType*/  return new Property("contentType", "code", "The mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType);
5932          case -1429847026: /*destination*/  return new Property("destination", "integer", "The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.", 0, 1, destination);
5933          case -1760554218: /*encodeRequestUrl*/  return new Property("encodeRequestUrl", "boolean", "Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.", 0, 1, encodeRequestUrl);
5934          case -1008619738: /*origin*/  return new Property("origin", "integer", "The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.", 0, 1, origin);
5935          case -995427962: /*params*/  return new Property("params", "string", "Path plus parameters after [type].  Used to set parts of the request URL explicitly.", 0, 1, params);
5936          case 1074158076: /*requestHeader*/  return new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader);
5937          case 693933066: /*requestId*/  return new Property("requestId", "id", "The fixture id (maybe new) to map to the request.", 0, 1, requestId);
5938          case -633138884: /*responseId*/  return new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, 1, responseId);
5939          case 1746327190: /*sourceId*/  return new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, 1, sourceId);
5940          case -441951604: /*targetId*/  return new Property("targetId", "id", "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.", 0, 1, targetId);
5941          case 116079: /*url*/  return new Property("url", "string", "Complete request URL.", 0, 1, url);
5942          default: return super.getNamedProperty(_hash, _name, _checkValid);
5943          }
5944
5945        }
5946
5947      @Override
5948      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5949        switch (hash) {
5950        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
5951        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType
5952        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
5953        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
5954        case -1423461112: /*accept*/ return this.accept == null ? new Base[0] : new Base[] {this.accept}; // CodeType
5955        case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType
5956        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType
5957        case -1760554218: /*encodeRequestUrl*/ return this.encodeRequestUrl == null ? new Base[0] : new Base[] {this.encodeRequestUrl}; // BooleanType
5958        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // IntegerType
5959        case -995427962: /*params*/ return this.params == null ? new Base[0] : new Base[] {this.params}; // StringType
5960        case 1074158076: /*requestHeader*/ return this.requestHeader == null ? new Base[0] : this.requestHeader.toArray(new Base[this.requestHeader.size()]); // SetupActionOperationRequestHeaderComponent
5961        case 693933066: /*requestId*/ return this.requestId == null ? new Base[0] : new Base[] {this.requestId}; // IdType
5962        case -633138884: /*responseId*/ return this.responseId == null ? new Base[0] : new Base[] {this.responseId}; // IdType
5963        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
5964        case -441951604: /*targetId*/ return this.targetId == null ? new Base[0] : new Base[] {this.targetId}; // IdType
5965        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // StringType
5966        default: return super.getProperty(hash, name, checkValid);
5967        }
5968
5969      }
5970
5971      @Override
5972      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5973        switch (hash) {
5974        case 3575610: // type
5975          this.type = castToCoding(value); // Coding
5976          return value;
5977        case -341064690: // resource
5978          this.resource = castToCode(value); // CodeType
5979          return value;
5980        case 102727412: // label
5981          this.label = castToString(value); // StringType
5982          return value;
5983        case -1724546052: // description
5984          this.description = castToString(value); // StringType
5985          return value;
5986        case -1423461112: // accept
5987          this.accept = castToCode(value); // CodeType
5988          return value;
5989        case -389131437: // contentType
5990          this.contentType = castToCode(value); // CodeType
5991          return value;
5992        case -1429847026: // destination
5993          this.destination = castToInteger(value); // IntegerType
5994          return value;
5995        case -1760554218: // encodeRequestUrl
5996          this.encodeRequestUrl = castToBoolean(value); // BooleanType
5997          return value;
5998        case -1008619738: // origin
5999          this.origin = castToInteger(value); // IntegerType
6000          return value;
6001        case -995427962: // params
6002          this.params = castToString(value); // StringType
6003          return value;
6004        case 1074158076: // requestHeader
6005          this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); // SetupActionOperationRequestHeaderComponent
6006          return value;
6007        case 693933066: // requestId
6008          this.requestId = castToId(value); // IdType
6009          return value;
6010        case -633138884: // responseId
6011          this.responseId = castToId(value); // IdType
6012          return value;
6013        case 1746327190: // sourceId
6014          this.sourceId = castToId(value); // IdType
6015          return value;
6016        case -441951604: // targetId
6017          this.targetId = castToId(value); // IdType
6018          return value;
6019        case 116079: // url
6020          this.url = castToString(value); // StringType
6021          return value;
6022        default: return super.setProperty(hash, name, value);
6023        }
6024
6025      }
6026
6027      @Override
6028      public Base setProperty(String name, Base value) throws FHIRException {
6029        if (name.equals("type")) {
6030          this.type = castToCoding(value); // Coding
6031        } else if (name.equals("resource")) {
6032          this.resource = castToCode(value); // CodeType
6033        } else if (name.equals("label")) {
6034          this.label = castToString(value); // StringType
6035        } else if (name.equals("description")) {
6036          this.description = castToString(value); // StringType
6037        } else if (name.equals("accept")) {
6038          this.accept = castToCode(value); // CodeType
6039        } else if (name.equals("contentType")) {
6040          this.contentType = castToCode(value); // CodeType
6041        } else if (name.equals("destination")) {
6042          this.destination = castToInteger(value); // IntegerType
6043        } else if (name.equals("encodeRequestUrl")) {
6044          this.encodeRequestUrl = castToBoolean(value); // BooleanType
6045        } else if (name.equals("origin")) {
6046          this.origin = castToInteger(value); // IntegerType
6047        } else if (name.equals("params")) {
6048          this.params = castToString(value); // StringType
6049        } else if (name.equals("requestHeader")) {
6050          this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value);
6051        } else if (name.equals("requestId")) {
6052          this.requestId = castToId(value); // IdType
6053        } else if (name.equals("responseId")) {
6054          this.responseId = castToId(value); // IdType
6055        } else if (name.equals("sourceId")) {
6056          this.sourceId = castToId(value); // IdType
6057        } else if (name.equals("targetId")) {
6058          this.targetId = castToId(value); // IdType
6059        } else if (name.equals("url")) {
6060          this.url = castToString(value); // StringType
6061        } else
6062          return super.setProperty(name, value);
6063        return value;
6064      }
6065
6066      @Override
6067      public Base makeProperty(int hash, String name) throws FHIRException {
6068        switch (hash) {
6069        case 3575610:  return getType(); 
6070        case -341064690:  return getResourceElement();
6071        case 102727412:  return getLabelElement();
6072        case -1724546052:  return getDescriptionElement();
6073        case -1423461112:  return getAcceptElement();
6074        case -389131437:  return getContentTypeElement();
6075        case -1429847026:  return getDestinationElement();
6076        case -1760554218:  return getEncodeRequestUrlElement();
6077        case -1008619738:  return getOriginElement();
6078        case -995427962:  return getParamsElement();
6079        case 1074158076:  return addRequestHeader(); 
6080        case 693933066:  return getRequestIdElement();
6081        case -633138884:  return getResponseIdElement();
6082        case 1746327190:  return getSourceIdElement();
6083        case -441951604:  return getTargetIdElement();
6084        case 116079:  return getUrlElement();
6085        default: return super.makeProperty(hash, name);
6086        }
6087
6088      }
6089
6090      @Override
6091      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6092        switch (hash) {
6093        case 3575610: /*type*/ return new String[] {"Coding"};
6094        case -341064690: /*resource*/ return new String[] {"code"};
6095        case 102727412: /*label*/ return new String[] {"string"};
6096        case -1724546052: /*description*/ return new String[] {"string"};
6097        case -1423461112: /*accept*/ return new String[] {"code"};
6098        case -389131437: /*contentType*/ return new String[] {"code"};
6099        case -1429847026: /*destination*/ return new String[] {"integer"};
6100        case -1760554218: /*encodeRequestUrl*/ return new String[] {"boolean"};
6101        case -1008619738: /*origin*/ return new String[] {"integer"};
6102        case -995427962: /*params*/ return new String[] {"string"};
6103        case 1074158076: /*requestHeader*/ return new String[] {};
6104        case 693933066: /*requestId*/ return new String[] {"id"};
6105        case -633138884: /*responseId*/ return new String[] {"id"};
6106        case 1746327190: /*sourceId*/ return new String[] {"id"};
6107        case -441951604: /*targetId*/ return new String[] {"id"};
6108        case 116079: /*url*/ return new String[] {"string"};
6109        default: return super.getTypesForProperty(hash, name);
6110        }
6111
6112      }
6113
6114      @Override
6115      public Base addChild(String name) throws FHIRException {
6116        if (name.equals("type")) {
6117          this.type = new Coding();
6118          return this.type;
6119        }
6120        else if (name.equals("resource")) {
6121          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
6122        }
6123        else if (name.equals("label")) {
6124          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
6125        }
6126        else if (name.equals("description")) {
6127          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
6128        }
6129        else if (name.equals("accept")) {
6130          throw new FHIRException("Cannot call addChild on a primitive type TestScript.accept");
6131        }
6132        else if (name.equals("contentType")) {
6133          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
6134        }
6135        else if (name.equals("destination")) {
6136          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
6137        }
6138        else if (name.equals("encodeRequestUrl")) {
6139          throw new FHIRException("Cannot call addChild on a primitive type TestScript.encodeRequestUrl");
6140        }
6141        else if (name.equals("origin")) {
6142          throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin");
6143        }
6144        else if (name.equals("params")) {
6145          throw new FHIRException("Cannot call addChild on a primitive type TestScript.params");
6146        }
6147        else if (name.equals("requestHeader")) {
6148          return addRequestHeader();
6149        }
6150        else if (name.equals("requestId")) {
6151          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestId");
6152        }
6153        else if (name.equals("responseId")) {
6154          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseId");
6155        }
6156        else if (name.equals("sourceId")) {
6157          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
6158        }
6159        else if (name.equals("targetId")) {
6160          throw new FHIRException("Cannot call addChild on a primitive type TestScript.targetId");
6161        }
6162        else if (name.equals("url")) {
6163          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
6164        }
6165        else
6166          return super.addChild(name);
6167      }
6168
6169      public SetupActionOperationComponent copy() {
6170        SetupActionOperationComponent dst = new SetupActionOperationComponent();
6171        copyValues(dst);
6172        dst.type = type == null ? null : type.copy();
6173        dst.resource = resource == null ? null : resource.copy();
6174        dst.label = label == null ? null : label.copy();
6175        dst.description = description == null ? null : description.copy();
6176        dst.accept = accept == null ? null : accept.copy();
6177        dst.contentType = contentType == null ? null : contentType.copy();
6178        dst.destination = destination == null ? null : destination.copy();
6179        dst.encodeRequestUrl = encodeRequestUrl == null ? null : encodeRequestUrl.copy();
6180        dst.origin = origin == null ? null : origin.copy();
6181        dst.params = params == null ? null : params.copy();
6182        if (requestHeader != null) {
6183          dst.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
6184          for (SetupActionOperationRequestHeaderComponent i : requestHeader)
6185            dst.requestHeader.add(i.copy());
6186        };
6187        dst.requestId = requestId == null ? null : requestId.copy();
6188        dst.responseId = responseId == null ? null : responseId.copy();
6189        dst.sourceId = sourceId == null ? null : sourceId.copy();
6190        dst.targetId = targetId == null ? null : targetId.copy();
6191        dst.url = url == null ? null : url.copy();
6192        return dst;
6193      }
6194
6195      @Override
6196      public boolean equalsDeep(Base other_) {
6197        if (!super.equalsDeep(other_))
6198          return false;
6199        if (!(other_ instanceof SetupActionOperationComponent))
6200          return false;
6201        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
6202        return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true) && compareDeep(label, o.label, true)
6203           && compareDeep(description, o.description, true) && compareDeep(accept, o.accept, true) && compareDeep(contentType, o.contentType, true)
6204           && compareDeep(destination, o.destination, true) && compareDeep(encodeRequestUrl, o.encodeRequestUrl, true)
6205           && compareDeep(origin, o.origin, true) && compareDeep(params, o.params, true) && compareDeep(requestHeader, o.requestHeader, true)
6206           && compareDeep(requestId, o.requestId, true) && compareDeep(responseId, o.responseId, true) && compareDeep(sourceId, o.sourceId, true)
6207           && compareDeep(targetId, o.targetId, true) && compareDeep(url, o.url, true);
6208      }
6209
6210      @Override
6211      public boolean equalsShallow(Base other_) {
6212        if (!super.equalsShallow(other_))
6213          return false;
6214        if (!(other_ instanceof SetupActionOperationComponent))
6215          return false;
6216        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
6217        return compareValues(resource, o.resource, true) && compareValues(label, o.label, true) && compareValues(description, o.description, true)
6218           && compareValues(accept, o.accept, true) && compareValues(contentType, o.contentType, true) && compareValues(destination, o.destination, true)
6219           && compareValues(encodeRequestUrl, o.encodeRequestUrl, true) && compareValues(origin, o.origin, true)
6220           && compareValues(params, o.params, true) && compareValues(requestId, o.requestId, true) && compareValues(responseId, o.responseId, true)
6221           && compareValues(sourceId, o.sourceId, true) && compareValues(targetId, o.targetId, true) && compareValues(url, o.url, true)
6222          ;
6223      }
6224
6225      public boolean isEmpty() {
6226        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, resource, label, description
6227          , accept, contentType, destination, encodeRequestUrl, origin, params, requestHeader
6228          , requestId, responseId, sourceId, targetId, url);
6229      }
6230
6231  public String fhirType() {
6232    return "TestScript.setup.action.operation";
6233
6234  }
6235
6236  }
6237
6238    @Block()
6239    public static class SetupActionOperationRequestHeaderComponent extends BackboneElement implements IBaseBackboneElement {
6240        /**
6241         * The HTTP header field e.g. "Accept".
6242         */
6243        @Child(name = "field", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
6244        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field e.g. \"Accept\"." )
6245        protected StringType field;
6246
6247        /**
6248         * The value of the header e.g. "application/fhir+xml".
6249         */
6250        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
6251        @Description(shortDefinition="HTTP headerfield value", formalDefinition="The value of the header e.g. \"application/fhir+xml\"." )
6252        protected StringType value;
6253
6254        private static final long serialVersionUID = 274395337L;
6255
6256    /**
6257     * Constructor
6258     */
6259      public SetupActionOperationRequestHeaderComponent() {
6260        super();
6261      }
6262
6263    /**
6264     * Constructor
6265     */
6266      public SetupActionOperationRequestHeaderComponent(StringType field, StringType value) {
6267        super();
6268        this.field = field;
6269        this.value = value;
6270      }
6271
6272        /**
6273         * @return {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value
6274         */
6275        public StringType getFieldElement() { 
6276          if (this.field == null)
6277            if (Configuration.errorOnAutoCreate())
6278              throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.field");
6279            else if (Configuration.doAutoCreate())
6280              this.field = new StringType(); // bb
6281          return this.field;
6282        }
6283
6284        public boolean hasFieldElement() { 
6285          return this.field != null && !this.field.isEmpty();
6286        }
6287
6288        public boolean hasField() { 
6289          return this.field != null && !this.field.isEmpty();
6290        }
6291
6292        /**
6293         * @param value {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value
6294         */
6295        public SetupActionOperationRequestHeaderComponent setFieldElement(StringType value) { 
6296          this.field = value;
6297          return this;
6298        }
6299
6300        /**
6301         * @return The HTTP header field e.g. "Accept".
6302         */
6303        public String getField() { 
6304          return this.field == null ? null : this.field.getValue();
6305        }
6306
6307        /**
6308         * @param value The HTTP header field e.g. "Accept".
6309         */
6310        public SetupActionOperationRequestHeaderComponent setField(String value) { 
6311            if (this.field == null)
6312              this.field = new StringType();
6313            this.field.setValue(value);
6314          return this;
6315        }
6316
6317        /**
6318         * @return {@link #value} (The value of the header e.g. "application/fhir+xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
6319         */
6320        public StringType getValueElement() { 
6321          if (this.value == null)
6322            if (Configuration.errorOnAutoCreate())
6323              throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.value");
6324            else if (Configuration.doAutoCreate())
6325              this.value = new StringType(); // bb
6326          return this.value;
6327        }
6328
6329        public boolean hasValueElement() { 
6330          return this.value != null && !this.value.isEmpty();
6331        }
6332
6333        public boolean hasValue() { 
6334          return this.value != null && !this.value.isEmpty();
6335        }
6336
6337        /**
6338         * @param value {@link #value} (The value of the header e.g. "application/fhir+xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
6339         */
6340        public SetupActionOperationRequestHeaderComponent setValueElement(StringType value) { 
6341          this.value = value;
6342          return this;
6343        }
6344
6345        /**
6346         * @return The value of the header e.g. "application/fhir+xml".
6347         */
6348        public String getValue() { 
6349          return this.value == null ? null : this.value.getValue();
6350        }
6351
6352        /**
6353         * @param value The value of the header e.g. "application/fhir+xml".
6354         */
6355        public SetupActionOperationRequestHeaderComponent setValue(String value) { 
6356            if (this.value == null)
6357              this.value = new StringType();
6358            this.value.setValue(value);
6359          return this;
6360        }
6361
6362        protected void listChildren(List<Property> children) {
6363          super.listChildren(children);
6364          children.add(new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, 1, field));
6365          children.add(new Property("value", "string", "The value of the header e.g. \"application/fhir+xml\".", 0, 1, value));
6366        }
6367
6368        @Override
6369        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6370          switch (_hash) {
6371          case 97427706: /*field*/  return new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, 1, field);
6372          case 111972721: /*value*/  return new Property("value", "string", "The value of the header e.g. \"application/fhir+xml\".", 0, 1, value);
6373          default: return super.getNamedProperty(_hash, _name, _checkValid);
6374          }
6375
6376        }
6377
6378      @Override
6379      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6380        switch (hash) {
6381        case 97427706: /*field*/ return this.field == null ? new Base[0] : new Base[] {this.field}; // StringType
6382        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
6383        default: return super.getProperty(hash, name, checkValid);
6384        }
6385
6386      }
6387
6388      @Override
6389      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6390        switch (hash) {
6391        case 97427706: // field
6392          this.field = castToString(value); // StringType
6393          return value;
6394        case 111972721: // value
6395          this.value = castToString(value); // StringType
6396          return value;
6397        default: return super.setProperty(hash, name, value);
6398        }
6399
6400      }
6401
6402      @Override
6403      public Base setProperty(String name, Base value) throws FHIRException {
6404        if (name.equals("field")) {
6405          this.field = castToString(value); // StringType
6406        } else if (name.equals("value")) {
6407          this.value = castToString(value); // StringType
6408        } else
6409          return super.setProperty(name, value);
6410        return value;
6411      }
6412
6413      @Override
6414      public Base makeProperty(int hash, String name) throws FHIRException {
6415        switch (hash) {
6416        case 97427706:  return getFieldElement();
6417        case 111972721:  return getValueElement();
6418        default: return super.makeProperty(hash, name);
6419        }
6420
6421      }
6422
6423      @Override
6424      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6425        switch (hash) {
6426        case 97427706: /*field*/ return new String[] {"string"};
6427        case 111972721: /*value*/ return new String[] {"string"};
6428        default: return super.getTypesForProperty(hash, name);
6429        }
6430
6431      }
6432
6433      @Override
6434      public Base addChild(String name) throws FHIRException {
6435        if (name.equals("field")) {
6436          throw new FHIRException("Cannot call addChild on a primitive type TestScript.field");
6437        }
6438        else if (name.equals("value")) {
6439          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
6440        }
6441        else
6442          return super.addChild(name);
6443      }
6444
6445      public SetupActionOperationRequestHeaderComponent copy() {
6446        SetupActionOperationRequestHeaderComponent dst = new SetupActionOperationRequestHeaderComponent();
6447        copyValues(dst);
6448        dst.field = field == null ? null : field.copy();
6449        dst.value = value == null ? null : value.copy();
6450        return dst;
6451      }
6452
6453      @Override
6454      public boolean equalsDeep(Base other_) {
6455        if (!super.equalsDeep(other_))
6456          return false;
6457        if (!(other_ instanceof SetupActionOperationRequestHeaderComponent))
6458          return false;
6459        SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other_;
6460        return compareDeep(field, o.field, true) && compareDeep(value, o.value, true);
6461      }
6462
6463      @Override
6464      public boolean equalsShallow(Base other_) {
6465        if (!super.equalsShallow(other_))
6466          return false;
6467        if (!(other_ instanceof SetupActionOperationRequestHeaderComponent))
6468          return false;
6469        SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other_;
6470        return compareValues(field, o.field, true) && compareValues(value, o.value, true);
6471      }
6472
6473      public boolean isEmpty() {
6474        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(field, value);
6475      }
6476
6477  public String fhirType() {
6478    return "TestScript.setup.action.operation.requestHeader";
6479
6480  }
6481
6482  }
6483
6484    @Block()
6485    public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement {
6486        /**
6487         * The label would be used for tracking/logging purposes by test engines.
6488         */
6489        @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6490        @Description(shortDefinition="Tracking/logging assertion label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
6491        protected StringType label;
6492
6493        /**
6494         * The description would be used by test engines for tracking and reporting purposes.
6495         */
6496        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6497        @Description(shortDefinition="Tracking/reporting assertion description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
6498        protected StringType description;
6499
6500        /**
6501         * The direction to use for the assertion.
6502         */
6503        @Child(name = "direction", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6504        @Description(shortDefinition="response | request", formalDefinition="The direction to use for the assertion." )
6505        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-direction-codes")
6506        protected Enumeration<AssertionDirectionType> direction;
6507
6508        /**
6509         * Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6510         */
6511        @Child(name = "compareToSourceId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6512        @Description(shortDefinition="Id of the source fixture to be evaluated", formalDefinition="Id of the source fixture used as the contents to be evaluated by either the \"source/expression\" or \"sourceId/path\" definition." )
6513        protected StringType compareToSourceId;
6514
6515        /**
6516         * The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6517         */
6518        @Child(name = "compareToSourceExpression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
6519        @Description(shortDefinition="The FHIRPath expression to evaluate against the source fixture", formalDefinition="The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both." )
6520        protected StringType compareToSourceExpression;
6521
6522        /**
6523         * XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6524         */
6525        @Child(name = "compareToSourcePath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
6526        @Description(shortDefinition="XPath or JSONPath expression to evaluate against the source fixture", formalDefinition="XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both." )
6527        protected StringType compareToSourcePath;
6528
6529        /**
6530         * The mime-type contents to compare against the request or response message 'Content-Type' header.
6531         */
6532        @Child(name = "contentType", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
6533        @Description(shortDefinition="Mime type to compare against the 'Content-Type' header", formalDefinition="The mime-type contents to compare against the request or response message 'Content-Type' header." )
6534        protected CodeType contentType;
6535
6536        /**
6537         * The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.
6538         */
6539        @Child(name = "expression", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
6540        @Description(shortDefinition="The FHIRPath expression to be evaluated", formalDefinition="The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload." )
6541        protected StringType expression;
6542
6543        /**
6544         * The HTTP header field name e.g. 'Location'.
6545         */
6546        @Child(name = "headerField", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
6547        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field name e.g. 'Location'." )
6548        protected StringType headerField;
6549
6550        /**
6551         * The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
6552         */
6553        @Child(name = "minimumId", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
6554        @Description(shortDefinition="Fixture Id of minimum content resource", formalDefinition="The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId." )
6555        protected StringType minimumId;
6556
6557        /**
6558         * Whether or not the test execution performs validation on the bundle navigation links.
6559         */
6560        @Child(name = "navigationLinks", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
6561        @Description(shortDefinition="Perform validation on navigation links?", formalDefinition="Whether or not the test execution performs validation on the bundle navigation links." )
6562        protected BooleanType navigationLinks;
6563
6564        /**
6565         * The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
6566         */
6567        @Child(name = "operator", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false)
6568        @Description(shortDefinition="equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains | eval", formalDefinition="The operator type defines the conditional behavior of the assert. If not defined, the default is equals." )
6569        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-operator-codes")
6570        protected Enumeration<AssertionOperatorType> operator;
6571
6572        /**
6573         * The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
6574         */
6575        @Child(name = "path", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
6576        @Description(shortDefinition="XPath or JSONPath expression", formalDefinition="The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server." )
6577        protected StringType path;
6578
6579        /**
6580         * The request method or HTTP operation code to compare against that used by the client system under test.
6581         */
6582        @Child(name = "requestMethod", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=false)
6583        @Description(shortDefinition="delete | get | options | patch | post | put", formalDefinition="The request method or HTTP operation code to compare against that used by the client system under test." )
6584        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/http-operations")
6585        protected Enumeration<TestScriptRequestMethodCode> requestMethod;
6586
6587        /**
6588         * The value to use in a comparison against the request URL path string.
6589         */
6590        @Child(name = "requestURL", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false)
6591        @Description(shortDefinition="Request URL comparison value", formalDefinition="The value to use in a comparison against the request URL path string." )
6592        protected StringType requestURL;
6593
6594        /**
6595         * The type of the resource.  See http://build.fhir.org/resourcelist.html.
6596         */
6597        @Child(name = "resource", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false)
6598        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://build.fhir.org/resourcelist.html." )
6599        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
6600        protected CodeType resource;
6601
6602        /**
6603         * okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
6604         */
6605        @Child(name = "response", type = {CodeType.class}, order=17, min=0, max=1, modifier=false, summary=false)
6606        @Description(shortDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable", formalDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable." )
6607        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-response-code-types")
6608        protected Enumeration<AssertionResponseTypes> response;
6609
6610        /**
6611         * The value of the HTTP response code to be tested.
6612         */
6613        @Child(name = "responseCode", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false)
6614        @Description(shortDefinition="HTTP response code to test", formalDefinition="The value of the HTTP response code to be tested." )
6615        protected StringType responseCode;
6616
6617        /**
6618         * The TestScript.rule this assert will evaluate.
6619         */
6620        @Child(name = "rule", type = {}, order=19, min=0, max=1, modifier=false, summary=false)
6621        @Description(shortDefinition="The reference to a TestScript.rule", formalDefinition="The TestScript.rule this assert will evaluate." )
6622        protected ActionAssertRuleComponent rule;
6623
6624        /**
6625         * The TestScript.ruleset this assert will evaluate.
6626         */
6627        @Child(name = "ruleset", type = {}, order=20, min=0, max=1, modifier=false, summary=false)
6628        @Description(shortDefinition="The reference to a TestScript.ruleset", formalDefinition="The TestScript.ruleset this assert will evaluate." )
6629        protected ActionAssertRulesetComponent ruleset;
6630
6631        /**
6632         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
6633         */
6634        @Child(name = "sourceId", type = {IdType.class}, order=21, min=0, max=1, modifier=false, summary=false)
6635        @Description(shortDefinition="Fixture Id of source expression or headerField", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField  against." )
6636        protected IdType sourceId;
6637
6638        /**
6639         * The ID of the Profile to validate against.
6640         */
6641        @Child(name = "validateProfileId", type = {IdType.class}, order=22, min=0, max=1, modifier=false, summary=false)
6642        @Description(shortDefinition="Profile Id of validation profile reference", formalDefinition="The ID of the Profile to validate against." )
6643        protected IdType validateProfileId;
6644
6645        /**
6646         * The value to compare to.
6647         */
6648        @Child(name = "value", type = {StringType.class}, order=23, min=0, max=1, modifier=false, summary=false)
6649        @Description(shortDefinition="The value to compare to", formalDefinition="The value to compare to." )
6650        protected StringType value;
6651
6652        /**
6653         * Whether or not the test execution will produce a warning only on error for this assert.
6654         */
6655        @Child(name = "warningOnly", type = {BooleanType.class}, order=24, min=1, max=1, modifier=false, summary=false)
6656        @Description(shortDefinition="Will this assert produce a warning only on error?", formalDefinition="Whether or not the test execution will produce a warning only on error for this assert." )
6657        protected BooleanType warningOnly;
6658
6659        private static final long serialVersionUID = -483432060L;
6660
6661    /**
6662     * Constructor
6663     */
6664      public SetupActionAssertComponent() {
6665        super();
6666      }
6667
6668    /**
6669     * Constructor
6670     */
6671      public SetupActionAssertComponent(BooleanType warningOnly) {
6672        super();
6673        this.warningOnly = warningOnly;
6674      }
6675
6676        /**
6677         * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
6678         */
6679        public StringType getLabelElement() { 
6680          if (this.label == null)
6681            if (Configuration.errorOnAutoCreate())
6682              throw new Error("Attempt to auto-create SetupActionAssertComponent.label");
6683            else if (Configuration.doAutoCreate())
6684              this.label = new StringType(); // bb
6685          return this.label;
6686        }
6687
6688        public boolean hasLabelElement() { 
6689          return this.label != null && !this.label.isEmpty();
6690        }
6691
6692        public boolean hasLabel() { 
6693          return this.label != null && !this.label.isEmpty();
6694        }
6695
6696        /**
6697         * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value
6698         */
6699        public SetupActionAssertComponent setLabelElement(StringType value) { 
6700          this.label = value;
6701          return this;
6702        }
6703
6704        /**
6705         * @return The label would be used for tracking/logging purposes by test engines.
6706         */
6707        public String getLabel() { 
6708          return this.label == null ? null : this.label.getValue();
6709        }
6710
6711        /**
6712         * @param value The label would be used for tracking/logging purposes by test engines.
6713         */
6714        public SetupActionAssertComponent setLabel(String value) { 
6715          if (Utilities.noString(value))
6716            this.label = null;
6717          else {
6718            if (this.label == null)
6719              this.label = new StringType();
6720            this.label.setValue(value);
6721          }
6722          return this;
6723        }
6724
6725        /**
6726         * @return {@link #description} (The description would be 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
6727         */
6728        public StringType getDescriptionElement() { 
6729          if (this.description == null)
6730            if (Configuration.errorOnAutoCreate())
6731              throw new Error("Attempt to auto-create SetupActionAssertComponent.description");
6732            else if (Configuration.doAutoCreate())
6733              this.description = new StringType(); // bb
6734          return this.description;
6735        }
6736
6737        public boolean hasDescriptionElement() { 
6738          return this.description != null && !this.description.isEmpty();
6739        }
6740
6741        public boolean hasDescription() { 
6742          return this.description != null && !this.description.isEmpty();
6743        }
6744
6745        /**
6746         * @param value {@link #description} (The description would be 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
6747         */
6748        public SetupActionAssertComponent setDescriptionElement(StringType value) { 
6749          this.description = value;
6750          return this;
6751        }
6752
6753        /**
6754         * @return The description would be used by test engines for tracking and reporting purposes.
6755         */
6756        public String getDescription() { 
6757          return this.description == null ? null : this.description.getValue();
6758        }
6759
6760        /**
6761         * @param value The description would be used by test engines for tracking and reporting purposes.
6762         */
6763        public SetupActionAssertComponent setDescription(String value) { 
6764          if (Utilities.noString(value))
6765            this.description = null;
6766          else {
6767            if (this.description == null)
6768              this.description = new StringType();
6769            this.description.setValue(value);
6770          }
6771          return this;
6772        }
6773
6774        /**
6775         * @return {@link #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value
6776         */
6777        public Enumeration<AssertionDirectionType> getDirectionElement() { 
6778          if (this.direction == null)
6779            if (Configuration.errorOnAutoCreate())
6780              throw new Error("Attempt to auto-create SetupActionAssertComponent.direction");
6781            else if (Configuration.doAutoCreate())
6782              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory()); // bb
6783          return this.direction;
6784        }
6785
6786        public boolean hasDirectionElement() { 
6787          return this.direction != null && !this.direction.isEmpty();
6788        }
6789
6790        public boolean hasDirection() { 
6791          return this.direction != null && !this.direction.isEmpty();
6792        }
6793
6794        /**
6795         * @param value {@link #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value
6796         */
6797        public SetupActionAssertComponent setDirectionElement(Enumeration<AssertionDirectionType> value) { 
6798          this.direction = value;
6799          return this;
6800        }
6801
6802        /**
6803         * @return The direction to use for the assertion.
6804         */
6805        public AssertionDirectionType getDirection() { 
6806          return this.direction == null ? null : this.direction.getValue();
6807        }
6808
6809        /**
6810         * @param value The direction to use for the assertion.
6811         */
6812        public SetupActionAssertComponent setDirection(AssertionDirectionType value) { 
6813          if (value == null)
6814            this.direction = null;
6815          else {
6816            if (this.direction == null)
6817              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory());
6818            this.direction.setValue(value);
6819          }
6820          return this;
6821        }
6822
6823        /**
6824         * @return {@link #compareToSourceId} (Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value
6825         */
6826        public StringType getCompareToSourceIdElement() { 
6827          if (this.compareToSourceId == null)
6828            if (Configuration.errorOnAutoCreate())
6829              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceId");
6830            else if (Configuration.doAutoCreate())
6831              this.compareToSourceId = new StringType(); // bb
6832          return this.compareToSourceId;
6833        }
6834
6835        public boolean hasCompareToSourceIdElement() { 
6836          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
6837        }
6838
6839        public boolean hasCompareToSourceId() { 
6840          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
6841        }
6842
6843        /**
6844         * @param value {@link #compareToSourceId} (Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value
6845         */
6846        public SetupActionAssertComponent setCompareToSourceIdElement(StringType value) { 
6847          this.compareToSourceId = value;
6848          return this;
6849        }
6850
6851        /**
6852         * @return Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6853         */
6854        public String getCompareToSourceId() { 
6855          return this.compareToSourceId == null ? null : this.compareToSourceId.getValue();
6856        }
6857
6858        /**
6859         * @param value Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6860         */
6861        public SetupActionAssertComponent setCompareToSourceId(String value) { 
6862          if (Utilities.noString(value))
6863            this.compareToSourceId = null;
6864          else {
6865            if (this.compareToSourceId == null)
6866              this.compareToSourceId = new StringType();
6867            this.compareToSourceId.setValue(value);
6868          }
6869          return this;
6870        }
6871
6872        /**
6873         * @return {@link #compareToSourceExpression} (The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceExpression" gives direct access to the value
6874         */
6875        public StringType getCompareToSourceExpressionElement() { 
6876          if (this.compareToSourceExpression == null)
6877            if (Configuration.errorOnAutoCreate())
6878              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceExpression");
6879            else if (Configuration.doAutoCreate())
6880              this.compareToSourceExpression = new StringType(); // bb
6881          return this.compareToSourceExpression;
6882        }
6883
6884        public boolean hasCompareToSourceExpressionElement() { 
6885          return this.compareToSourceExpression != null && !this.compareToSourceExpression.isEmpty();
6886        }
6887
6888        public boolean hasCompareToSourceExpression() { 
6889          return this.compareToSourceExpression != null && !this.compareToSourceExpression.isEmpty();
6890        }
6891
6892        /**
6893         * @param value {@link #compareToSourceExpression} (The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceExpression" gives direct access to the value
6894         */
6895        public SetupActionAssertComponent setCompareToSourceExpressionElement(StringType value) { 
6896          this.compareToSourceExpression = value;
6897          return this;
6898        }
6899
6900        /**
6901         * @return The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6902         */
6903        public String getCompareToSourceExpression() { 
6904          return this.compareToSourceExpression == null ? null : this.compareToSourceExpression.getValue();
6905        }
6906
6907        /**
6908         * @param value The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6909         */
6910        public SetupActionAssertComponent setCompareToSourceExpression(String value) { 
6911          if (Utilities.noString(value))
6912            this.compareToSourceExpression = null;
6913          else {
6914            if (this.compareToSourceExpression == null)
6915              this.compareToSourceExpression = new StringType();
6916            this.compareToSourceExpression.setValue(value);
6917          }
6918          return this;
6919        }
6920
6921        /**
6922         * @return {@link #compareToSourcePath} (XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value
6923         */
6924        public StringType getCompareToSourcePathElement() { 
6925          if (this.compareToSourcePath == null)
6926            if (Configuration.errorOnAutoCreate())
6927              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourcePath");
6928            else if (Configuration.doAutoCreate())
6929              this.compareToSourcePath = new StringType(); // bb
6930          return this.compareToSourcePath;
6931        }
6932
6933        public boolean hasCompareToSourcePathElement() { 
6934          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
6935        }
6936
6937        public boolean hasCompareToSourcePath() { 
6938          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
6939        }
6940
6941        /**
6942         * @param value {@link #compareToSourcePath} (XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value
6943         */
6944        public SetupActionAssertComponent setCompareToSourcePathElement(StringType value) { 
6945          this.compareToSourcePath = value;
6946          return this;
6947        }
6948
6949        /**
6950         * @return XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6951         */
6952        public String getCompareToSourcePath() { 
6953          return this.compareToSourcePath == null ? null : this.compareToSourcePath.getValue();
6954        }
6955
6956        /**
6957         * @param value XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6958         */
6959        public SetupActionAssertComponent setCompareToSourcePath(String value) { 
6960          if (Utilities.noString(value))
6961            this.compareToSourcePath = null;
6962          else {
6963            if (this.compareToSourcePath == null)
6964              this.compareToSourcePath = new StringType();
6965            this.compareToSourcePath.setValue(value);
6966          }
6967          return this;
6968        }
6969
6970        /**
6971         * @return {@link #contentType} (The mime-type contents to compare against the request or response message 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
6972         */
6973        public CodeType getContentTypeElement() { 
6974          if (this.contentType == null)
6975            if (Configuration.errorOnAutoCreate())
6976              throw new Error("Attempt to auto-create SetupActionAssertComponent.contentType");
6977            else if (Configuration.doAutoCreate())
6978              this.contentType = new CodeType(); // bb
6979          return this.contentType;
6980        }
6981
6982        public boolean hasContentTypeElement() { 
6983          return this.contentType != null && !this.contentType.isEmpty();
6984        }
6985
6986        public boolean hasContentType() { 
6987          return this.contentType != null && !this.contentType.isEmpty();
6988        }
6989
6990        /**
6991         * @param value {@link #contentType} (The mime-type contents to compare against the request or response message 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value
6992         */
6993        public SetupActionAssertComponent setContentTypeElement(CodeType value) { 
6994          this.contentType = value;
6995          return this;
6996        }
6997
6998        /**
6999         * @return The mime-type contents to compare against the request or response message 'Content-Type' header.
7000         */
7001        public String getContentType() { 
7002          return this.contentType == null ? null : this.contentType.getValue();
7003        }
7004
7005        /**
7006         * @param value The mime-type contents to compare against the request or response message 'Content-Type' header.
7007         */
7008        public SetupActionAssertComponent setContentType(String value) { 
7009          if (Utilities.noString(value))
7010            this.contentType = null;
7011          else {
7012            if (this.contentType == null)
7013              this.contentType = new CodeType();
7014            this.contentType.setValue(value);
7015          }
7016          return this;
7017        }
7018
7019        /**
7020         * @return {@link #expression} (The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
7021         */
7022        public StringType getExpressionElement() { 
7023          if (this.expression == null)
7024            if (Configuration.errorOnAutoCreate())
7025              throw new Error("Attempt to auto-create SetupActionAssertComponent.expression");
7026            else if (Configuration.doAutoCreate())
7027              this.expression = new StringType(); // bb
7028          return this.expression;
7029        }
7030
7031        public boolean hasExpressionElement() { 
7032          return this.expression != null && !this.expression.isEmpty();
7033        }
7034
7035        public boolean hasExpression() { 
7036          return this.expression != null && !this.expression.isEmpty();
7037        }
7038
7039        /**
7040         * @param value {@link #expression} (The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value
7041         */
7042        public SetupActionAssertComponent setExpressionElement(StringType value) { 
7043          this.expression = value;
7044          return this;
7045        }
7046
7047        /**
7048         * @return The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.
7049         */
7050        public String getExpression() { 
7051          return this.expression == null ? null : this.expression.getValue();
7052        }
7053
7054        /**
7055         * @param value The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.
7056         */
7057        public SetupActionAssertComponent setExpression(String value) { 
7058          if (Utilities.noString(value))
7059            this.expression = null;
7060          else {
7061            if (this.expression == null)
7062              this.expression = new StringType();
7063            this.expression.setValue(value);
7064          }
7065          return this;
7066        }
7067
7068        /**
7069         * @return {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value
7070         */
7071        public StringType getHeaderFieldElement() { 
7072          if (this.headerField == null)
7073            if (Configuration.errorOnAutoCreate())
7074              throw new Error("Attempt to auto-create SetupActionAssertComponent.headerField");
7075            else if (Configuration.doAutoCreate())
7076              this.headerField = new StringType(); // bb
7077          return this.headerField;
7078        }
7079
7080        public boolean hasHeaderFieldElement() { 
7081          return this.headerField != null && !this.headerField.isEmpty();
7082        }
7083
7084        public boolean hasHeaderField() { 
7085          return this.headerField != null && !this.headerField.isEmpty();
7086        }
7087
7088        /**
7089         * @param value {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value
7090         */
7091        public SetupActionAssertComponent setHeaderFieldElement(StringType value) { 
7092          this.headerField = value;
7093          return this;
7094        }
7095
7096        /**
7097         * @return The HTTP header field name e.g. 'Location'.
7098         */
7099        public String getHeaderField() { 
7100          return this.headerField == null ? null : this.headerField.getValue();
7101        }
7102
7103        /**
7104         * @param value The HTTP header field name e.g. 'Location'.
7105         */
7106        public SetupActionAssertComponent setHeaderField(String value) { 
7107          if (Utilities.noString(value))
7108            this.headerField = null;
7109          else {
7110            if (this.headerField == null)
7111              this.headerField = new StringType();
7112            this.headerField.setValue(value);
7113          }
7114          return this;
7115        }
7116
7117        /**
7118         * @return {@link #minimumId} (The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value
7119         */
7120        public StringType getMinimumIdElement() { 
7121          if (this.minimumId == null)
7122            if (Configuration.errorOnAutoCreate())
7123              throw new Error("Attempt to auto-create SetupActionAssertComponent.minimumId");
7124            else if (Configuration.doAutoCreate())
7125              this.minimumId = new StringType(); // bb
7126          return this.minimumId;
7127        }
7128
7129        public boolean hasMinimumIdElement() { 
7130          return this.minimumId != null && !this.minimumId.isEmpty();
7131        }
7132
7133        public boolean hasMinimumId() { 
7134          return this.minimumId != null && !this.minimumId.isEmpty();
7135        }
7136
7137        /**
7138         * @param value {@link #minimumId} (The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value
7139         */
7140        public SetupActionAssertComponent setMinimumIdElement(StringType value) { 
7141          this.minimumId = value;
7142          return this;
7143        }
7144
7145        /**
7146         * @return The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
7147         */
7148        public String getMinimumId() { 
7149          return this.minimumId == null ? null : this.minimumId.getValue();
7150        }
7151
7152        /**
7153         * @param value The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
7154         */
7155        public SetupActionAssertComponent setMinimumId(String value) { 
7156          if (Utilities.noString(value))
7157            this.minimumId = null;
7158          else {
7159            if (this.minimumId == null)
7160              this.minimumId = new StringType();
7161            this.minimumId.setValue(value);
7162          }
7163          return this;
7164        }
7165
7166        /**
7167         * @return {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value
7168         */
7169        public BooleanType getNavigationLinksElement() { 
7170          if (this.navigationLinks == null)
7171            if (Configuration.errorOnAutoCreate())
7172              throw new Error("Attempt to auto-create SetupActionAssertComponent.navigationLinks");
7173            else if (Configuration.doAutoCreate())
7174              this.navigationLinks = new BooleanType(); // bb
7175          return this.navigationLinks;
7176        }
7177
7178        public boolean hasNavigationLinksElement() { 
7179          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
7180        }
7181
7182        public boolean hasNavigationLinks() { 
7183          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
7184        }
7185
7186        /**
7187         * @param value {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value
7188         */
7189        public SetupActionAssertComponent setNavigationLinksElement(BooleanType value) { 
7190          this.navigationLinks = value;
7191          return this;
7192        }
7193
7194        /**
7195         * @return Whether or not the test execution performs validation on the bundle navigation links.
7196         */
7197        public boolean getNavigationLinks() { 
7198          return this.navigationLinks == null || this.navigationLinks.isEmpty() ? false : this.navigationLinks.getValue();
7199        }
7200
7201        /**
7202         * @param value Whether or not the test execution performs validation on the bundle navigation links.
7203         */
7204        public SetupActionAssertComponent setNavigationLinks(boolean value) { 
7205            if (this.navigationLinks == null)
7206              this.navigationLinks = new BooleanType();
7207            this.navigationLinks.setValue(value);
7208          return this;
7209        }
7210
7211        /**
7212         * @return {@link #operator} (The operator type defines the conditional behavior of the assert. If not defined, the default is equals.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value
7213         */
7214        public Enumeration<AssertionOperatorType> getOperatorElement() { 
7215          if (this.operator == null)
7216            if (Configuration.errorOnAutoCreate())
7217              throw new Error("Attempt to auto-create SetupActionAssertComponent.operator");
7218            else if (Configuration.doAutoCreate())
7219              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory()); // bb
7220          return this.operator;
7221        }
7222
7223        public boolean hasOperatorElement() { 
7224          return this.operator != null && !this.operator.isEmpty();
7225        }
7226
7227        public boolean hasOperator() { 
7228          return this.operator != null && !this.operator.isEmpty();
7229        }
7230
7231        /**
7232         * @param value {@link #operator} (The operator type defines the conditional behavior of the assert. If not defined, the default is equals.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value
7233         */
7234        public SetupActionAssertComponent setOperatorElement(Enumeration<AssertionOperatorType> value) { 
7235          this.operator = value;
7236          return this;
7237        }
7238
7239        /**
7240         * @return The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
7241         */
7242        public AssertionOperatorType getOperator() { 
7243          return this.operator == null ? null : this.operator.getValue();
7244        }
7245
7246        /**
7247         * @param value The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
7248         */
7249        public SetupActionAssertComponent setOperator(AssertionOperatorType value) { 
7250          if (value == null)
7251            this.operator = null;
7252          else {
7253            if (this.operator == null)
7254              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory());
7255            this.operator.setValue(value);
7256          }
7257          return this;
7258        }
7259
7260        /**
7261         * @return {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
7262         */
7263        public StringType getPathElement() { 
7264          if (this.path == null)
7265            if (Configuration.errorOnAutoCreate())
7266              throw new Error("Attempt to auto-create SetupActionAssertComponent.path");
7267            else if (Configuration.doAutoCreate())
7268              this.path = new StringType(); // bb
7269          return this.path;
7270        }
7271
7272        public boolean hasPathElement() { 
7273          return this.path != null && !this.path.isEmpty();
7274        }
7275
7276        public boolean hasPath() { 
7277          return this.path != null && !this.path.isEmpty();
7278        }
7279
7280        /**
7281         * @param value {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
7282         */
7283        public SetupActionAssertComponent setPathElement(StringType value) { 
7284          this.path = value;
7285          return this;
7286        }
7287
7288        /**
7289         * @return The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
7290         */
7291        public String getPath() { 
7292          return this.path == null ? null : this.path.getValue();
7293        }
7294
7295        /**
7296         * @param value The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
7297         */
7298        public SetupActionAssertComponent setPath(String value) { 
7299          if (Utilities.noString(value))
7300            this.path = null;
7301          else {
7302            if (this.path == null)
7303              this.path = new StringType();
7304            this.path.setValue(value);
7305          }
7306          return this;
7307        }
7308
7309        /**
7310         * @return {@link #requestMethod} (The request method or HTTP operation code to compare against that used by the client system under test.). This is the underlying object with id, value and extensions. The accessor "getRequestMethod" gives direct access to the value
7311         */
7312        public Enumeration<TestScriptRequestMethodCode> getRequestMethodElement() { 
7313          if (this.requestMethod == null)
7314            if (Configuration.errorOnAutoCreate())
7315              throw new Error("Attempt to auto-create SetupActionAssertComponent.requestMethod");
7316            else if (Configuration.doAutoCreate())
7317              this.requestMethod = new Enumeration<TestScriptRequestMethodCode>(new TestScriptRequestMethodCodeEnumFactory()); // bb
7318          return this.requestMethod;
7319        }
7320
7321        public boolean hasRequestMethodElement() { 
7322          return this.requestMethod != null && !this.requestMethod.isEmpty();
7323        }
7324
7325        public boolean hasRequestMethod() { 
7326          return this.requestMethod != null && !this.requestMethod.isEmpty();
7327        }
7328
7329        /**
7330         * @param value {@link #requestMethod} (The request method or HTTP operation code to compare against that used by the client system under test.). This is the underlying object with id, value and extensions. The accessor "getRequestMethod" gives direct access to the value
7331         */
7332        public SetupActionAssertComponent setRequestMethodElement(Enumeration<TestScriptRequestMethodCode> value) { 
7333          this.requestMethod = value;
7334          return this;
7335        }
7336
7337        /**
7338         * @return The request method or HTTP operation code to compare against that used by the client system under test.
7339         */
7340        public TestScriptRequestMethodCode getRequestMethod() { 
7341          return this.requestMethod == null ? null : this.requestMethod.getValue();
7342        }
7343
7344        /**
7345         * @param value The request method or HTTP operation code to compare against that used by the client system under test.
7346         */
7347        public SetupActionAssertComponent setRequestMethod(TestScriptRequestMethodCode value) { 
7348          if (value == null)
7349            this.requestMethod = null;
7350          else {
7351            if (this.requestMethod == null)
7352              this.requestMethod = new Enumeration<TestScriptRequestMethodCode>(new TestScriptRequestMethodCodeEnumFactory());
7353            this.requestMethod.setValue(value);
7354          }
7355          return this;
7356        }
7357
7358        /**
7359         * @return {@link #requestURL} (The value to use in a comparison against the request URL path string.). This is the underlying object with id, value and extensions. The accessor "getRequestURL" gives direct access to the value
7360         */
7361        public StringType getRequestURLElement() { 
7362          if (this.requestURL == null)
7363            if (Configuration.errorOnAutoCreate())
7364              throw new Error("Attempt to auto-create SetupActionAssertComponent.requestURL");
7365            else if (Configuration.doAutoCreate())
7366              this.requestURL = new StringType(); // bb
7367          return this.requestURL;
7368        }
7369
7370        public boolean hasRequestURLElement() { 
7371          return this.requestURL != null && !this.requestURL.isEmpty();
7372        }
7373
7374        public boolean hasRequestURL() { 
7375          return this.requestURL != null && !this.requestURL.isEmpty();
7376        }
7377
7378        /**
7379         * @param value {@link #requestURL} (The value to use in a comparison against the request URL path string.). This is the underlying object with id, value and extensions. The accessor "getRequestURL" gives direct access to the value
7380         */
7381        public SetupActionAssertComponent setRequestURLElement(StringType value) { 
7382          this.requestURL = value;
7383          return this;
7384        }
7385
7386        /**
7387         * @return The value to use in a comparison against the request URL path string.
7388         */
7389        public String getRequestURL() { 
7390          return this.requestURL == null ? null : this.requestURL.getValue();
7391        }
7392
7393        /**
7394         * @param value The value to use in a comparison against the request URL path string.
7395         */
7396        public SetupActionAssertComponent setRequestURL(String value) { 
7397          if (Utilities.noString(value))
7398            this.requestURL = null;
7399          else {
7400            if (this.requestURL == null)
7401              this.requestURL = new StringType();
7402            this.requestURL.setValue(value);
7403          }
7404          return this;
7405        }
7406
7407        /**
7408         * @return {@link #resource} (The type of the resource.  See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
7409         */
7410        public CodeType getResourceElement() { 
7411          if (this.resource == null)
7412            if (Configuration.errorOnAutoCreate())
7413              throw new Error("Attempt to auto-create SetupActionAssertComponent.resource");
7414            else if (Configuration.doAutoCreate())
7415              this.resource = new CodeType(); // bb
7416          return this.resource;
7417        }
7418
7419        public boolean hasResourceElement() { 
7420          return this.resource != null && !this.resource.isEmpty();
7421        }
7422
7423        public boolean hasResource() { 
7424          return this.resource != null && !this.resource.isEmpty();
7425        }
7426
7427        /**
7428         * @param value {@link #resource} (The type of the resource.  See http://build.fhir.org/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
7429         */
7430        public SetupActionAssertComponent setResourceElement(CodeType value) { 
7431          this.resource = value;
7432          return this;
7433        }
7434
7435        /**
7436         * @return The type of the resource.  See http://build.fhir.org/resourcelist.html.
7437         */
7438        public String getResource() { 
7439          return this.resource == null ? null : this.resource.getValue();
7440        }
7441
7442        /**
7443         * @param value The type of the resource.  See http://build.fhir.org/resourcelist.html.
7444         */
7445        public SetupActionAssertComponent setResource(String value) { 
7446          if (Utilities.noString(value))
7447            this.resource = null;
7448          else {
7449            if (this.resource == null)
7450              this.resource = new CodeType();
7451            this.resource.setValue(value);
7452          }
7453          return this;
7454        }
7455
7456        /**
7457         * @return {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value
7458         */
7459        public Enumeration<AssertionResponseTypes> getResponseElement() { 
7460          if (this.response == null)
7461            if (Configuration.errorOnAutoCreate())
7462              throw new Error("Attempt to auto-create SetupActionAssertComponent.response");
7463            else if (Configuration.doAutoCreate())
7464              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory()); // bb
7465          return this.response;
7466        }
7467
7468        public boolean hasResponseElement() { 
7469          return this.response != null && !this.response.isEmpty();
7470        }
7471
7472        public boolean hasResponse() { 
7473          return this.response != null && !this.response.isEmpty();
7474        }
7475
7476        /**
7477         * @param value {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value
7478         */
7479        public SetupActionAssertComponent setResponseElement(Enumeration<AssertionResponseTypes> value) { 
7480          this.response = value;
7481          return this;
7482        }
7483
7484        /**
7485         * @return okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
7486         */
7487        public AssertionResponseTypes getResponse() { 
7488          return this.response == null ? null : this.response.getValue();
7489        }
7490
7491        /**
7492         * @param value okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
7493         */
7494        public SetupActionAssertComponent setResponse(AssertionResponseTypes value) { 
7495          if (value == null)
7496            this.response = null;
7497          else {
7498            if (this.response == null)
7499              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory());
7500            this.response.setValue(value);
7501          }
7502          return this;
7503        }
7504
7505        /**
7506         * @return {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value
7507         */
7508        public StringType getResponseCodeElement() { 
7509          if (this.responseCode == null)
7510            if (Configuration.errorOnAutoCreate())
7511              throw new Error("Attempt to auto-create SetupActionAssertComponent.responseCode");
7512            else if (Configuration.doAutoCreate())
7513              this.responseCode = new StringType(); // bb
7514          return this.responseCode;
7515        }
7516
7517        public boolean hasResponseCodeElement() { 
7518          return this.responseCode != null && !this.responseCode.isEmpty();
7519        }
7520
7521        public boolean hasResponseCode() { 
7522          return this.responseCode != null && !this.responseCode.isEmpty();
7523        }
7524
7525        /**
7526         * @param value {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value
7527         */
7528        public SetupActionAssertComponent setResponseCodeElement(StringType value) { 
7529          this.responseCode = value;
7530          return this;
7531        }
7532
7533        /**
7534         * @return The value of the HTTP response code to be tested.
7535         */
7536        public String getResponseCode() { 
7537          return this.responseCode == null ? null : this.responseCode.getValue();
7538        }
7539
7540        /**
7541         * @param value The value of the HTTP response code to be tested.
7542         */
7543        public SetupActionAssertComponent setResponseCode(String value) { 
7544          if (Utilities.noString(value))
7545            this.responseCode = null;
7546          else {
7547            if (this.responseCode == null)
7548              this.responseCode = new StringType();
7549            this.responseCode.setValue(value);
7550          }
7551          return this;
7552        }
7553
7554        /**
7555         * @return {@link #rule} (The TestScript.rule this assert will evaluate.)
7556         */
7557        public ActionAssertRuleComponent getRule() { 
7558          if (this.rule == null)
7559            if (Configuration.errorOnAutoCreate())
7560              throw new Error("Attempt to auto-create SetupActionAssertComponent.rule");
7561            else if (Configuration.doAutoCreate())
7562              this.rule = new ActionAssertRuleComponent(); // cc
7563          return this.rule;
7564        }
7565
7566        public boolean hasRule() { 
7567          return this.rule != null && !this.rule.isEmpty();
7568        }
7569
7570        /**
7571         * @param value {@link #rule} (The TestScript.rule this assert will evaluate.)
7572         */
7573        public SetupActionAssertComponent setRule(ActionAssertRuleComponent value) { 
7574          this.rule = value;
7575          return this;
7576        }
7577
7578        /**
7579         * @return {@link #ruleset} (The TestScript.ruleset this assert will evaluate.)
7580         */
7581        public ActionAssertRulesetComponent getRuleset() { 
7582          if (this.ruleset == null)
7583            if (Configuration.errorOnAutoCreate())
7584              throw new Error("Attempt to auto-create SetupActionAssertComponent.ruleset");
7585            else if (Configuration.doAutoCreate())
7586              this.ruleset = new ActionAssertRulesetComponent(); // cc
7587          return this.ruleset;
7588        }
7589
7590        public boolean hasRuleset() { 
7591          return this.ruleset != null && !this.ruleset.isEmpty();
7592        }
7593
7594        /**
7595         * @param value {@link #ruleset} (The TestScript.ruleset this assert will evaluate.)
7596         */
7597        public SetupActionAssertComponent setRuleset(ActionAssertRulesetComponent value) { 
7598          this.ruleset = value;
7599          return this;
7600        }
7601
7602        /**
7603         * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField  against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
7604         */
7605        public IdType getSourceIdElement() { 
7606          if (this.sourceId == null)
7607            if (Configuration.errorOnAutoCreate())
7608              throw new Error("Attempt to auto-create SetupActionAssertComponent.sourceId");
7609            else if (Configuration.doAutoCreate())
7610              this.sourceId = new IdType(); // bb
7611          return this.sourceId;
7612        }
7613
7614        public boolean hasSourceIdElement() { 
7615          return this.sourceId != null && !this.sourceId.isEmpty();
7616        }
7617
7618        public boolean hasSourceId() { 
7619          return this.sourceId != null && !this.sourceId.isEmpty();
7620        }
7621
7622        /**
7623         * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField  against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value
7624         */
7625        public SetupActionAssertComponent setSourceIdElement(IdType value) { 
7626          this.sourceId = value;
7627          return this;
7628        }
7629
7630        /**
7631         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
7632         */
7633        public String getSourceId() { 
7634          return this.sourceId == null ? null : this.sourceId.getValue();
7635        }
7636
7637        /**
7638         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
7639         */
7640        public SetupActionAssertComponent setSourceId(String value) { 
7641          if (Utilities.noString(value))
7642            this.sourceId = null;
7643          else {
7644            if (this.sourceId == null)
7645              this.sourceId = new IdType();
7646            this.sourceId.setValue(value);
7647          }
7648          return this;
7649        }
7650
7651        /**
7652         * @return {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value
7653         */
7654        public IdType getValidateProfileIdElement() { 
7655          if (this.validateProfileId == null)
7656            if (Configuration.errorOnAutoCreate())
7657              throw new Error("Attempt to auto-create SetupActionAssertComponent.validateProfileId");
7658            else if (Configuration.doAutoCreate())
7659              this.validateProfileId = new IdType(); // bb
7660          return this.validateProfileId;
7661        }
7662
7663        public boolean hasValidateProfileIdElement() { 
7664          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
7665        }
7666
7667        public boolean hasValidateProfileId() { 
7668          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
7669        }
7670
7671        /**
7672         * @param value {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value
7673         */
7674        public SetupActionAssertComponent setValidateProfileIdElement(IdType value) { 
7675          this.validateProfileId = value;
7676          return this;
7677        }
7678
7679        /**
7680         * @return The ID of the Profile to validate against.
7681         */
7682        public String getValidateProfileId() { 
7683          return this.validateProfileId == null ? null : this.validateProfileId.getValue();
7684        }
7685
7686        /**
7687         * @param value The ID of the Profile to validate against.
7688         */
7689        public SetupActionAssertComponent setValidateProfileId(String value) { 
7690          if (Utilities.noString(value))
7691            this.validateProfileId = null;
7692          else {
7693            if (this.validateProfileId == null)
7694              this.validateProfileId = new IdType();
7695            this.validateProfileId.setValue(value);
7696          }
7697          return this;
7698        }
7699
7700        /**
7701         * @return {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
7702         */
7703        public StringType getValueElement() { 
7704          if (this.value == null)
7705            if (Configuration.errorOnAutoCreate())
7706              throw new Error("Attempt to auto-create SetupActionAssertComponent.value");
7707            else if (Configuration.doAutoCreate())
7708              this.value = new StringType(); // bb
7709          return this.value;
7710        }
7711
7712        public boolean hasValueElement() { 
7713          return this.value != null && !this.value.isEmpty();
7714        }
7715
7716        public boolean hasValue() { 
7717          return this.value != null && !this.value.isEmpty();
7718        }
7719
7720        /**
7721         * @param value {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
7722         */
7723        public SetupActionAssertComponent setValueElement(StringType value) { 
7724          this.value = value;
7725          return this;
7726        }
7727
7728        /**
7729         * @return The value to compare to.
7730         */
7731        public String getValue() { 
7732          return this.value == null ? null : this.value.getValue();
7733        }
7734
7735        /**
7736         * @param value The value to compare to.
7737         */
7738        public SetupActionAssertComponent setValue(String value) { 
7739          if (Utilities.noString(value))
7740            this.value = null;
7741          else {
7742            if (this.value == null)
7743              this.value = new StringType();
7744            this.value.setValue(value);
7745          }
7746          return this;
7747        }
7748
7749        /**
7750         * @return {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value
7751         */
7752        public BooleanType getWarningOnlyElement() { 
7753          if (this.warningOnly == null)
7754            if (Configuration.errorOnAutoCreate())
7755              throw new Error("Attempt to auto-create SetupActionAssertComponent.warningOnly");
7756            else if (Configuration.doAutoCreate())
7757              this.warningOnly = new BooleanType(); // bb
7758          return this.warningOnly;
7759        }
7760
7761        public boolean hasWarningOnlyElement() { 
7762          return this.warningOnly != null && !this.warningOnly.isEmpty();
7763        }
7764
7765        public boolean hasWarningOnly() { 
7766          return this.warningOnly != null && !this.warningOnly.isEmpty();
7767        }
7768
7769        /**
7770         * @param value {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value
7771         */
7772        public SetupActionAssertComponent setWarningOnlyElement(BooleanType value) { 
7773          this.warningOnly = value;
7774          return this;
7775        }
7776
7777        /**
7778         * @return Whether or not the test execution will produce a warning only on error for this assert.
7779         */
7780        public boolean getWarningOnly() { 
7781          return this.warningOnly == null || this.warningOnly.isEmpty() ? false : this.warningOnly.getValue();
7782        }
7783
7784        /**
7785         * @param value Whether or not the test execution will produce a warning only on error for this assert.
7786         */
7787        public SetupActionAssertComponent setWarningOnly(boolean value) { 
7788            if (this.warningOnly == null)
7789              this.warningOnly = new BooleanType();
7790            this.warningOnly.setValue(value);
7791          return this;
7792        }
7793
7794        protected void listChildren(List<Property> children) {
7795          super.listChildren(children);
7796          children.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label));
7797          children.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description));
7798          children.add(new Property("direction", "code", "The direction to use for the assertion.", 0, 1, direction));
7799          children.add(new Property("compareToSourceId", "string", "Id of the source fixture used as the contents to be evaluated by either the \"source/expression\" or \"sourceId/path\" definition.", 0, 1, compareToSourceId));
7800          children.add(new Property("compareToSourceExpression", "string", "The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourceExpression));
7801          children.add(new Property("compareToSourcePath", "string", "XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourcePath));
7802          children.add(new Property("contentType", "code", "The mime-type contents to compare against the request or response message 'Content-Type' header.", 0, 1, contentType));
7803          children.add(new Property("expression", "string", "The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.", 0, 1, expression));
7804          children.add(new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, 1, headerField));
7805          children.add(new Property("minimumId", "string", "The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.", 0, 1, minimumId));
7806          children.add(new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, 1, navigationLinks));
7807          children.add(new Property("operator", "code", "The operator type defines the conditional behavior of the assert. If not defined, the default is equals.", 0, 1, operator));
7808          children.add(new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, 1, path));
7809          children.add(new Property("requestMethod", "code", "The request method or HTTP operation code to compare against that used by the client system under test.", 0, 1, requestMethod));
7810          children.add(new Property("requestURL", "string", "The value to use in a comparison against the request URL path string.", 0, 1, requestURL));
7811          children.add(new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource));
7812          children.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, 1, response));
7813          children.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, 1, responseCode));
7814          children.add(new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, 1, rule));
7815          children.add(new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, 1, ruleset));
7816          children.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.", 0, 1, sourceId));
7817          children.add(new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, 1, validateProfileId));
7818          children.add(new Property("value", "string", "The value to compare to.", 0, 1, value));
7819          children.add(new Property("warningOnly", "boolean", "Whether or not the test execution will produce a warning only on error for this assert.", 0, 1, warningOnly));
7820        }
7821
7822        @Override
7823        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7824          switch (_hash) {
7825          case 102727412: /*label*/  return new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label);
7826          case -1724546052: /*description*/  return new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description);
7827          case -962590849: /*direction*/  return new Property("direction", "code", "The direction to use for the assertion.", 0, 1, direction);
7828          case 2081856758: /*compareToSourceId*/  return new Property("compareToSourceId", "string", "Id of the source fixture used as the contents to be evaluated by either the \"source/expression\" or \"sourceId/path\" definition.", 0, 1, compareToSourceId);
7829          case -1415702669: /*compareToSourceExpression*/  return new Property("compareToSourceExpression", "string", "The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourceExpression);
7830          case -790206144: /*compareToSourcePath*/  return new Property("compareToSourcePath", "string", "XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourcePath);
7831          case -389131437: /*contentType*/  return new Property("contentType", "code", "The mime-type contents to compare against the request or response message 'Content-Type' header.", 0, 1, contentType);
7832          case -1795452264: /*expression*/  return new Property("expression", "string", "The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.", 0, 1, expression);
7833          case 1160732269: /*headerField*/  return new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, 1, headerField);
7834          case 818925001: /*minimumId*/  return new Property("minimumId", "string", "The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.", 0, 1, minimumId);
7835          case 1001488901: /*navigationLinks*/  return new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, 1, navigationLinks);
7836          case -500553564: /*operator*/  return new Property("operator", "code", "The operator type defines the conditional behavior of the assert. If not defined, the default is equals.", 0, 1, operator);
7837          case 3433509: /*path*/  return new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, 1, path);
7838          case 1217874000: /*requestMethod*/  return new Property("requestMethod", "code", "The request method or HTTP operation code to compare against that used by the client system under test.", 0, 1, requestMethod);
7839          case 37099616: /*requestURL*/  return new Property("requestURL", "string", "The value to use in a comparison against the request URL path string.", 0, 1, requestURL);
7840          case -341064690: /*resource*/  return new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource);
7841          case -340323263: /*response*/  return new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, 1, response);
7842          case 1438723534: /*responseCode*/  return new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, 1, responseCode);
7843          case 3512060: /*rule*/  return new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, 1, rule);
7844          case 1548678118: /*ruleset*/  return new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, 1, ruleset);
7845          case 1746327190: /*sourceId*/  return new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.", 0, 1, sourceId);
7846          case 1555541038: /*validateProfileId*/  return new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, 1, validateProfileId);
7847          case 111972721: /*value*/  return new Property("value", "string", "The value to compare to.", 0, 1, value);
7848          case -481159832: /*warningOnly*/  return new Property("warningOnly", "boolean", "Whether or not the test execution will produce a warning only on error for this assert.", 0, 1, warningOnly);
7849          default: return super.getNamedProperty(_hash, _name, _checkValid);
7850          }
7851
7852        }
7853
7854      @Override
7855      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7856        switch (hash) {
7857        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
7858        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
7859        case -962590849: /*direction*/ return this.direction == null ? new Base[0] : new Base[] {this.direction}; // Enumeration<AssertionDirectionType>
7860        case 2081856758: /*compareToSourceId*/ return this.compareToSourceId == null ? new Base[0] : new Base[] {this.compareToSourceId}; // StringType
7861        case -1415702669: /*compareToSourceExpression*/ return this.compareToSourceExpression == null ? new Base[0] : new Base[] {this.compareToSourceExpression}; // StringType
7862        case -790206144: /*compareToSourcePath*/ return this.compareToSourcePath == null ? new Base[0] : new Base[] {this.compareToSourcePath}; // StringType
7863        case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType
7864        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
7865        case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType
7866        case 818925001: /*minimumId*/ return this.minimumId == null ? new Base[0] : new Base[] {this.minimumId}; // StringType
7867        case 1001488901: /*navigationLinks*/ return this.navigationLinks == null ? new Base[0] : new Base[] {this.navigationLinks}; // BooleanType
7868        case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Enumeration<AssertionOperatorType>
7869        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
7870        case 1217874000: /*requestMethod*/ return this.requestMethod == null ? new Base[0] : new Base[] {this.requestMethod}; // Enumeration<TestScriptRequestMethodCode>
7871        case 37099616: /*requestURL*/ return this.requestURL == null ? new Base[0] : new Base[] {this.requestURL}; // StringType
7872        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType
7873        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Enumeration<AssertionResponseTypes>
7874        case 1438723534: /*responseCode*/ return this.responseCode == null ? new Base[0] : new Base[] {this.responseCode}; // StringType
7875        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : new Base[] {this.rule}; // ActionAssertRuleComponent
7876        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // ActionAssertRulesetComponent
7877        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
7878        case 1555541038: /*validateProfileId*/ return this.validateProfileId == null ? new Base[0] : new Base[] {this.validateProfileId}; // IdType
7879        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
7880        case -481159832: /*warningOnly*/ return this.warningOnly == null ? new Base[0] : new Base[] {this.warningOnly}; // BooleanType
7881        default: return super.getProperty(hash, name, checkValid);
7882        }
7883
7884      }
7885
7886      @Override
7887      public Base setProperty(int hash, String name, Base value) throws FHIRException {
7888        switch (hash) {
7889        case 102727412: // label
7890          this.label = castToString(value); // StringType
7891          return value;
7892        case -1724546052: // description
7893          this.description = castToString(value); // StringType
7894          return value;
7895        case -962590849: // direction
7896          value = new AssertionDirectionTypeEnumFactory().fromType(castToCode(value));
7897          this.direction = (Enumeration) value; // Enumeration<AssertionDirectionType>
7898          return value;
7899        case 2081856758: // compareToSourceId
7900          this.compareToSourceId = castToString(value); // StringType
7901          return value;
7902        case -1415702669: // compareToSourceExpression
7903          this.compareToSourceExpression = castToString(value); // StringType
7904          return value;
7905        case -790206144: // compareToSourcePath
7906          this.compareToSourcePath = castToString(value); // StringType
7907          return value;
7908        case -389131437: // contentType
7909          this.contentType = castToCode(value); // CodeType
7910          return value;
7911        case -1795452264: // expression
7912          this.expression = castToString(value); // StringType
7913          return value;
7914        case 1160732269: // headerField
7915          this.headerField = castToString(value); // StringType
7916          return value;
7917        case 818925001: // minimumId
7918          this.minimumId = castToString(value); // StringType
7919          return value;
7920        case 1001488901: // navigationLinks
7921          this.navigationLinks = castToBoolean(value); // BooleanType
7922          return value;
7923        case -500553564: // operator
7924          value = new AssertionOperatorTypeEnumFactory().fromType(castToCode(value));
7925          this.operator = (Enumeration) value; // Enumeration<AssertionOperatorType>
7926          return value;
7927        case 3433509: // path
7928          this.path = castToString(value); // StringType
7929          return value;
7930        case 1217874000: // requestMethod
7931          value = new TestScriptRequestMethodCodeEnumFactory().fromType(castToCode(value));
7932          this.requestMethod = (Enumeration) value; // Enumeration<TestScriptRequestMethodCode>
7933          return value;
7934        case 37099616: // requestURL
7935          this.requestURL = castToString(value); // StringType
7936          return value;
7937        case -341064690: // resource
7938          this.resource = castToCode(value); // CodeType
7939          return value;
7940        case -340323263: // response
7941          value = new AssertionResponseTypesEnumFactory().fromType(castToCode(value));
7942          this.response = (Enumeration) value; // Enumeration<AssertionResponseTypes>
7943          return value;
7944        case 1438723534: // responseCode
7945          this.responseCode = castToString(value); // StringType
7946          return value;
7947        case 3512060: // rule
7948          this.rule = (ActionAssertRuleComponent) value; // ActionAssertRuleComponent
7949          return value;
7950        case 1548678118: // ruleset
7951          this.ruleset = (ActionAssertRulesetComponent) value; // ActionAssertRulesetComponent
7952          return value;
7953        case 1746327190: // sourceId
7954          this.sourceId = castToId(value); // IdType
7955          return value;
7956        case 1555541038: // validateProfileId
7957          this.validateProfileId = castToId(value); // IdType
7958          return value;
7959        case 111972721: // value
7960          this.value = castToString(value); // StringType
7961          return value;
7962        case -481159832: // warningOnly
7963          this.warningOnly = castToBoolean(value); // BooleanType
7964          return value;
7965        default: return super.setProperty(hash, name, value);
7966        }
7967
7968      }
7969
7970      @Override
7971      public Base setProperty(String name, Base value) throws FHIRException {
7972        if (name.equals("label")) {
7973          this.label = castToString(value); // StringType
7974        } else if (name.equals("description")) {
7975          this.description = castToString(value); // StringType
7976        } else if (name.equals("direction")) {
7977          value = new AssertionDirectionTypeEnumFactory().fromType(castToCode(value));
7978          this.direction = (Enumeration) value; // Enumeration<AssertionDirectionType>
7979        } else if (name.equals("compareToSourceId")) {
7980          this.compareToSourceId = castToString(value); // StringType
7981        } else if (name.equals("compareToSourceExpression")) {
7982          this.compareToSourceExpression = castToString(value); // StringType
7983        } else if (name.equals("compareToSourcePath")) {
7984          this.compareToSourcePath = castToString(value); // StringType
7985        } else if (name.equals("contentType")) {
7986          this.contentType = castToCode(value); // CodeType
7987        } else if (name.equals("expression")) {
7988          this.expression = castToString(value); // StringType
7989        } else if (name.equals("headerField")) {
7990          this.headerField = castToString(value); // StringType
7991        } else if (name.equals("minimumId")) {
7992          this.minimumId = castToString(value); // StringType
7993        } else if (name.equals("navigationLinks")) {
7994          this.navigationLinks = castToBoolean(value); // BooleanType
7995        } else if (name.equals("operator")) {
7996          value = new AssertionOperatorTypeEnumFactory().fromType(castToCode(value));
7997          this.operator = (Enumeration) value; // Enumeration<AssertionOperatorType>
7998        } else if (name.equals("path")) {
7999          this.path = castToString(value); // StringType
8000        } else if (name.equals("requestMethod")) {
8001          value = new TestScriptRequestMethodCodeEnumFactory().fromType(castToCode(value));
8002          this.requestMethod = (Enumeration) value; // Enumeration<TestScriptRequestMethodCode>
8003        } else if (name.equals("requestURL")) {
8004          this.requestURL = castToString(value); // StringType
8005        } else if (name.equals("resource")) {
8006          this.resource = castToCode(value); // CodeType
8007        } else if (name.equals("response")) {
8008          value = new AssertionResponseTypesEnumFactory().fromType(castToCode(value));
8009          this.response = (Enumeration) value; // Enumeration<AssertionResponseTypes>
8010        } else if (name.equals("responseCode")) {
8011          this.responseCode = castToString(value); // StringType
8012        } else if (name.equals("rule")) {
8013          this.rule = (ActionAssertRuleComponent) value; // ActionAssertRuleComponent
8014        } else if (name.equals("ruleset")) {
8015          this.ruleset = (ActionAssertRulesetComponent) value; // ActionAssertRulesetComponent
8016        } else if (name.equals("sourceId")) {
8017          this.sourceId = castToId(value); // IdType
8018        } else if (name.equals("validateProfileId")) {
8019          this.validateProfileId = castToId(value); // IdType
8020        } else if (name.equals("value")) {
8021          this.value = castToString(value); // StringType
8022        } else if (name.equals("warningOnly")) {
8023          this.warningOnly = castToBoolean(value); // BooleanType
8024        } else
8025          return super.setProperty(name, value);
8026        return value;
8027      }
8028
8029      @Override
8030      public Base makeProperty(int hash, String name) throws FHIRException {
8031        switch (hash) {
8032        case 102727412:  return getLabelElement();
8033        case -1724546052:  return getDescriptionElement();
8034        case -962590849:  return getDirectionElement();
8035        case 2081856758:  return getCompareToSourceIdElement();
8036        case -1415702669:  return getCompareToSourceExpressionElement();
8037        case -790206144:  return getCompareToSourcePathElement();
8038        case -389131437:  return getContentTypeElement();
8039        case -1795452264:  return getExpressionElement();
8040        case 1160732269:  return getHeaderFieldElement();
8041        case 818925001:  return getMinimumIdElement();
8042        case 1001488901:  return getNavigationLinksElement();
8043        case -500553564:  return getOperatorElement();
8044        case 3433509:  return getPathElement();
8045        case 1217874000:  return getRequestMethodElement();
8046        case 37099616:  return getRequestURLElement();
8047        case -341064690:  return getResourceElement();
8048        case -340323263:  return getResponseElement();
8049        case 1438723534:  return getResponseCodeElement();
8050        case 3512060:  return getRule(); 
8051        case 1548678118:  return getRuleset(); 
8052        case 1746327190:  return getSourceIdElement();
8053        case 1555541038:  return getValidateProfileIdElement();
8054        case 111972721:  return getValueElement();
8055        case -481159832:  return getWarningOnlyElement();
8056        default: return super.makeProperty(hash, name);
8057        }
8058
8059      }
8060
8061      @Override
8062      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8063        switch (hash) {
8064        case 102727412: /*label*/ return new String[] {"string"};
8065        case -1724546052: /*description*/ return new String[] {"string"};
8066        case -962590849: /*direction*/ return new String[] {"code"};
8067        case 2081856758: /*compareToSourceId*/ return new String[] {"string"};
8068        case -1415702669: /*compareToSourceExpression*/ return new String[] {"string"};
8069        case -790206144: /*compareToSourcePath*/ return new String[] {"string"};
8070        case -389131437: /*contentType*/ return new String[] {"code"};
8071        case -1795452264: /*expression*/ return new String[] {"string"};
8072        case 1160732269: /*headerField*/ return new String[] {"string"};
8073        case 818925001: /*minimumId*/ return new String[] {"string"};
8074        case 1001488901: /*navigationLinks*/ return new String[] {"boolean"};
8075        case -500553564: /*operator*/ return new String[] {"code"};
8076        case 3433509: /*path*/ return new String[] {"string"};
8077        case 1217874000: /*requestMethod*/ return new String[] {"code"};
8078        case 37099616: /*requestURL*/ return new String[] {"string"};
8079        case -341064690: /*resource*/ return new String[] {"code"};
8080        case -340323263: /*response*/ return new String[] {"code"};
8081        case 1438723534: /*responseCode*/ return new String[] {"string"};
8082        case 3512060: /*rule*/ return new String[] {};
8083        case 1548678118: /*ruleset*/ return new String[] {};
8084        case 1746327190: /*sourceId*/ return new String[] {"id"};
8085        case 1555541038: /*validateProfileId*/ return new String[] {"id"};
8086        case 111972721: /*value*/ return new String[] {"string"};
8087        case -481159832: /*warningOnly*/ return new String[] {"boolean"};
8088        default: return super.getTypesForProperty(hash, name);
8089        }
8090
8091      }
8092
8093      @Override
8094      public Base addChild(String name) throws FHIRException {
8095        if (name.equals("label")) {
8096          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
8097        }
8098        else if (name.equals("description")) {
8099          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
8100        }
8101        else if (name.equals("direction")) {
8102          throw new FHIRException("Cannot call addChild on a primitive type TestScript.direction");
8103        }
8104        else if (name.equals("compareToSourceId")) {
8105          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceId");
8106        }
8107        else if (name.equals("compareToSourceExpression")) {
8108          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceExpression");
8109        }
8110        else if (name.equals("compareToSourcePath")) {
8111          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourcePath");
8112        }
8113        else if (name.equals("contentType")) {
8114          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
8115        }
8116        else if (name.equals("expression")) {
8117          throw new FHIRException("Cannot call addChild on a primitive type TestScript.expression");
8118        }
8119        else if (name.equals("headerField")) {
8120          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
8121        }
8122        else if (name.equals("minimumId")) {
8123          throw new FHIRException("Cannot call addChild on a primitive type TestScript.minimumId");
8124        }
8125        else if (name.equals("navigationLinks")) {
8126          throw new FHIRException("Cannot call addChild on a primitive type TestScript.navigationLinks");
8127        }
8128        else if (name.equals("operator")) {
8129          throw new FHIRException("Cannot call addChild on a primitive type TestScript.operator");
8130        }
8131        else if (name.equals("path")) {
8132          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
8133        }
8134        else if (name.equals("requestMethod")) {
8135          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestMethod");
8136        }
8137        else if (name.equals("requestURL")) {
8138          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestURL");
8139        }
8140        else if (name.equals("resource")) {
8141          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
8142        }
8143        else if (name.equals("response")) {
8144          throw new FHIRException("Cannot call addChild on a primitive type TestScript.response");
8145        }
8146        else if (name.equals("responseCode")) {
8147          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseCode");
8148        }
8149        else if (name.equals("rule")) {
8150          this.rule = new ActionAssertRuleComponent();
8151          return this.rule;
8152        }
8153        else if (name.equals("ruleset")) {
8154          this.ruleset = new ActionAssertRulesetComponent();
8155          return this.ruleset;
8156        }
8157        else if (name.equals("sourceId")) {
8158          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
8159        }
8160        else if (name.equals("validateProfileId")) {
8161          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validateProfileId");
8162        }
8163        else if (name.equals("value")) {
8164          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
8165        }
8166        else if (name.equals("warningOnly")) {
8167          throw new FHIRException("Cannot call addChild on a primitive type TestScript.warningOnly");
8168        }
8169        else
8170          return super.addChild(name);
8171      }
8172
8173      public SetupActionAssertComponent copy() {
8174        SetupActionAssertComponent dst = new SetupActionAssertComponent();
8175        copyValues(dst);
8176        dst.label = label == null ? null : label.copy();
8177        dst.description = description == null ? null : description.copy();
8178        dst.direction = direction == null ? null : direction.copy();
8179        dst.compareToSourceId = compareToSourceId == null ? null : compareToSourceId.copy();
8180        dst.compareToSourceExpression = compareToSourceExpression == null ? null : compareToSourceExpression.copy();
8181        dst.compareToSourcePath = compareToSourcePath == null ? null : compareToSourcePath.copy();
8182        dst.contentType = contentType == null ? null : contentType.copy();
8183        dst.expression = expression == null ? null : expression.copy();
8184        dst.headerField = headerField == null ? null : headerField.copy();
8185        dst.minimumId = minimumId == null ? null : minimumId.copy();
8186        dst.navigationLinks = navigationLinks == null ? null : navigationLinks.copy();
8187        dst.operator = operator == null ? null : operator.copy();
8188        dst.path = path == null ? null : path.copy();
8189        dst.requestMethod = requestMethod == null ? null : requestMethod.copy();
8190        dst.requestURL = requestURL == null ? null : requestURL.copy();
8191        dst.resource = resource == null ? null : resource.copy();
8192        dst.response = response == null ? null : response.copy();
8193        dst.responseCode = responseCode == null ? null : responseCode.copy();
8194        dst.rule = rule == null ? null : rule.copy();
8195        dst.ruleset = ruleset == null ? null : ruleset.copy();
8196        dst.sourceId = sourceId == null ? null : sourceId.copy();
8197        dst.validateProfileId = validateProfileId == null ? null : validateProfileId.copy();
8198        dst.value = value == null ? null : value.copy();
8199        dst.warningOnly = warningOnly == null ? null : warningOnly.copy();
8200        return dst;
8201      }
8202
8203      @Override
8204      public boolean equalsDeep(Base other_) {
8205        if (!super.equalsDeep(other_))
8206          return false;
8207        if (!(other_ instanceof SetupActionAssertComponent))
8208          return false;
8209        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
8210        return compareDeep(label, o.label, true) && compareDeep(description, o.description, true) && compareDeep(direction, o.direction, true)
8211           && compareDeep(compareToSourceId, o.compareToSourceId, true) && compareDeep(compareToSourceExpression, o.compareToSourceExpression, true)
8212           && compareDeep(compareToSourcePath, o.compareToSourcePath, true) && compareDeep(contentType, o.contentType, true)
8213           && compareDeep(expression, o.expression, true) && compareDeep(headerField, o.headerField, true)
8214           && compareDeep(minimumId, o.minimumId, true) && compareDeep(navigationLinks, o.navigationLinks, true)
8215           && compareDeep(operator, o.operator, true) && compareDeep(path, o.path, true) && compareDeep(requestMethod, o.requestMethod, true)
8216           && compareDeep(requestURL, o.requestURL, true) && compareDeep(resource, o.resource, true) && compareDeep(response, o.response, true)
8217           && compareDeep(responseCode, o.responseCode, true) && compareDeep(rule, o.rule, true) && compareDeep(ruleset, o.ruleset, true)
8218           && compareDeep(sourceId, o.sourceId, true) && compareDeep(validateProfileId, o.validateProfileId, true)
8219           && compareDeep(value, o.value, true) && compareDeep(warningOnly, o.warningOnly, true);
8220      }
8221
8222      @Override
8223      public boolean equalsShallow(Base other_) {
8224        if (!super.equalsShallow(other_))
8225          return false;
8226        if (!(other_ instanceof SetupActionAssertComponent))
8227          return false;
8228        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
8229        return compareValues(label, o.label, true) && compareValues(description, o.description, true) && compareValues(direction, o.direction, true)
8230           && compareValues(compareToSourceId, o.compareToSourceId, true) && compareValues(compareToSourceExpression, o.compareToSourceExpression, true)
8231           && compareValues(compareToSourcePath, o.compareToSourcePath, true) && compareValues(contentType, o.contentType, true)
8232           && compareValues(expression, o.expression, true) && compareValues(headerField, o.headerField, true)
8233           && compareValues(minimumId, o.minimumId, true) && compareValues(navigationLinks, o.navigationLinks, true)
8234           && compareValues(operator, o.operator, true) && compareValues(path, o.path, true) && compareValues(requestMethod, o.requestMethod, true)
8235           && compareValues(requestURL, o.requestURL, true) && compareValues(resource, o.resource, true) && compareValues(response, o.response, true)
8236           && compareValues(responseCode, o.responseCode, true) && compareValues(sourceId, o.sourceId, true) && compareValues(validateProfileId, o.validateProfileId, true)
8237           && compareValues(value, o.value, true) && compareValues(warningOnly, o.warningOnly, true);
8238      }
8239
8240      public boolean isEmpty() {
8241        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, description, direction
8242          , compareToSourceId, compareToSourceExpression, compareToSourcePath, contentType, expression
8243          , headerField, minimumId, navigationLinks, operator, path, requestMethod, requestURL
8244          , resource, response, responseCode, rule, ruleset, sourceId, validateProfileId
8245          , value, warningOnly);
8246      }
8247
8248  public String fhirType() {
8249    return "TestScript.setup.action.assert";
8250
8251  }
8252
8253  }
8254
8255    @Block()
8256    public static class ActionAssertRuleComponent extends BackboneElement implements IBaseBackboneElement {
8257        /**
8258         * The TestScript.rule id value this assert will evaluate.
8259         */
8260        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8261        @Description(shortDefinition="Id of the TestScript.rule", formalDefinition="The TestScript.rule id value this assert will evaluate." )
8262        protected IdType ruleId;
8263
8264        /**
8265         * Each rule template can take one or more parameters for rule evaluation.
8266         */
8267        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8268        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
8269        protected List<ActionAssertRuleParamComponent> param;
8270
8271        private static final long serialVersionUID = -1860715431L;
8272
8273    /**
8274     * Constructor
8275     */
8276      public ActionAssertRuleComponent() {
8277        super();
8278      }
8279
8280    /**
8281     * Constructor
8282     */
8283      public ActionAssertRuleComponent(IdType ruleId) {
8284        super();
8285        this.ruleId = ruleId;
8286      }
8287
8288        /**
8289         * @return {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
8290         */
8291        public IdType getRuleIdElement() { 
8292          if (this.ruleId == null)
8293            if (Configuration.errorOnAutoCreate())
8294              throw new Error("Attempt to auto-create ActionAssertRuleComponent.ruleId");
8295            else if (Configuration.doAutoCreate())
8296              this.ruleId = new IdType(); // bb
8297          return this.ruleId;
8298        }
8299
8300        public boolean hasRuleIdElement() { 
8301          return this.ruleId != null && !this.ruleId.isEmpty();
8302        }
8303
8304        public boolean hasRuleId() { 
8305          return this.ruleId != null && !this.ruleId.isEmpty();
8306        }
8307
8308        /**
8309         * @param value {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
8310         */
8311        public ActionAssertRuleComponent setRuleIdElement(IdType value) { 
8312          this.ruleId = value;
8313          return this;
8314        }
8315
8316        /**
8317         * @return The TestScript.rule id value this assert will evaluate.
8318         */
8319        public String getRuleId() { 
8320          return this.ruleId == null ? null : this.ruleId.getValue();
8321        }
8322
8323        /**
8324         * @param value The TestScript.rule id value this assert will evaluate.
8325         */
8326        public ActionAssertRuleComponent setRuleId(String value) { 
8327            if (this.ruleId == null)
8328              this.ruleId = new IdType();
8329            this.ruleId.setValue(value);
8330          return this;
8331        }
8332
8333        /**
8334         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
8335         */
8336        public List<ActionAssertRuleParamComponent> getParam() { 
8337          if (this.param == null)
8338            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8339          return this.param;
8340        }
8341
8342        /**
8343         * @return Returns a reference to <code>this</code> for easy method chaining
8344         */
8345        public ActionAssertRuleComponent setParam(List<ActionAssertRuleParamComponent> theParam) { 
8346          this.param = theParam;
8347          return this;
8348        }
8349
8350        public boolean hasParam() { 
8351          if (this.param == null)
8352            return false;
8353          for (ActionAssertRuleParamComponent item : this.param)
8354            if (!item.isEmpty())
8355              return true;
8356          return false;
8357        }
8358
8359        public ActionAssertRuleParamComponent addParam() { //3
8360          ActionAssertRuleParamComponent t = new ActionAssertRuleParamComponent();
8361          if (this.param == null)
8362            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8363          this.param.add(t);
8364          return t;
8365        }
8366
8367        public ActionAssertRuleComponent addParam(ActionAssertRuleParamComponent t) { //3
8368          if (t == null)
8369            return this;
8370          if (this.param == null)
8371            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8372          this.param.add(t);
8373          return this;
8374        }
8375
8376        /**
8377         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
8378         */
8379        public ActionAssertRuleParamComponent getParamFirstRep() { 
8380          if (getParam().isEmpty()) {
8381            addParam();
8382          }
8383          return getParam().get(0);
8384        }
8385
8386        protected void listChildren(List<Property> children) {
8387          super.listChildren(children);
8388          children.add(new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, 1, ruleId));
8389          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
8390        }
8391
8392        @Override
8393        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8394          switch (_hash) {
8395          case -919875273: /*ruleId*/  return new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, 1, ruleId);
8396          case 106436749: /*param*/  return new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param);
8397          default: return super.getNamedProperty(_hash, _name, _checkValid);
8398          }
8399
8400        }
8401
8402      @Override
8403      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8404        switch (hash) {
8405        case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType
8406        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // ActionAssertRuleParamComponent
8407        default: return super.getProperty(hash, name, checkValid);
8408        }
8409
8410      }
8411
8412      @Override
8413      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8414        switch (hash) {
8415        case -919875273: // ruleId
8416          this.ruleId = castToId(value); // IdType
8417          return value;
8418        case 106436749: // param
8419          this.getParam().add((ActionAssertRuleParamComponent) value); // ActionAssertRuleParamComponent
8420          return value;
8421        default: return super.setProperty(hash, name, value);
8422        }
8423
8424      }
8425
8426      @Override
8427      public Base setProperty(String name, Base value) throws FHIRException {
8428        if (name.equals("ruleId")) {
8429          this.ruleId = castToId(value); // IdType
8430        } else if (name.equals("param")) {
8431          this.getParam().add((ActionAssertRuleParamComponent) value);
8432        } else
8433          return super.setProperty(name, value);
8434        return value;
8435      }
8436
8437      @Override
8438      public Base makeProperty(int hash, String name) throws FHIRException {
8439        switch (hash) {
8440        case -919875273:  return getRuleIdElement();
8441        case 106436749:  return addParam(); 
8442        default: return super.makeProperty(hash, name);
8443        }
8444
8445      }
8446
8447      @Override
8448      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8449        switch (hash) {
8450        case -919875273: /*ruleId*/ return new String[] {"id"};
8451        case 106436749: /*param*/ return new String[] {};
8452        default: return super.getTypesForProperty(hash, name);
8453        }
8454
8455      }
8456
8457      @Override
8458      public Base addChild(String name) throws FHIRException {
8459        if (name.equals("ruleId")) {
8460          throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId");
8461        }
8462        else if (name.equals("param")) {
8463          return addParam();
8464        }
8465        else
8466          return super.addChild(name);
8467      }
8468
8469      public ActionAssertRuleComponent copy() {
8470        ActionAssertRuleComponent dst = new ActionAssertRuleComponent();
8471        copyValues(dst);
8472        dst.ruleId = ruleId == null ? null : ruleId.copy();
8473        if (param != null) {
8474          dst.param = new ArrayList<ActionAssertRuleParamComponent>();
8475          for (ActionAssertRuleParamComponent i : param)
8476            dst.param.add(i.copy());
8477        };
8478        return dst;
8479      }
8480
8481      @Override
8482      public boolean equalsDeep(Base other_) {
8483        if (!super.equalsDeep(other_))
8484          return false;
8485        if (!(other_ instanceof ActionAssertRuleComponent))
8486          return false;
8487        ActionAssertRuleComponent o = (ActionAssertRuleComponent) other_;
8488        return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true);
8489      }
8490
8491      @Override
8492      public boolean equalsShallow(Base other_) {
8493        if (!super.equalsShallow(other_))
8494          return false;
8495        if (!(other_ instanceof ActionAssertRuleComponent))
8496          return false;
8497        ActionAssertRuleComponent o = (ActionAssertRuleComponent) other_;
8498        return compareValues(ruleId, o.ruleId, true);
8499      }
8500
8501      public boolean isEmpty() {
8502        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ruleId, param);
8503      }
8504
8505  public String fhirType() {
8506    return "TestScript.setup.action.assert.rule";
8507
8508  }
8509
8510  }
8511
8512    @Block()
8513    public static class ActionAssertRuleParamComponent extends BackboneElement implements IBaseBackboneElement {
8514        /**
8515         * Descriptive name for this parameter that matches the external assert rule parameter name.
8516         */
8517        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8518        @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." )
8519        protected StringType name;
8520
8521        /**
8522         * The value for the parameter that will be passed on to the external rule template.
8523         */
8524        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
8525        @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external rule template." )
8526        protected StringType value;
8527
8528        private static final long serialVersionUID = 395259392L;
8529
8530    /**
8531     * Constructor
8532     */
8533      public ActionAssertRuleParamComponent() {
8534        super();
8535      }
8536
8537    /**
8538     * Constructor
8539     */
8540      public ActionAssertRuleParamComponent(StringType name, StringType value) {
8541        super();
8542        this.name = name;
8543        this.value = value;
8544      }
8545
8546        /**
8547         * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
8548         */
8549        public StringType getNameElement() { 
8550          if (this.name == null)
8551            if (Configuration.errorOnAutoCreate())
8552              throw new Error("Attempt to auto-create ActionAssertRuleParamComponent.name");
8553            else if (Configuration.doAutoCreate())
8554              this.name = new StringType(); // bb
8555          return this.name;
8556        }
8557
8558        public boolean hasNameElement() { 
8559          return this.name != null && !this.name.isEmpty();
8560        }
8561
8562        public boolean hasName() { 
8563          return this.name != null && !this.name.isEmpty();
8564        }
8565
8566        /**
8567         * @param value {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
8568         */
8569        public ActionAssertRuleParamComponent setNameElement(StringType value) { 
8570          this.name = value;
8571          return this;
8572        }
8573
8574        /**
8575         * @return Descriptive name for this parameter that matches the external assert rule parameter name.
8576         */
8577        public String getName() { 
8578          return this.name == null ? null : this.name.getValue();
8579        }
8580
8581        /**
8582         * @param value Descriptive name for this parameter that matches the external assert rule parameter name.
8583         */
8584        public ActionAssertRuleParamComponent setName(String value) { 
8585            if (this.name == null)
8586              this.name = new StringType();
8587            this.name.setValue(value);
8588          return this;
8589        }
8590
8591        /**
8592         * @return {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8593         */
8594        public StringType getValueElement() { 
8595          if (this.value == null)
8596            if (Configuration.errorOnAutoCreate())
8597              throw new Error("Attempt to auto-create ActionAssertRuleParamComponent.value");
8598            else if (Configuration.doAutoCreate())
8599              this.value = new StringType(); // bb
8600          return this.value;
8601        }
8602
8603        public boolean hasValueElement() { 
8604          return this.value != null && !this.value.isEmpty();
8605        }
8606
8607        public boolean hasValue() { 
8608          return this.value != null && !this.value.isEmpty();
8609        }
8610
8611        /**
8612         * @param value {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
8613         */
8614        public ActionAssertRuleParamComponent setValueElement(StringType value) { 
8615          this.value = value;
8616          return this;
8617        }
8618
8619        /**
8620         * @return The value for the parameter that will be passed on to the external rule template.
8621         */
8622        public String getValue() { 
8623          return this.value == null ? null : this.value.getValue();
8624        }
8625
8626        /**
8627         * @param value The value for the parameter that will be passed on to the external rule template.
8628         */
8629        public ActionAssertRuleParamComponent setValue(String value) { 
8630            if (this.value == null)
8631              this.value = new StringType();
8632            this.value.setValue(value);
8633          return this;
8634        }
8635
8636        protected void listChildren(List<Property> children) {
8637          super.listChildren(children);
8638          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name));
8639          children.add(new Property("value", "string", "The value for the parameter that will be passed on to the external rule template.", 0, 1, value));
8640        }
8641
8642        @Override
8643        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8644          switch (_hash) {
8645          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name);
8646          case 111972721: /*value*/  return new Property("value", "string", "The value for the parameter that will be passed on to the external rule template.", 0, 1, value);
8647          default: return super.getNamedProperty(_hash, _name, _checkValid);
8648          }
8649
8650        }
8651
8652      @Override
8653      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8654        switch (hash) {
8655        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
8656        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
8657        default: return super.getProperty(hash, name, checkValid);
8658        }
8659
8660      }
8661
8662      @Override
8663      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8664        switch (hash) {
8665        case 3373707: // name
8666          this.name = castToString(value); // StringType
8667          return value;
8668        case 111972721: // value
8669          this.value = castToString(value); // StringType
8670          return value;
8671        default: return super.setProperty(hash, name, value);
8672        }
8673
8674      }
8675
8676      @Override
8677      public Base setProperty(String name, Base value) throws FHIRException {
8678        if (name.equals("name")) {
8679          this.name = castToString(value); // StringType
8680        } else if (name.equals("value")) {
8681          this.value = castToString(value); // StringType
8682        } else
8683          return super.setProperty(name, value);
8684        return value;
8685      }
8686
8687      @Override
8688      public Base makeProperty(int hash, String name) throws FHIRException {
8689        switch (hash) {
8690        case 3373707:  return getNameElement();
8691        case 111972721:  return getValueElement();
8692        default: return super.makeProperty(hash, name);
8693        }
8694
8695      }
8696
8697      @Override
8698      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8699        switch (hash) {
8700        case 3373707: /*name*/ return new String[] {"string"};
8701        case 111972721: /*value*/ return new String[] {"string"};
8702        default: return super.getTypesForProperty(hash, name);
8703        }
8704
8705      }
8706
8707      @Override
8708      public Base addChild(String name) throws FHIRException {
8709        if (name.equals("name")) {
8710          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
8711        }
8712        else if (name.equals("value")) {
8713          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
8714        }
8715        else
8716          return super.addChild(name);
8717      }
8718
8719      public ActionAssertRuleParamComponent copy() {
8720        ActionAssertRuleParamComponent dst = new ActionAssertRuleParamComponent();
8721        copyValues(dst);
8722        dst.name = name == null ? null : name.copy();
8723        dst.value = value == null ? null : value.copy();
8724        return dst;
8725      }
8726
8727      @Override
8728      public boolean equalsDeep(Base other_) {
8729        if (!super.equalsDeep(other_))
8730          return false;
8731        if (!(other_ instanceof ActionAssertRuleParamComponent))
8732          return false;
8733        ActionAssertRuleParamComponent o = (ActionAssertRuleParamComponent) other_;
8734        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
8735      }
8736
8737      @Override
8738      public boolean equalsShallow(Base other_) {
8739        if (!super.equalsShallow(other_))
8740          return false;
8741        if (!(other_ instanceof ActionAssertRuleParamComponent))
8742          return false;
8743        ActionAssertRuleParamComponent o = (ActionAssertRuleParamComponent) other_;
8744        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
8745      }
8746
8747      public boolean isEmpty() {
8748        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
8749      }
8750
8751  public String fhirType() {
8752    return "TestScript.setup.action.assert.rule.param";
8753
8754  }
8755
8756  }
8757
8758    @Block()
8759    public static class ActionAssertRulesetComponent extends BackboneElement implements IBaseBackboneElement {
8760        /**
8761         * The TestScript.ruleset id value this assert will evaluate.
8762         */
8763        @Child(name = "rulesetId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8764        @Description(shortDefinition="Id of the TestScript.ruleset", formalDefinition="The TestScript.ruleset id value this assert will evaluate." )
8765        protected IdType rulesetId;
8766
8767        /**
8768         * The referenced rule within the external ruleset template.
8769         */
8770        @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8771        @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." )
8772        protected List<ActionAssertRulesetRuleComponent> rule;
8773
8774        private static final long serialVersionUID = -976736025L;
8775
8776    /**
8777     * Constructor
8778     */
8779      public ActionAssertRulesetComponent() {
8780        super();
8781      }
8782
8783    /**
8784     * Constructor
8785     */
8786      public ActionAssertRulesetComponent(IdType rulesetId) {
8787        super();
8788        this.rulesetId = rulesetId;
8789      }
8790
8791        /**
8792         * @return {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value
8793         */
8794        public IdType getRulesetIdElement() { 
8795          if (this.rulesetId == null)
8796            if (Configuration.errorOnAutoCreate())
8797              throw new Error("Attempt to auto-create ActionAssertRulesetComponent.rulesetId");
8798            else if (Configuration.doAutoCreate())
8799              this.rulesetId = new IdType(); // bb
8800          return this.rulesetId;
8801        }
8802
8803        public boolean hasRulesetIdElement() { 
8804          return this.rulesetId != null && !this.rulesetId.isEmpty();
8805        }
8806
8807        public boolean hasRulesetId() { 
8808          return this.rulesetId != null && !this.rulesetId.isEmpty();
8809        }
8810
8811        /**
8812         * @param value {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value
8813         */
8814        public ActionAssertRulesetComponent setRulesetIdElement(IdType value) { 
8815          this.rulesetId = value;
8816          return this;
8817        }
8818
8819        /**
8820         * @return The TestScript.ruleset id value this assert will evaluate.
8821         */
8822        public String getRulesetId() { 
8823          return this.rulesetId == null ? null : this.rulesetId.getValue();
8824        }
8825
8826        /**
8827         * @param value The TestScript.ruleset id value this assert will evaluate.
8828         */
8829        public ActionAssertRulesetComponent setRulesetId(String value) { 
8830            if (this.rulesetId == null)
8831              this.rulesetId = new IdType();
8832            this.rulesetId.setValue(value);
8833          return this;
8834        }
8835
8836        /**
8837         * @return {@link #rule} (The referenced rule within the external ruleset template.)
8838         */
8839        public List<ActionAssertRulesetRuleComponent> getRule() { 
8840          if (this.rule == null)
8841            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
8842          return this.rule;
8843        }
8844
8845        /**
8846         * @return Returns a reference to <code>this</code> for easy method chaining
8847         */
8848        public ActionAssertRulesetComponent setRule(List<ActionAssertRulesetRuleComponent> theRule) { 
8849          this.rule = theRule;
8850          return this;
8851        }
8852
8853        public boolean hasRule() { 
8854          if (this.rule == null)
8855            return false;
8856          for (ActionAssertRulesetRuleComponent item : this.rule)
8857            if (!item.isEmpty())
8858              return true;
8859          return false;
8860        }
8861
8862        public ActionAssertRulesetRuleComponent addRule() { //3
8863          ActionAssertRulesetRuleComponent t = new ActionAssertRulesetRuleComponent();
8864          if (this.rule == null)
8865            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
8866          this.rule.add(t);
8867          return t;
8868        }
8869
8870        public ActionAssertRulesetComponent addRule(ActionAssertRulesetRuleComponent t) { //3
8871          if (t == null)
8872            return this;
8873          if (this.rule == null)
8874            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
8875          this.rule.add(t);
8876          return this;
8877        }
8878
8879        /**
8880         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
8881         */
8882        public ActionAssertRulesetRuleComponent getRuleFirstRep() { 
8883          if (getRule().isEmpty()) {
8884            addRule();
8885          }
8886          return getRule().get(0);
8887        }
8888
8889        protected void listChildren(List<Property> children) {
8890          super.listChildren(children);
8891          children.add(new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, 1, rulesetId));
8892          children.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule));
8893        }
8894
8895        @Override
8896        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8897          switch (_hash) {
8898          case -2073977951: /*rulesetId*/  return new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, 1, rulesetId);
8899          case 3512060: /*rule*/  return new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule);
8900          default: return super.getNamedProperty(_hash, _name, _checkValid);
8901          }
8902
8903        }
8904
8905      @Override
8906      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8907        switch (hash) {
8908        case -2073977951: /*rulesetId*/ return this.rulesetId == null ? new Base[0] : new Base[] {this.rulesetId}; // IdType
8909        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ActionAssertRulesetRuleComponent
8910        default: return super.getProperty(hash, name, checkValid);
8911        }
8912
8913      }
8914
8915      @Override
8916      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8917        switch (hash) {
8918        case -2073977951: // rulesetId
8919          this.rulesetId = castToId(value); // IdType
8920          return value;
8921        case 3512060: // rule
8922          this.getRule().add((ActionAssertRulesetRuleComponent) value); // ActionAssertRulesetRuleComponent
8923          return value;
8924        default: return super.setProperty(hash, name, value);
8925        }
8926
8927      }
8928
8929      @Override
8930      public Base setProperty(String name, Base value) throws FHIRException {
8931        if (name.equals("rulesetId")) {
8932          this.rulesetId = castToId(value); // IdType
8933        } else if (name.equals("rule")) {
8934          this.getRule().add((ActionAssertRulesetRuleComponent) value);
8935        } else
8936          return super.setProperty(name, value);
8937        return value;
8938      }
8939
8940      @Override
8941      public Base makeProperty(int hash, String name) throws FHIRException {
8942        switch (hash) {
8943        case -2073977951:  return getRulesetIdElement();
8944        case 3512060:  return addRule(); 
8945        default: return super.makeProperty(hash, name);
8946        }
8947
8948      }
8949
8950      @Override
8951      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8952        switch (hash) {
8953        case -2073977951: /*rulesetId*/ return new String[] {"id"};
8954        case 3512060: /*rule*/ return new String[] {};
8955        default: return super.getTypesForProperty(hash, name);
8956        }
8957
8958      }
8959
8960      @Override
8961      public Base addChild(String name) throws FHIRException {
8962        if (name.equals("rulesetId")) {
8963          throw new FHIRException("Cannot call addChild on a primitive type TestScript.rulesetId");
8964        }
8965        else if (name.equals("rule")) {
8966          return addRule();
8967        }
8968        else
8969          return super.addChild(name);
8970      }
8971
8972      public ActionAssertRulesetComponent copy() {
8973        ActionAssertRulesetComponent dst = new ActionAssertRulesetComponent();
8974        copyValues(dst);
8975        dst.rulesetId = rulesetId == null ? null : rulesetId.copy();
8976        if (rule != null) {
8977          dst.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
8978          for (ActionAssertRulesetRuleComponent i : rule)
8979            dst.rule.add(i.copy());
8980        };
8981        return dst;
8982      }
8983
8984      @Override
8985      public boolean equalsDeep(Base other_) {
8986        if (!super.equalsDeep(other_))
8987          return false;
8988        if (!(other_ instanceof ActionAssertRulesetComponent))
8989          return false;
8990        ActionAssertRulesetComponent o = (ActionAssertRulesetComponent) other_;
8991        return compareDeep(rulesetId, o.rulesetId, true) && compareDeep(rule, o.rule, true);
8992      }
8993
8994      @Override
8995      public boolean equalsShallow(Base other_) {
8996        if (!super.equalsShallow(other_))
8997          return false;
8998        if (!(other_ instanceof ActionAssertRulesetComponent))
8999          return false;
9000        ActionAssertRulesetComponent o = (ActionAssertRulesetComponent) other_;
9001        return compareValues(rulesetId, o.rulesetId, true);
9002      }
9003
9004      public boolean isEmpty() {
9005        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(rulesetId, rule);
9006      }
9007
9008  public String fhirType() {
9009    return "TestScript.setup.action.assert.ruleset";
9010
9011  }
9012
9013  }
9014
9015    @Block()
9016    public static class ActionAssertRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement {
9017        /**
9018         * Id of the referenced rule within the external ruleset template.
9019         */
9020        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
9021        @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." )
9022        protected IdType ruleId;
9023
9024        /**
9025         * Each rule template can take one or more parameters for rule evaluation.
9026         */
9027        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9028        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
9029        protected List<ActionAssertRulesetRuleParamComponent> param;
9030
9031        private static final long serialVersionUID = -1850698529L;
9032
9033    /**
9034     * Constructor
9035     */
9036      public ActionAssertRulesetRuleComponent() {
9037        super();
9038      }
9039
9040    /**
9041     * Constructor
9042     */
9043      public ActionAssertRulesetRuleComponent(IdType ruleId) {
9044        super();
9045        this.ruleId = ruleId;
9046      }
9047
9048        /**
9049         * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
9050         */
9051        public IdType getRuleIdElement() { 
9052          if (this.ruleId == null)
9053            if (Configuration.errorOnAutoCreate())
9054              throw new Error("Attempt to auto-create ActionAssertRulesetRuleComponent.ruleId");
9055            else if (Configuration.doAutoCreate())
9056              this.ruleId = new IdType(); // bb
9057          return this.ruleId;
9058        }
9059
9060        public boolean hasRuleIdElement() { 
9061          return this.ruleId != null && !this.ruleId.isEmpty();
9062        }
9063
9064        public boolean hasRuleId() { 
9065          return this.ruleId != null && !this.ruleId.isEmpty();
9066        }
9067
9068        /**
9069         * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value
9070         */
9071        public ActionAssertRulesetRuleComponent setRuleIdElement(IdType value) { 
9072          this.ruleId = value;
9073          return this;
9074        }
9075
9076        /**
9077         * @return Id of the referenced rule within the external ruleset template.
9078         */
9079        public String getRuleId() { 
9080          return this.ruleId == null ? null : this.ruleId.getValue();
9081        }
9082
9083        /**
9084         * @param value Id of the referenced rule within the external ruleset template.
9085         */
9086        public ActionAssertRulesetRuleComponent setRuleId(String value) { 
9087            if (this.ruleId == null)
9088              this.ruleId = new IdType();
9089            this.ruleId.setValue(value);
9090          return this;
9091        }
9092
9093        /**
9094         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
9095         */
9096        public List<ActionAssertRulesetRuleParamComponent> getParam() { 
9097          if (this.param == null)
9098            this.param = new ArrayList<ActionAssertRulesetRuleParamComponent>();
9099          return this.param;
9100        }
9101
9102        /**
9103         * @return Returns a reference to <code>this</code> for easy method chaining
9104         */
9105        public ActionAssertRulesetRuleComponent setParam(List<ActionAssertRulesetRuleParamComponent> theParam) { 
9106          this.param = theParam;
9107          return this;
9108        }
9109
9110        public boolean hasParam() { 
9111          if (this.param == null)
9112            return false;
9113          for (ActionAssertRulesetRuleParamComponent item : this.param)
9114            if (!item.isEmpty())
9115              return true;
9116          return false;
9117        }
9118
9119        public ActionAssertRulesetRuleParamComponent addParam() { //3
9120          ActionAssertRulesetRuleParamComponent t = new ActionAssertRulesetRuleParamComponent();
9121          if (this.param == null)
9122            this.param = new ArrayList<ActionAssertRulesetRuleParamComponent>();
9123          this.param.add(t);
9124          return t;
9125        }
9126
9127        public ActionAssertRulesetRuleComponent addParam(ActionAssertRulesetRuleParamComponent t) { //3
9128          if (t == null)
9129            return this;
9130          if (this.param == null)
9131            this.param = new ArrayList<ActionAssertRulesetRuleParamComponent>();
9132          this.param.add(t);
9133          return this;
9134        }
9135
9136        /**
9137         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
9138         */
9139        public ActionAssertRulesetRuleParamComponent getParamFirstRep() { 
9140          if (getParam().isEmpty()) {
9141            addParam();
9142          }
9143          return getParam().get(0);
9144        }
9145
9146        protected void listChildren(List<Property> children) {
9147          super.listChildren(children);
9148          children.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId));
9149          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
9150        }
9151
9152        @Override
9153        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9154          switch (_hash) {
9155          case -919875273: /*ruleId*/  return new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId);
9156          case 106436749: /*param*/  return new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param);
9157          default: return super.getNamedProperty(_hash, _name, _checkValid);
9158          }
9159
9160        }
9161
9162      @Override
9163      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9164        switch (hash) {
9165        case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType
9166        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // ActionAssertRulesetRuleParamComponent
9167        default: return super.getProperty(hash, name, checkValid);
9168        }
9169
9170      }
9171
9172      @Override
9173      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9174        switch (hash) {
9175        case -919875273: // ruleId
9176          this.ruleId = castToId(value); // IdType
9177          return value;
9178        case 106436749: // param
9179          this.getParam().add((ActionAssertRulesetRuleParamComponent) value); // ActionAssertRulesetRuleParamComponent
9180          return value;
9181        default: return super.setProperty(hash, name, value);
9182        }
9183
9184      }
9185
9186      @Override
9187      public Base setProperty(String name, Base value) throws FHIRException {
9188        if (name.equals("ruleId")) {
9189          this.ruleId = castToId(value); // IdType
9190        } else if (name.equals("param")) {
9191          this.getParam().add((ActionAssertRulesetRuleParamComponent) value);
9192        } else
9193          return super.setProperty(name, value);
9194        return value;
9195      }
9196
9197      @Override
9198      public Base makeProperty(int hash, String name) throws FHIRException {
9199        switch (hash) {
9200        case -919875273:  return getRuleIdElement();
9201        case 106436749:  return addParam(); 
9202        default: return super.makeProperty(hash, name);
9203        }
9204
9205      }
9206
9207      @Override
9208      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9209        switch (hash) {
9210        case -919875273: /*ruleId*/ return new String[] {"id"};
9211        case 106436749: /*param*/ return new String[] {};
9212        default: return super.getTypesForProperty(hash, name);
9213        }
9214
9215      }
9216
9217      @Override
9218      public Base addChild(String name) throws FHIRException {
9219        if (name.equals("ruleId")) {
9220          throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId");
9221        }
9222        else if (name.equals("param")) {
9223          return addParam();
9224        }
9225        else
9226          return super.addChild(name);
9227      }
9228
9229      public ActionAssertRulesetRuleComponent copy() {
9230        ActionAssertRulesetRuleComponent dst = new ActionAssertRulesetRuleComponent();
9231        copyValues(dst);
9232        dst.ruleId = ruleId == null ? null : ruleId.copy();
9233        if (param != null) {
9234          dst.param = new ArrayList<ActionAssertRulesetRuleParamComponent>();
9235          for (ActionAssertRulesetRuleParamComponent i : param)
9236            dst.param.add(i.copy());
9237        };
9238        return dst;
9239      }
9240
9241      @Override
9242      public boolean equalsDeep(Base other_) {
9243        if (!super.equalsDeep(other_))
9244          return false;
9245        if (!(other_ instanceof ActionAssertRulesetRuleComponent))
9246          return false;
9247        ActionAssertRulesetRuleComponent o = (ActionAssertRulesetRuleComponent) other_;
9248        return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true);
9249      }
9250
9251      @Override
9252      public boolean equalsShallow(Base other_) {
9253        if (!super.equalsShallow(other_))
9254          return false;
9255        if (!(other_ instanceof ActionAssertRulesetRuleComponent))
9256          return false;
9257        ActionAssertRulesetRuleComponent o = (ActionAssertRulesetRuleComponent) other_;
9258        return compareValues(ruleId, o.ruleId, true);
9259      }
9260
9261      public boolean isEmpty() {
9262        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ruleId, param);
9263      }
9264
9265  public String fhirType() {
9266    return "TestScript.setup.action.assert.ruleset.rule";
9267
9268  }
9269
9270  }
9271
9272    @Block()
9273    public static class ActionAssertRulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement {
9274        /**
9275         * Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
9276         */
9277        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
9278        @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." )
9279        protected StringType name;
9280
9281        /**
9282         * The value for the parameter that will be passed on to the external ruleset rule template.
9283         */
9284        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
9285        @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." )
9286        protected StringType value;
9287
9288        private static final long serialVersionUID = 395259392L;
9289
9290    /**
9291     * Constructor
9292     */
9293      public ActionAssertRulesetRuleParamComponent() {
9294        super();
9295      }
9296
9297    /**
9298     * Constructor
9299     */
9300      public ActionAssertRulesetRuleParamComponent(StringType name, StringType value) {
9301        super();
9302        this.name = name;
9303        this.value = value;
9304      }
9305
9306        /**
9307         * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
9308         */
9309        public StringType getNameElement() { 
9310          if (this.name == null)
9311            if (Configuration.errorOnAutoCreate())
9312              throw new Error("Attempt to auto-create ActionAssertRulesetRuleParamComponent.name");
9313            else if (Configuration.doAutoCreate())
9314              this.name = new StringType(); // bb
9315          return this.name;
9316        }
9317
9318        public boolean hasNameElement() { 
9319          return this.name != null && !this.name.isEmpty();
9320        }
9321
9322        public boolean hasName() { 
9323          return this.name != null && !this.name.isEmpty();
9324        }
9325
9326        /**
9327         * @param value {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
9328         */
9329        public ActionAssertRulesetRuleParamComponent setNameElement(StringType value) { 
9330          this.name = value;
9331          return this;
9332        }
9333
9334        /**
9335         * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
9336         */
9337        public String getName() { 
9338          return this.name == null ? null : this.name.getValue();
9339        }
9340
9341        /**
9342         * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
9343         */
9344        public ActionAssertRulesetRuleParamComponent setName(String value) { 
9345            if (this.name == null)
9346              this.name = new StringType();
9347            this.name.setValue(value);
9348          return this;
9349        }
9350
9351        /**
9352         * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
9353         */
9354        public StringType getValueElement() { 
9355          if (this.value == null)
9356            if (Configuration.errorOnAutoCreate())
9357              throw new Error("Attempt to auto-create ActionAssertRulesetRuleParamComponent.value");
9358            else if (Configuration.doAutoCreate())
9359              this.value = new StringType(); // bb
9360          return this.value;
9361        }
9362
9363        public boolean hasValueElement() { 
9364          return this.value != null && !this.value.isEmpty();
9365        }
9366
9367        public boolean hasValue() { 
9368          return this.value != null && !this.value.isEmpty();
9369        }
9370
9371        /**
9372         * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
9373         */
9374        public ActionAssertRulesetRuleParamComponent setValueElement(StringType value) { 
9375          this.value = value;
9376          return this;
9377        }
9378
9379        /**
9380         * @return The value for the parameter that will be passed on to the external ruleset rule template.
9381         */
9382        public String getValue() { 
9383          return this.value == null ? null : this.value.getValue();
9384        }
9385
9386        /**
9387         * @param value The value for the parameter that will be passed on to the external ruleset rule template.
9388         */
9389        public ActionAssertRulesetRuleParamComponent setValue(String value) { 
9390            if (this.value == null)
9391              this.value = new StringType();
9392            this.value.setValue(value);
9393          return this;
9394        }
9395
9396        protected void listChildren(List<Property> children) {
9397          super.listChildren(children);
9398          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, 1, name));
9399          children.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, 1, value));
9400        }
9401
9402        @Override
9403        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9404          switch (_hash) {
9405          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, 1, name);
9406          case 111972721: /*value*/  return new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, 1, value);
9407          default: return super.getNamedProperty(_hash, _name, _checkValid);
9408          }
9409
9410        }
9411
9412      @Override
9413      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9414        switch (hash) {
9415        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
9416        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
9417        default: return super.getProperty(hash, name, checkValid);
9418        }
9419
9420      }
9421
9422      @Override
9423      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9424        switch (hash) {
9425        case 3373707: // name
9426          this.name = castToString(value); // StringType
9427          return value;
9428        case 111972721: // value
9429          this.value = castToString(value); // StringType
9430          return value;
9431        default: return super.setProperty(hash, name, value);
9432        }
9433
9434      }
9435
9436      @Override
9437      public Base setProperty(String name, Base value) throws FHIRException {
9438        if (name.equals("name")) {
9439          this.name = castToString(value); // StringType
9440        } else if (name.equals("value")) {
9441          this.value = castToString(value); // StringType
9442        } else
9443          return super.setProperty(name, value);
9444        return value;
9445      }
9446
9447      @Override
9448      public Base makeProperty(int hash, String name) throws FHIRException {
9449        switch (hash) {
9450        case 3373707:  return getNameElement();
9451        case 111972721:  return getValueElement();
9452        default: return super.makeProperty(hash, name);
9453        }
9454
9455      }
9456
9457      @Override
9458      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9459        switch (hash) {
9460        case 3373707: /*name*/ return new String[] {"string"};
9461        case 111972721: /*value*/ return new String[] {"string"};
9462        default: return super.getTypesForProperty(hash, name);
9463        }
9464
9465      }
9466
9467      @Override
9468      public Base addChild(String name) throws FHIRException {
9469        if (name.equals("name")) {
9470          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
9471        }
9472        else if (name.equals("value")) {
9473          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
9474        }
9475        else
9476          return super.addChild(name);
9477      }
9478
9479      public ActionAssertRulesetRuleParamComponent copy() {
9480        ActionAssertRulesetRuleParamComponent dst = new ActionAssertRulesetRuleParamComponent();
9481        copyValues(dst);
9482        dst.name = name == null ? null : name.copy();
9483        dst.value = value == null ? null : value.copy();
9484        return dst;
9485      }
9486
9487      @Override
9488      public boolean equalsDeep(Base other_) {
9489        if (!super.equalsDeep(other_))
9490          return false;
9491        if (!(other_ instanceof ActionAssertRulesetRuleParamComponent))
9492          return false;
9493        ActionAssertRulesetRuleParamComponent o = (ActionAssertRulesetRuleParamComponent) other_;
9494        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
9495      }
9496
9497      @Override
9498      public boolean equalsShallow(Base other_) {
9499        if (!super.equalsShallow(other_))
9500          return false;
9501        if (!(other_ instanceof ActionAssertRulesetRuleParamComponent))
9502          return false;
9503        ActionAssertRulesetRuleParamComponent o = (ActionAssertRulesetRuleParamComponent) other_;
9504        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
9505      }
9506
9507      public boolean isEmpty() {
9508        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
9509      }
9510
9511  public String fhirType() {
9512    return "TestScript.setup.action.assert.ruleset.rule.param";
9513
9514  }
9515
9516  }
9517
9518    @Block()
9519    public static class TestScriptTestComponent extends BackboneElement implements IBaseBackboneElement {
9520        /**
9521         * The name of this test used for tracking/logging purposes by test engines.
9522         */
9523        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
9524        @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." )
9525        protected StringType name;
9526
9527        /**
9528         * A short description of the test used by test engines for tracking and reporting purposes.
9529         */
9530        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
9531        @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." )
9532        protected StringType description;
9533
9534        /**
9535         * Action would contain either an operation or an assertion.
9536         */
9537        @Child(name = "action", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9538        @Description(shortDefinition="A test operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." )
9539        protected List<TestActionComponent> action;
9540
9541        private static final long serialVersionUID = -865006110L;
9542
9543    /**
9544     * Constructor
9545     */
9546      public TestScriptTestComponent() {
9547        super();
9548      }
9549
9550        /**
9551         * @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
9552         */
9553        public StringType getNameElement() { 
9554          if (this.name == null)
9555            if (Configuration.errorOnAutoCreate())
9556              throw new Error("Attempt to auto-create TestScriptTestComponent.name");
9557            else if (Configuration.doAutoCreate())
9558              this.name = new StringType(); // bb
9559          return this.name;
9560        }
9561
9562        public boolean hasNameElement() { 
9563          return this.name != null && !this.name.isEmpty();
9564        }
9565
9566        public boolean hasName() { 
9567          return this.name != null && !this.name.isEmpty();
9568        }
9569
9570        /**
9571         * @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
9572         */
9573        public TestScriptTestComponent setNameElement(StringType value) { 
9574          this.name = value;
9575          return this;
9576        }
9577
9578        /**
9579         * @return The name of this test used for tracking/logging purposes by test engines.
9580         */
9581        public String getName() { 
9582          return this.name == null ? null : this.name.getValue();
9583        }
9584
9585        /**
9586         * @param value The name of this test used for tracking/logging purposes by test engines.
9587         */
9588        public TestScriptTestComponent setName(String value) { 
9589          if (Utilities.noString(value))
9590            this.name = null;
9591          else {
9592            if (this.name == null)
9593              this.name = new StringType();
9594            this.name.setValue(value);
9595          }
9596          return this;
9597        }
9598
9599        /**
9600         * @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
9601         */
9602        public StringType getDescriptionElement() { 
9603          if (this.description == null)
9604            if (Configuration.errorOnAutoCreate())
9605              throw new Error("Attempt to auto-create TestScriptTestComponent.description");
9606            else if (Configuration.doAutoCreate())
9607              this.description = new StringType(); // bb
9608          return this.description;
9609        }
9610
9611        public boolean hasDescriptionElement() { 
9612          return this.description != null && !this.description.isEmpty();
9613        }
9614
9615        public boolean hasDescription() { 
9616          return this.description != null && !this.description.isEmpty();
9617        }
9618
9619        /**
9620         * @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
9621         */
9622        public TestScriptTestComponent setDescriptionElement(StringType value) { 
9623          this.description = value;
9624          return this;
9625        }
9626
9627        /**
9628         * @return A short description of the test used by test engines for tracking and reporting purposes.
9629         */
9630        public String getDescription() { 
9631          return this.description == null ? null : this.description.getValue();
9632        }
9633
9634        /**
9635         * @param value A short description of the test used by test engines for tracking and reporting purposes.
9636         */
9637        public TestScriptTestComponent setDescription(String value) { 
9638          if (Utilities.noString(value))
9639            this.description = null;
9640          else {
9641            if (this.description == null)
9642              this.description = new StringType();
9643            this.description.setValue(value);
9644          }
9645          return this;
9646        }
9647
9648        /**
9649         * @return {@link #action} (Action would contain either an operation or an assertion.)
9650         */
9651        public List<TestActionComponent> getAction() { 
9652          if (this.action == null)
9653            this.action = new ArrayList<TestActionComponent>();
9654          return this.action;
9655        }
9656
9657        /**
9658         * @return Returns a reference to <code>this</code> for easy method chaining
9659         */
9660        public TestScriptTestComponent setAction(List<TestActionComponent> theAction) { 
9661          this.action = theAction;
9662          return this;
9663        }
9664
9665        public boolean hasAction() { 
9666          if (this.action == null)
9667            return false;
9668          for (TestActionComponent item : this.action)
9669            if (!item.isEmpty())
9670              return true;
9671          return false;
9672        }
9673
9674        public TestActionComponent addAction() { //3
9675          TestActionComponent t = new TestActionComponent();
9676          if (this.action == null)
9677            this.action = new ArrayList<TestActionComponent>();
9678          this.action.add(t);
9679          return t;
9680        }
9681
9682        public TestScriptTestComponent addAction(TestActionComponent t) { //3
9683          if (t == null)
9684            return this;
9685          if (this.action == null)
9686            this.action = new ArrayList<TestActionComponent>();
9687          this.action.add(t);
9688          return this;
9689        }
9690
9691        /**
9692         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
9693         */
9694        public TestActionComponent getActionFirstRep() { 
9695          if (getAction().isEmpty()) {
9696            addAction();
9697          }
9698          return getAction().get(0);
9699        }
9700
9701        protected void listChildren(List<Property> children) {
9702          super.listChildren(children);
9703          children.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name));
9704          children.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, 1, description));
9705          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
9706        }
9707
9708        @Override
9709        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9710          switch (_hash) {
9711          case 3373707: /*name*/  return new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, 1, name);
9712          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);
9713          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
9714          default: return super.getNamedProperty(_hash, _name, _checkValid);
9715          }
9716
9717        }
9718
9719      @Override
9720      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9721        switch (hash) {
9722        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
9723        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
9724        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent
9725        default: return super.getProperty(hash, name, checkValid);
9726        }
9727
9728      }
9729
9730      @Override
9731      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9732        switch (hash) {
9733        case 3373707: // name
9734          this.name = castToString(value); // StringType
9735          return value;
9736        case -1724546052: // description
9737          this.description = castToString(value); // StringType
9738          return value;
9739        case -1422950858: // action
9740          this.getAction().add((TestActionComponent) value); // TestActionComponent
9741          return value;
9742        default: return super.setProperty(hash, name, value);
9743        }
9744
9745      }
9746
9747      @Override
9748      public Base setProperty(String name, Base value) throws FHIRException {
9749        if (name.equals("name")) {
9750          this.name = castToString(value); // StringType
9751        } else if (name.equals("description")) {
9752          this.description = castToString(value); // StringType
9753        } else if (name.equals("action")) {
9754          this.getAction().add((TestActionComponent) value);
9755        } else
9756          return super.setProperty(name, value);
9757        return value;
9758      }
9759
9760      @Override
9761      public Base makeProperty(int hash, String name) throws FHIRException {
9762        switch (hash) {
9763        case 3373707:  return getNameElement();
9764        case -1724546052:  return getDescriptionElement();
9765        case -1422950858:  return addAction(); 
9766        default: return super.makeProperty(hash, name);
9767        }
9768
9769      }
9770
9771      @Override
9772      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9773        switch (hash) {
9774        case 3373707: /*name*/ return new String[] {"string"};
9775        case -1724546052: /*description*/ return new String[] {"string"};
9776        case -1422950858: /*action*/ return new String[] {};
9777        default: return super.getTypesForProperty(hash, name);
9778        }
9779
9780      }
9781
9782      @Override
9783      public Base addChild(String name) throws FHIRException {
9784        if (name.equals("name")) {
9785          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
9786        }
9787        else if (name.equals("description")) {
9788          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
9789        }
9790        else if (name.equals("action")) {
9791          return addAction();
9792        }
9793        else
9794          return super.addChild(name);
9795      }
9796
9797      public TestScriptTestComponent copy() {
9798        TestScriptTestComponent dst = new TestScriptTestComponent();
9799        copyValues(dst);
9800        dst.name = name == null ? null : name.copy();
9801        dst.description = description == null ? null : description.copy();
9802        if (action != null) {
9803          dst.action = new ArrayList<TestActionComponent>();
9804          for (TestActionComponent i : action)
9805            dst.action.add(i.copy());
9806        };
9807        return dst;
9808      }
9809
9810      @Override
9811      public boolean equalsDeep(Base other_) {
9812        if (!super.equalsDeep(other_))
9813          return false;
9814        if (!(other_ instanceof TestScriptTestComponent))
9815          return false;
9816        TestScriptTestComponent o = (TestScriptTestComponent) other_;
9817        return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(action, o.action, true)
9818          ;
9819      }
9820
9821      @Override
9822      public boolean equalsShallow(Base other_) {
9823        if (!super.equalsShallow(other_))
9824          return false;
9825        if (!(other_ instanceof TestScriptTestComponent))
9826          return false;
9827        TestScriptTestComponent o = (TestScriptTestComponent) other_;
9828        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
9829      }
9830
9831      public boolean isEmpty() {
9832        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, description, action
9833          );
9834      }
9835
9836  public String fhirType() {
9837    return "TestScript.test";
9838
9839  }
9840
9841  }
9842
9843    @Block()
9844    public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement {
9845        /**
9846         * An operation would involve a REST request to a server.
9847         */
9848        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
9849        @Description(shortDefinition="The setup operation to perform", formalDefinition="An operation would involve a REST request to a server." )
9850        protected SetupActionOperationComponent operation;
9851
9852        /**
9853         * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
9854         */
9855        @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false)
9856        @Description(shortDefinition="The setup assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." )
9857        protected SetupActionAssertComponent assert_;
9858
9859        private static final long serialVersionUID = -252088305L;
9860
9861    /**
9862     * Constructor
9863     */
9864      public TestActionComponent() {
9865        super();
9866      }
9867
9868        /**
9869         * @return {@link #operation} (An operation would involve a REST request to a server.)
9870         */
9871        public SetupActionOperationComponent getOperation() { 
9872          if (this.operation == null)
9873            if (Configuration.errorOnAutoCreate())
9874              throw new Error("Attempt to auto-create TestActionComponent.operation");
9875            else if (Configuration.doAutoCreate())
9876              this.operation = new SetupActionOperationComponent(); // cc
9877          return this.operation;
9878        }
9879
9880        public boolean hasOperation() { 
9881          return this.operation != null && !this.operation.isEmpty();
9882        }
9883
9884        /**
9885         * @param value {@link #operation} (An operation would involve a REST request to a server.)
9886         */
9887        public TestActionComponent setOperation(SetupActionOperationComponent value) { 
9888          this.operation = value;
9889          return this;
9890        }
9891
9892        /**
9893         * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
9894         */
9895        public SetupActionAssertComponent getAssert() { 
9896          if (this.assert_ == null)
9897            if (Configuration.errorOnAutoCreate())
9898              throw new Error("Attempt to auto-create TestActionComponent.assert_");
9899            else if (Configuration.doAutoCreate())
9900              this.assert_ = new SetupActionAssertComponent(); // cc
9901          return this.assert_;
9902        }
9903
9904        public boolean hasAssert() { 
9905          return this.assert_ != null && !this.assert_.isEmpty();
9906        }
9907
9908        /**
9909         * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
9910         */
9911        public TestActionComponent setAssert(SetupActionAssertComponent value) { 
9912          this.assert_ = value;
9913          return this;
9914        }
9915
9916        protected void listChildren(List<Property> children) {
9917          super.listChildren(children);
9918          children.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
9919          children.add(new Property("assert", "@TestScript.setup.action.assert", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, 1, assert_));
9920        }
9921
9922        @Override
9923        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9924          switch (_hash) {
9925          case 1662702951: /*operation*/  return new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
9926          case -1408208058: /*assert*/  return new Property("assert", "@TestScript.setup.action.assert", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, 1, assert_);
9927          default: return super.getNamedProperty(_hash, _name, _checkValid);
9928          }
9929
9930        }
9931
9932      @Override
9933      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9934        switch (hash) {
9935        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
9936        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
9937        default: return super.getProperty(hash, name, checkValid);
9938        }
9939
9940      }
9941
9942      @Override
9943      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9944        switch (hash) {
9945        case 1662702951: // operation
9946          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
9947          return value;
9948        case -1408208058: // assert
9949          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
9950          return value;
9951        default: return super.setProperty(hash, name, value);
9952        }
9953
9954      }
9955
9956      @Override
9957      public Base setProperty(String name, Base value) throws FHIRException {
9958        if (name.equals("operation")) {
9959          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
9960        } else if (name.equals("assert")) {
9961          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
9962        } else
9963          return super.setProperty(name, value);
9964        return value;
9965      }
9966
9967      @Override
9968      public Base makeProperty(int hash, String name) throws FHIRException {
9969        switch (hash) {
9970        case 1662702951:  return getOperation(); 
9971        case -1408208058:  return getAssert(); 
9972        default: return super.makeProperty(hash, name);
9973        }
9974
9975      }
9976
9977      @Override
9978      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9979        switch (hash) {
9980        case 1662702951: /*operation*/ return new String[] {"@TestScript.setup.action.operation"};
9981        case -1408208058: /*assert*/ return new String[] {"@TestScript.setup.action.assert"};
9982        default: return super.getTypesForProperty(hash, name);
9983        }
9984
9985      }
9986
9987      @Override
9988      public Base addChild(String name) throws FHIRException {
9989        if (name.equals("operation")) {
9990          this.operation = new SetupActionOperationComponent();
9991          return this.operation;
9992        }
9993        else if (name.equals("assert")) {
9994          this.assert_ = new SetupActionAssertComponent();
9995          return this.assert_;
9996        }
9997        else
9998          return super.addChild(name);
9999      }
10000
10001      public TestActionComponent copy() {
10002        TestActionComponent dst = new TestActionComponent();
10003        copyValues(dst);
10004        dst.operation = operation == null ? null : operation.copy();
10005        dst.assert_ = assert_ == null ? null : assert_.copy();
10006        return dst;
10007      }
10008
10009      @Override
10010      public boolean equalsDeep(Base other_) {
10011        if (!super.equalsDeep(other_))
10012          return false;
10013        if (!(other_ instanceof TestActionComponent))
10014          return false;
10015        TestActionComponent o = (TestActionComponent) other_;
10016        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
10017      }
10018
10019      @Override
10020      public boolean equalsShallow(Base other_) {
10021        if (!super.equalsShallow(other_))
10022          return false;
10023        if (!(other_ instanceof TestActionComponent))
10024          return false;
10025        TestActionComponent o = (TestActionComponent) other_;
10026        return true;
10027      }
10028
10029      public boolean isEmpty() {
10030        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
10031      }
10032
10033  public String fhirType() {
10034    return "TestScript.test.action";
10035
10036  }
10037
10038  }
10039
10040    @Block()
10041    public static class TestScriptTeardownComponent extends BackboneElement implements IBaseBackboneElement {
10042        /**
10043         * The teardown action will only contain an operation.
10044         */
10045        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10046        @Description(shortDefinition="One or more teardown operations to perform", formalDefinition="The teardown action will only contain an operation." )
10047        protected List<TeardownActionComponent> action;
10048
10049        private static final long serialVersionUID = 1168638089L;
10050
10051    /**
10052     * Constructor
10053     */
10054      public TestScriptTeardownComponent() {
10055        super();
10056      }
10057
10058        /**
10059         * @return {@link #action} (The teardown action will only contain an operation.)
10060         */
10061        public List<TeardownActionComponent> getAction() { 
10062          if (this.action == null)
10063            this.action = new ArrayList<TeardownActionComponent>();
10064          return this.action;
10065        }
10066
10067        /**
10068         * @return Returns a reference to <code>this</code> for easy method chaining
10069         */
10070        public TestScriptTeardownComponent setAction(List<TeardownActionComponent> theAction) { 
10071          this.action = theAction;
10072          return this;
10073        }
10074
10075        public boolean hasAction() { 
10076          if (this.action == null)
10077            return false;
10078          for (TeardownActionComponent item : this.action)
10079            if (!item.isEmpty())
10080              return true;
10081          return false;
10082        }
10083
10084        public TeardownActionComponent addAction() { //3
10085          TeardownActionComponent t = new TeardownActionComponent();
10086          if (this.action == null)
10087            this.action = new ArrayList<TeardownActionComponent>();
10088          this.action.add(t);
10089          return t;
10090        }
10091
10092        public TestScriptTeardownComponent addAction(TeardownActionComponent t) { //3
10093          if (t == null)
10094            return this;
10095          if (this.action == null)
10096            this.action = new ArrayList<TeardownActionComponent>();
10097          this.action.add(t);
10098          return this;
10099        }
10100
10101        /**
10102         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
10103         */
10104        public TeardownActionComponent getActionFirstRep() { 
10105          if (getAction().isEmpty()) {
10106            addAction();
10107          }
10108          return getAction().get(0);
10109        }
10110
10111        protected void listChildren(List<Property> children) {
10112          super.listChildren(children);
10113          children.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action));
10114        }
10115
10116        @Override
10117        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
10118          switch (_hash) {
10119          case -1422950858: /*action*/  return new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action);
10120          default: return super.getNamedProperty(_hash, _name, _checkValid);
10121          }
10122
10123        }
10124
10125      @Override
10126      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
10127        switch (hash) {
10128        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent
10129        default: return super.getProperty(hash, name, checkValid);
10130        }
10131
10132      }
10133
10134      @Override
10135      public Base setProperty(int hash, String name, Base value) throws FHIRException {
10136        switch (hash) {
10137        case -1422950858: // action
10138          this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent
10139          return value;
10140        default: return super.setProperty(hash, name, value);
10141        }
10142
10143      }
10144
10145      @Override
10146      public Base setProperty(String name, Base value) throws FHIRException {
10147        if (name.equals("action")) {
10148          this.getAction().add((TeardownActionComponent) value);
10149        } else
10150          return super.setProperty(name, value);
10151        return value;
10152      }
10153
10154      @Override
10155      public Base makeProperty(int hash, String name) throws FHIRException {
10156        switch (hash) {
10157        case -1422950858:  return addAction(); 
10158        default: return super.makeProperty(hash, name);
10159        }
10160
10161      }
10162
10163      @Override
10164      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
10165        switch (hash) {
10166        case -1422950858: /*action*/ return new String[] {};
10167        default: return super.getTypesForProperty(hash, name);
10168        }
10169
10170      }
10171
10172      @Override
10173      public Base addChild(String name) throws FHIRException {
10174        if (name.equals("action")) {
10175          return addAction();
10176        }
10177        else
10178          return super.addChild(name);
10179      }
10180
10181      public TestScriptTeardownComponent copy() {
10182        TestScriptTeardownComponent dst = new TestScriptTeardownComponent();
10183        copyValues(dst);
10184        if (action != null) {
10185          dst.action = new ArrayList<TeardownActionComponent>();
10186          for (TeardownActionComponent i : action)
10187            dst.action.add(i.copy());
10188        };
10189        return dst;
10190      }
10191
10192      @Override
10193      public boolean equalsDeep(Base other_) {
10194        if (!super.equalsDeep(other_))
10195          return false;
10196        if (!(other_ instanceof TestScriptTeardownComponent))
10197          return false;
10198        TestScriptTeardownComponent o = (TestScriptTeardownComponent) other_;
10199        return compareDeep(action, o.action, true);
10200      }
10201
10202      @Override
10203      public boolean equalsShallow(Base other_) {
10204        if (!super.equalsShallow(other_))
10205          return false;
10206        if (!(other_ instanceof TestScriptTeardownComponent))
10207          return false;
10208        TestScriptTeardownComponent o = (TestScriptTeardownComponent) other_;
10209        return true;
10210      }
10211
10212      public boolean isEmpty() {
10213        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
10214      }
10215
10216  public String fhirType() {
10217    return "TestScript.teardown";
10218
10219  }
10220
10221  }
10222
10223    @Block()
10224    public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement {
10225        /**
10226         * An operation would involve a REST request to a server.
10227         */
10228        @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=1, max=1, modifier=false, summary=false)
10229        @Description(shortDefinition="The teardown operation to perform", formalDefinition="An operation would involve a REST request to a server." )
10230        protected SetupActionOperationComponent operation;
10231
10232        private static final long serialVersionUID = -1099598054L;
10233
10234    /**
10235     * Constructor
10236     */
10237      public TeardownActionComponent() {
10238        super();
10239      }
10240
10241    /**
10242     * Constructor
10243     */
10244      public TeardownActionComponent(SetupActionOperationComponent operation) {
10245        super();
10246        this.operation = operation;
10247      }
10248
10249        /**
10250         * @return {@link #operation} (An operation would involve a REST request to a server.)
10251         */
10252        public SetupActionOperationComponent getOperation() { 
10253          if (this.operation == null)
10254            if (Configuration.errorOnAutoCreate())
10255              throw new Error("Attempt to auto-create TeardownActionComponent.operation");
10256            else if (Configuration.doAutoCreate())
10257              this.operation = new SetupActionOperationComponent(); // cc
10258          return this.operation;
10259        }
10260
10261        public boolean hasOperation() { 
10262          return this.operation != null && !this.operation.isEmpty();
10263        }
10264
10265        /**
10266         * @param value {@link #operation} (An operation would involve a REST request to a server.)
10267         */
10268        public TeardownActionComponent setOperation(SetupActionOperationComponent value) { 
10269          this.operation = value;
10270          return this;
10271        }
10272
10273        protected void listChildren(List<Property> children) {
10274          super.listChildren(children);
10275          children.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation));
10276        }
10277
10278        @Override
10279        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
10280          switch (_hash) {
10281          case 1662702951: /*operation*/  return new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, 1, operation);
10282          default: return super.getNamedProperty(_hash, _name, _checkValid);
10283          }
10284
10285        }
10286
10287      @Override
10288      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
10289        switch (hash) {
10290        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
10291        default: return super.getProperty(hash, name, checkValid);
10292        }
10293
10294      }
10295
10296      @Override
10297      public Base setProperty(int hash, String name, Base value) throws FHIRException {
10298        switch (hash) {
10299        case 1662702951: // operation
10300          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
10301          return value;
10302        default: return super.setProperty(hash, name, value);
10303        }
10304
10305      }
10306
10307      @Override
10308      public Base setProperty(String name, Base value) throws FHIRException {
10309        if (name.equals("operation")) {
10310          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
10311        } else
10312          return super.setProperty(name, value);
10313        return value;
10314      }
10315
10316      @Override
10317      public Base makeProperty(int hash, String name) throws FHIRException {
10318        switch (hash) {
10319        case 1662702951:  return getOperation(); 
10320        default: return super.makeProperty(hash, name);
10321        }
10322
10323      }
10324
10325      @Override
10326      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
10327        switch (hash) {
10328        case 1662702951: /*operation*/ return new String[] {"@TestScript.setup.action.operation"};
10329        default: return super.getTypesForProperty(hash, name);
10330        }
10331
10332      }
10333
10334      @Override
10335      public Base addChild(String name) throws FHIRException {
10336        if (name.equals("operation")) {
10337          this.operation = new SetupActionOperationComponent();
10338          return this.operation;
10339        }
10340        else
10341          return super.addChild(name);
10342      }
10343
10344      public TeardownActionComponent copy() {
10345        TeardownActionComponent dst = new TeardownActionComponent();
10346        copyValues(dst);
10347        dst.operation = operation == null ? null : operation.copy();
10348        return dst;
10349      }
10350
10351      @Override
10352      public boolean equalsDeep(Base other_) {
10353        if (!super.equalsDeep(other_))
10354          return false;
10355        if (!(other_ instanceof TeardownActionComponent))
10356          return false;
10357        TeardownActionComponent o = (TeardownActionComponent) other_;
10358        return compareDeep(operation, o.operation, true);
10359      }
10360
10361      @Override
10362      public boolean equalsShallow(Base other_) {
10363        if (!super.equalsShallow(other_))
10364          return false;
10365        if (!(other_ instanceof TeardownActionComponent))
10366          return false;
10367        TeardownActionComponent o = (TeardownActionComponent) other_;
10368        return true;
10369      }
10370
10371      public boolean isEmpty() {
10372        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation);
10373      }
10374
10375  public String fhirType() {
10376    return "TestScript.teardown.action";
10377
10378  }
10379
10380  }
10381
10382    /**
10383     * A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.
10384     */
10385    @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true)
10386    @Description(shortDefinition="Additional identifier for the test script", formalDefinition="A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance." )
10387    protected Identifier identifier;
10388
10389    /**
10390     * Explanation of why this test script is needed and why it has been designed as it has.
10391     */
10392    @Child(name = "purpose", type = {MarkdownType.class}, order=1, min=0, max=1, modifier=false, summary=false)
10393    @Description(shortDefinition="Why this test script is defined", formalDefinition="Explanation of why this test script is needed and why it has been designed as it has." )
10394    protected MarkdownType purpose;
10395
10396    /**
10397     * A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.
10398     */
10399    @Child(name = "copyright", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=false)
10400    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script." )
10401    protected MarkdownType copyright;
10402
10403    /**
10404     * An abstract server used in operations within this test script in the origin element.
10405     */
10406    @Child(name = "origin", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10407    @Description(shortDefinition="An abstract server representing a client or sender in a message exchange", formalDefinition="An abstract server used in operations within this test script in the origin element." )
10408    protected List<TestScriptOriginComponent> origin;
10409
10410    /**
10411     * An abstract server used in operations within this test script in the destination element.
10412     */
10413    @Child(name = "destination", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10414    @Description(shortDefinition="An abstract server representing a destination or receiver in a message exchange", formalDefinition="An abstract server used in operations within this test script in the destination element." )
10415    protected List<TestScriptDestinationComponent> destination;
10416
10417    /**
10418     * The required capability must exist and are assumed to function correctly on the FHIR server being tested.
10419     */
10420    @Child(name = "metadata", type = {}, order=5, min=0, max=1, modifier=false, summary=false)
10421    @Description(shortDefinition="Required capability that is assumed to function correctly on the FHIR server being tested", formalDefinition="The required capability must exist and are assumed to function correctly on the FHIR server being tested." )
10422    protected TestScriptMetadataComponent metadata;
10423
10424    /**
10425     * Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.
10426     */
10427    @Child(name = "fixture", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10428    @Description(shortDefinition="Fixture in the test script - by reference (uri)", formalDefinition="Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute." )
10429    protected List<TestScriptFixtureComponent> fixture;
10430
10431    /**
10432     * Reference to the profile to be used for validation.
10433     */
10434    @Child(name = "profile", type = {Reference.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10435    @Description(shortDefinition="Reference of the validation profile", formalDefinition="Reference to the profile to be used for validation." )
10436    protected List<Reference> profile;
10437    /**
10438     * The actual objects that are the target of the reference (Reference to the profile to be used for validation.)
10439     */
10440    protected List<Resource> profileTarget;
10441
10442
10443    /**
10444     * Variable is set based either on element value in response body or on header field value in the response headers.
10445     */
10446    @Child(name = "variable", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10447    @Description(shortDefinition="Placeholder for evaluated elements", formalDefinition="Variable is set based either on element value in response body or on header field value in the response headers." )
10448    protected List<TestScriptVariableComponent> variable;
10449
10450    /**
10451     * Assert rule to be used in one or more asserts within the test script.
10452     */
10453    @Child(name = "rule", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10454    @Description(shortDefinition="Assert rule used within the test script", formalDefinition="Assert rule to be used in one or more asserts within the test script." )
10455    protected List<TestScriptRuleComponent> rule;
10456
10457    /**
10458     * Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied.
10459     */
10460    @Child(name = "ruleset", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10461    @Description(shortDefinition="Assert ruleset used within the test script", formalDefinition="Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied." )
10462    protected List<TestScriptRulesetComponent> ruleset;
10463
10464    /**
10465     * A series of required setup operations before tests are executed.
10466     */
10467    @Child(name = "setup", type = {}, order=11, min=0, max=1, modifier=false, summary=false)
10468    @Description(shortDefinition="A series of required setup operations before tests are executed", formalDefinition="A series of required setup operations before tests are executed." )
10469    protected TestScriptSetupComponent setup;
10470
10471    /**
10472     * A test in this script.
10473     */
10474    @Child(name = "test", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
10475    @Description(shortDefinition="A test in this script", formalDefinition="A test in this script." )
10476    protected List<TestScriptTestComponent> test;
10477
10478    /**
10479     * A series of operations required to clean up after all the tests are executed (successfully or otherwise).
10480     */
10481    @Child(name = "teardown", type = {}, order=13, min=0, max=1, modifier=false, summary=false)
10482    @Description(shortDefinition="A series of required clean up steps", formalDefinition="A series of operations required to clean up after all the tests are executed (successfully or otherwise)." )
10483    protected TestScriptTeardownComponent teardown;
10484
10485    private static final long serialVersionUID = 1164952373L;
10486
10487  /**
10488   * Constructor
10489   */
10490    public TestScript() {
10491      super();
10492    }
10493
10494  /**
10495   * Constructor
10496   */
10497    public TestScript(UriType url, StringType name, Enumeration<PublicationStatus> status) {
10498      super();
10499      this.url = url;
10500      this.name = name;
10501      this.status = status;
10502    }
10503
10504    /**
10505     * @return {@link #url} (An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
10506     */
10507    public UriType getUrlElement() { 
10508      if (this.url == null)
10509        if (Configuration.errorOnAutoCreate())
10510          throw new Error("Attempt to auto-create TestScript.url");
10511        else if (Configuration.doAutoCreate())
10512          this.url = new UriType(); // bb
10513      return this.url;
10514    }
10515
10516    public boolean hasUrlElement() { 
10517      return this.url != null && !this.url.isEmpty();
10518    }
10519
10520    public boolean hasUrl() { 
10521      return this.url != null && !this.url.isEmpty();
10522    }
10523
10524    /**
10525     * @param value {@link #url} (An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
10526     */
10527    public TestScript setUrlElement(UriType value) { 
10528      this.url = value;
10529      return this;
10530    }
10531
10532    /**
10533     * @return An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.
10534     */
10535    public String getUrl() { 
10536      return this.url == null ? null : this.url.getValue();
10537    }
10538
10539    /**
10540     * @param value An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.
10541     */
10542    public TestScript setUrl(String value) { 
10543        if (this.url == null)
10544          this.url = new UriType();
10545        this.url.setValue(value);
10546      return this;
10547    }
10548
10549    /**
10550     * @return {@link #identifier} (A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.)
10551     */
10552    public Identifier getIdentifier() { 
10553      if (this.identifier == null)
10554        if (Configuration.errorOnAutoCreate())
10555          throw new Error("Attempt to auto-create TestScript.identifier");
10556        else if (Configuration.doAutoCreate())
10557          this.identifier = new Identifier(); // cc
10558      return this.identifier;
10559    }
10560
10561    public boolean hasIdentifier() { 
10562      return this.identifier != null && !this.identifier.isEmpty();
10563    }
10564
10565    /**
10566     * @param value {@link #identifier} (A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.)
10567     */
10568    public TestScript setIdentifier(Identifier value) { 
10569      this.identifier = value;
10570      return this;
10571    }
10572
10573    /**
10574     * @return {@link #version} (The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
10575     */
10576    public StringType getVersionElement() { 
10577      if (this.version == null)
10578        if (Configuration.errorOnAutoCreate())
10579          throw new Error("Attempt to auto-create TestScript.version");
10580        else if (Configuration.doAutoCreate())
10581          this.version = new StringType(); // bb
10582      return this.version;
10583    }
10584
10585    public boolean hasVersionElement() { 
10586      return this.version != null && !this.version.isEmpty();
10587    }
10588
10589    public boolean hasVersion() { 
10590      return this.version != null && !this.version.isEmpty();
10591    }
10592
10593    /**
10594     * @param value {@link #version} (The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
10595     */
10596    public TestScript setVersionElement(StringType value) { 
10597      this.version = value;
10598      return this;
10599    }
10600
10601    /**
10602     * @return The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
10603     */
10604    public String getVersion() { 
10605      return this.version == null ? null : this.version.getValue();
10606    }
10607
10608    /**
10609     * @param value The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.
10610     */
10611    public TestScript setVersion(String value) { 
10612      if (Utilities.noString(value))
10613        this.version = null;
10614      else {
10615        if (this.version == null)
10616          this.version = new StringType();
10617        this.version.setValue(value);
10618      }
10619      return this;
10620    }
10621
10622    /**
10623     * @return {@link #name} (A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
10624     */
10625    public StringType getNameElement() { 
10626      if (this.name == null)
10627        if (Configuration.errorOnAutoCreate())
10628          throw new Error("Attempt to auto-create TestScript.name");
10629        else if (Configuration.doAutoCreate())
10630          this.name = new StringType(); // bb
10631      return this.name;
10632    }
10633
10634    public boolean hasNameElement() { 
10635      return this.name != null && !this.name.isEmpty();
10636    }
10637
10638    public boolean hasName() { 
10639      return this.name != null && !this.name.isEmpty();
10640    }
10641
10642    /**
10643     * @param value {@link #name} (A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
10644     */
10645    public TestScript setNameElement(StringType value) { 
10646      this.name = value;
10647      return this;
10648    }
10649
10650    /**
10651     * @return A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.
10652     */
10653    public String getName() { 
10654      return this.name == null ? null : this.name.getValue();
10655    }
10656
10657    /**
10658     * @param value A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.
10659     */
10660    public TestScript setName(String value) { 
10661        if (this.name == null)
10662          this.name = new StringType();
10663        this.name.setValue(value);
10664      return this;
10665    }
10666
10667    /**
10668     * @return {@link #title} (A short, descriptive, user-friendly title for the test script.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
10669     */
10670    public StringType getTitleElement() { 
10671      if (this.title == null)
10672        if (Configuration.errorOnAutoCreate())
10673          throw new Error("Attempt to auto-create TestScript.title");
10674        else if (Configuration.doAutoCreate())
10675          this.title = new StringType(); // bb
10676      return this.title;
10677    }
10678
10679    public boolean hasTitleElement() { 
10680      return this.title != null && !this.title.isEmpty();
10681    }
10682
10683    public boolean hasTitle() { 
10684      return this.title != null && !this.title.isEmpty();
10685    }
10686
10687    /**
10688     * @param value {@link #title} (A short, descriptive, user-friendly title for the test script.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value
10689     */
10690    public TestScript setTitleElement(StringType value) { 
10691      this.title = value;
10692      return this;
10693    }
10694
10695    /**
10696     * @return A short, descriptive, user-friendly title for the test script.
10697     */
10698    public String getTitle() { 
10699      return this.title == null ? null : this.title.getValue();
10700    }
10701
10702    /**
10703     * @param value A short, descriptive, user-friendly title for the test script.
10704     */
10705    public TestScript setTitle(String value) { 
10706      if (Utilities.noString(value))
10707        this.title = null;
10708      else {
10709        if (this.title == null)
10710          this.title = new StringType();
10711        this.title.setValue(value);
10712      }
10713      return this;
10714    }
10715
10716    /**
10717     * @return {@link #status} (The status of this test script. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
10718     */
10719    public Enumeration<PublicationStatus> getStatusElement() { 
10720      if (this.status == null)
10721        if (Configuration.errorOnAutoCreate())
10722          throw new Error("Attempt to auto-create TestScript.status");
10723        else if (Configuration.doAutoCreate())
10724          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory()); // bb
10725      return this.status;
10726    }
10727
10728    public boolean hasStatusElement() { 
10729      return this.status != null && !this.status.isEmpty();
10730    }
10731
10732    public boolean hasStatus() { 
10733      return this.status != null && !this.status.isEmpty();
10734    }
10735
10736    /**
10737     * @param value {@link #status} (The status of this test script. Enables tracking the life-cycle of the content.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
10738     */
10739    public TestScript setStatusElement(Enumeration<PublicationStatus> value) { 
10740      this.status = value;
10741      return this;
10742    }
10743
10744    /**
10745     * @return The status of this test script. Enables tracking the life-cycle of the content.
10746     */
10747    public PublicationStatus getStatus() { 
10748      return this.status == null ? null : this.status.getValue();
10749    }
10750
10751    /**
10752     * @param value The status of this test script. Enables tracking the life-cycle of the content.
10753     */
10754    public TestScript setStatus(PublicationStatus value) { 
10755        if (this.status == null)
10756          this.status = new Enumeration<PublicationStatus>(new PublicationStatusEnumFactory());
10757        this.status.setValue(value);
10758      return this;
10759    }
10760
10761    /**
10762     * @return {@link #experimental} (A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
10763     */
10764    public BooleanType getExperimentalElement() { 
10765      if (this.experimental == null)
10766        if (Configuration.errorOnAutoCreate())
10767          throw new Error("Attempt to auto-create TestScript.experimental");
10768        else if (Configuration.doAutoCreate())
10769          this.experimental = new BooleanType(); // bb
10770      return this.experimental;
10771    }
10772
10773    public boolean hasExperimentalElement() { 
10774      return this.experimental != null && !this.experimental.isEmpty();
10775    }
10776
10777    public boolean hasExperimental() { 
10778      return this.experimental != null && !this.experimental.isEmpty();
10779    }
10780
10781    /**
10782     * @param value {@link #experimental} (A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
10783     */
10784    public TestScript setExperimentalElement(BooleanType value) { 
10785      this.experimental = value;
10786      return this;
10787    }
10788
10789    /**
10790     * @return A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
10791     */
10792    public boolean getExperimental() { 
10793      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
10794    }
10795
10796    /**
10797     * @param value A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.
10798     */
10799    public TestScript setExperimental(boolean value) { 
10800        if (this.experimental == null)
10801          this.experimental = new BooleanType();
10802        this.experimental.setValue(value);
10803      return this;
10804    }
10805
10806    /**
10807     * @return {@link #date} (The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
10808     */
10809    public DateTimeType getDateElement() { 
10810      if (this.date == null)
10811        if (Configuration.errorOnAutoCreate())
10812          throw new Error("Attempt to auto-create TestScript.date");
10813        else if (Configuration.doAutoCreate())
10814          this.date = new DateTimeType(); // bb
10815      return this.date;
10816    }
10817
10818    public boolean hasDateElement() { 
10819      return this.date != null && !this.date.isEmpty();
10820    }
10821
10822    public boolean hasDate() { 
10823      return this.date != null && !this.date.isEmpty();
10824    }
10825
10826    /**
10827     * @param value {@link #date} (The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
10828     */
10829    public TestScript setDateElement(DateTimeType value) { 
10830      this.date = value;
10831      return this;
10832    }
10833
10834    /**
10835     * @return The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.
10836     */
10837    public Date getDate() { 
10838      return this.date == null ? null : this.date.getValue();
10839    }
10840
10841    /**
10842     * @param value The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.
10843     */
10844    public TestScript setDate(Date value) { 
10845      if (value == null)
10846        this.date = null;
10847      else {
10848        if (this.date == null)
10849          this.date = new DateTimeType();
10850        this.date.setValue(value);
10851      }
10852      return this;
10853    }
10854
10855    /**
10856     * @return {@link #publisher} (The name of the organization or individual that published the test script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
10857     */
10858    public StringType getPublisherElement() { 
10859      if (this.publisher == null)
10860        if (Configuration.errorOnAutoCreate())
10861          throw new Error("Attempt to auto-create TestScript.publisher");
10862        else if (Configuration.doAutoCreate())
10863          this.publisher = new StringType(); // bb
10864      return this.publisher;
10865    }
10866
10867    public boolean hasPublisherElement() { 
10868      return this.publisher != null && !this.publisher.isEmpty();
10869    }
10870
10871    public boolean hasPublisher() { 
10872      return this.publisher != null && !this.publisher.isEmpty();
10873    }
10874
10875    /**
10876     * @param value {@link #publisher} (The name of the organization or individual that published the test script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
10877     */
10878    public TestScript setPublisherElement(StringType value) { 
10879      this.publisher = value;
10880      return this;
10881    }
10882
10883    /**
10884     * @return The name of the organization or individual that published the test script.
10885     */
10886    public String getPublisher() { 
10887      return this.publisher == null ? null : this.publisher.getValue();
10888    }
10889
10890    /**
10891     * @param value The name of the organization or individual that published the test script.
10892     */
10893    public TestScript setPublisher(String value) { 
10894      if (Utilities.noString(value))
10895        this.publisher = null;
10896      else {
10897        if (this.publisher == null)
10898          this.publisher = new StringType();
10899        this.publisher.setValue(value);
10900      }
10901      return this;
10902    }
10903
10904    /**
10905     * @return {@link #contact} (Contact details to assist a user in finding and communicating with the publisher.)
10906     */
10907    public List<ContactDetail> getContact() { 
10908      if (this.contact == null)
10909        this.contact = new ArrayList<ContactDetail>();
10910      return this.contact;
10911    }
10912
10913    /**
10914     * @return Returns a reference to <code>this</code> for easy method chaining
10915     */
10916    public TestScript setContact(List<ContactDetail> theContact) { 
10917      this.contact = theContact;
10918      return this;
10919    }
10920
10921    public boolean hasContact() { 
10922      if (this.contact == null)
10923        return false;
10924      for (ContactDetail item : this.contact)
10925        if (!item.isEmpty())
10926          return true;
10927      return false;
10928    }
10929
10930    public ContactDetail addContact() { //3
10931      ContactDetail t = new ContactDetail();
10932      if (this.contact == null)
10933        this.contact = new ArrayList<ContactDetail>();
10934      this.contact.add(t);
10935      return t;
10936    }
10937
10938    public TestScript addContact(ContactDetail t) { //3
10939      if (t == null)
10940        return this;
10941      if (this.contact == null)
10942        this.contact = new ArrayList<ContactDetail>();
10943      this.contact.add(t);
10944      return this;
10945    }
10946
10947    /**
10948     * @return The first repetition of repeating field {@link #contact}, creating it if it does not already exist
10949     */
10950    public ContactDetail getContactFirstRep() { 
10951      if (getContact().isEmpty()) {
10952        addContact();
10953      }
10954      return getContact().get(0);
10955    }
10956
10957    /**
10958     * @return {@link #description} (A free text natural language description of the test script from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
10959     */
10960    public MarkdownType getDescriptionElement() { 
10961      if (this.description == null)
10962        if (Configuration.errorOnAutoCreate())
10963          throw new Error("Attempt to auto-create TestScript.description");
10964        else if (Configuration.doAutoCreate())
10965          this.description = new MarkdownType(); // bb
10966      return this.description;
10967    }
10968
10969    public boolean hasDescriptionElement() { 
10970      return this.description != null && !this.description.isEmpty();
10971    }
10972
10973    public boolean hasDescription() { 
10974      return this.description != null && !this.description.isEmpty();
10975    }
10976
10977    /**
10978     * @param value {@link #description} (A free text natural language description of the test script from a consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
10979     */
10980    public TestScript setDescriptionElement(MarkdownType value) { 
10981      this.description = value;
10982      return this;
10983    }
10984
10985    /**
10986     * @return A free text natural language description of the test script from a consumer's perspective.
10987     */
10988    public String getDescription() { 
10989      return this.description == null ? null : this.description.getValue();
10990    }
10991
10992    /**
10993     * @param value A free text natural language description of the test script from a consumer's perspective.
10994     */
10995    public TestScript setDescription(String value) { 
10996      if (value == null)
10997        this.description = null;
10998      else {
10999        if (this.description == null)
11000          this.description = new MarkdownType();
11001        this.description.setValue(value);
11002      }
11003      return this;
11004    }
11005
11006    /**
11007     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate test script instances.)
11008     */
11009    public List<UsageContext> getUseContext() { 
11010      if (this.useContext == null)
11011        this.useContext = new ArrayList<UsageContext>();
11012      return this.useContext;
11013    }
11014
11015    /**
11016     * @return Returns a reference to <code>this</code> for easy method chaining
11017     */
11018    public TestScript setUseContext(List<UsageContext> theUseContext) { 
11019      this.useContext = theUseContext;
11020      return this;
11021    }
11022
11023    public boolean hasUseContext() { 
11024      if (this.useContext == null)
11025        return false;
11026      for (UsageContext item : this.useContext)
11027        if (!item.isEmpty())
11028          return true;
11029      return false;
11030    }
11031
11032    public UsageContext addUseContext() { //3
11033      UsageContext t = new UsageContext();
11034      if (this.useContext == null)
11035        this.useContext = new ArrayList<UsageContext>();
11036      this.useContext.add(t);
11037      return t;
11038    }
11039
11040    public TestScript addUseContext(UsageContext t) { //3
11041      if (t == null)
11042        return this;
11043      if (this.useContext == null)
11044        this.useContext = new ArrayList<UsageContext>();
11045      this.useContext.add(t);
11046      return this;
11047    }
11048
11049    /**
11050     * @return The first repetition of repeating field {@link #useContext}, creating it if it does not already exist
11051     */
11052    public UsageContext getUseContextFirstRep() { 
11053      if (getUseContext().isEmpty()) {
11054        addUseContext();
11055      }
11056      return getUseContext().get(0);
11057    }
11058
11059    /**
11060     * @return {@link #jurisdiction} (A legal or geographic region in which the test script is intended to be used.)
11061     */
11062    public List<CodeableConcept> getJurisdiction() { 
11063      if (this.jurisdiction == null)
11064        this.jurisdiction = new ArrayList<CodeableConcept>();
11065      return this.jurisdiction;
11066    }
11067
11068    /**
11069     * @return Returns a reference to <code>this</code> for easy method chaining
11070     */
11071    public TestScript setJurisdiction(List<CodeableConcept> theJurisdiction) { 
11072      this.jurisdiction = theJurisdiction;
11073      return this;
11074    }
11075
11076    public boolean hasJurisdiction() { 
11077      if (this.jurisdiction == null)
11078        return false;
11079      for (CodeableConcept item : this.jurisdiction)
11080        if (!item.isEmpty())
11081          return true;
11082      return false;
11083    }
11084
11085    public CodeableConcept addJurisdiction() { //3
11086      CodeableConcept t = new CodeableConcept();
11087      if (this.jurisdiction == null)
11088        this.jurisdiction = new ArrayList<CodeableConcept>();
11089      this.jurisdiction.add(t);
11090      return t;
11091    }
11092
11093    public TestScript addJurisdiction(CodeableConcept t) { //3
11094      if (t == null)
11095        return this;
11096      if (this.jurisdiction == null)
11097        this.jurisdiction = new ArrayList<CodeableConcept>();
11098      this.jurisdiction.add(t);
11099      return this;
11100    }
11101
11102    /**
11103     * @return The first repetition of repeating field {@link #jurisdiction}, creating it if it does not already exist
11104     */
11105    public CodeableConcept getJurisdictionFirstRep() { 
11106      if (getJurisdiction().isEmpty()) {
11107        addJurisdiction();
11108      }
11109      return getJurisdiction().get(0);
11110    }
11111
11112    /**
11113     * @return {@link #purpose} (Explanation of why this test script is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
11114     */
11115    public MarkdownType getPurposeElement() { 
11116      if (this.purpose == null)
11117        if (Configuration.errorOnAutoCreate())
11118          throw new Error("Attempt to auto-create TestScript.purpose");
11119        else if (Configuration.doAutoCreate())
11120          this.purpose = new MarkdownType(); // bb
11121      return this.purpose;
11122    }
11123
11124    public boolean hasPurposeElement() { 
11125      return this.purpose != null && !this.purpose.isEmpty();
11126    }
11127
11128    public boolean hasPurpose() { 
11129      return this.purpose != null && !this.purpose.isEmpty();
11130    }
11131
11132    /**
11133     * @param value {@link #purpose} (Explanation of why this test script is needed and why it has been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value
11134     */
11135    public TestScript setPurposeElement(MarkdownType value) { 
11136      this.purpose = value;
11137      return this;
11138    }
11139
11140    /**
11141     * @return Explanation of why this test script is needed and why it has been designed as it has.
11142     */
11143    public String getPurpose() { 
11144      return this.purpose == null ? null : this.purpose.getValue();
11145    }
11146
11147    /**
11148     * @param value Explanation of why this test script is needed and why it has been designed as it has.
11149     */
11150    public TestScript setPurpose(String value) { 
11151      if (value == null)
11152        this.purpose = null;
11153      else {
11154        if (this.purpose == null)
11155          this.purpose = new MarkdownType();
11156        this.purpose.setValue(value);
11157      }
11158      return this;
11159    }
11160
11161    /**
11162     * @return {@link #copyright} (A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
11163     */
11164    public MarkdownType getCopyrightElement() { 
11165      if (this.copyright == null)
11166        if (Configuration.errorOnAutoCreate())
11167          throw new Error("Attempt to auto-create TestScript.copyright");
11168        else if (Configuration.doAutoCreate())
11169          this.copyright = new MarkdownType(); // bb
11170      return this.copyright;
11171    }
11172
11173    public boolean hasCopyrightElement() { 
11174      return this.copyright != null && !this.copyright.isEmpty();
11175    }
11176
11177    public boolean hasCopyright() { 
11178      return this.copyright != null && !this.copyright.isEmpty();
11179    }
11180
11181    /**
11182     * @param value {@link #copyright} (A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
11183     */
11184    public TestScript setCopyrightElement(MarkdownType value) { 
11185      this.copyright = value;
11186      return this;
11187    }
11188
11189    /**
11190     * @return A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.
11191     */
11192    public String getCopyright() { 
11193      return this.copyright == null ? null : this.copyright.getValue();
11194    }
11195
11196    /**
11197     * @param value A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.
11198     */
11199    public TestScript setCopyright(String value) { 
11200      if (value == null)
11201        this.copyright = null;
11202      else {
11203        if (this.copyright == null)
11204          this.copyright = new MarkdownType();
11205        this.copyright.setValue(value);
11206      }
11207      return this;
11208    }
11209
11210    /**
11211     * @return {@link #origin} (An abstract server used in operations within this test script in the origin element.)
11212     */
11213    public List<TestScriptOriginComponent> getOrigin() { 
11214      if (this.origin == null)
11215        this.origin = new ArrayList<TestScriptOriginComponent>();
11216      return this.origin;
11217    }
11218
11219    /**
11220     * @return Returns a reference to <code>this</code> for easy method chaining
11221     */
11222    public TestScript setOrigin(List<TestScriptOriginComponent> theOrigin) { 
11223      this.origin = theOrigin;
11224      return this;
11225    }
11226
11227    public boolean hasOrigin() { 
11228      if (this.origin == null)
11229        return false;
11230      for (TestScriptOriginComponent item : this.origin)
11231        if (!item.isEmpty())
11232          return true;
11233      return false;
11234    }
11235
11236    public TestScriptOriginComponent addOrigin() { //3
11237      TestScriptOriginComponent t = new TestScriptOriginComponent();
11238      if (this.origin == null)
11239        this.origin = new ArrayList<TestScriptOriginComponent>();
11240      this.origin.add(t);
11241      return t;
11242    }
11243
11244    public TestScript addOrigin(TestScriptOriginComponent t) { //3
11245      if (t == null)
11246        return this;
11247      if (this.origin == null)
11248        this.origin = new ArrayList<TestScriptOriginComponent>();
11249      this.origin.add(t);
11250      return this;
11251    }
11252
11253    /**
11254     * @return The first repetition of repeating field {@link #origin}, creating it if it does not already exist
11255     */
11256    public TestScriptOriginComponent getOriginFirstRep() { 
11257      if (getOrigin().isEmpty()) {
11258        addOrigin();
11259      }
11260      return getOrigin().get(0);
11261    }
11262
11263    /**
11264     * @return {@link #destination} (An abstract server used in operations within this test script in the destination element.)
11265     */
11266    public List<TestScriptDestinationComponent> getDestination() { 
11267      if (this.destination == null)
11268        this.destination = new ArrayList<TestScriptDestinationComponent>();
11269      return this.destination;
11270    }
11271
11272    /**
11273     * @return Returns a reference to <code>this</code> for easy method chaining
11274     */
11275    public TestScript setDestination(List<TestScriptDestinationComponent> theDestination) { 
11276      this.destination = theDestination;
11277      return this;
11278    }
11279
11280    public boolean hasDestination() { 
11281      if (this.destination == null)
11282        return false;
11283      for (TestScriptDestinationComponent item : this.destination)
11284        if (!item.isEmpty())
11285          return true;
11286      return false;
11287    }
11288
11289    public TestScriptDestinationComponent addDestination() { //3
11290      TestScriptDestinationComponent t = new TestScriptDestinationComponent();
11291      if (this.destination == null)
11292        this.destination = new ArrayList<TestScriptDestinationComponent>();
11293      this.destination.add(t);
11294      return t;
11295    }
11296
11297    public TestScript addDestination(TestScriptDestinationComponent t) { //3
11298      if (t == null)
11299        return this;
11300      if (this.destination == null)
11301        this.destination = new ArrayList<TestScriptDestinationComponent>();
11302      this.destination.add(t);
11303      return this;
11304    }
11305
11306    /**
11307     * @return The first repetition of repeating field {@link #destination}, creating it if it does not already exist
11308     */
11309    public TestScriptDestinationComponent getDestinationFirstRep() { 
11310      if (getDestination().isEmpty()) {
11311        addDestination();
11312      }
11313      return getDestination().get(0);
11314    }
11315
11316    /**
11317     * @return {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.)
11318     */
11319    public TestScriptMetadataComponent getMetadata() { 
11320      if (this.metadata == null)
11321        if (Configuration.errorOnAutoCreate())
11322          throw new Error("Attempt to auto-create TestScript.metadata");
11323        else if (Configuration.doAutoCreate())
11324          this.metadata = new TestScriptMetadataComponent(); // cc
11325      return this.metadata;
11326    }
11327
11328    public boolean hasMetadata() { 
11329      return this.metadata != null && !this.metadata.isEmpty();
11330    }
11331
11332    /**
11333     * @param value {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.)
11334     */
11335    public TestScript setMetadata(TestScriptMetadataComponent value) { 
11336      this.metadata = value;
11337      return this;
11338    }
11339
11340    /**
11341     * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.)
11342     */
11343    public List<TestScriptFixtureComponent> getFixture() { 
11344      if (this.fixture == null)
11345        this.fixture = new ArrayList<TestScriptFixtureComponent>();
11346      return this.fixture;
11347    }
11348
11349    /**
11350     * @return Returns a reference to <code>this</code> for easy method chaining
11351     */
11352    public TestScript setFixture(List<TestScriptFixtureComponent> theFixture) { 
11353      this.fixture = theFixture;
11354      return this;
11355    }
11356
11357    public boolean hasFixture() { 
11358      if (this.fixture == null)
11359        return false;
11360      for (TestScriptFixtureComponent item : this.fixture)
11361        if (!item.isEmpty())
11362          return true;
11363      return false;
11364    }
11365
11366    public TestScriptFixtureComponent addFixture() { //3
11367      TestScriptFixtureComponent t = new TestScriptFixtureComponent();
11368      if (this.fixture == null)
11369        this.fixture = new ArrayList<TestScriptFixtureComponent>();
11370      this.fixture.add(t);
11371      return t;
11372    }
11373
11374    public TestScript addFixture(TestScriptFixtureComponent t) { //3
11375      if (t == null)
11376        return this;
11377      if (this.fixture == null)
11378        this.fixture = new ArrayList<TestScriptFixtureComponent>();
11379      this.fixture.add(t);
11380      return this;
11381    }
11382
11383    /**
11384     * @return The first repetition of repeating field {@link #fixture}, creating it if it does not already exist
11385     */
11386    public TestScriptFixtureComponent getFixtureFirstRep() { 
11387      if (getFixture().isEmpty()) {
11388        addFixture();
11389      }
11390      return getFixture().get(0);
11391    }
11392
11393    /**
11394     * @return {@link #profile} (Reference to the profile to be used for validation.)
11395     */
11396    public List<Reference> getProfile() { 
11397      if (this.profile == null)
11398        this.profile = new ArrayList<Reference>();
11399      return this.profile;
11400    }
11401
11402    /**
11403     * @return Returns a reference to <code>this</code> for easy method chaining
11404     */
11405    public TestScript setProfile(List<Reference> theProfile) { 
11406      this.profile = theProfile;
11407      return this;
11408    }
11409
11410    public boolean hasProfile() { 
11411      if (this.profile == null)
11412        return false;
11413      for (Reference item : this.profile)
11414        if (!item.isEmpty())
11415          return true;
11416      return false;
11417    }
11418
11419    public Reference addProfile() { //3
11420      Reference t = new Reference();
11421      if (this.profile == null)
11422        this.profile = new ArrayList<Reference>();
11423      this.profile.add(t);
11424      return t;
11425    }
11426
11427    public TestScript addProfile(Reference t) { //3
11428      if (t == null)
11429        return this;
11430      if (this.profile == null)
11431        this.profile = new ArrayList<Reference>();
11432      this.profile.add(t);
11433      return this;
11434    }
11435
11436    /**
11437     * @return The first repetition of repeating field {@link #profile}, creating it if it does not already exist
11438     */
11439    public Reference getProfileFirstRep() { 
11440      if (getProfile().isEmpty()) {
11441        addProfile();
11442      }
11443      return getProfile().get(0);
11444    }
11445
11446    /**
11447     * @deprecated Use Reference#setResource(IBaseResource) instead
11448     */
11449    @Deprecated
11450    public List<Resource> getProfileTarget() { 
11451      if (this.profileTarget == null)
11452        this.profileTarget = new ArrayList<Resource>();
11453      return this.profileTarget;
11454    }
11455
11456    /**
11457     * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.)
11458     */
11459    public List<TestScriptVariableComponent> getVariable() { 
11460      if (this.variable == null)
11461        this.variable = new ArrayList<TestScriptVariableComponent>();
11462      return this.variable;
11463    }
11464
11465    /**
11466     * @return Returns a reference to <code>this</code> for easy method chaining
11467     */
11468    public TestScript setVariable(List<TestScriptVariableComponent> theVariable) { 
11469      this.variable = theVariable;
11470      return this;
11471    }
11472
11473    public boolean hasVariable() { 
11474      if (this.variable == null)
11475        return false;
11476      for (TestScriptVariableComponent item : this.variable)
11477        if (!item.isEmpty())
11478          return true;
11479      return false;
11480    }
11481
11482    public TestScriptVariableComponent addVariable() { //3
11483      TestScriptVariableComponent t = new TestScriptVariableComponent();
11484      if (this.variable == null)
11485        this.variable = new ArrayList<TestScriptVariableComponent>();
11486      this.variable.add(t);
11487      return t;
11488    }
11489
11490    public TestScript addVariable(TestScriptVariableComponent t) { //3
11491      if (t == null)
11492        return this;
11493      if (this.variable == null)
11494        this.variable = new ArrayList<TestScriptVariableComponent>();
11495      this.variable.add(t);
11496      return this;
11497    }
11498
11499    /**
11500     * @return The first repetition of repeating field {@link #variable}, creating it if it does not already exist
11501     */
11502    public TestScriptVariableComponent getVariableFirstRep() { 
11503      if (getVariable().isEmpty()) {
11504        addVariable();
11505      }
11506      return getVariable().get(0);
11507    }
11508
11509    /**
11510     * @return {@link #rule} (Assert rule to be used in one or more asserts within the test script.)
11511     */
11512    public List<TestScriptRuleComponent> getRule() { 
11513      if (this.rule == null)
11514        this.rule = new ArrayList<TestScriptRuleComponent>();
11515      return this.rule;
11516    }
11517
11518    /**
11519     * @return Returns a reference to <code>this</code> for easy method chaining
11520     */
11521    public TestScript setRule(List<TestScriptRuleComponent> theRule) { 
11522      this.rule = theRule;
11523      return this;
11524    }
11525
11526    public boolean hasRule() { 
11527      if (this.rule == null)
11528        return false;
11529      for (TestScriptRuleComponent item : this.rule)
11530        if (!item.isEmpty())
11531          return true;
11532      return false;
11533    }
11534
11535    public TestScriptRuleComponent addRule() { //3
11536      TestScriptRuleComponent t = new TestScriptRuleComponent();
11537      if (this.rule == null)
11538        this.rule = new ArrayList<TestScriptRuleComponent>();
11539      this.rule.add(t);
11540      return t;
11541    }
11542
11543    public TestScript addRule(TestScriptRuleComponent t) { //3
11544      if (t == null)
11545        return this;
11546      if (this.rule == null)
11547        this.rule = new ArrayList<TestScriptRuleComponent>();
11548      this.rule.add(t);
11549      return this;
11550    }
11551
11552    /**
11553     * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
11554     */
11555    public TestScriptRuleComponent getRuleFirstRep() { 
11556      if (getRule().isEmpty()) {
11557        addRule();
11558      }
11559      return getRule().get(0);
11560    }
11561
11562    /**
11563     * @return {@link #ruleset} (Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied.)
11564     */
11565    public List<TestScriptRulesetComponent> getRuleset() { 
11566      if (this.ruleset == null)
11567        this.ruleset = new ArrayList<TestScriptRulesetComponent>();
11568      return this.ruleset;
11569    }
11570
11571    /**
11572     * @return Returns a reference to <code>this</code> for easy method chaining
11573     */
11574    public TestScript setRuleset(List<TestScriptRulesetComponent> theRuleset) { 
11575      this.ruleset = theRuleset;
11576      return this;
11577    }
11578
11579    public boolean hasRuleset() { 
11580      if (this.ruleset == null)
11581        return false;
11582      for (TestScriptRulesetComponent item : this.ruleset)
11583        if (!item.isEmpty())
11584          return true;
11585      return false;
11586    }
11587
11588    public TestScriptRulesetComponent addRuleset() { //3
11589      TestScriptRulesetComponent t = new TestScriptRulesetComponent();
11590      if (this.ruleset == null)
11591        this.ruleset = new ArrayList<TestScriptRulesetComponent>();
11592      this.ruleset.add(t);
11593      return t;
11594    }
11595
11596    public TestScript addRuleset(TestScriptRulesetComponent t) { //3
11597      if (t == null)
11598        return this;
11599      if (this.ruleset == null)
11600        this.ruleset = new ArrayList<TestScriptRulesetComponent>();
11601      this.ruleset.add(t);
11602      return this;
11603    }
11604
11605    /**
11606     * @return The first repetition of repeating field {@link #ruleset}, creating it if it does not already exist
11607     */
11608    public TestScriptRulesetComponent getRulesetFirstRep() { 
11609      if (getRuleset().isEmpty()) {
11610        addRuleset();
11611      }
11612      return getRuleset().get(0);
11613    }
11614
11615    /**
11616     * @return {@link #setup} (A series of required setup operations before tests are executed.)
11617     */
11618    public TestScriptSetupComponent getSetup() { 
11619      if (this.setup == null)
11620        if (Configuration.errorOnAutoCreate())
11621          throw new Error("Attempt to auto-create TestScript.setup");
11622        else if (Configuration.doAutoCreate())
11623          this.setup = new TestScriptSetupComponent(); // cc
11624      return this.setup;
11625    }
11626
11627    public boolean hasSetup() { 
11628      return this.setup != null && !this.setup.isEmpty();
11629    }
11630
11631    /**
11632     * @param value {@link #setup} (A series of required setup operations before tests are executed.)
11633     */
11634    public TestScript setSetup(TestScriptSetupComponent value) { 
11635      this.setup = value;
11636      return this;
11637    }
11638
11639    /**
11640     * @return {@link #test} (A test in this script.)
11641     */
11642    public List<TestScriptTestComponent> getTest() { 
11643      if (this.test == null)
11644        this.test = new ArrayList<TestScriptTestComponent>();
11645      return this.test;
11646    }
11647
11648    /**
11649     * @return Returns a reference to <code>this</code> for easy method chaining
11650     */
11651    public TestScript setTest(List<TestScriptTestComponent> theTest) { 
11652      this.test = theTest;
11653      return this;
11654    }
11655
11656    public boolean hasTest() { 
11657      if (this.test == null)
11658        return false;
11659      for (TestScriptTestComponent item : this.test)
11660        if (!item.isEmpty())
11661          return true;
11662      return false;
11663    }
11664
11665    public TestScriptTestComponent addTest() { //3
11666      TestScriptTestComponent t = new TestScriptTestComponent();
11667      if (this.test == null)
11668        this.test = new ArrayList<TestScriptTestComponent>();
11669      this.test.add(t);
11670      return t;
11671    }
11672
11673    public TestScript addTest(TestScriptTestComponent t) { //3
11674      if (t == null)
11675        return this;
11676      if (this.test == null)
11677        this.test = new ArrayList<TestScriptTestComponent>();
11678      this.test.add(t);
11679      return this;
11680    }
11681
11682    /**
11683     * @return The first repetition of repeating field {@link #test}, creating it if it does not already exist
11684     */
11685    public TestScriptTestComponent getTestFirstRep() { 
11686      if (getTest().isEmpty()) {
11687        addTest();
11688      }
11689      return getTest().get(0);
11690    }
11691
11692    /**
11693     * @return {@link #teardown} (A series of operations required to clean up after all the tests are executed (successfully or otherwise).)
11694     */
11695    public TestScriptTeardownComponent getTeardown() { 
11696      if (this.teardown == null)
11697        if (Configuration.errorOnAutoCreate())
11698          throw new Error("Attempt to auto-create TestScript.teardown");
11699        else if (Configuration.doAutoCreate())
11700          this.teardown = new TestScriptTeardownComponent(); // cc
11701      return this.teardown;
11702    }
11703
11704    public boolean hasTeardown() { 
11705      return this.teardown != null && !this.teardown.isEmpty();
11706    }
11707
11708    /**
11709     * @param value {@link #teardown} (A series of operations required to clean up after all the tests are executed (successfully or otherwise).)
11710     */
11711    public TestScript setTeardown(TestScriptTeardownComponent value) { 
11712      this.teardown = value;
11713      return this;
11714    }
11715
11716      protected void listChildren(List<Property> children) {
11717        super.listChildren(children);
11718        children.add(new Property("url", "uri", "An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.", 0, 1, url));
11719        children.add(new Property("identifier", "Identifier", "A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, 1, identifier));
11720        children.add(new Property("version", "string", "The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version));
11721        children.add(new Property("name", "string", "A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name));
11722        children.add(new Property("title", "string", "A short, descriptive, user-friendly title for the test script.", 0, 1, title));
11723        children.add(new Property("status", "code", "The status of this test script. Enables tracking the life-cycle of the content.", 0, 1, status));
11724        children.add(new Property("experimental", "boolean", "A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental));
11725        children.add(new Property("date", "dateTime", "The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.", 0, 1, date));
11726        children.add(new Property("publisher", "string", "The name of the organization or individual that published the test script.", 0, 1, publisher));
11727        children.add(new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
11728        children.add(new Property("description", "markdown", "A free text natural language description of the test script from a consumer's perspective.", 0, 1, description));
11729        children.add(new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate test script instances.", 0, java.lang.Integer.MAX_VALUE, useContext));
11730        children.add(new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the test script is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction));
11731        children.add(new Property("purpose", "markdown", "Explanation of why this test script is needed and why it has been designed as it has.", 0, 1, purpose));
11732        children.add(new Property("copyright", "markdown", "A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.", 0, 1, copyright));
11733        children.add(new Property("origin", "", "An abstract server used in operations within this test script in the origin element.", 0, java.lang.Integer.MAX_VALUE, origin));
11734        children.add(new Property("destination", "", "An abstract server used in operations within this test script in the destination element.", 0, java.lang.Integer.MAX_VALUE, destination));
11735        children.add(new Property("metadata", "", "The required capability must exist and are assumed to function correctly on the FHIR server being tested.", 0, 1, metadata));
11736        children.add(new Property("fixture", "", "Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture));
11737        children.add(new Property("profile", "Reference(Any)", "Reference to the profile to be used for validation.", 0, java.lang.Integer.MAX_VALUE, profile));
11738        children.add(new Property("variable", "", "Variable is set based either on element value in response body or on header field value in the response headers.", 0, java.lang.Integer.MAX_VALUE, variable));
11739        children.add(new Property("rule", "", "Assert rule to be used in one or more asserts within the test script.", 0, java.lang.Integer.MAX_VALUE, rule));
11740        children.add(new Property("ruleset", "", "Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied.", 0, java.lang.Integer.MAX_VALUE, ruleset));
11741        children.add(new Property("setup", "", "A series of required setup operations before tests are executed.", 0, 1, setup));
11742        children.add(new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test));
11743        children.add(new Property("teardown", "", "A series of operations required to clean up after all the tests are executed (successfully or otherwise).", 0, 1, teardown));
11744      }
11745
11746      @Override
11747      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
11748        switch (_hash) {
11749        case 116079: /*url*/  return new Property("url", "uri", "An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which this test script is (or will be) published.", 0, 1, url);
11750        case -1618432855: /*identifier*/  return new Property("identifier", "Identifier", "A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, 1, identifier);
11751        case 351608024: /*version*/  return new Property("version", "string", "The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.", 0, 1, version);
11752        case 3373707: /*name*/  return new Property("name", "string", "A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, 1, name);
11753        case 110371416: /*title*/  return new Property("title", "string", "A short, descriptive, user-friendly title for the test script.", 0, 1, title);
11754        case -892481550: /*status*/  return new Property("status", "code", "The status of this test script. Enables tracking the life-cycle of the content.", 0, 1, status);
11755        case -404562712: /*experimental*/  return new Property("experimental", "boolean", "A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.", 0, 1, experimental);
11756        case 3076014: /*date*/  return new Property("date", "dateTime", "The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.", 0, 1, date);
11757        case 1447404028: /*publisher*/  return new Property("publisher", "string", "The name of the organization or individual that published the test script.", 0, 1, publisher);
11758        case 951526432: /*contact*/  return new Property("contact", "ContactDetail", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact);
11759        case -1724546052: /*description*/  return new Property("description", "markdown", "A free text natural language description of the test script from a consumer's perspective.", 0, 1, description);
11760        case -669707736: /*useContext*/  return new Property("useContext", "UsageContext", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching for appropriate test script instances.", 0, java.lang.Integer.MAX_VALUE, useContext);
11761        case -507075711: /*jurisdiction*/  return new Property("jurisdiction", "CodeableConcept", "A legal or geographic region in which the test script is intended to be used.", 0, java.lang.Integer.MAX_VALUE, jurisdiction);
11762        case -220463842: /*purpose*/  return new Property("purpose", "markdown", "Explanation of why this test script is needed and why it has been designed as it has.", 0, 1, purpose);
11763        case 1522889671: /*copyright*/  return new Property("copyright", "markdown", "A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.", 0, 1, copyright);
11764        case -1008619738: /*origin*/  return new Property("origin", "", "An abstract server used in operations within this test script in the origin element.", 0, java.lang.Integer.MAX_VALUE, origin);
11765        case -1429847026: /*destination*/  return new Property("destination", "", "An abstract server used in operations within this test script in the destination element.", 0, java.lang.Integer.MAX_VALUE, destination);
11766        case -450004177: /*metadata*/  return new Property("metadata", "", "The required capability must exist and are assumed to function correctly on the FHIR server being tested.", 0, 1, metadata);
11767        case -843449847: /*fixture*/  return new Property("fixture", "", "Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture);
11768        case -309425751: /*profile*/  return new Property("profile", "Reference(Any)", "Reference to the profile to be used for validation.", 0, java.lang.Integer.MAX_VALUE, profile);
11769        case -1249586564: /*variable*/  return new Property("variable", "", "Variable is set based either on element value in response body or on header field value in the response headers.", 0, java.lang.Integer.MAX_VALUE, variable);
11770        case 3512060: /*rule*/  return new Property("rule", "", "Assert rule to be used in one or more asserts within the test script.", 0, java.lang.Integer.MAX_VALUE, rule);
11771        case 1548678118: /*ruleset*/  return new Property("ruleset", "", "Contains one or more rules.  Offers a way to group rules so assertions could reference the group of rules and have them all applied.", 0, java.lang.Integer.MAX_VALUE, ruleset);
11772        case 109329021: /*setup*/  return new Property("setup", "", "A series of required setup operations before tests are executed.", 0, 1, setup);
11773        case 3556498: /*test*/  return new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test);
11774        case -1663474172: /*teardown*/  return new Property("teardown", "", "A series of operations required to clean up after all the tests are executed (successfully or otherwise).", 0, 1, teardown);
11775        default: return super.getNamedProperty(_hash, _name, _checkValid);
11776        }
11777
11778      }
11779
11780      @Override
11781      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
11782        switch (hash) {
11783        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
11784        case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
11785        case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType
11786        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
11787        case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType
11788        case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration<PublicationStatus>
11789        case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType
11790        case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType
11791        case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType
11792        case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactDetail
11793        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // MarkdownType
11794        case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // UsageContext
11795        case -507075711: /*jurisdiction*/ return this.jurisdiction == null ? new Base[0] : this.jurisdiction.toArray(new Base[this.jurisdiction.size()]); // CodeableConcept
11796        case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // MarkdownType
11797        case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // MarkdownType
11798        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // TestScriptOriginComponent
11799        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // TestScriptDestinationComponent
11800        case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent
11801        case -843449847: /*fixture*/ return this.fixture == null ? new Base[0] : this.fixture.toArray(new Base[this.fixture.size()]); // TestScriptFixtureComponent
11802        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference
11803        case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // TestScriptVariableComponent
11804        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // TestScriptRuleComponent
11805        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : this.ruleset.toArray(new Base[this.ruleset.size()]); // TestScriptRulesetComponent
11806        case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestScriptSetupComponent
11807        case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestScriptTestComponent
11808        case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestScriptTeardownComponent
11809        default: return super.getProperty(hash, name, checkValid);
11810        }
11811
11812      }
11813
11814      @Override
11815      public Base setProperty(int hash, String name, Base value) throws FHIRException {
11816        switch (hash) {
11817        case 116079: // url
11818          this.url = castToUri(value); // UriType
11819          return value;
11820        case -1618432855: // identifier
11821          this.identifier = castToIdentifier(value); // Identifier
11822          return value;
11823        case 351608024: // version
11824          this.version = castToString(value); // StringType
11825          return value;
11826        case 3373707: // name
11827          this.name = castToString(value); // StringType
11828          return value;
11829        case 110371416: // title
11830          this.title = castToString(value); // StringType
11831          return value;
11832        case -892481550: // status
11833          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
11834          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
11835          return value;
11836        case -404562712: // experimental
11837          this.experimental = castToBoolean(value); // BooleanType
11838          return value;
11839        case 3076014: // date
11840          this.date = castToDateTime(value); // DateTimeType
11841          return value;
11842        case 1447404028: // publisher
11843          this.publisher = castToString(value); // StringType
11844          return value;
11845        case 951526432: // contact
11846          this.getContact().add(castToContactDetail(value)); // ContactDetail
11847          return value;
11848        case -1724546052: // description
11849          this.description = castToMarkdown(value); // MarkdownType
11850          return value;
11851        case -669707736: // useContext
11852          this.getUseContext().add(castToUsageContext(value)); // UsageContext
11853          return value;
11854        case -507075711: // jurisdiction
11855          this.getJurisdiction().add(castToCodeableConcept(value)); // CodeableConcept
11856          return value;
11857        case -220463842: // purpose
11858          this.purpose = castToMarkdown(value); // MarkdownType
11859          return value;
11860        case 1522889671: // copyright
11861          this.copyright = castToMarkdown(value); // MarkdownType
11862          return value;
11863        case -1008619738: // origin
11864          this.getOrigin().add((TestScriptOriginComponent) value); // TestScriptOriginComponent
11865          return value;
11866        case -1429847026: // destination
11867          this.getDestination().add((TestScriptDestinationComponent) value); // TestScriptDestinationComponent
11868          return value;
11869        case -450004177: // metadata
11870          this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent
11871          return value;
11872        case -843449847: // fixture
11873          this.getFixture().add((TestScriptFixtureComponent) value); // TestScriptFixtureComponent
11874          return value;
11875        case -309425751: // profile
11876          this.getProfile().add(castToReference(value)); // Reference
11877          return value;
11878        case -1249586564: // variable
11879          this.getVariable().add((TestScriptVariableComponent) value); // TestScriptVariableComponent
11880          return value;
11881        case 3512060: // rule
11882          this.getRule().add((TestScriptRuleComponent) value); // TestScriptRuleComponent
11883          return value;
11884        case 1548678118: // ruleset
11885          this.getRuleset().add((TestScriptRulesetComponent) value); // TestScriptRulesetComponent
11886          return value;
11887        case 109329021: // setup
11888          this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent
11889          return value;
11890        case 3556498: // test
11891          this.getTest().add((TestScriptTestComponent) value); // TestScriptTestComponent
11892          return value;
11893        case -1663474172: // teardown
11894          this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent
11895          return value;
11896        default: return super.setProperty(hash, name, value);
11897        }
11898
11899      }
11900
11901      @Override
11902      public Base setProperty(String name, Base value) throws FHIRException {
11903        if (name.equals("url")) {
11904          this.url = castToUri(value); // UriType
11905        } else if (name.equals("identifier")) {
11906          this.identifier = castToIdentifier(value); // Identifier
11907        } else if (name.equals("version")) {
11908          this.version = castToString(value); // StringType
11909        } else if (name.equals("name")) {
11910          this.name = castToString(value); // StringType
11911        } else if (name.equals("title")) {
11912          this.title = castToString(value); // StringType
11913        } else if (name.equals("status")) {
11914          value = new PublicationStatusEnumFactory().fromType(castToCode(value));
11915          this.status = (Enumeration) value; // Enumeration<PublicationStatus>
11916        } else if (name.equals("experimental")) {
11917          this.experimental = castToBoolean(value); // BooleanType
11918        } else if (name.equals("date")) {
11919          this.date = castToDateTime(value); // DateTimeType
11920        } else if (name.equals("publisher")) {
11921          this.publisher = castToString(value); // StringType
11922        } else if (name.equals("contact")) {
11923          this.getContact().add(castToContactDetail(value));
11924        } else if (name.equals("description")) {
11925          this.description = castToMarkdown(value); // MarkdownType
11926        } else if (name.equals("useContext")) {
11927          this.getUseContext().add(castToUsageContext(value));
11928        } else if (name.equals("jurisdiction")) {
11929          this.getJurisdiction().add(castToCodeableConcept(value));
11930        } else if (name.equals("purpose")) {
11931          this.purpose = castToMarkdown(value); // MarkdownType
11932        } else if (name.equals("copyright")) {
11933          this.copyright = castToMarkdown(value); // MarkdownType
11934        } else if (name.equals("origin")) {
11935          this.getOrigin().add((TestScriptOriginComponent) value);
11936        } else if (name.equals("destination")) {
11937          this.getDestination().add((TestScriptDestinationComponent) value);
11938        } else if (name.equals("metadata")) {
11939          this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent
11940        } else if (name.equals("fixture")) {
11941          this.getFixture().add((TestScriptFixtureComponent) value);
11942        } else if (name.equals("profile")) {
11943          this.getProfile().add(castToReference(value));
11944        } else if (name.equals("variable")) {
11945          this.getVariable().add((TestScriptVariableComponent) value);
11946        } else if (name.equals("rule")) {
11947          this.getRule().add((TestScriptRuleComponent) value);
11948        } else if (name.equals("ruleset")) {
11949          this.getRuleset().add((TestScriptRulesetComponent) value);
11950        } else if (name.equals("setup")) {
11951          this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent
11952        } else if (name.equals("test")) {
11953          this.getTest().add((TestScriptTestComponent) value);
11954        } else if (name.equals("teardown")) {
11955          this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent
11956        } else
11957          return super.setProperty(name, value);
11958        return value;
11959      }
11960
11961      @Override
11962      public Base makeProperty(int hash, String name) throws FHIRException {
11963        switch (hash) {
11964        case 116079:  return getUrlElement();
11965        case -1618432855:  return getIdentifier(); 
11966        case 351608024:  return getVersionElement();
11967        case 3373707:  return getNameElement();
11968        case 110371416:  return getTitleElement();
11969        case -892481550:  return getStatusElement();
11970        case -404562712:  return getExperimentalElement();
11971        case 3076014:  return getDateElement();
11972        case 1447404028:  return getPublisherElement();
11973        case 951526432:  return addContact(); 
11974        case -1724546052:  return getDescriptionElement();
11975        case -669707736:  return addUseContext(); 
11976        case -507075711:  return addJurisdiction(); 
11977        case -220463842:  return getPurposeElement();
11978        case 1522889671:  return getCopyrightElement();
11979        case -1008619738:  return addOrigin(); 
11980        case -1429847026:  return addDestination(); 
11981        case -450004177:  return getMetadata(); 
11982        case -843449847:  return addFixture(); 
11983        case -309425751:  return addProfile(); 
11984        case -1249586564:  return addVariable(); 
11985        case 3512060:  return addRule(); 
11986        case 1548678118:  return addRuleset(); 
11987        case 109329021:  return getSetup(); 
11988        case 3556498:  return addTest(); 
11989        case -1663474172:  return getTeardown(); 
11990        default: return super.makeProperty(hash, name);
11991        }
11992
11993      }
11994
11995      @Override
11996      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
11997        switch (hash) {
11998        case 116079: /*url*/ return new String[] {"uri"};
11999        case -1618432855: /*identifier*/ return new String[] {"Identifier"};
12000        case 351608024: /*version*/ return new String[] {"string"};
12001        case 3373707: /*name*/ return new String[] {"string"};
12002        case 110371416: /*title*/ return new String[] {"string"};
12003        case -892481550: /*status*/ return new String[] {"code"};
12004        case -404562712: /*experimental*/ return new String[] {"boolean"};
12005        case 3076014: /*date*/ return new String[] {"dateTime"};
12006        case 1447404028: /*publisher*/ return new String[] {"string"};
12007        case 951526432: /*contact*/ return new String[] {"ContactDetail"};
12008        case -1724546052: /*description*/ return new String[] {"markdown"};
12009        case -669707736: /*useContext*/ return new String[] {"UsageContext"};
12010        case -507075711: /*jurisdiction*/ return new String[] {"CodeableConcept"};
12011        case -220463842: /*purpose*/ return new String[] {"markdown"};
12012        case 1522889671: /*copyright*/ return new String[] {"markdown"};
12013        case -1008619738: /*origin*/ return new String[] {};
12014        case -1429847026: /*destination*/ return new String[] {};
12015        case -450004177: /*metadata*/ return new String[] {};
12016        case -843449847: /*fixture*/ return new String[] {};
12017        case -309425751: /*profile*/ return new String[] {"Reference"};
12018        case -1249586564: /*variable*/ return new String[] {};
12019        case 3512060: /*rule*/ return new String[] {};
12020        case 1548678118: /*ruleset*/ return new String[] {};
12021        case 109329021: /*setup*/ return new String[] {};
12022        case 3556498: /*test*/ return new String[] {};
12023        case -1663474172: /*teardown*/ return new String[] {};
12024        default: return super.getTypesForProperty(hash, name);
12025        }
12026
12027      }
12028
12029      @Override
12030      public Base addChild(String name) throws FHIRException {
12031        if (name.equals("url")) {
12032          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
12033        }
12034        else if (name.equals("identifier")) {
12035          this.identifier = new Identifier();
12036          return this.identifier;
12037        }
12038        else if (name.equals("version")) {
12039          throw new FHIRException("Cannot call addChild on a primitive type TestScript.version");
12040        }
12041        else if (name.equals("name")) {
12042          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
12043        }
12044        else if (name.equals("title")) {
12045          throw new FHIRException("Cannot call addChild on a primitive type TestScript.title");
12046        }
12047        else if (name.equals("status")) {
12048          throw new FHIRException("Cannot call addChild on a primitive type TestScript.status");
12049        }
12050        else if (name.equals("experimental")) {
12051          throw new FHIRException("Cannot call addChild on a primitive type TestScript.experimental");
12052        }
12053        else if (name.equals("date")) {
12054          throw new FHIRException("Cannot call addChild on a primitive type TestScript.date");
12055        }
12056        else if (name.equals("publisher")) {
12057          throw new FHIRException("Cannot call addChild on a primitive type TestScript.publisher");
12058        }
12059        else if (name.equals("contact")) {
12060          return addContact();
12061        }
12062        else if (name.equals("description")) {
12063          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
12064        }
12065        else if (name.equals("useContext")) {
12066          return addUseContext();
12067        }
12068        else if (name.equals("jurisdiction")) {
12069          return addJurisdiction();
12070        }
12071        else if (name.equals("purpose")) {
12072          throw new FHIRException("Cannot call addChild on a primitive type TestScript.purpose");
12073        }
12074        else if (name.equals("copyright")) {
12075          throw new FHIRException("Cannot call addChild on a primitive type TestScript.copyright");
12076        }
12077        else if (name.equals("origin")) {
12078          return addOrigin();
12079        }
12080        else if (name.equals("destination")) {
12081          return addDestination();
12082        }
12083        else if (name.equals("metadata")) {
12084          this.metadata = new TestScriptMetadataComponent();
12085          return this.metadata;
12086        }
12087        else if (name.equals("fixture")) {
12088          return addFixture();
12089        }
12090        else if (name.equals("profile")) {
12091          return addProfile();
12092        }
12093        else if (name.equals("variable")) {
12094          return addVariable();
12095        }
12096        else if (name.equals("rule")) {
12097          return addRule();
12098        }
12099        else if (name.equals("ruleset")) {
12100          return addRuleset();
12101        }
12102        else if (name.equals("setup")) {
12103          this.setup = new TestScriptSetupComponent();
12104          return this.setup;
12105        }
12106        else if (name.equals("test")) {
12107          return addTest();
12108        }
12109        else if (name.equals("teardown")) {
12110          this.teardown = new TestScriptTeardownComponent();
12111          return this.teardown;
12112        }
12113        else
12114          return super.addChild(name);
12115      }
12116
12117  public String fhirType() {
12118    return "TestScript";
12119
12120  }
12121
12122      public TestScript copy() {
12123        TestScript dst = new TestScript();
12124        copyValues(dst);
12125        dst.url = url == null ? null : url.copy();
12126        dst.identifier = identifier == null ? null : identifier.copy();
12127        dst.version = version == null ? null : version.copy();
12128        dst.name = name == null ? null : name.copy();
12129        dst.title = title == null ? null : title.copy();
12130        dst.status = status == null ? null : status.copy();
12131        dst.experimental = experimental == null ? null : experimental.copy();
12132        dst.date = date == null ? null : date.copy();
12133        dst.publisher = publisher == null ? null : publisher.copy();
12134        if (contact != null) {
12135          dst.contact = new ArrayList<ContactDetail>();
12136          for (ContactDetail i : contact)
12137            dst.contact.add(i.copy());
12138        };
12139        dst.description = description == null ? null : description.copy();
12140        if (useContext != null) {
12141          dst.useContext = new ArrayList<UsageContext>();
12142          for (UsageContext i : useContext)
12143            dst.useContext.add(i.copy());
12144        };
12145        if (jurisdiction != null) {
12146          dst.jurisdiction = new ArrayList<CodeableConcept>();
12147          for (CodeableConcept i : jurisdiction)
12148            dst.jurisdiction.add(i.copy());
12149        };
12150        dst.purpose = purpose == null ? null : purpose.copy();
12151        dst.copyright = copyright == null ? null : copyright.copy();
12152        if (origin != null) {
12153          dst.origin = new ArrayList<TestScriptOriginComponent>();
12154          for (TestScriptOriginComponent i : origin)
12155            dst.origin.add(i.copy());
12156        };
12157        if (destination != null) {
12158          dst.destination = new ArrayList<TestScriptDestinationComponent>();
12159          for (TestScriptDestinationComponent i : destination)
12160            dst.destination.add(i.copy());
12161        };
12162        dst.metadata = metadata == null ? null : metadata.copy();
12163        if (fixture != null) {
12164          dst.fixture = new ArrayList<TestScriptFixtureComponent>();
12165          for (TestScriptFixtureComponent i : fixture)
12166            dst.fixture.add(i.copy());
12167        };
12168        if (profile != null) {
12169          dst.profile = new ArrayList<Reference>();
12170          for (Reference i : profile)
12171            dst.profile.add(i.copy());
12172        };
12173        if (variable != null) {
12174          dst.variable = new ArrayList<TestScriptVariableComponent>();
12175          for (TestScriptVariableComponent i : variable)
12176            dst.variable.add(i.copy());
12177        };
12178        if (rule != null) {
12179          dst.rule = new ArrayList<TestScriptRuleComponent>();
12180          for (TestScriptRuleComponent i : rule)
12181            dst.rule.add(i.copy());
12182        };
12183        if (ruleset != null) {
12184          dst.ruleset = new ArrayList<TestScriptRulesetComponent>();
12185          for (TestScriptRulesetComponent i : ruleset)
12186            dst.ruleset.add(i.copy());
12187        };
12188        dst.setup = setup == null ? null : setup.copy();
12189        if (test != null) {
12190          dst.test = new ArrayList<TestScriptTestComponent>();
12191          for (TestScriptTestComponent i : test)
12192            dst.test.add(i.copy());
12193        };
12194        dst.teardown = teardown == null ? null : teardown.copy();
12195        return dst;
12196      }
12197
12198      protected TestScript typedCopy() {
12199        return copy();
12200      }
12201
12202      @Override
12203      public boolean equalsDeep(Base other_) {
12204        if (!super.equalsDeep(other_))
12205          return false;
12206        if (!(other_ instanceof TestScript))
12207          return false;
12208        TestScript o = (TestScript) other_;
12209        return compareDeep(identifier, o.identifier, true) && compareDeep(purpose, o.purpose, true) && compareDeep(copyright, o.copyright, true)
12210           && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(metadata, o.metadata, true)
12211           && compareDeep(fixture, o.fixture, true) && compareDeep(profile, o.profile, true) && compareDeep(variable, o.variable, true)
12212           && compareDeep(rule, o.rule, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(setup, o.setup, true)
12213           && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true);
12214      }
12215
12216      @Override
12217      public boolean equalsShallow(Base other_) {
12218        if (!super.equalsShallow(other_))
12219          return false;
12220        if (!(other_ instanceof TestScript))
12221          return false;
12222        TestScript o = (TestScript) other_;
12223        return compareValues(purpose, o.purpose, true) && compareValues(copyright, o.copyright, true);
12224      }
12225
12226      public boolean isEmpty() {
12227        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(identifier, purpose, copyright
12228          , origin, destination, metadata, fixture, profile, variable, rule, ruleset, setup
12229          , test, teardown);
12230      }
12231
12232  @Override
12233  public ResourceType getResourceType() {
12234    return ResourceType.TestScript;
12235   }
12236
12237 /**
12238   * Search parameter: <b>date</b>
12239   * <p>
12240   * Description: <b>The test script publication date</b><br>
12241   * Type: <b>date</b><br>
12242   * Path: <b>TestScript.date</b><br>
12243   * </p>
12244   */
12245  @SearchParamDefinition(name="date", path="TestScript.date", description="The test script publication date", type="date" )
12246  public static final String SP_DATE = "date";
12247 /**
12248   * <b>Fluent Client</b> search parameter constant for <b>date</b>
12249   * <p>
12250   * Description: <b>The test script publication date</b><br>
12251   * Type: <b>date</b><br>
12252   * Path: <b>TestScript.date</b><br>
12253   * </p>
12254   */
12255  public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE);
12256
12257 /**
12258   * Search parameter: <b>identifier</b>
12259   * <p>
12260   * Description: <b>External identifier for the test script</b><br>
12261   * Type: <b>token</b><br>
12262   * Path: <b>TestScript.identifier</b><br>
12263   * </p>
12264   */
12265  @SearchParamDefinition(name="identifier", path="TestScript.identifier", description="External identifier for the test script", type="token" )
12266  public static final String SP_IDENTIFIER = "identifier";
12267 /**
12268   * <b>Fluent Client</b> search parameter constant for <b>identifier</b>
12269   * <p>
12270   * Description: <b>External identifier for the test script</b><br>
12271   * Type: <b>token</b><br>
12272   * Path: <b>TestScript.identifier</b><br>
12273   * </p>
12274   */
12275  public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER);
12276
12277 /**
12278   * Search parameter: <b>jurisdiction</b>
12279   * <p>
12280   * Description: <b>Intended jurisdiction for the test script</b><br>
12281   * Type: <b>token</b><br>
12282   * Path: <b>TestScript.jurisdiction</b><br>
12283   * </p>
12284   */
12285  @SearchParamDefinition(name="jurisdiction", path="TestScript.jurisdiction", description="Intended jurisdiction for the test script", type="token" )
12286  public static final String SP_JURISDICTION = "jurisdiction";
12287 /**
12288   * <b>Fluent Client</b> search parameter constant for <b>jurisdiction</b>
12289   * <p>
12290   * Description: <b>Intended jurisdiction for the test script</b><br>
12291   * Type: <b>token</b><br>
12292   * Path: <b>TestScript.jurisdiction</b><br>
12293   * </p>
12294   */
12295  public static final ca.uhn.fhir.rest.gclient.TokenClientParam JURISDICTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_JURISDICTION);
12296
12297 /**
12298   * Search parameter: <b>name</b>
12299   * <p>
12300   * Description: <b>Computationally friendly name of the test script</b><br>
12301   * Type: <b>string</b><br>
12302   * Path: <b>TestScript.name</b><br>
12303   * </p>
12304   */
12305  @SearchParamDefinition(name="name", path="TestScript.name", description="Computationally friendly name of the test script", type="string" )
12306  public static final String SP_NAME = "name";
12307 /**
12308   * <b>Fluent Client</b> search parameter constant for <b>name</b>
12309   * <p>
12310   * Description: <b>Computationally friendly name of the test script</b><br>
12311   * Type: <b>string</b><br>
12312   * Path: <b>TestScript.name</b><br>
12313   * </p>
12314   */
12315  public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME);
12316
12317 /**
12318   * Search parameter: <b>description</b>
12319   * <p>
12320   * Description: <b>The description of the test script</b><br>
12321   * Type: <b>string</b><br>
12322   * Path: <b>TestScript.description</b><br>
12323   * </p>
12324   */
12325  @SearchParamDefinition(name="description", path="TestScript.description", description="The description of the test script", type="string" )
12326  public static final String SP_DESCRIPTION = "description";
12327 /**
12328   * <b>Fluent Client</b> search parameter constant for <b>description</b>
12329   * <p>
12330   * Description: <b>The description of the test script</b><br>
12331   * Type: <b>string</b><br>
12332   * Path: <b>TestScript.description</b><br>
12333   * </p>
12334   */
12335  public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION);
12336
12337 /**
12338   * Search parameter: <b>publisher</b>
12339   * <p>
12340   * Description: <b>Name of the publisher of the test script</b><br>
12341   * Type: <b>string</b><br>
12342   * Path: <b>TestScript.publisher</b><br>
12343   * </p>
12344   */
12345  @SearchParamDefinition(name="publisher", path="TestScript.publisher", description="Name of the publisher of the test script", type="string" )
12346  public static final String SP_PUBLISHER = "publisher";
12347 /**
12348   * <b>Fluent Client</b> search parameter constant for <b>publisher</b>
12349   * <p>
12350   * Description: <b>Name of the publisher of the test script</b><br>
12351   * Type: <b>string</b><br>
12352   * Path: <b>TestScript.publisher</b><br>
12353   * </p>
12354   */
12355  public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER);
12356
12357 /**
12358   * Search parameter: <b>testscript-capability</b>
12359   * <p>
12360   * Description: <b>TestScript required and validated capability</b><br>
12361   * Type: <b>string</b><br>
12362   * Path: <b>TestScript.metadata.capability.description</b><br>
12363   * </p>
12364   */
12365  @SearchParamDefinition(name="testscript-capability", path="TestScript.metadata.capability.description", description="TestScript required and validated capability", type="string" )
12366  public static final String SP_TESTSCRIPT_CAPABILITY = "testscript-capability";
12367 /**
12368   * <b>Fluent Client</b> search parameter constant for <b>testscript-capability</b>
12369   * <p>
12370   * Description: <b>TestScript required and validated capability</b><br>
12371   * Type: <b>string</b><br>
12372   * Path: <b>TestScript.metadata.capability.description</b><br>
12373   * </p>
12374   */
12375  public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_CAPABILITY);
12376
12377 /**
12378   * Search parameter: <b>title</b>
12379   * <p>
12380   * Description: <b>The human-friendly name of the test script</b><br>
12381   * Type: <b>string</b><br>
12382   * Path: <b>TestScript.title</b><br>
12383   * </p>
12384   */
12385  @SearchParamDefinition(name="title", path="TestScript.title", description="The human-friendly name of the test script", type="string" )
12386  public static final String SP_TITLE = "title";
12387 /**
12388   * <b>Fluent Client</b> search parameter constant for <b>title</b>
12389   * <p>
12390   * Description: <b>The human-friendly name of the test script</b><br>
12391   * Type: <b>string</b><br>
12392   * Path: <b>TestScript.title</b><br>
12393   * </p>
12394   */
12395  public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE);
12396
12397 /**
12398   * Search parameter: <b>version</b>
12399   * <p>
12400   * Description: <b>The business version of the test script</b><br>
12401   * Type: <b>token</b><br>
12402   * Path: <b>TestScript.version</b><br>
12403   * </p>
12404   */
12405  @SearchParamDefinition(name="version", path="TestScript.version", description="The business version of the test script", type="token" )
12406  public static final String SP_VERSION = "version";
12407 /**
12408   * <b>Fluent Client</b> search parameter constant for <b>version</b>
12409   * <p>
12410   * Description: <b>The business version of the test script</b><br>
12411   * Type: <b>token</b><br>
12412   * Path: <b>TestScript.version</b><br>
12413   * </p>
12414   */
12415  public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION);
12416
12417 /**
12418   * Search parameter: <b>url</b>
12419   * <p>
12420   * Description: <b>The uri that identifies the test script</b><br>
12421   * Type: <b>uri</b><br>
12422   * Path: <b>TestScript.url</b><br>
12423   * </p>
12424   */
12425  @SearchParamDefinition(name="url", path="TestScript.url", description="The uri that identifies the test script", type="uri" )
12426  public static final String SP_URL = "url";
12427 /**
12428   * <b>Fluent Client</b> search parameter constant for <b>url</b>
12429   * <p>
12430   * Description: <b>The uri that identifies the test script</b><br>
12431   * Type: <b>uri</b><br>
12432   * Path: <b>TestScript.url</b><br>
12433   * </p>
12434   */
12435  public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL);
12436
12437 /**
12438   * Search parameter: <b>status</b>
12439   * <p>
12440   * Description: <b>The current status of the test script</b><br>
12441   * Type: <b>token</b><br>
12442   * Path: <b>TestScript.status</b><br>
12443   * </p>
12444   */
12445  @SearchParamDefinition(name="status", path="TestScript.status", description="The current status of the test script", type="token" )
12446  public static final String SP_STATUS = "status";
12447 /**
12448   * <b>Fluent Client</b> search parameter constant for <b>status</b>
12449   * <p>
12450   * Description: <b>The current status of the test script</b><br>
12451   * Type: <b>token</b><br>
12452   * Path: <b>TestScript.status</b><br>
12453   * </p>
12454   */
12455  public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS);
12456
12457
12458}
12459