001package org.hl7.fhir.dstu3.model;
002
003
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, 
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this 
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, 
015     this list of conditions and the following disclaimer in the documentation 
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
030  POSSIBILITY OF SUCH DAMAGE.
031  
032*/
033
034// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
035import java.util.ArrayList;
036import java.util.Date;
037import java.util.List;
038
039import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus;
040import org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory;
041import org.hl7.fhir.exceptions.FHIRException;
042import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
043import org.hl7.fhir.utilities.Utilities;
044
045import ca.uhn.fhir.model.api.annotation.Block;
046import ca.uhn.fhir.model.api.annotation.Child;
047import ca.uhn.fhir.model.api.annotation.ChildOrder;
048import ca.uhn.fhir.model.api.annotation.Description;
049import ca.uhn.fhir.model.api.annotation.ResourceDef;
050import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
051/**
052 * A structured set of tests against a FHIR server implementation to determine compliance against the FHIR specification.
053 */
054@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript")
055@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"})
056public class TestScript extends MetadataResource {
057
058    public enum ContentType {
059        /**
060         * XML content-type corresponding to the application/fhir+xml mime-type.
061         */
062        XML, 
063        /**
064         * JSON content-type corresponding to the application/fhir+json mime-type.
065         */
066        JSON, 
067        /**
068         * RDF content-type corresponding to the text/turtle mime-type.
069         */
070        TTL, 
071        /**
072         * Prevent the use of the corresponding http header.
073         */
074        NONE, 
075        /**
076         * added to help the parsers with the generic types
077         */
078        NULL;
079        public static ContentType fromCode(String codeString) throws FHIRException {
080            if (codeString == null || "".equals(codeString))
081                return null;
082        if ("xml".equals(codeString))
083          return XML;
084        if ("json".equals(codeString))
085          return JSON;
086        if ("ttl".equals(codeString))
087          return TTL;
088        if ("none".equals(codeString))
089          return NONE;
090        if (Configuration.isAcceptInvalidEnums())
091          return null;
092        else
093          throw new FHIRException("Unknown ContentType code '"+codeString+"'");
094        }
095        public String toCode() {
096          switch (this) {
097            case XML: return "xml";
098            case JSON: return "json";
099            case TTL: return "ttl";
100            case NONE: return "none";
101            case NULL: return null;
102            default: return "?";
103          }
104        }
105        public String getSystem() {
106          switch (this) {
107            case XML: return "http://hl7.org/fhir/content-type";
108            case JSON: return "http://hl7.org/fhir/content-type";
109            case TTL: return "http://hl7.org/fhir/content-type";
110            case NONE: return "http://hl7.org/fhir/content-type";
111            case NULL: return null;
112            default: return "?";
113          }
114        }
115        public String getDefinition() {
116          switch (this) {
117            case XML: return "XML content-type corresponding to the application/fhir+xml mime-type.";
118            case JSON: return "JSON content-type corresponding to the application/fhir+json mime-type.";
119            case TTL: return "RDF content-type corresponding to the text/turtle mime-type.";
120            case NONE: return "Prevent the use of the corresponding http header.";
121            case NULL: return null;
122            default: return "?";
123          }
124        }
125        public String getDisplay() {
126          switch (this) {
127            case XML: return "xml";
128            case JSON: return "json";
129            case TTL: return "ttl";
130            case NONE: return "none";
131            case NULL: return null;
132            default: return "?";
133          }
134        }
135    }
136
137  public static class ContentTypeEnumFactory implements EnumFactory<ContentType> {
138    public ContentType fromCode(String codeString) throws IllegalArgumentException {
139      if (codeString == null || "".equals(codeString))
140            if (codeString == null || "".equals(codeString))
141                return null;
142        if ("xml".equals(codeString))
143          return ContentType.XML;
144        if ("json".equals(codeString))
145          return ContentType.JSON;
146        if ("ttl".equals(codeString))
147          return ContentType.TTL;
148        if ("none".equals(codeString))
149          return ContentType.NONE;
150        throw new IllegalArgumentException("Unknown ContentType code '"+codeString+"'");
151        }
152        public Enumeration<ContentType> fromType(Base code) throws FHIRException {
153          if (code == null)
154            return null;
155          if (code.isEmpty())
156            return new Enumeration<ContentType>(this);
157          String codeString = ((PrimitiveType) code).asStringValue();
158          if (codeString == null || "".equals(codeString))
159            return null;
160        if ("xml".equals(codeString))
161          return new Enumeration<ContentType>(this, ContentType.XML);
162        if ("json".equals(codeString))
163          return new Enumeration<ContentType>(this, ContentType.JSON);
164        if ("ttl".equals(codeString))
165          return new Enumeration<ContentType>(this, ContentType.TTL);
166        if ("none".equals(codeString))
167          return new Enumeration<ContentType>(this, ContentType.NONE);
168        throw new FHIRException("Unknown ContentType code '"+codeString+"'");
169        }
170    public String toCode(ContentType code) {
171      if (code == ContentType.XML)
172        return "xml";
173      if (code == ContentType.JSON)
174        return "json";
175      if (code == ContentType.TTL)
176        return "ttl";
177      if (code == ContentType.NONE)
178        return "none";
179      return "?";
180      }
181    public String toSystem(ContentType code) {
182      return code.getSystem();
183      }
184    }
185
186    public enum AssertionDirectionType {
187        /**
188         * The assertion is evaluated on the response. This is the default value.
189         */
190        RESPONSE, 
191        /**
192         * The assertion is evaluated on the request.
193         */
194        REQUEST, 
195        /**
196         * added to help the parsers with the generic types
197         */
198        NULL;
199        public static AssertionDirectionType fromCode(String codeString) throws FHIRException {
200            if (codeString == null || "".equals(codeString))
201                return null;
202        if ("response".equals(codeString))
203          return RESPONSE;
204        if ("request".equals(codeString))
205          return REQUEST;
206        if (Configuration.isAcceptInvalidEnums())
207          return null;
208        else
209          throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
210        }
211        public String toCode() {
212          switch (this) {
213            case RESPONSE: return "response";
214            case REQUEST: return "request";
215            case NULL: return null;
216            default: return "?";
217          }
218        }
219        public String getSystem() {
220          switch (this) {
221            case RESPONSE: return "http://hl7.org/fhir/assert-direction-codes";
222            case REQUEST: return "http://hl7.org/fhir/assert-direction-codes";
223            case NULL: return null;
224            default: return "?";
225          }
226        }
227        public String getDefinition() {
228          switch (this) {
229            case RESPONSE: return "The assertion is evaluated on the response. This is the default value.";
230            case REQUEST: return "The assertion is evaluated on the request.";
231            case NULL: return null;
232            default: return "?";
233          }
234        }
235        public String getDisplay() {
236          switch (this) {
237            case RESPONSE: return "response";
238            case REQUEST: return "request";
239            case NULL: return null;
240            default: return "?";
241          }
242        }
243    }
244
245  public static class AssertionDirectionTypeEnumFactory implements EnumFactory<AssertionDirectionType> {
246    public AssertionDirectionType fromCode(String codeString) throws IllegalArgumentException {
247      if (codeString == null || "".equals(codeString))
248            if (codeString == null || "".equals(codeString))
249                return null;
250        if ("response".equals(codeString))
251          return AssertionDirectionType.RESPONSE;
252        if ("request".equals(codeString))
253          return AssertionDirectionType.REQUEST;
254        throw new IllegalArgumentException("Unknown AssertionDirectionType code '"+codeString+"'");
255        }
256        public Enumeration<AssertionDirectionType> fromType(Base code) throws FHIRException {
257          if (code == null)
258            return null;
259          if (code.isEmpty())
260            return new Enumeration<AssertionDirectionType>(this);
261          String codeString = ((PrimitiveType) code).asStringValue();
262          if (codeString == null || "".equals(codeString))
263            return null;
264        if ("response".equals(codeString))
265          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.RESPONSE);
266        if ("request".equals(codeString))
267          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.REQUEST);
268        throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
269        }
270    public String toCode(AssertionDirectionType code) {
271      if (code == AssertionDirectionType.RESPONSE)
272        return "response";
273      if (code == AssertionDirectionType.REQUEST)
274        return "request";
275      return "?";
276      }
277    public String toSystem(AssertionDirectionType code) {
278      return code.getSystem();
279      }
280    }
281
282    public enum AssertionOperatorType {
283        /**
284         * Default value. Equals comparison.
285         */
286        EQUALS, 
287        /**
288         * Not equals comparison.
289         */
290        NOTEQUALS, 
291        /**
292         * Compare value within a known set of values.
293         */
294        IN, 
295        /**
296         * Compare value not within a known set of values.
297         */
298        NOTIN, 
299        /**
300         * Compare value to be greater than a known value.
301         */
302        GREATERTHAN, 
303        /**
304         * Compare value to be less than a known value.
305         */
306        LESSTHAN, 
307        /**
308         * Compare value is empty.
309         */
310        EMPTY, 
311        /**
312         * Compare value is not empty.
313         */
314        NOTEMPTY, 
315        /**
316         * Compare value string contains a known value.
317         */
318        CONTAINS, 
319        /**
320         * Compare value string does not contain a known value.
321         */
322        NOTCONTAINS, 
323        /**
324         * Evaluate the fluentpath expression as a boolean condition.
325         */
326        EVAL, 
327        /**
328         * added to help the parsers with the generic types
329         */
330        NULL;
331        public static AssertionOperatorType fromCode(String codeString) throws FHIRException {
332            if (codeString == null || "".equals(codeString))
333                return null;
334        if ("equals".equals(codeString))
335          return EQUALS;
336        if ("notEquals".equals(codeString))
337          return NOTEQUALS;
338        if ("in".equals(codeString))
339          return IN;
340        if ("notIn".equals(codeString))
341          return NOTIN;
342        if ("greaterThan".equals(codeString))
343          return GREATERTHAN;
344        if ("lessThan".equals(codeString))
345          return LESSTHAN;
346        if ("empty".equals(codeString))
347          return EMPTY;
348        if ("notEmpty".equals(codeString))
349          return NOTEMPTY;
350        if ("contains".equals(codeString))
351          return CONTAINS;
352        if ("notContains".equals(codeString))
353          return NOTCONTAINS;
354        if ("eval".equals(codeString))
355          return EVAL;
356        if (Configuration.isAcceptInvalidEnums())
357          return null;
358        else
359          throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
360        }
361        public String toCode() {
362          switch (this) {
363            case EQUALS: return "equals";
364            case NOTEQUALS: return "notEquals";
365            case IN: return "in";
366            case NOTIN: return "notIn";
367            case GREATERTHAN: return "greaterThan";
368            case LESSTHAN: return "lessThan";
369            case EMPTY: return "empty";
370            case NOTEMPTY: return "notEmpty";
371            case CONTAINS: return "contains";
372            case NOTCONTAINS: return "notContains";
373            case EVAL: return "eval";
374            case NULL: return null;
375            default: return "?";
376          }
377        }
378        public String getSystem() {
379          switch (this) {
380            case EQUALS: return "http://hl7.org/fhir/assert-operator-codes";
381            case NOTEQUALS: return "http://hl7.org/fhir/assert-operator-codes";
382            case IN: return "http://hl7.org/fhir/assert-operator-codes";
383            case NOTIN: return "http://hl7.org/fhir/assert-operator-codes";
384            case GREATERTHAN: return "http://hl7.org/fhir/assert-operator-codes";
385            case LESSTHAN: return "http://hl7.org/fhir/assert-operator-codes";
386            case EMPTY: return "http://hl7.org/fhir/assert-operator-codes";
387            case NOTEMPTY: return "http://hl7.org/fhir/assert-operator-codes";
388            case CONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
389            case NOTCONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
390            case EVAL: return "http://hl7.org/fhir/assert-operator-codes";
391            case NULL: return null;
392            default: return "?";
393          }
394        }
395        public String getDefinition() {
396          switch (this) {
397            case EQUALS: return "Default value. Equals comparison.";
398            case NOTEQUALS: return "Not equals comparison.";
399            case IN: return "Compare value within a known set of values.";
400            case NOTIN: return "Compare value not within a known set of values.";
401            case GREATERTHAN: return "Compare value to be greater than a known value.";
402            case LESSTHAN: return "Compare value to be less than a known value.";
403            case EMPTY: return "Compare value is empty.";
404            case NOTEMPTY: return "Compare value is not empty.";
405            case CONTAINS: return "Compare value string contains a known value.";
406            case NOTCONTAINS: return "Compare value string does not contain a known value.";
407            case EVAL: return "Evaluate the fluentpath expression as a boolean condition.";
408            case NULL: return null;
409            default: return "?";
410          }
411        }
412        public String getDisplay() {
413          switch (this) {
414            case EQUALS: return "equals";
415            case NOTEQUALS: return "notEquals";
416            case IN: return "in";
417            case NOTIN: return "notIn";
418            case GREATERTHAN: return "greaterThan";
419            case LESSTHAN: return "lessThan";
420            case EMPTY: return "empty";
421            case NOTEMPTY: return "notEmpty";
422            case CONTAINS: return "contains";
423            case NOTCONTAINS: return "notContains";
424            case EVAL: return "evaluate";
425            case NULL: return null;
426            default: return "?";
427          }
428        }
429    }
430
431  public static class AssertionOperatorTypeEnumFactory implements EnumFactory<AssertionOperatorType> {
432    public AssertionOperatorType fromCode(String codeString) throws IllegalArgumentException {
433      if (codeString == null || "".equals(codeString))
434            if (codeString == null || "".equals(codeString))
435                return null;
436        if ("equals".equals(codeString))
437          return AssertionOperatorType.EQUALS;
438        if ("notEquals".equals(codeString))
439          return AssertionOperatorType.NOTEQUALS;
440        if ("in".equals(codeString))
441          return AssertionOperatorType.IN;
442        if ("notIn".equals(codeString))
443          return AssertionOperatorType.NOTIN;
444        if ("greaterThan".equals(codeString))
445          return AssertionOperatorType.GREATERTHAN;
446        if ("lessThan".equals(codeString))
447          return AssertionOperatorType.LESSTHAN;
448        if ("empty".equals(codeString))
449          return AssertionOperatorType.EMPTY;
450        if ("notEmpty".equals(codeString))
451          return AssertionOperatorType.NOTEMPTY;
452        if ("contains".equals(codeString))
453          return AssertionOperatorType.CONTAINS;
454        if ("notContains".equals(codeString))
455          return AssertionOperatorType.NOTCONTAINS;
456        if ("eval".equals(codeString))
457          return AssertionOperatorType.EVAL;
458        throw new IllegalArgumentException("Unknown AssertionOperatorType code '"+codeString+"'");
459        }
460        public Enumeration<AssertionOperatorType> fromType(Base code) throws FHIRException {
461          if (code == null)
462            return null;
463          if (code.isEmpty())
464            return new Enumeration<AssertionOperatorType>(this);
465          String codeString = ((PrimitiveType) code).asStringValue();
466          if (codeString == null || "".equals(codeString))
467            return null;
468        if ("equals".equals(codeString))
469          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EQUALS);
470        if ("notEquals".equals(codeString))
471          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEQUALS);
472        if ("in".equals(codeString))
473          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.IN);
474        if ("notIn".equals(codeString))
475          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTIN);
476        if ("greaterThan".equals(codeString))
477          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.GREATERTHAN);
478        if ("lessThan".equals(codeString))
479          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.LESSTHAN);
480        if ("empty".equals(codeString))
481          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EMPTY);
482        if ("notEmpty".equals(codeString))
483          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEMPTY);
484        if ("contains".equals(codeString))
485          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.CONTAINS);
486        if ("notContains".equals(codeString))
487          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTCONTAINS);
488        if ("eval".equals(codeString))
489          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EVAL);
490        throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
491        }
492    public String toCode(AssertionOperatorType code) {
493      if (code == AssertionOperatorType.EQUALS)
494        return "equals";
495      if (code == AssertionOperatorType.NOTEQUALS)
496        return "notEquals";
497      if (code == AssertionOperatorType.IN)
498        return "in";
499      if (code == AssertionOperatorType.NOTIN)
500        return "notIn";
501      if (code == AssertionOperatorType.GREATERTHAN)
502        return "greaterThan";
503      if (code == AssertionOperatorType.LESSTHAN)
504        return "lessThan";
505      if (code == AssertionOperatorType.EMPTY)
506        return "empty";
507      if (code == AssertionOperatorType.NOTEMPTY)
508        return "notEmpty";
509      if (code == AssertionOperatorType.CONTAINS)
510        return "contains";
511      if (code == AssertionOperatorType.NOTCONTAINS)
512        return "notContains";
513      if (code == AssertionOperatorType.EVAL)
514        return "eval";
515      return "?";
516      }
517    public String toSystem(AssertionOperatorType code) {
518      return code.getSystem();
519      }
520    }
521
522    public enum TestScriptRequestMethodCode {
523        /**
524         * HTTP DELETE operation
525         */
526        DELETE, 
527        /**
528         * HTTP GET operation
529         */
530        GET, 
531        /**
532         * HTTP OPTIONS operation
533         */
534        OPTIONS, 
535        /**
536         * HTTP PATCH operation
537         */
538        PATCH, 
539        /**
540         * HTTP POST operation
541         */
542        POST, 
543        /**
544         * HTTP PUT operation
545         */
546        PUT, 
547        /**
548         * added to help the parsers with the generic types
549         */
550        NULL;
551        public static TestScriptRequestMethodCode fromCode(String codeString) throws FHIRException {
552            if (codeString == null || "".equals(codeString))
553                return null;
554        if ("delete".equals(codeString))
555          return DELETE;
556        if ("get".equals(codeString))
557          return GET;
558        if ("options".equals(codeString))
559          return OPTIONS;
560        if ("patch".equals(codeString))
561          return PATCH;
562        if ("post".equals(codeString))
563          return POST;
564        if ("put".equals(codeString))
565          return PUT;
566        if (Configuration.isAcceptInvalidEnums())
567          return null;
568        else
569          throw new FHIRException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
570        }
571        public String toCode() {
572          switch (this) {
573            case DELETE: return "delete";
574            case GET: return "get";
575            case OPTIONS: return "options";
576            case PATCH: return "patch";
577            case POST: return "post";
578            case PUT: return "put";
579            case NULL: return null;
580            default: return "?";
581          }
582        }
583        public String getSystem() {
584          switch (this) {
585            case DELETE: return "http://hl7.org/fhir/http-operations";
586            case GET: return "http://hl7.org/fhir/http-operations";
587            case OPTIONS: return "http://hl7.org/fhir/http-operations";
588            case PATCH: return "http://hl7.org/fhir/http-operations";
589            case POST: return "http://hl7.org/fhir/http-operations";
590            case PUT: return "http://hl7.org/fhir/http-operations";
591            case NULL: return null;
592            default: return "?";
593          }
594        }
595        public String getDefinition() {
596          switch (this) {
597            case DELETE: return "HTTP DELETE operation";
598            case GET: return "HTTP GET operation";
599            case OPTIONS: return "HTTP OPTIONS operation";
600            case PATCH: return "HTTP PATCH operation";
601            case POST: return "HTTP POST operation";
602            case PUT: return "HTTP PUT operation";
603            case NULL: return null;
604            default: return "?";
605          }
606        }
607        public String getDisplay() {
608          switch (this) {
609            case DELETE: return "DELETE";
610            case GET: return "GET";
611            case OPTIONS: return "OPTIONS";
612            case PATCH: return "PATCH";
613            case POST: return "POST";
614            case PUT: return "PUT";
615            case NULL: return null;
616            default: return "?";
617          }
618        }
619    }
620
621  public static class TestScriptRequestMethodCodeEnumFactory implements EnumFactory<TestScriptRequestMethodCode> {
622    public TestScriptRequestMethodCode fromCode(String codeString) throws IllegalArgumentException {
623      if (codeString == null || "".equals(codeString))
624            if (codeString == null || "".equals(codeString))
625                return null;
626        if ("delete".equals(codeString))
627          return TestScriptRequestMethodCode.DELETE;
628        if ("get".equals(codeString))
629          return TestScriptRequestMethodCode.GET;
630        if ("options".equals(codeString))
631          return TestScriptRequestMethodCode.OPTIONS;
632        if ("patch".equals(codeString))
633          return TestScriptRequestMethodCode.PATCH;
634        if ("post".equals(codeString))
635          return TestScriptRequestMethodCode.POST;
636        if ("put".equals(codeString))
637          return TestScriptRequestMethodCode.PUT;
638        throw new IllegalArgumentException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
639        }
640        public Enumeration<TestScriptRequestMethodCode> fromType(Base code) throws FHIRException {
641          if (code == null)
642            return null;
643          if (code.isEmpty())
644            return new Enumeration<TestScriptRequestMethodCode>(this);
645          String codeString = ((PrimitiveType) code).asStringValue();
646          if (codeString == null || "".equals(codeString))
647            return null;
648        if ("delete".equals(codeString))
649          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.DELETE);
650        if ("get".equals(codeString))
651          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.GET);
652        if ("options".equals(codeString))
653          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.OPTIONS);
654        if ("patch".equals(codeString))
655          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.PATCH);
656        if ("post".equals(codeString))
657          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.POST);
658        if ("put".equals(codeString))
659          return new Enumeration<TestScriptRequestMethodCode>(this, TestScriptRequestMethodCode.PUT);
660        throw new FHIRException("Unknown TestScriptRequestMethodCode code '"+codeString+"'");
661        }
662    public String toCode(TestScriptRequestMethodCode code) {
663      if (code == TestScriptRequestMethodCode.DELETE)
664        return "delete";
665      if (code == TestScriptRequestMethodCode.GET)
666        return "get";
667      if (code == TestScriptRequestMethodCode.OPTIONS)
668        return "options";
669      if (code == TestScriptRequestMethodCode.PATCH)
670        return "patch";
671      if (code == TestScriptRequestMethodCode.POST)
672        return "post";
673      if (code == TestScriptRequestMethodCode.PUT)
674        return "put";
675      return "?";
676      }
677    public String toSystem(TestScriptRequestMethodCode code) {
678      return code.getSystem();
679      }
680    }
681
682    public enum AssertionResponseTypes {
683        /**
684         * Response code is 200.
685         */
686        OKAY, 
687        /**
688         * Response code is 201.
689         */
690        CREATED, 
691        /**
692         * Response code is 204.
693         */
694        NOCONTENT, 
695        /**
696         * Response code is 304.
697         */
698        NOTMODIFIED, 
699        /**
700         * Response code is 400.
701         */
702        BAD, 
703        /**
704         * Response code is 403.
705         */
706        FORBIDDEN, 
707        /**
708         * Response code is 404.
709         */
710        NOTFOUND, 
711        /**
712         * Response code is 405.
713         */
714        METHODNOTALLOWED, 
715        /**
716         * Response code is 409.
717         */
718        CONFLICT, 
719        /**
720         * Response code is 410.
721         */
722        GONE, 
723        /**
724         * Response code is 412.
725         */
726        PRECONDITIONFAILED, 
727        /**
728         * Response code is 422.
729         */
730        UNPROCESSABLE, 
731        /**
732         * added to help the parsers with the generic types
733         */
734        NULL;
735        public static AssertionResponseTypes fromCode(String codeString) throws FHIRException {
736            if (codeString == null || "".equals(codeString))
737                return null;
738        if ("okay".equals(codeString))
739          return OKAY;
740        if ("created".equals(codeString))
741          return CREATED;
742        if ("noContent".equals(codeString))
743          return NOCONTENT;
744        if ("notModified".equals(codeString))
745          return NOTMODIFIED;
746        if ("bad".equals(codeString))
747          return BAD;
748        if ("forbidden".equals(codeString))
749          return FORBIDDEN;
750        if ("notFound".equals(codeString))
751          return NOTFOUND;
752        if ("methodNotAllowed".equals(codeString))
753          return METHODNOTALLOWED;
754        if ("conflict".equals(codeString))
755          return CONFLICT;
756        if ("gone".equals(codeString))
757          return GONE;
758        if ("preconditionFailed".equals(codeString))
759          return PRECONDITIONFAILED;
760        if ("unprocessable".equals(codeString))
761          return UNPROCESSABLE;
762        if (Configuration.isAcceptInvalidEnums())
763          return null;
764        else
765          throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
766        }
767        public String toCode() {
768          switch (this) {
769            case OKAY: return "okay";
770            case CREATED: return "created";
771            case NOCONTENT: return "noContent";
772            case NOTMODIFIED: return "notModified";
773            case BAD: return "bad";
774            case FORBIDDEN: return "forbidden";
775            case NOTFOUND: return "notFound";
776            case METHODNOTALLOWED: return "methodNotAllowed";
777            case CONFLICT: return "conflict";
778            case GONE: return "gone";
779            case PRECONDITIONFAILED: return "preconditionFailed";
780            case UNPROCESSABLE: return "unprocessable";
781            case NULL: return null;
782            default: return "?";
783          }
784        }
785        public String getSystem() {
786          switch (this) {
787            case OKAY: return "http://hl7.org/fhir/assert-response-code-types";
788            case CREATED: return "http://hl7.org/fhir/assert-response-code-types";
789            case NOCONTENT: return "http://hl7.org/fhir/assert-response-code-types";
790            case NOTMODIFIED: return "http://hl7.org/fhir/assert-response-code-types";
791            case BAD: return "http://hl7.org/fhir/assert-response-code-types";
792            case FORBIDDEN: return "http://hl7.org/fhir/assert-response-code-types";
793            case NOTFOUND: return "http://hl7.org/fhir/assert-response-code-types";
794            case METHODNOTALLOWED: return "http://hl7.org/fhir/assert-response-code-types";
795            case CONFLICT: return "http://hl7.org/fhir/assert-response-code-types";
796            case GONE: return "http://hl7.org/fhir/assert-response-code-types";
797            case PRECONDITIONFAILED: return "http://hl7.org/fhir/assert-response-code-types";
798            case UNPROCESSABLE: return "http://hl7.org/fhir/assert-response-code-types";
799            case NULL: return null;
800            default: return "?";
801          }
802        }
803        public String getDefinition() {
804          switch (this) {
805            case OKAY: return "Response code is 200.";
806            case CREATED: return "Response code is 201.";
807            case NOCONTENT: return "Response code is 204.";
808            case NOTMODIFIED: return "Response code is 304.";
809            case BAD: return "Response code is 400.";
810            case FORBIDDEN: return "Response code is 403.";
811            case NOTFOUND: return "Response code is 404.";
812            case METHODNOTALLOWED: return "Response code is 405.";
813            case CONFLICT: return "Response code is 409.";
814            case GONE: return "Response code is 410.";
815            case PRECONDITIONFAILED: return "Response code is 412.";
816            case UNPROCESSABLE: return "Response code is 422.";
817            case NULL: return null;
818            default: return "?";
819          }
820        }
821        public String getDisplay() {
822          switch (this) {
823            case OKAY: return "okay";
824            case CREATED: return "created";
825            case NOCONTENT: return "noContent";
826            case NOTMODIFIED: return "notModified";
827            case BAD: return "bad";
828            case FORBIDDEN: return "forbidden";
829            case NOTFOUND: return "notFound";
830            case METHODNOTALLOWED: return "methodNotAllowed";
831            case CONFLICT: return "conflict";
832            case GONE: return "gone";
833            case PRECONDITIONFAILED: return "preconditionFailed";
834            case UNPROCESSABLE: return "unprocessable";
835            case NULL: return null;
836            default: return "?";
837          }
838        }
839    }
840
841  public static class AssertionResponseTypesEnumFactory implements EnumFactory<AssertionResponseTypes> {
842    public AssertionResponseTypes fromCode(String codeString) throws IllegalArgumentException {
843      if (codeString == null || "".equals(codeString))
844            if (codeString == null || "".equals(codeString))
845                return null;
846        if ("okay".equals(codeString))
847          return AssertionResponseTypes.OKAY;
848        if ("created".equals(codeString))
849          return AssertionResponseTypes.CREATED;
850        if ("noContent".equals(codeString))
851          return AssertionResponseTypes.NOCONTENT;
852        if ("notModified".equals(codeString))
853          return AssertionResponseTypes.NOTMODIFIED;
854        if ("bad".equals(codeString))
855          return AssertionResponseTypes.BAD;
856        if ("forbidden".equals(codeString))
857          return AssertionResponseTypes.FORBIDDEN;
858        if ("notFound".equals(codeString))
859          return AssertionResponseTypes.NOTFOUND;
860        if ("methodNotAllowed".equals(codeString))
861          return AssertionResponseTypes.METHODNOTALLOWED;
862        if ("conflict".equals(codeString))
863          return AssertionResponseTypes.CONFLICT;
864        if ("gone".equals(codeString))
865          return AssertionResponseTypes.GONE;
866        if ("preconditionFailed".equals(codeString))
867          return AssertionResponseTypes.PRECONDITIONFAILED;
868        if ("unprocessable".equals(codeString))
869          return AssertionResponseTypes.UNPROCESSABLE;
870        throw new IllegalArgumentException("Unknown AssertionResponseTypes code '"+codeString+"'");
871        }
872        public Enumeration<AssertionResponseTypes> fromType(Base code) throws FHIRException {
873          if (code == null)
874            return null;
875          if (code.isEmpty())
876            return new Enumeration<AssertionResponseTypes>(this);
877          String codeString = ((PrimitiveType) code).asStringValue();
878          if (codeString == null || "".equals(codeString))
879            return null;
880        if ("okay".equals(codeString))
881          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.OKAY);
882        if ("created".equals(codeString))
883          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CREATED);
884        if ("noContent".equals(codeString))
885          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOCONTENT);
886        if ("notModified".equals(codeString))
887          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTMODIFIED);
888        if ("bad".equals(codeString))
889          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.BAD);
890        if ("forbidden".equals(codeString))
891          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.FORBIDDEN);
892        if ("notFound".equals(codeString))
893          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTFOUND);
894        if ("methodNotAllowed".equals(codeString))
895          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.METHODNOTALLOWED);
896        if ("conflict".equals(codeString))
897          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CONFLICT);
898        if ("gone".equals(codeString))
899          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.GONE);
900        if ("preconditionFailed".equals(codeString))
901          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.PRECONDITIONFAILED);
902        if ("unprocessable".equals(codeString))
903          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.UNPROCESSABLE);
904        throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
905        }
906    public String toCode(AssertionResponseTypes code) {
907      if (code == AssertionResponseTypes.OKAY)
908        return "okay";
909      if (code == AssertionResponseTypes.CREATED)
910        return "created";
911      if (code == AssertionResponseTypes.NOCONTENT)
912        return "noContent";
913      if (code == AssertionResponseTypes.NOTMODIFIED)
914        return "notModified";
915      if (code == AssertionResponseTypes.BAD)
916        return "bad";
917      if (code == AssertionResponseTypes.FORBIDDEN)
918        return "forbidden";
919      if (code == AssertionResponseTypes.NOTFOUND)
920        return "notFound";
921      if (code == AssertionResponseTypes.METHODNOTALLOWED)
922        return "methodNotAllowed";
923      if (code == AssertionResponseTypes.CONFLICT)
924        return "conflict";
925      if (code == AssertionResponseTypes.GONE)
926        return "gone";
927      if (code == AssertionResponseTypes.PRECONDITIONFAILED)
928        return "preconditionFailed";
929      if (code == AssertionResponseTypes.UNPROCESSABLE)
930        return "unprocessable";
931      return "?";
932      }
933    public String toSystem(AssertionResponseTypes code) {
934      return code.getSystem();
935      }
936    }
937
938    @Block()
939    public static class TestScriptOriginComponent extends BackboneElement implements IBaseBackboneElement {
940        /**
941         * Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
942         */
943        @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false)
944        @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." )
945        protected IntegerType index;
946
947        /**
948         * The type of origin profile the test system supports.
949         */
950        @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
951        @Description(shortDefinition="FHIR-Client | FHIR-SDC-FormFiller", formalDefinition="The type of origin profile the test system supports." )
952        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-profile-origin-types")
953        protected Coding profile;
954
955        private static final long serialVersionUID = -1239935149L;
956
957    /**
958     * Constructor
959     */
960      public TestScriptOriginComponent() {
961        super();
962      }
963
964    /**
965     * Constructor
966     */
967      public TestScriptOriginComponent(IntegerType index, Coding profile) {
968        super();
969        this.index = index;
970        this.profile = profile;
971      }
972
973        /**
974         * @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
975         */
976        public IntegerType getIndexElement() { 
977          if (this.index == null)
978            if (Configuration.errorOnAutoCreate())
979              throw new Error("Attempt to auto-create TestScriptOriginComponent.index");
980            else if (Configuration.doAutoCreate())
981              this.index = new IntegerType(); // bb
982          return this.index;
983        }
984
985        public boolean hasIndexElement() { 
986          return this.index != null && !this.index.isEmpty();
987        }
988
989        public boolean hasIndex() { 
990          return this.index != null && !this.index.isEmpty();
991        }
992
993        /**
994         * @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
995         */
996        public TestScriptOriginComponent setIndexElement(IntegerType value) { 
997          this.index = value;
998          return this;
999        }
1000
1001        /**
1002         * @return Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
1003         */
1004        public int getIndex() { 
1005          return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue();
1006        }
1007
1008        /**
1009         * @param value Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.
1010         */
1011        public TestScriptOriginComponent setIndex(int value) { 
1012            if (this.index == null)
1013              this.index = new IntegerType();
1014            this.index.setValue(value);
1015          return this;
1016        }
1017
1018        /**
1019         * @return {@link #profile} (The type of origin profile the test system supports.)
1020         */
1021        public Coding getProfile() { 
1022          if (this.profile == null)
1023            if (Configuration.errorOnAutoCreate())
1024              throw new Error("Attempt to auto-create TestScriptOriginComponent.profile");
1025            else if (Configuration.doAutoCreate())
1026              this.profile = new Coding(); // cc
1027          return this.profile;
1028        }
1029
1030        public boolean hasProfile() { 
1031          return this.profile != null && !this.profile.isEmpty();
1032        }
1033
1034        /**
1035         * @param value {@link #profile} (The type of origin profile the test system supports.)
1036         */
1037        public TestScriptOriginComponent setProfile(Coding value)  { 
1038          this.profile = value;
1039          return this;
1040        }
1041
1042        protected void listChildren(List<Property> children) {
1043          super.listChildren(children);
1044          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));
1045          children.add(new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, 1, profile));
1046        }
1047
1048        @Override
1049        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1050          switch (_hash) {
1051          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);
1052          case -309425751: /*profile*/  return new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, 1, profile);
1053          default: return super.getNamedProperty(_hash, _name, _checkValid);
1054          }
1055
1056        }
1057
1058      @Override
1059      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1060        switch (hash) {
1061        case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType
1062        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding
1063        default: return super.getProperty(hash, name, checkValid);
1064        }
1065
1066      }
1067
1068      @Override
1069      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1070        switch (hash) {
1071        case 100346066: // index
1072          this.index = castToInteger(value); // IntegerType
1073          return value;
1074        case -309425751: // profile
1075          this.profile = castToCoding(value); // Coding
1076          return value;
1077        default: return super.setProperty(hash, name, value);
1078        }
1079
1080      }
1081
1082      @Override
1083      public Base setProperty(String name, Base value) throws FHIRException {
1084        if (name.equals("index")) {
1085          this.index = castToInteger(value); // IntegerType
1086        } else if (name.equals("profile")) {
1087          this.profile = castToCoding(value); // Coding
1088        } else
1089          return super.setProperty(name, value);
1090        return value;
1091      }
1092
1093      @Override
1094      public Base makeProperty(int hash, String name) throws FHIRException {
1095        switch (hash) {
1096        case 100346066:  return getIndexElement();
1097        case -309425751:  return getProfile(); 
1098        default: return super.makeProperty(hash, name);
1099        }
1100
1101      }
1102
1103      @Override
1104      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1105        switch (hash) {
1106        case 100346066: /*index*/ return new String[] {"integer"};
1107        case -309425751: /*profile*/ return new String[] {"Coding"};
1108        default: return super.getTypesForProperty(hash, name);
1109        }
1110
1111      }
1112
1113      @Override
1114      public Base addChild(String name) throws FHIRException {
1115        if (name.equals("index")) {
1116          throw new FHIRException("Cannot call addChild on a primitive type TestScript.index");
1117        }
1118        else if (name.equals("profile")) {
1119          this.profile = new Coding();
1120          return this.profile;
1121        }
1122        else
1123          return super.addChild(name);
1124      }
1125
1126      public TestScriptOriginComponent copy() {
1127        TestScriptOriginComponent dst = new TestScriptOriginComponent();
1128        copyValues(dst);
1129        dst.index = index == null ? null : index.copy();
1130        dst.profile = profile == null ? null : profile.copy();
1131        return dst;
1132      }
1133
1134      @Override
1135      public boolean equalsDeep(Base other_) {
1136        if (!super.equalsDeep(other_))
1137          return false;
1138        if (!(other_ instanceof TestScriptOriginComponent))
1139          return false;
1140        TestScriptOriginComponent o = (TestScriptOriginComponent) other_;
1141        return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true);
1142      }
1143
1144      @Override
1145      public boolean equalsShallow(Base other_) {
1146        if (!super.equalsShallow(other_))
1147          return false;
1148        if (!(other_ instanceof TestScriptOriginComponent))
1149          return false;
1150        TestScriptOriginComponent o = (TestScriptOriginComponent) other_;
1151        return compareValues(index, o.index, true);
1152      }
1153
1154      public boolean isEmpty() {
1155        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(index, profile);
1156      }
1157
1158  public String fhirType() {
1159    return "TestScript.origin";
1160
1161  }
1162
1163  }
1164
1165    @Block()
1166    public static class TestScriptDestinationComponent extends BackboneElement implements IBaseBackboneElement {
1167        /**
1168         * Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1169         */
1170        @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1171        @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." )
1172        protected IntegerType index;
1173
1174        /**
1175         * The type of destination profile the test system supports.
1176         */
1177        @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false)
1178        @Description(shortDefinition="FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor", formalDefinition="The type of destination profile the test system supports." )
1179        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-profile-destination-types")
1180        protected Coding profile;
1181
1182        private static final long serialVersionUID = -1239935149L;
1183
1184    /**
1185     * Constructor
1186     */
1187      public TestScriptDestinationComponent() {
1188        super();
1189      }
1190
1191    /**
1192     * Constructor
1193     */
1194      public TestScriptDestinationComponent(IntegerType index, Coding profile) {
1195        super();
1196        this.index = index;
1197        this.profile = profile;
1198      }
1199
1200        /**
1201         * @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
1202         */
1203        public IntegerType getIndexElement() { 
1204          if (this.index == null)
1205            if (Configuration.errorOnAutoCreate())
1206              throw new Error("Attempt to auto-create TestScriptDestinationComponent.index");
1207            else if (Configuration.doAutoCreate())
1208              this.index = new IntegerType(); // bb
1209          return this.index;
1210        }
1211
1212        public boolean hasIndexElement() { 
1213          return this.index != null && !this.index.isEmpty();
1214        }
1215
1216        public boolean hasIndex() { 
1217          return this.index != null && !this.index.isEmpty();
1218        }
1219
1220        /**
1221         * @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
1222         */
1223        public TestScriptDestinationComponent setIndexElement(IntegerType value) { 
1224          this.index = value;
1225          return this;
1226        }
1227
1228        /**
1229         * @return Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1230         */
1231        public int getIndex() { 
1232          return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue();
1233        }
1234
1235        /**
1236         * @param value Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.
1237         */
1238        public TestScriptDestinationComponent setIndex(int value) { 
1239            if (this.index == null)
1240              this.index = new IntegerType();
1241            this.index.setValue(value);
1242          return this;
1243        }
1244
1245        /**
1246         * @return {@link #profile} (The type of destination profile the test system supports.)
1247         */
1248        public Coding getProfile() { 
1249          if (this.profile == null)
1250            if (Configuration.errorOnAutoCreate())
1251              throw new Error("Attempt to auto-create TestScriptDestinationComponent.profile");
1252            else if (Configuration.doAutoCreate())
1253              this.profile = new Coding(); // cc
1254          return this.profile;
1255        }
1256
1257        public boolean hasProfile() { 
1258          return this.profile != null && !this.profile.isEmpty();
1259        }
1260
1261        /**
1262         * @param value {@link #profile} (The type of destination profile the test system supports.)
1263         */
1264        public TestScriptDestinationComponent setProfile(Coding value)  { 
1265          this.profile = value;
1266          return this;
1267        }
1268
1269        protected void listChildren(List<Property> children) {
1270          super.listChildren(children);
1271          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));
1272          children.add(new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, 1, profile));
1273        }
1274
1275        @Override
1276        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1277          switch (_hash) {
1278          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);
1279          case -309425751: /*profile*/  return new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, 1, profile);
1280          default: return super.getNamedProperty(_hash, _name, _checkValid);
1281          }
1282
1283        }
1284
1285      @Override
1286      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1287        switch (hash) {
1288        case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType
1289        case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding
1290        default: return super.getProperty(hash, name, checkValid);
1291        }
1292
1293      }
1294
1295      @Override
1296      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1297        switch (hash) {
1298        case 100346066: // index
1299          this.index = castToInteger(value); // IntegerType
1300          return value;
1301        case -309425751: // profile
1302          this.profile = castToCoding(value); // Coding
1303          return value;
1304        default: return super.setProperty(hash, name, value);
1305        }
1306
1307      }
1308
1309      @Override
1310      public Base setProperty(String name, Base value) throws FHIRException {
1311        if (name.equals("index")) {
1312          this.index = castToInteger(value); // IntegerType
1313        } else if (name.equals("profile")) {
1314          this.profile = castToCoding(value); // Coding
1315        } else
1316          return super.setProperty(name, value);
1317        return value;
1318      }
1319
1320      @Override
1321      public Base makeProperty(int hash, String name) throws FHIRException {
1322        switch (hash) {
1323        case 100346066:  return getIndexElement();
1324        case -309425751:  return getProfile(); 
1325        default: return super.makeProperty(hash, name);
1326        }
1327
1328      }
1329
1330      @Override
1331      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1332        switch (hash) {
1333        case 100346066: /*index*/ return new String[] {"integer"};
1334        case -309425751: /*profile*/ return new String[] {"Coding"};
1335        default: return super.getTypesForProperty(hash, name);
1336        }
1337
1338      }
1339
1340      @Override
1341      public Base addChild(String name) throws FHIRException {
1342        if (name.equals("index")) {
1343          throw new FHIRException("Cannot call addChild on a primitive type TestScript.index");
1344        }
1345        else if (name.equals("profile")) {
1346          this.profile = new Coding();
1347          return this.profile;
1348        }
1349        else
1350          return super.addChild(name);
1351      }
1352
1353      public TestScriptDestinationComponent copy() {
1354        TestScriptDestinationComponent dst = new TestScriptDestinationComponent();
1355        copyValues(dst);
1356        dst.index = index == null ? null : index.copy();
1357        dst.profile = profile == null ? null : profile.copy();
1358        return dst;
1359      }
1360
1361      @Override
1362      public boolean equalsDeep(Base other_) {
1363        if (!super.equalsDeep(other_))
1364          return false;
1365        if (!(other_ instanceof TestScriptDestinationComponent))
1366          return false;
1367        TestScriptDestinationComponent o = (TestScriptDestinationComponent) other_;
1368        return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true);
1369      }
1370
1371      @Override
1372      public boolean equalsShallow(Base other_) {
1373        if (!super.equalsShallow(other_))
1374          return false;
1375        if (!(other_ instanceof TestScriptDestinationComponent))
1376          return false;
1377        TestScriptDestinationComponent o = (TestScriptDestinationComponent) other_;
1378        return compareValues(index, o.index, true);
1379      }
1380
1381      public boolean isEmpty() {
1382        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(index, profile);
1383      }
1384
1385  public String fhirType() {
1386    return "TestScript.destination";
1387
1388  }
1389
1390  }
1391
1392    @Block()
1393    public static class TestScriptMetadataComponent extends BackboneElement implements IBaseBackboneElement {
1394        /**
1395         * A link to the FHIR specification that this test is covering.
1396         */
1397        @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1398        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="A link to the FHIR specification that this test is covering." )
1399        protected List<TestScriptMetadataLinkComponent> link;
1400
1401        /**
1402         * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
1403         */
1404        @Child(name = "capability", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1405        @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." )
1406        protected List<TestScriptMetadataCapabilityComponent> capability;
1407
1408        private static final long serialVersionUID = 745183328L;
1409
1410    /**
1411     * Constructor
1412     */
1413      public TestScriptMetadataComponent() {
1414        super();
1415      }
1416
1417        /**
1418         * @return {@link #link} (A link to the FHIR specification that this test is covering.)
1419         */
1420        public List<TestScriptMetadataLinkComponent> getLink() { 
1421          if (this.link == null)
1422            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1423          return this.link;
1424        }
1425
1426        /**
1427         * @return Returns a reference to <code>this</code> for easy method chaining
1428         */
1429        public TestScriptMetadataComponent setLink(List<TestScriptMetadataLinkComponent> theLink) { 
1430          this.link = theLink;
1431          return this;
1432        }
1433
1434        public boolean hasLink() { 
1435          if (this.link == null)
1436            return false;
1437          for (TestScriptMetadataLinkComponent item : this.link)
1438            if (!item.isEmpty())
1439              return true;
1440          return false;
1441        }
1442
1443        public TestScriptMetadataLinkComponent addLink() { //3
1444          TestScriptMetadataLinkComponent t = new TestScriptMetadataLinkComponent();
1445          if (this.link == null)
1446            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1447          this.link.add(t);
1448          return t;
1449        }
1450
1451        public TestScriptMetadataComponent addLink(TestScriptMetadataLinkComponent t) { //3
1452          if (t == null)
1453            return this;
1454          if (this.link == null)
1455            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
1456          this.link.add(t);
1457          return this;
1458        }
1459
1460        /**
1461         * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
1462         */
1463        public TestScriptMetadataLinkComponent getLinkFirstRep() { 
1464          if (getLink().isEmpty()) {
1465            addLink();
1466          }
1467          return getLink().get(0);
1468        }
1469
1470        /**
1471         * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
1472         */
1473        public List<TestScriptMetadataCapabilityComponent> getCapability() { 
1474          if (this.capability == null)
1475            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1476          return this.capability;
1477        }
1478
1479        /**
1480         * @return Returns a reference to <code>this</code> for easy method chaining
1481         */
1482        public TestScriptMetadataComponent setCapability(List<TestScriptMetadataCapabilityComponent> theCapability) { 
1483          this.capability = theCapability;
1484          return this;
1485        }
1486
1487        public boolean hasCapability() { 
1488          if (this.capability == null)
1489            return false;
1490          for (TestScriptMetadataCapabilityComponent item : this.capability)
1491            if (!item.isEmpty())
1492              return true;
1493          return false;
1494        }
1495
1496        public TestScriptMetadataCapabilityComponent addCapability() { //3
1497          TestScriptMetadataCapabilityComponent t = new TestScriptMetadataCapabilityComponent();
1498          if (this.capability == null)
1499            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1500          this.capability.add(t);
1501          return t;
1502        }
1503
1504        public TestScriptMetadataComponent addCapability(TestScriptMetadataCapabilityComponent t) { //3
1505          if (t == null)
1506            return this;
1507          if (this.capability == null)
1508            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1509          this.capability.add(t);
1510          return this;
1511        }
1512
1513        /**
1514         * @return The first repetition of repeating field {@link #capability}, creating it if it does not already exist
1515         */
1516        public TestScriptMetadataCapabilityComponent getCapabilityFirstRep() { 
1517          if (getCapability().isEmpty()) {
1518            addCapability();
1519          }
1520          return getCapability().get(0);
1521        }
1522
1523        protected void listChildren(List<Property> children) {
1524          super.listChildren(children);
1525          children.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link));
1526          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));
1527        }
1528
1529        @Override
1530        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1531          switch (_hash) {
1532          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);
1533          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);
1534          default: return super.getNamedProperty(_hash, _name, _checkValid);
1535          }
1536
1537        }
1538
1539      @Override
1540      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1541        switch (hash) {
1542        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // TestScriptMetadataLinkComponent
1543        case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // TestScriptMetadataCapabilityComponent
1544        default: return super.getProperty(hash, name, checkValid);
1545        }
1546
1547      }
1548
1549      @Override
1550      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1551        switch (hash) {
1552        case 3321850: // link
1553          this.getLink().add((TestScriptMetadataLinkComponent) value); // TestScriptMetadataLinkComponent
1554          return value;
1555        case -783669992: // capability
1556          this.getCapability().add((TestScriptMetadataCapabilityComponent) value); // TestScriptMetadataCapabilityComponent
1557          return value;
1558        default: return super.setProperty(hash, name, value);
1559        }
1560
1561      }
1562
1563      @Override
1564      public Base setProperty(String name, Base value) throws FHIRException {
1565        if (name.equals("link")) {
1566          this.getLink().add((TestScriptMetadataLinkComponent) value);
1567        } else if (name.equals("capability")) {
1568          this.getCapability().add((TestScriptMetadataCapabilityComponent) value);
1569        } else
1570          return super.setProperty(name, value);
1571        return value;
1572      }
1573
1574      @Override
1575      public Base makeProperty(int hash, String name) throws FHIRException {
1576        switch (hash) {
1577        case 3321850:  return addLink(); 
1578        case -783669992:  return addCapability(); 
1579        default: return super.makeProperty(hash, name);
1580        }
1581
1582      }
1583
1584      @Override
1585      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1586        switch (hash) {
1587        case 3321850: /*link*/ return new String[] {};
1588        case -783669992: /*capability*/ return new String[] {};
1589        default: return super.getTypesForProperty(hash, name);
1590        }
1591
1592      }
1593
1594      @Override
1595      public Base addChild(String name) throws FHIRException {
1596        if (name.equals("link")) {
1597          return addLink();
1598        }
1599        else if (name.equals("capability")) {
1600          return addCapability();
1601        }
1602        else
1603          return super.addChild(name);
1604      }
1605
1606      public TestScriptMetadataComponent copy() {
1607        TestScriptMetadataComponent dst = new TestScriptMetadataComponent();
1608        copyValues(dst);
1609        if (link != null) {
1610          dst.link = new ArrayList<TestScriptMetadataLinkComponent>();
1611          for (TestScriptMetadataLinkComponent i : link)
1612            dst.link.add(i.copy());
1613        };
1614        if (capability != null) {
1615          dst.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1616          for (TestScriptMetadataCapabilityComponent i : capability)
1617            dst.capability.add(i.copy());
1618        };
1619        return dst;
1620      }
1621
1622      @Override
1623      public boolean equalsDeep(Base other_) {
1624        if (!super.equalsDeep(other_))
1625          return false;
1626        if (!(other_ instanceof TestScriptMetadataComponent))
1627          return false;
1628        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other_;
1629        return compareDeep(link, o.link, true) && compareDeep(capability, o.capability, true);
1630      }
1631
1632      @Override
1633      public boolean equalsShallow(Base other_) {
1634        if (!super.equalsShallow(other_))
1635          return false;
1636        if (!(other_ instanceof TestScriptMetadataComponent))
1637          return false;
1638        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other_;
1639        return true;
1640      }
1641
1642      public boolean isEmpty() {
1643        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(link, capability);
1644      }
1645
1646  public String fhirType() {
1647    return "TestScript.metadata";
1648
1649  }
1650
1651  }
1652
1653    @Block()
1654    public static class TestScriptMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement {
1655        /**
1656         * URL to a particular requirement or feature within the FHIR specification.
1657         */
1658        @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1659        @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." )
1660        protected UriType url;
1661
1662        /**
1663         * Short description of the link.
1664         */
1665        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1666        @Description(shortDefinition="Short description", formalDefinition="Short description of the link." )
1667        protected StringType description;
1668
1669        private static final long serialVersionUID = 213372298L;
1670
1671    /**
1672     * Constructor
1673     */
1674      public TestScriptMetadataLinkComponent() {
1675        super();
1676      }
1677
1678    /**
1679     * Constructor
1680     */
1681      public TestScriptMetadataLinkComponent(UriType url) {
1682        super();
1683        this.url = url;
1684      }
1685
1686        /**
1687         * @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
1688         */
1689        public UriType getUrlElement() { 
1690          if (this.url == null)
1691            if (Configuration.errorOnAutoCreate())
1692              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.url");
1693            else if (Configuration.doAutoCreate())
1694              this.url = new UriType(); // bb
1695          return this.url;
1696        }
1697
1698        public boolean hasUrlElement() { 
1699          return this.url != null && !this.url.isEmpty();
1700        }
1701
1702        public boolean hasUrl() { 
1703          return this.url != null && !this.url.isEmpty();
1704        }
1705
1706        /**
1707         * @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
1708         */
1709        public TestScriptMetadataLinkComponent setUrlElement(UriType value) { 
1710          this.url = value;
1711          return this;
1712        }
1713
1714        /**
1715         * @return URL to a particular requirement or feature within the FHIR specification.
1716         */
1717        public String getUrl() { 
1718          return this.url == null ? null : this.url.getValue();
1719        }
1720
1721        /**
1722         * @param value URL to a particular requirement or feature within the FHIR specification.
1723         */
1724        public TestScriptMetadataLinkComponent setUrl(String value) { 
1725            if (this.url == null)
1726              this.url = new UriType();
1727            this.url.setValue(value);
1728          return this;
1729        }
1730
1731        /**
1732         * @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
1733         */
1734        public StringType getDescriptionElement() { 
1735          if (this.description == null)
1736            if (Configuration.errorOnAutoCreate())
1737              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.description");
1738            else if (Configuration.doAutoCreate())
1739              this.description = new StringType(); // bb
1740          return this.description;
1741        }
1742
1743        public boolean hasDescriptionElement() { 
1744          return this.description != null && !this.description.isEmpty();
1745        }
1746
1747        public boolean hasDescription() { 
1748          return this.description != null && !this.description.isEmpty();
1749        }
1750
1751        /**
1752         * @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
1753         */
1754        public TestScriptMetadataLinkComponent setDescriptionElement(StringType value) { 
1755          this.description = value;
1756          return this;
1757        }
1758
1759        /**
1760         * @return Short description of the link.
1761         */
1762        public String getDescription() { 
1763          return this.description == null ? null : this.description.getValue();
1764        }
1765
1766        /**
1767         * @param value Short description of the link.
1768         */
1769        public TestScriptMetadataLinkComponent setDescription(String value) { 
1770          if (Utilities.noString(value))
1771            this.description = null;
1772          else {
1773            if (this.description == null)
1774              this.description = new StringType();
1775            this.description.setValue(value);
1776          }
1777          return this;
1778        }
1779
1780        protected void listChildren(List<Property> children) {
1781          super.listChildren(children);
1782          children.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, 1, url));
1783          children.add(new Property("description", "string", "Short description of the link.", 0, 1, description));
1784        }
1785
1786        @Override
1787        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
1788          switch (_hash) {
1789          case 116079: /*url*/  return new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, 1, url);
1790          case -1724546052: /*description*/  return new Property("description", "string", "Short description of the link.", 0, 1, description);
1791          default: return super.getNamedProperty(_hash, _name, _checkValid);
1792          }
1793
1794        }
1795
1796      @Override
1797      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
1798        switch (hash) {
1799        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType
1800        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
1801        default: return super.getProperty(hash, name, checkValid);
1802        }
1803
1804      }
1805
1806      @Override
1807      public Base setProperty(int hash, String name, Base value) throws FHIRException {
1808        switch (hash) {
1809        case 116079: // url
1810          this.url = castToUri(value); // UriType
1811          return value;
1812        case -1724546052: // description
1813          this.description = castToString(value); // StringType
1814          return value;
1815        default: return super.setProperty(hash, name, value);
1816        }
1817
1818      }
1819
1820      @Override
1821      public Base setProperty(String name, Base value) throws FHIRException {
1822        if (name.equals("url")) {
1823          this.url = castToUri(value); // UriType
1824        } else if (name.equals("description")) {
1825          this.description = castToString(value); // StringType
1826        } else
1827          return super.setProperty(name, value);
1828        return value;
1829      }
1830
1831      @Override
1832      public Base makeProperty(int hash, String name) throws FHIRException {
1833        switch (hash) {
1834        case 116079:  return getUrlElement();
1835        case -1724546052:  return getDescriptionElement();
1836        default: return super.makeProperty(hash, name);
1837        }
1838
1839      }
1840
1841      @Override
1842      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
1843        switch (hash) {
1844        case 116079: /*url*/ return new String[] {"uri"};
1845        case -1724546052: /*description*/ return new String[] {"string"};
1846        default: return super.getTypesForProperty(hash, name);
1847        }
1848
1849      }
1850
1851      @Override
1852      public Base addChild(String name) throws FHIRException {
1853        if (name.equals("url")) {
1854          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
1855        }
1856        else if (name.equals("description")) {
1857          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
1858        }
1859        else
1860          return super.addChild(name);
1861      }
1862
1863      public TestScriptMetadataLinkComponent copy() {
1864        TestScriptMetadataLinkComponent dst = new TestScriptMetadataLinkComponent();
1865        copyValues(dst);
1866        dst.url = url == null ? null : url.copy();
1867        dst.description = description == null ? null : description.copy();
1868        return dst;
1869      }
1870
1871      @Override
1872      public boolean equalsDeep(Base other_) {
1873        if (!super.equalsDeep(other_))
1874          return false;
1875        if (!(other_ instanceof TestScriptMetadataLinkComponent))
1876          return false;
1877        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other_;
1878        return compareDeep(url, o.url, true) && compareDeep(description, o.description, true);
1879      }
1880
1881      @Override
1882      public boolean equalsShallow(Base other_) {
1883        if (!super.equalsShallow(other_))
1884          return false;
1885        if (!(other_ instanceof TestScriptMetadataLinkComponent))
1886          return false;
1887        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other_;
1888        return compareValues(url, o.url, true) && compareValues(description, o.description, true);
1889      }
1890
1891      public boolean isEmpty() {
1892        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(url, description);
1893      }
1894
1895  public String fhirType() {
1896    return "TestScript.metadata.link";
1897
1898  }
1899
1900  }
1901
1902    @Block()
1903    public static class TestScriptMetadataCapabilityComponent extends BackboneElement implements IBaseBackboneElement {
1904        /**
1905         * Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1906         */
1907        @Child(name = "required", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1908        @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." )
1909        protected BooleanType required;
1910
1911        /**
1912         * Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1913         */
1914        @Child(name = "validated", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1915        @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." )
1916        protected BooleanType validated;
1917
1918        /**
1919         * Description of the capabilities that this test script is requiring the server to support.
1920         */
1921        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1922        @Description(shortDefinition="The expected capabilities of the server", formalDefinition="Description of the capabilities that this test script is requiring the server to support." )
1923        protected StringType description;
1924
1925        /**
1926         * Which origin server these requirements apply to.
1927         */
1928        @Child(name = "origin", type = {IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1929        @Description(shortDefinition="Which origin server these requirements apply to", formalDefinition="Which origin server these requirements apply to." )
1930        protected List<IntegerType> origin;
1931
1932        /**
1933         * Which server these requirements apply to.
1934         */
1935        @Child(name = "destination", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=false)
1936        @Description(shortDefinition="Which server these requirements apply to", formalDefinition="Which server these requirements apply to." )
1937        protected IntegerType destination;
1938
1939        /**
1940         * Links to the FHIR specification that describes this interaction and the resources involved in more detail.
1941         */
1942        @Child(name = "link", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1943        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="Links to the FHIR specification that describes this interaction and the resources involved in more detail." )
1944        protected List<UriType> link;
1945
1946        /**
1947         * 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.
1948         */
1949        @Child(name = "capabilities", type = {CapabilityStatement.class}, order=7, min=1, max=1, modifier=false, summary=false)
1950        @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." )
1951        protected Reference capabilities;
1952
1953        /**
1954         * The actual object that is the target of the reference (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.)
1955         */
1956        protected CapabilityStatement capabilitiesTarget;
1957
1958        private static final long serialVersionUID = -106110735L;
1959
1960    /**
1961     * Constructor
1962     */
1963      public TestScriptMetadataCapabilityComponent() {
1964        super();
1965      }
1966
1967    /**
1968     * Constructor
1969     */
1970      public TestScriptMetadataCapabilityComponent(Reference capabilities) {
1971        super();
1972        this.capabilities = capabilities;
1973      }
1974
1975        /**
1976         * @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
1977         */
1978        public BooleanType getRequiredElement() { 
1979          if (this.required == null)
1980            if (Configuration.errorOnAutoCreate())
1981              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.required");
1982            else if (Configuration.doAutoCreate())
1983              this.required = new BooleanType(); // bb
1984          return this.required;
1985        }
1986
1987        public boolean hasRequiredElement() { 
1988          return this.required != null && !this.required.isEmpty();
1989        }
1990
1991        public boolean hasRequired() { 
1992          return this.required != null && !this.required.isEmpty();
1993        }
1994
1995        /**
1996         * @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
1997         */
1998        public TestScriptMetadataCapabilityComponent setRequiredElement(BooleanType value) { 
1999          this.required = value;
2000          return this;
2001        }
2002
2003        /**
2004         * @return Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
2005         */
2006        public boolean getRequired() { 
2007          return this.required == null || this.required.isEmpty() ? false : this.required.getValue();
2008        }
2009
2010        /**
2011         * @param value Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
2012         */
2013        public TestScriptMetadataCapabilityComponent setRequired(boolean value) { 
2014            if (this.required == null)
2015              this.required = new BooleanType();
2016            this.required.setValue(value);
2017          return this;
2018        }
2019
2020        /**
2021         * @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
2022         */
2023        public BooleanType getValidatedElement() { 
2024          if (this.validated == null)
2025            if (Configuration.errorOnAutoCreate())
2026              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.validated");
2027            else if (Configuration.doAutoCreate())
2028              this.validated = new BooleanType(); // bb
2029          return this.validated;
2030        }
2031
2032        public boolean hasValidatedElement() { 
2033          return this.validated != null && !this.validated.isEmpty();
2034        }
2035
2036        public boolean hasValidated() { 
2037          return this.validated != null && !this.validated.isEmpty();
2038        }
2039
2040        /**
2041         * @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
2042         */
2043        public TestScriptMetadataCapabilityComponent setValidatedElement(BooleanType value) { 
2044          this.validated = value;
2045          return this;
2046        }
2047
2048        /**
2049         * @return Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
2050         */
2051        public boolean getValidated() { 
2052          return this.validated == null || this.validated.isEmpty() ? false : this.validated.getValue();
2053        }
2054
2055        /**
2056         * @param value Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
2057         */
2058        public TestScriptMetadataCapabilityComponent setValidated(boolean value) { 
2059            if (this.validated == null)
2060              this.validated = new BooleanType();
2061            this.validated.setValue(value);
2062          return this;
2063        }
2064
2065        /**
2066         * @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
2067         */
2068        public StringType getDescriptionElement() { 
2069          if (this.description == null)
2070            if (Configuration.errorOnAutoCreate())
2071              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.description");
2072            else if (Configuration.doAutoCreate())
2073              this.description = new StringType(); // bb
2074          return this.description;
2075        }
2076
2077        public boolean hasDescriptionElement() { 
2078          return this.description != null && !this.description.isEmpty();
2079        }
2080
2081        public boolean hasDescription() { 
2082          return this.description != null && !this.description.isEmpty();
2083        }
2084
2085        /**
2086         * @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
2087         */
2088        public TestScriptMetadataCapabilityComponent setDescriptionElement(StringType value) { 
2089          this.description = value;
2090          return this;
2091        }
2092
2093        /**
2094         * @return Description of the capabilities that this test script is requiring the server to support.
2095         */
2096        public String getDescription() { 
2097          return this.description == null ? null : this.description.getValue();
2098        }
2099
2100        /**
2101         * @param value Description of the capabilities that this test script is requiring the server to support.
2102         */
2103        public TestScriptMetadataCapabilityComponent setDescription(String value) { 
2104          if (Utilities.noString(value))
2105            this.description = null;
2106          else {
2107            if (this.description == null)
2108              this.description = new StringType();
2109            this.description.setValue(value);
2110          }
2111          return this;
2112        }
2113
2114        /**
2115         * @return {@link #origin} (Which origin server these requirements apply to.)
2116         */
2117        public List<IntegerType> getOrigin() { 
2118          if (this.origin == null)
2119            this.origin = new ArrayList<IntegerType>();
2120          return this.origin;
2121        }
2122
2123        /**
2124         * @return Returns a reference to <code>this</code> for easy method chaining
2125         */
2126        public TestScriptMetadataCapabilityComponent setOrigin(List<IntegerType> theOrigin) { 
2127          this.origin = theOrigin;
2128          return this;
2129        }
2130
2131        public boolean hasOrigin() { 
2132          if (this.origin == null)
2133            return false;
2134          for (IntegerType item : this.origin)
2135            if (!item.isEmpty())
2136              return true;
2137          return false;
2138        }
2139
2140        /**
2141         * @return {@link #origin} (Which origin server these requirements apply to.)
2142         */
2143        public IntegerType addOriginElement() {//2 
2144          IntegerType t = new IntegerType();
2145          if (this.origin == null)
2146            this.origin = new ArrayList<IntegerType>();
2147          this.origin.add(t);
2148          return t;
2149        }
2150
2151        /**
2152         * @param value {@link #origin} (Which origin server these requirements apply to.)
2153         */
2154        public TestScriptMetadataCapabilityComponent addOrigin(int value) { //1
2155          IntegerType t = new IntegerType();
2156          t.setValue(value);
2157          if (this.origin == null)
2158            this.origin = new ArrayList<IntegerType>();
2159          this.origin.add(t);
2160          return this;
2161        }
2162
2163        /**
2164         * @param value {@link #origin} (Which origin server these requirements apply to.)
2165         */
2166        public boolean hasOrigin(int value) { 
2167          if (this.origin == null)
2168            return false;
2169          for (IntegerType v : this.origin)
2170            if (v.getValue().equals(value)) // integer
2171              return true;
2172          return false;
2173        }
2174
2175        /**
2176         * @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
2177         */
2178        public IntegerType getDestinationElement() { 
2179          if (this.destination == null)
2180            if (Configuration.errorOnAutoCreate())
2181              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.destination");
2182            else if (Configuration.doAutoCreate())
2183              this.destination = new IntegerType(); // bb
2184          return this.destination;
2185        }
2186
2187        public boolean hasDestinationElement() { 
2188          return this.destination != null && !this.destination.isEmpty();
2189        }
2190
2191        public boolean hasDestination() { 
2192          return this.destination != null && !this.destination.isEmpty();
2193        }
2194
2195        /**
2196         * @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
2197         */
2198        public TestScriptMetadataCapabilityComponent setDestinationElement(IntegerType value) { 
2199          this.destination = value;
2200          return this;
2201        }
2202
2203        /**
2204         * @return Which server these requirements apply to.
2205         */
2206        public int getDestination() { 
2207          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
2208        }
2209
2210        /**
2211         * @param value Which server these requirements apply to.
2212         */
2213        public TestScriptMetadataCapabilityComponent setDestination(int value) { 
2214            if (this.destination == null)
2215              this.destination = new IntegerType();
2216            this.destination.setValue(value);
2217          return this;
2218        }
2219
2220        /**
2221         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2222         */
2223        public List<UriType> getLink() { 
2224          if (this.link == null)
2225            this.link = new ArrayList<UriType>();
2226          return this.link;
2227        }
2228
2229        /**
2230         * @return Returns a reference to <code>this</code> for easy method chaining
2231         */
2232        public TestScriptMetadataCapabilityComponent setLink(List<UriType> theLink) { 
2233          this.link = theLink;
2234          return this;
2235        }
2236
2237        public boolean hasLink() { 
2238          if (this.link == null)
2239            return false;
2240          for (UriType item : this.link)
2241            if (!item.isEmpty())
2242              return true;
2243          return false;
2244        }
2245
2246        /**
2247         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2248         */
2249        public UriType addLinkElement() {//2 
2250          UriType t = new UriType();
2251          if (this.link == null)
2252            this.link = new ArrayList<UriType>();
2253          this.link.add(t);
2254          return t;
2255        }
2256
2257        /**
2258         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2259         */
2260        public TestScriptMetadataCapabilityComponent addLink(String value) { //1
2261          UriType t = new UriType();
2262          t.setValue(value);
2263          if (this.link == null)
2264            this.link = new ArrayList<UriType>();
2265          this.link.add(t);
2266          return this;
2267        }
2268
2269        /**
2270         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
2271         */
2272        public boolean hasLink(String value) { 
2273          if (this.link == null)
2274            return false;
2275          for (UriType v : this.link)
2276            if (v.getValue().equals(value)) // uri
2277              return true;
2278          return false;
2279        }
2280
2281        /**
2282         * @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.)
2283         */
2284        public Reference getCapabilities() { 
2285          if (this.capabilities == null)
2286            if (Configuration.errorOnAutoCreate())
2287              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.capabilities");
2288            else if (Configuration.doAutoCreate())
2289              this.capabilities = new Reference(); // cc
2290          return this.capabilities;
2291        }
2292
2293        public boolean hasCapabilities() { 
2294          return this.capabilities != null && !this.capabilities.isEmpty();
2295        }
2296
2297        /**
2298         * @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.)
2299         */
2300        public TestScriptMetadataCapabilityComponent setCapabilities(Reference value)  { 
2301          this.capabilities = value;
2302          return this;
2303        }
2304
2305        /**
2306         * @return {@link #capabilities} 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. (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.)
2307         */
2308        public CapabilityStatement getCapabilitiesTarget() { 
2309          if (this.capabilitiesTarget == null)
2310            if (Configuration.errorOnAutoCreate())
2311              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.capabilities");
2312            else if (Configuration.doAutoCreate())
2313              this.capabilitiesTarget = new CapabilityStatement(); // aa
2314          return this.capabilitiesTarget;
2315        }
2316
2317        /**
2318         * @param value {@link #capabilities} 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. (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.)
2319         */
2320        public TestScriptMetadataCapabilityComponent setCapabilitiesTarget(CapabilityStatement value) { 
2321          this.capabilitiesTarget = value;
2322          return this;
2323        }
2324
2325        protected void listChildren(List<Property> children) {
2326          super.listChildren(children);
2327          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));
2328          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));
2329          children.add(new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, 1, description));
2330          children.add(new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin));
2331          children.add(new Property("destination", "integer", "Which server these requirements apply to.", 0, 1, destination));
2332          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));
2333          children.add(new Property("capabilities", "Reference(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));
2334        }
2335
2336        @Override
2337        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2338          switch (_hash) {
2339          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);
2340          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);
2341          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);
2342          case -1008619738: /*origin*/  return new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin);
2343          case -1429847026: /*destination*/  return new Property("destination", "integer", "Which server these requirements apply to.", 0, 1, destination);
2344          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);
2345          case -1487597642: /*capabilities*/  return new Property("capabilities", "Reference(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);
2346          default: return super.getNamedProperty(_hash, _name, _checkValid);
2347          }
2348
2349        }
2350
2351      @Override
2352      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2353        switch (hash) {
2354        case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType
2355        case -1109784050: /*validated*/ return this.validated == null ? new Base[0] : new Base[] {this.validated}; // BooleanType
2356        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
2357        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // IntegerType
2358        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType
2359        case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // UriType
2360        case -1487597642: /*capabilities*/ return this.capabilities == null ? new Base[0] : new Base[] {this.capabilities}; // Reference
2361        default: return super.getProperty(hash, name, checkValid);
2362        }
2363
2364      }
2365
2366      @Override
2367      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2368        switch (hash) {
2369        case -393139297: // required
2370          this.required = castToBoolean(value); // BooleanType
2371          return value;
2372        case -1109784050: // validated
2373          this.validated = castToBoolean(value); // BooleanType
2374          return value;
2375        case -1724546052: // description
2376          this.description = castToString(value); // StringType
2377          return value;
2378        case -1008619738: // origin
2379          this.getOrigin().add(castToInteger(value)); // IntegerType
2380          return value;
2381        case -1429847026: // destination
2382          this.destination = castToInteger(value); // IntegerType
2383          return value;
2384        case 3321850: // link
2385          this.getLink().add(castToUri(value)); // UriType
2386          return value;
2387        case -1487597642: // capabilities
2388          this.capabilities = castToReference(value); // Reference
2389          return value;
2390        default: return super.setProperty(hash, name, value);
2391        }
2392
2393      }
2394
2395      @Override
2396      public Base setProperty(String name, Base value) throws FHIRException {
2397        if (name.equals("required")) {
2398          this.required = castToBoolean(value); // BooleanType
2399        } else if (name.equals("validated")) {
2400          this.validated = castToBoolean(value); // BooleanType
2401        } else if (name.equals("description")) {
2402          this.description = castToString(value); // StringType
2403        } else if (name.equals("origin")) {
2404          this.getOrigin().add(castToInteger(value));
2405        } else if (name.equals("destination")) {
2406          this.destination = castToInteger(value); // IntegerType
2407        } else if (name.equals("link")) {
2408          this.getLink().add(castToUri(value));
2409        } else if (name.equals("capabilities")) {
2410          this.capabilities = castToReference(value); // Reference
2411        } else
2412          return super.setProperty(name, value);
2413        return value;
2414      }
2415
2416      @Override
2417      public Base makeProperty(int hash, String name) throws FHIRException {
2418        switch (hash) {
2419        case -393139297:  return getRequiredElement();
2420        case -1109784050:  return getValidatedElement();
2421        case -1724546052:  return getDescriptionElement();
2422        case -1008619738:  return addOriginElement();
2423        case -1429847026:  return getDestinationElement();
2424        case 3321850:  return addLinkElement();
2425        case -1487597642:  return getCapabilities(); 
2426        default: return super.makeProperty(hash, name);
2427        }
2428
2429      }
2430
2431      @Override
2432      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2433        switch (hash) {
2434        case -393139297: /*required*/ return new String[] {"boolean"};
2435        case -1109784050: /*validated*/ return new String[] {"boolean"};
2436        case -1724546052: /*description*/ return new String[] {"string"};
2437        case -1008619738: /*origin*/ return new String[] {"integer"};
2438        case -1429847026: /*destination*/ return new String[] {"integer"};
2439        case 3321850: /*link*/ return new String[] {"uri"};
2440        case -1487597642: /*capabilities*/ return new String[] {"Reference"};
2441        default: return super.getTypesForProperty(hash, name);
2442        }
2443
2444      }
2445
2446      @Override
2447      public Base addChild(String name) throws FHIRException {
2448        if (name.equals("required")) {
2449          throw new FHIRException("Cannot call addChild on a primitive type TestScript.required");
2450        }
2451        else if (name.equals("validated")) {
2452          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validated");
2453        }
2454        else if (name.equals("description")) {
2455          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
2456        }
2457        else if (name.equals("origin")) {
2458          throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin");
2459        }
2460        else if (name.equals("destination")) {
2461          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
2462        }
2463        else if (name.equals("link")) {
2464          throw new FHIRException("Cannot call addChild on a primitive type TestScript.link");
2465        }
2466        else if (name.equals("capabilities")) {
2467          this.capabilities = new Reference();
2468          return this.capabilities;
2469        }
2470        else
2471          return super.addChild(name);
2472      }
2473
2474      public TestScriptMetadataCapabilityComponent copy() {
2475        TestScriptMetadataCapabilityComponent dst = new TestScriptMetadataCapabilityComponent();
2476        copyValues(dst);
2477        dst.required = required == null ? null : required.copy();
2478        dst.validated = validated == null ? null : validated.copy();
2479        dst.description = description == null ? null : description.copy();
2480        if (origin != null) {
2481          dst.origin = new ArrayList<IntegerType>();
2482          for (IntegerType i : origin)
2483            dst.origin.add(i.copy());
2484        };
2485        dst.destination = destination == null ? null : destination.copy();
2486        if (link != null) {
2487          dst.link = new ArrayList<UriType>();
2488          for (UriType i : link)
2489            dst.link.add(i.copy());
2490        };
2491        dst.capabilities = capabilities == null ? null : capabilities.copy();
2492        return dst;
2493      }
2494
2495      @Override
2496      public boolean equalsDeep(Base other_) {
2497        if (!super.equalsDeep(other_))
2498          return false;
2499        if (!(other_ instanceof TestScriptMetadataCapabilityComponent))
2500          return false;
2501        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other_;
2502        return compareDeep(required, o.required, true) && compareDeep(validated, o.validated, true) && compareDeep(description, o.description, true)
2503           && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(link, o.link, true)
2504           && compareDeep(capabilities, o.capabilities, true);
2505      }
2506
2507      @Override
2508      public boolean equalsShallow(Base other_) {
2509        if (!super.equalsShallow(other_))
2510          return false;
2511        if (!(other_ instanceof TestScriptMetadataCapabilityComponent))
2512          return false;
2513        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other_;
2514        return compareValues(required, o.required, true) && compareValues(validated, o.validated, true) && compareValues(description, o.description, true)
2515           && compareValues(origin, o.origin, true) && compareValues(destination, o.destination, true) && compareValues(link, o.link, true)
2516          ;
2517      }
2518
2519      public boolean isEmpty() {
2520        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(required, validated, description
2521          , origin, destination, link, capabilities);
2522      }
2523
2524  public String fhirType() {
2525    return "TestScript.metadata.capability";
2526
2527  }
2528
2529  }
2530
2531    @Block()
2532    public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement {
2533        /**
2534         * 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.
2535         */
2536        @Child(name = "autocreate", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
2537        @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." )
2538        protected BooleanType autocreate;
2539
2540        /**
2541         * 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.
2542         */
2543        @Child(name = "autodelete", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2544        @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." )
2545        protected BooleanType autodelete;
2546
2547        /**
2548         * Reference to the resource (containing the contents of the resource needed for operations).
2549         */
2550        @Child(name = "resource", type = {Reference.class}, order=3, min=0, max=1, modifier=false, summary=false)
2551        @Description(shortDefinition="Reference of the resource", formalDefinition="Reference to the resource (containing the contents of the resource needed for operations)." )
2552        protected Reference resource;
2553
2554        /**
2555         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the resource needed for operations).)
2556         */
2557        protected Resource resourceTarget;
2558
2559        private static final long serialVersionUID = 1110683307L;
2560
2561    /**
2562     * Constructor
2563     */
2564      public TestScriptFixtureComponent() {
2565        super();
2566      }
2567
2568        /**
2569         * @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
2570         */
2571        public BooleanType getAutocreateElement() { 
2572          if (this.autocreate == null)
2573            if (Configuration.errorOnAutoCreate())
2574              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate");
2575            else if (Configuration.doAutoCreate())
2576              this.autocreate = new BooleanType(); // bb
2577          return this.autocreate;
2578        }
2579
2580        public boolean hasAutocreateElement() { 
2581          return this.autocreate != null && !this.autocreate.isEmpty();
2582        }
2583
2584        public boolean hasAutocreate() { 
2585          return this.autocreate != null && !this.autocreate.isEmpty();
2586        }
2587
2588        /**
2589         * @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
2590         */
2591        public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { 
2592          this.autocreate = value;
2593          return this;
2594        }
2595
2596        /**
2597         * @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.
2598         */
2599        public boolean getAutocreate() { 
2600          return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue();
2601        }
2602
2603        /**
2604         * @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.
2605         */
2606        public TestScriptFixtureComponent setAutocreate(boolean value) { 
2607            if (this.autocreate == null)
2608              this.autocreate = new BooleanType();
2609            this.autocreate.setValue(value);
2610          return this;
2611        }
2612
2613        /**
2614         * @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
2615         */
2616        public BooleanType getAutodeleteElement() { 
2617          if (this.autodelete == null)
2618            if (Configuration.errorOnAutoCreate())
2619              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete");
2620            else if (Configuration.doAutoCreate())
2621              this.autodelete = new BooleanType(); // bb
2622          return this.autodelete;
2623        }
2624
2625        public boolean hasAutodeleteElement() { 
2626          return this.autodelete != null && !this.autodelete.isEmpty();
2627        }
2628
2629        public boolean hasAutodelete() { 
2630          return this.autodelete != null && !this.autodelete.isEmpty();
2631        }
2632
2633        /**
2634         * @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
2635         */
2636        public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { 
2637          this.autodelete = value;
2638          return this;
2639        }
2640
2641        /**
2642         * @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.
2643         */
2644        public boolean getAutodelete() { 
2645          return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue();
2646        }
2647
2648        /**
2649         * @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.
2650         */
2651        public TestScriptFixtureComponent setAutodelete(boolean value) { 
2652            if (this.autodelete == null)
2653              this.autodelete = new BooleanType();
2654            this.autodelete.setValue(value);
2655          return this;
2656        }
2657
2658        /**
2659         * @return {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
2660         */
2661        public Reference getResource() { 
2662          if (this.resource == null)
2663            if (Configuration.errorOnAutoCreate())
2664              throw new Error("Attempt to auto-create TestScriptFixtureComponent.resource");
2665            else if (Configuration.doAutoCreate())
2666              this.resource = new Reference(); // cc
2667          return this.resource;
2668        }
2669
2670        public boolean hasResource() { 
2671          return this.resource != null && !this.resource.isEmpty();
2672        }
2673
2674        /**
2675         * @param value {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
2676         */
2677        public TestScriptFixtureComponent setResource(Reference value)  { 
2678          this.resource = value;
2679          return this;
2680        }
2681
2682        /**
2683         * @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).)
2684         */
2685        public Resource getResourceTarget() { 
2686          return this.resourceTarget;
2687        }
2688
2689        /**
2690         * @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).)
2691         */
2692        public TestScriptFixtureComponent setResourceTarget(Resource value) { 
2693          this.resourceTarget = value;
2694          return this;
2695        }
2696
2697        protected void listChildren(List<Property> children) {
2698          super.listChildren(children);
2699          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));
2700          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));
2701          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, 1, resource));
2702        }
2703
2704        @Override
2705        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
2706          switch (_hash) {
2707          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);
2708          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);
2709          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);
2710          default: return super.getNamedProperty(_hash, _name, _checkValid);
2711          }
2712
2713        }
2714
2715      @Override
2716      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
2717        switch (hash) {
2718        case 73154411: /*autocreate*/ return this.autocreate == null ? new Base[0] : new Base[] {this.autocreate}; // BooleanType
2719        case 89990170: /*autodelete*/ return this.autodelete == null ? new Base[0] : new Base[] {this.autodelete}; // BooleanType
2720        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
2721        default: return super.getProperty(hash, name, checkValid);
2722        }
2723
2724      }
2725
2726      @Override
2727      public Base setProperty(int hash, String name, Base value) throws FHIRException {
2728        switch (hash) {
2729        case 73154411: // autocreate
2730          this.autocreate = castToBoolean(value); // BooleanType
2731          return value;
2732        case 89990170: // autodelete
2733          this.autodelete = castToBoolean(value); // BooleanType
2734          return value;
2735        case -341064690: // resource
2736          this.resource = castToReference(value); // Reference
2737          return value;
2738        default: return super.setProperty(hash, name, value);
2739        }
2740
2741      }
2742
2743      @Override
2744      public Base setProperty(String name, Base value) throws FHIRException {
2745        if (name.equals("autocreate")) {
2746          this.autocreate = castToBoolean(value); // BooleanType
2747        } else if (name.equals("autodelete")) {
2748          this.autodelete = castToBoolean(value); // BooleanType
2749        } else if (name.equals("resource")) {
2750          this.resource = castToReference(value); // Reference
2751        } else
2752          return super.setProperty(name, value);
2753        return value;
2754      }
2755
2756      @Override
2757      public Base makeProperty(int hash, String name) throws FHIRException {
2758        switch (hash) {
2759        case 73154411:  return getAutocreateElement();
2760        case 89990170:  return getAutodeleteElement();
2761        case -341064690:  return getResource(); 
2762        default: return super.makeProperty(hash, name);
2763        }
2764
2765      }
2766
2767      @Override
2768      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
2769        switch (hash) {
2770        case 73154411: /*autocreate*/ return new String[] {"boolean"};
2771        case 89990170: /*autodelete*/ return new String[] {"boolean"};
2772        case -341064690: /*resource*/ return new String[] {"Reference"};
2773        default: return super.getTypesForProperty(hash, name);
2774        }
2775
2776      }
2777
2778      @Override
2779      public Base addChild(String name) throws FHIRException {
2780        if (name.equals("autocreate")) {
2781          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autocreate");
2782        }
2783        else if (name.equals("autodelete")) {
2784          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autodelete");
2785        }
2786        else if (name.equals("resource")) {
2787          this.resource = new Reference();
2788          return this.resource;
2789        }
2790        else
2791          return super.addChild(name);
2792      }
2793
2794      public TestScriptFixtureComponent copy() {
2795        TestScriptFixtureComponent dst = new TestScriptFixtureComponent();
2796        copyValues(dst);
2797        dst.autocreate = autocreate == null ? null : autocreate.copy();
2798        dst.autodelete = autodelete == null ? null : autodelete.copy();
2799        dst.resource = resource == null ? null : resource.copy();
2800        return dst;
2801      }
2802
2803      @Override
2804      public boolean equalsDeep(Base other_) {
2805        if (!super.equalsDeep(other_))
2806          return false;
2807        if (!(other_ instanceof TestScriptFixtureComponent))
2808          return false;
2809        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other_;
2810        return compareDeep(autocreate, o.autocreate, true) && compareDeep(autodelete, o.autodelete, true)
2811           && compareDeep(resource, o.resource, true);
2812      }
2813
2814      @Override
2815      public boolean equalsShallow(Base other_) {
2816        if (!super.equalsShallow(other_))
2817          return false;
2818        if (!(other_ instanceof TestScriptFixtureComponent))
2819          return false;
2820        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other_;
2821        return compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true)
2822          ;
2823      }
2824
2825      public boolean isEmpty() {
2826        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(autocreate, autodelete, resource
2827          );
2828      }
2829
2830  public String fhirType() {
2831    return "TestScript.fixture";
2832
2833  }
2834
2835  }
2836
2837    @Block()
2838    public static class TestScriptVariableComponent extends BackboneElement implements IBaseBackboneElement {
2839        /**
2840         * Descriptive name for this variable.
2841         */
2842        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
2843        @Description(shortDefinition="Descriptive name for this variable", formalDefinition="Descriptive name for this variable." )
2844        protected StringType name;
2845
2846        /**
2847         * A default, hard-coded, or user-defined value for this variable.
2848         */
2849        @Child(name = "defaultValue", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2850        @Description(shortDefinition="Default, hard-coded, or user-defined value for this variable", formalDefinition="A default, hard-coded, or user-defined value for this variable." )
2851        protected StringType defaultValue;
2852
2853        /**
2854         * A free text natural language description of the variable and its purpose.
2855         */
2856        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2857        @Description(shortDefinition="Natural language description of the variable", formalDefinition="A free text natural language description of the variable and its purpose." )
2858        protected StringType description;
2859
2860        /**
2861         * The fluentpath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
2862         */
2863        @Child(name = "expression", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2864        @Description(shortDefinition="The fluentpath expression against the fixture body", formalDefinition="The fluentpath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified." )
2865        protected StringType expression;
2866
2867        /**
2868         * Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2869         */
2870        @Child(name = "headerField", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2871        @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." )
2872        protected StringType headerField;
2873
2874        /**
2875         * Displayable text string with hint help information to the user when entering a default value.
2876         */
2877        @Child(name = "hint", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2878        @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." )
2879        protected StringType hint;
2880
2881        /**
2882         * XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.
2883         */
2884        @Child(name = "path", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2885        @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." )
2886        protected StringType path;
2887
2888        /**
2889         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
2890         */
2891        @Child(name = "sourceId", type = {IdType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2892        @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." )
2893        protected IdType sourceId;
2894
2895        private static final long serialVersionUID = -1592325432L;
2896
2897    /**
2898     * Constructor
2899     */
2900      public TestScriptVariableComponent() {
2901        super();
2902      }
2903
2904    /**
2905     * Constructor
2906     */
2907      public TestScriptVariableComponent(StringType name) {
2908        super();
2909        this.name = name;
2910      }
2911
2912        /**
2913         * @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
2914         */
2915        public StringType getNameElement() { 
2916          if (this.name == null)
2917            if (Configuration.errorOnAutoCreate())
2918              throw new Error("Attempt to auto-create TestScriptVariableComponent.name");
2919            else if (Configuration.doAutoCreate())
2920              this.name = new StringType(); // bb
2921          return this.name;
2922        }
2923
2924        public boolean hasNameElement() { 
2925          return this.name != null && !this.name.isEmpty();
2926        }
2927
2928        public boolean hasName() { 
2929          return this.name != null && !this.name.isEmpty();
2930        }
2931
2932        /**
2933         * @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
2934         */
2935        public TestScriptVariableComponent setNameElement(StringType value) { 
2936          this.name = value;
2937          return this;
2938        }
2939
2940        /**
2941         * @return Descriptive name for this variable.
2942         */
2943        public String getName() { 
2944          return this.name == null ? null : this.name.getValue();
2945        }
2946
2947        /**
2948         * @param value Descriptive name for this variable.
2949         */
2950        public TestScriptVariableComponent setName(String value) { 
2951            if (this.name == null)
2952              this.name = new StringType();
2953            this.name.setValue(value);
2954          return this;
2955        }
2956
2957        /**
2958         * @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
2959         */
2960        public StringType getDefaultValueElement() { 
2961          if (this.defaultValue == null)
2962            if (Configuration.errorOnAutoCreate())
2963              throw new Error("Attempt to auto-create TestScriptVariableComponent.defaultValue");
2964            else if (Configuration.doAutoCreate())
2965              this.defaultValue = new StringType(); // bb
2966          return this.defaultValue;
2967        }
2968
2969        public boolean hasDefaultValueElement() { 
2970          return this.defaultValue != null && !this.defaultValue.isEmpty();
2971        }
2972
2973        public boolean hasDefaultValue() { 
2974          return this.defaultValue != null && !this.defaultValue.isEmpty();
2975        }
2976
2977        /**
2978         * @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
2979         */
2980        public TestScriptVariableComponent setDefaultValueElement(StringType value) { 
2981          this.defaultValue = value;
2982          return this;
2983        }
2984
2985        /**
2986         * @return A default, hard-coded, or user-defined value for this variable.
2987         */
2988        public String getDefaultValue() { 
2989          return this.defaultValue == null ? null : this.defaultValue.getValue();
2990        }
2991
2992        /**
2993         * @param value A default, hard-coded, or user-defined value for this variable.
2994         */
2995        public TestScriptVariableComponent setDefaultValue(String value) { 
2996          if (Utilities.noString(value))
2997            this.defaultValue = null;
2998          else {
2999            if (this.defaultValue == null)
3000              this.defaultValue = new StringType();
3001            this.defaultValue.setValue(value);
3002          }
3003          return this;
3004        }
3005
3006        /**
3007         * @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
3008         */
3009        public StringType getDescriptionElement() { 
3010          if (this.description == null)
3011            if (Configuration.errorOnAutoCreate())
3012              throw new Error("Attempt to auto-create TestScriptVariableComponent.description");
3013            else if (Configuration.doAutoCreate())
3014              this.description = new StringType(); // bb
3015          return this.description;
3016        }
3017
3018        public boolean hasDescriptionElement() { 
3019          return this.description != null && !this.description.isEmpty();
3020        }
3021
3022        public boolean hasDescription() { 
3023          return this.description != null && !this.description.isEmpty();
3024        }
3025
3026        /**
3027         * @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
3028         */
3029        public TestScriptVariableComponent setDescriptionElement(StringType value) { 
3030          this.description = value;
3031          return this;
3032        }
3033
3034        /**
3035         * @return A free text natural language description of the variable and its purpose.
3036         */
3037        public String getDescription() { 
3038          return this.description == null ? null : this.description.getValue();
3039        }
3040
3041        /**
3042         * @param value A free text natural language description of the variable and its purpose.
3043         */
3044        public TestScriptVariableComponent setDescription(String value) { 
3045          if (Utilities.noString(value))
3046            this.description = null;
3047          else {
3048            if (this.description == null)
3049              this.description = new StringType();
3050            this.description.setValue(value);
3051          }
3052          return this;
3053        }
3054
3055        /**
3056         * @return {@link #expression} (The fluentpath 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
3057         */
3058        public StringType getExpressionElement() { 
3059          if (this.expression == null)
3060            if (Configuration.errorOnAutoCreate())
3061              throw new Error("Attempt to auto-create TestScriptVariableComponent.expression");
3062            else if (Configuration.doAutoCreate())
3063              this.expression = new StringType(); // bb
3064          return this.expression;
3065        }
3066
3067        public boolean hasExpressionElement() { 
3068          return this.expression != null && !this.expression.isEmpty();
3069        }
3070
3071        public boolean hasExpression() { 
3072          return this.expression != null && !this.expression.isEmpty();
3073        }
3074
3075        /**
3076         * @param value {@link #expression} (The fluentpath 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
3077         */
3078        public TestScriptVariableComponent setExpressionElement(StringType value) { 
3079          this.expression = value;
3080          return this;
3081        }
3082
3083        /**
3084         * @return The fluentpath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
3085         */
3086        public String getExpression() { 
3087          return this.expression == null ? null : this.expression.getValue();
3088        }
3089
3090        /**
3091         * @param value The fluentpath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.
3092         */
3093        public TestScriptVariableComponent setExpression(String value) { 
3094          if (Utilities.noString(value))
3095            this.expression = null;
3096          else {
3097            if (this.expression == null)
3098              this.expression = new StringType();
3099            this.expression.setValue(value);
3100          }
3101          return this;
3102        }
3103
3104        /**
3105         * @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
3106         */
3107        public StringType getHeaderFieldElement() { 
3108          if (this.headerField == null)
3109            if (Configuration.errorOnAutoCreate())
3110              throw new Error("Attempt to auto-create TestScriptVariableComponent.headerField");
3111            else if (Configuration.doAutoCreate())
3112              this.headerField = new StringType(); // bb
3113          return this.headerField;
3114        }
3115
3116        public boolean hasHeaderFieldElement() { 
3117          return this.headerField != null && !this.headerField.isEmpty();
3118        }
3119
3120        public boolean hasHeaderField() { 
3121          return this.headerField != null && !this.headerField.isEmpty();
3122        }
3123
3124        /**
3125         * @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
3126         */
3127        public TestScriptVariableComponent setHeaderFieldElement(StringType value) { 
3128          this.headerField = value;
3129          return this;
3130        }
3131
3132        /**
3133         * @return Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
3134         */
3135        public String getHeaderField() { 
3136          return this.headerField == null ? null : this.headerField.getValue();
3137        }
3138
3139        /**
3140         * @param value Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
3141         */
3142        public TestScriptVariableComponent setHeaderField(String value) { 
3143          if (Utilities.noString(value))
3144            this.headerField = null;
3145          else {
3146            if (this.headerField == null)
3147              this.headerField = new StringType();
3148            this.headerField.setValue(value);
3149          }
3150          return this;
3151        }
3152
3153        /**
3154         * @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
3155         */
3156        public StringType getHintElement() { 
3157          if (this.hint == null)
3158            if (Configuration.errorOnAutoCreate())
3159              throw new Error("Attempt to auto-create TestScriptVariableComponent.hint");
3160            else if (Configuration.doAutoCreate())
3161              this.hint = new StringType(); // bb
3162          return this.hint;
3163        }
3164
3165        public boolean hasHintElement() { 
3166          return this.hint != null && !this.hint.isEmpty();
3167        }
3168
3169        public boolean hasHint() { 
3170          return this.hint != null && !this.hint.isEmpty();
3171        }
3172
3173        /**
3174         * @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
3175         */
3176        public TestScriptVariableComponent setHintElement(StringType value) { 
3177          this.hint = value;
3178          return this;
3179        }
3180
3181        /**
3182         * @return Displayable text string with hint help information to the user when entering a default value.
3183         */
3184        public String getHint() { 
3185          return this.hint == null ? null : this.hint.getValue();
3186        }
3187
3188        /**
3189         * @param value Displayable text string with hint help information to the user when entering a default value.
3190         */
3191        public TestScriptVariableComponent setHint(String value) { 
3192          if (Utilities.noString(value))
3193            this.hint = null;
3194          else {
3195            if (this.hint == null)
3196              this.hint = new StringType();
3197            this.hint.setValue(value);
3198          }
3199          return this;
3200        }
3201
3202        /**
3203         * @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
3204         */
3205        public StringType getPathElement() { 
3206          if (this.path == null)
3207            if (Configuration.errorOnAutoCreate())
3208              throw new Error("Attempt to auto-create TestScriptVariableComponent.path");
3209            else if (Configuration.doAutoCreate())
3210              this.path = new StringType(); // bb
3211          return this.path;
3212        }
3213
3214        public boolean hasPathElement() { 
3215          return this.path != null && !this.path.isEmpty();
3216        }
3217
3218        public boolean hasPath() { 
3219          return this.path != null && !this.path.isEmpty();
3220        }
3221
3222        /**
3223         * @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
3224         */
3225        public TestScriptVariableComponent setPathElement(StringType value) { 
3226          this.path = value;
3227          return this;
3228        }
3229
3230        /**
3231         * @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.
3232         */
3233        public String getPath() { 
3234          return this.path == null ? null : this.path.getValue();
3235        }
3236
3237        /**
3238         * @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.
3239         */
3240        public TestScriptVariableComponent setPath(String value) { 
3241          if (Utilities.noString(value))
3242            this.path = null;
3243          else {
3244            if (this.path == null)
3245              this.path = new StringType();
3246            this.path.setValue(value);
3247          }
3248          return this;
3249        }
3250
3251        /**
3252         * @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
3253         */
3254        public IdType getSourceIdElement() { 
3255          if (this.sourceId == null)
3256            if (Configuration.errorOnAutoCreate())
3257              throw new Error("Attempt to auto-create TestScriptVariableComponent.sourceId");
3258            else if (Configuration.doAutoCreate())
3259              this.sourceId = new IdType(); // bb
3260          return this.sourceId;
3261        }
3262
3263        public boolean hasSourceIdElement() { 
3264          return this.sourceId != null && !this.sourceId.isEmpty();
3265        }
3266
3267        public boolean hasSourceId() { 
3268          return this.sourceId != null && !this.sourceId.isEmpty();
3269        }
3270
3271        /**
3272         * @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
3273         */
3274        public TestScriptVariableComponent setSourceIdElement(IdType value) { 
3275          this.sourceId = value;
3276          return this;
3277        }
3278
3279        /**
3280         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
3281         */
3282        public String getSourceId() { 
3283          return this.sourceId == null ? null : this.sourceId.getValue();
3284        }
3285
3286        /**
3287         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
3288         */
3289        public TestScriptVariableComponent setSourceId(String value) { 
3290          if (Utilities.noString(value))
3291            this.sourceId = null;
3292          else {
3293            if (this.sourceId == null)
3294              this.sourceId = new IdType();
3295            this.sourceId.setValue(value);
3296          }
3297          return this;
3298        }
3299
3300        protected void listChildren(List<Property> children) {
3301          super.listChildren(children);
3302          children.add(new Property("name", "string", "Descriptive name for this variable.", 0, 1, name));
3303          children.add(new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, 1, defaultValue));
3304          children.add(new Property("description", "string", "A free text natural language description of the variable and its purpose.", 0, 1, description));
3305          children.add(new Property("expression", "string", "The fluentpath 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));
3306          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));
3307          children.add(new Property("hint", "string", "Displayable text string with hint help information to the user when entering a default value.", 0, 1, hint));
3308          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));
3309          children.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.", 0, 1, sourceId));
3310        }
3311
3312        @Override
3313        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3314          switch (_hash) {
3315          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this variable.", 0, 1, name);
3316          case -659125328: /*defaultValue*/  return new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, 1, defaultValue);
3317          case -1724546052: /*description*/  return new Property("description", "string", "A free text natural language description of the variable and its purpose.", 0, 1, description);
3318          case -1795452264: /*expression*/  return new Property("expression", "string", "The fluentpath 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);
3319          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);
3320          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);
3321          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);
3322          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);
3323          default: return super.getNamedProperty(_hash, _name, _checkValid);
3324          }
3325
3326        }
3327
3328      @Override
3329      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3330        switch (hash) {
3331        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3332        case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // StringType
3333        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
3334        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
3335        case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType
3336        case 3202695: /*hint*/ return this.hint == null ? new Base[0] : new Base[] {this.hint}; // StringType
3337        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
3338        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
3339        default: return super.getProperty(hash, name, checkValid);
3340        }
3341
3342      }
3343
3344      @Override
3345      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3346        switch (hash) {
3347        case 3373707: // name
3348          this.name = castToString(value); // StringType
3349          return value;
3350        case -659125328: // defaultValue
3351          this.defaultValue = castToString(value); // StringType
3352          return value;
3353        case -1724546052: // description
3354          this.description = castToString(value); // StringType
3355          return value;
3356        case -1795452264: // expression
3357          this.expression = castToString(value); // StringType
3358          return value;
3359        case 1160732269: // headerField
3360          this.headerField = castToString(value); // StringType
3361          return value;
3362        case 3202695: // hint
3363          this.hint = castToString(value); // StringType
3364          return value;
3365        case 3433509: // path
3366          this.path = castToString(value); // StringType
3367          return value;
3368        case 1746327190: // sourceId
3369          this.sourceId = castToId(value); // IdType
3370          return value;
3371        default: return super.setProperty(hash, name, value);
3372        }
3373
3374      }
3375
3376      @Override
3377      public Base setProperty(String name, Base value) throws FHIRException {
3378        if (name.equals("name")) {
3379          this.name = castToString(value); // StringType
3380        } else if (name.equals("defaultValue")) {
3381          this.defaultValue = castToString(value); // StringType
3382        } else if (name.equals("description")) {
3383          this.description = castToString(value); // StringType
3384        } else if (name.equals("expression")) {
3385          this.expression = castToString(value); // StringType
3386        } else if (name.equals("headerField")) {
3387          this.headerField = castToString(value); // StringType
3388        } else if (name.equals("hint")) {
3389          this.hint = castToString(value); // StringType
3390        } else if (name.equals("path")) {
3391          this.path = castToString(value); // StringType
3392        } else if (name.equals("sourceId")) {
3393          this.sourceId = castToId(value); // IdType
3394        } else
3395          return super.setProperty(name, value);
3396        return value;
3397      }
3398
3399      @Override
3400      public Base makeProperty(int hash, String name) throws FHIRException {
3401        switch (hash) {
3402        case 3373707:  return getNameElement();
3403        case -659125328:  return getDefaultValueElement();
3404        case -1724546052:  return getDescriptionElement();
3405        case -1795452264:  return getExpressionElement();
3406        case 1160732269:  return getHeaderFieldElement();
3407        case 3202695:  return getHintElement();
3408        case 3433509:  return getPathElement();
3409        case 1746327190:  return getSourceIdElement();
3410        default: return super.makeProperty(hash, name);
3411        }
3412
3413      }
3414
3415      @Override
3416      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3417        switch (hash) {
3418        case 3373707: /*name*/ return new String[] {"string"};
3419        case -659125328: /*defaultValue*/ return new String[] {"string"};
3420        case -1724546052: /*description*/ return new String[] {"string"};
3421        case -1795452264: /*expression*/ return new String[] {"string"};
3422        case 1160732269: /*headerField*/ return new String[] {"string"};
3423        case 3202695: /*hint*/ return new String[] {"string"};
3424        case 3433509: /*path*/ return new String[] {"string"};
3425        case 1746327190: /*sourceId*/ return new String[] {"id"};
3426        default: return super.getTypesForProperty(hash, name);
3427        }
3428
3429      }
3430
3431      @Override
3432      public Base addChild(String name) throws FHIRException {
3433        if (name.equals("name")) {
3434          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
3435        }
3436        else if (name.equals("defaultValue")) {
3437          throw new FHIRException("Cannot call addChild on a primitive type TestScript.defaultValue");
3438        }
3439        else if (name.equals("description")) {
3440          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
3441        }
3442        else if (name.equals("expression")) {
3443          throw new FHIRException("Cannot call addChild on a primitive type TestScript.expression");
3444        }
3445        else if (name.equals("headerField")) {
3446          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
3447        }
3448        else if (name.equals("hint")) {
3449          throw new FHIRException("Cannot call addChild on a primitive type TestScript.hint");
3450        }
3451        else if (name.equals("path")) {
3452          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
3453        }
3454        else if (name.equals("sourceId")) {
3455          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
3456        }
3457        else
3458          return super.addChild(name);
3459      }
3460
3461      public TestScriptVariableComponent copy() {
3462        TestScriptVariableComponent dst = new TestScriptVariableComponent();
3463        copyValues(dst);
3464        dst.name = name == null ? null : name.copy();
3465        dst.defaultValue = defaultValue == null ? null : defaultValue.copy();
3466        dst.description = description == null ? null : description.copy();
3467        dst.expression = expression == null ? null : expression.copy();
3468        dst.headerField = headerField == null ? null : headerField.copy();
3469        dst.hint = hint == null ? null : hint.copy();
3470        dst.path = path == null ? null : path.copy();
3471        dst.sourceId = sourceId == null ? null : sourceId.copy();
3472        return dst;
3473      }
3474
3475      @Override
3476      public boolean equalsDeep(Base other_) {
3477        if (!super.equalsDeep(other_))
3478          return false;
3479        if (!(other_ instanceof TestScriptVariableComponent))
3480          return false;
3481        TestScriptVariableComponent o = (TestScriptVariableComponent) other_;
3482        return compareDeep(name, o.name, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(description, o.description, true)
3483           && compareDeep(expression, o.expression, true) && compareDeep(headerField, o.headerField, true)
3484           && compareDeep(hint, o.hint, true) && compareDeep(path, o.path, true) && compareDeep(sourceId, o.sourceId, true)
3485          ;
3486      }
3487
3488      @Override
3489      public boolean equalsShallow(Base other_) {
3490        if (!super.equalsShallow(other_))
3491          return false;
3492        if (!(other_ instanceof TestScriptVariableComponent))
3493          return false;
3494        TestScriptVariableComponent o = (TestScriptVariableComponent) other_;
3495        return compareValues(name, o.name, true) && compareValues(defaultValue, o.defaultValue, true) && compareValues(description, o.description, true)
3496           && compareValues(expression, o.expression, true) && compareValues(headerField, o.headerField, true)
3497           && compareValues(hint, o.hint, true) && compareValues(path, o.path, true) && compareValues(sourceId, o.sourceId, true)
3498          ;
3499      }
3500
3501      public boolean isEmpty() {
3502        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, defaultValue, description
3503          , expression, headerField, hint, path, sourceId);
3504      }
3505
3506  public String fhirType() {
3507    return "TestScript.variable";
3508
3509  }
3510
3511  }
3512
3513    @Block()
3514    public static class TestScriptRuleComponent extends BackboneElement implements IBaseBackboneElement {
3515        /**
3516         * Reference to the resource (containing the contents of the rule needed for assertions).
3517         */
3518        @Child(name = "resource", type = {Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
3519        @Description(shortDefinition="Assert rule resource reference", formalDefinition="Reference to the resource (containing the contents of the rule needed for assertions)." )
3520        protected Reference resource;
3521
3522        /**
3523         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the rule needed for assertions).)
3524         */
3525        protected Resource resourceTarget;
3526
3527        /**
3528         * Each rule template can take one or more parameters for rule evaluation.
3529         */
3530        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
3531        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
3532        protected List<RuleParamComponent> param;
3533
3534        private static final long serialVersionUID = -1869267735L;
3535
3536    /**
3537     * Constructor
3538     */
3539      public TestScriptRuleComponent() {
3540        super();
3541      }
3542
3543    /**
3544     * Constructor
3545     */
3546      public TestScriptRuleComponent(Reference resource) {
3547        super();
3548        this.resource = resource;
3549      }
3550
3551        /**
3552         * @return {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).)
3553         */
3554        public Reference getResource() { 
3555          if (this.resource == null)
3556            if (Configuration.errorOnAutoCreate())
3557              throw new Error("Attempt to auto-create TestScriptRuleComponent.resource");
3558            else if (Configuration.doAutoCreate())
3559              this.resource = new Reference(); // cc
3560          return this.resource;
3561        }
3562
3563        public boolean hasResource() { 
3564          return this.resource != null && !this.resource.isEmpty();
3565        }
3566
3567        /**
3568         * @param value {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).)
3569         */
3570        public TestScriptRuleComponent setResource(Reference value)  { 
3571          this.resource = value;
3572          return this;
3573        }
3574
3575        /**
3576         * @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).)
3577         */
3578        public Resource getResourceTarget() { 
3579          return this.resourceTarget;
3580        }
3581
3582        /**
3583         * @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).)
3584         */
3585        public TestScriptRuleComponent setResourceTarget(Resource value) { 
3586          this.resourceTarget = value;
3587          return this;
3588        }
3589
3590        /**
3591         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
3592         */
3593        public List<RuleParamComponent> getParam() { 
3594          if (this.param == null)
3595            this.param = new ArrayList<RuleParamComponent>();
3596          return this.param;
3597        }
3598
3599        /**
3600         * @return Returns a reference to <code>this</code> for easy method chaining
3601         */
3602        public TestScriptRuleComponent setParam(List<RuleParamComponent> theParam) { 
3603          this.param = theParam;
3604          return this;
3605        }
3606
3607        public boolean hasParam() { 
3608          if (this.param == null)
3609            return false;
3610          for (RuleParamComponent item : this.param)
3611            if (!item.isEmpty())
3612              return true;
3613          return false;
3614        }
3615
3616        public RuleParamComponent addParam() { //3
3617          RuleParamComponent t = new RuleParamComponent();
3618          if (this.param == null)
3619            this.param = new ArrayList<RuleParamComponent>();
3620          this.param.add(t);
3621          return t;
3622        }
3623
3624        public TestScriptRuleComponent addParam(RuleParamComponent t) { //3
3625          if (t == null)
3626            return this;
3627          if (this.param == null)
3628            this.param = new ArrayList<RuleParamComponent>();
3629          this.param.add(t);
3630          return this;
3631        }
3632
3633        /**
3634         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
3635         */
3636        public RuleParamComponent getParamFirstRep() { 
3637          if (getParam().isEmpty()) {
3638            addParam();
3639          }
3640          return getParam().get(0);
3641        }
3642
3643        protected void listChildren(List<Property> children) {
3644          super.listChildren(children);
3645          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the rule needed for assertions).", 0, 1, resource));
3646          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
3647        }
3648
3649        @Override
3650        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3651          switch (_hash) {
3652          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);
3653          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);
3654          default: return super.getNamedProperty(_hash, _name, _checkValid);
3655          }
3656
3657        }
3658
3659      @Override
3660      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3661        switch (hash) {
3662        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
3663        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // RuleParamComponent
3664        default: return super.getProperty(hash, name, checkValid);
3665        }
3666
3667      }
3668
3669      @Override
3670      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3671        switch (hash) {
3672        case -341064690: // resource
3673          this.resource = castToReference(value); // Reference
3674          return value;
3675        case 106436749: // param
3676          this.getParam().add((RuleParamComponent) value); // RuleParamComponent
3677          return value;
3678        default: return super.setProperty(hash, name, value);
3679        }
3680
3681      }
3682
3683      @Override
3684      public Base setProperty(String name, Base value) throws FHIRException {
3685        if (name.equals("resource")) {
3686          this.resource = castToReference(value); // Reference
3687        } else if (name.equals("param")) {
3688          this.getParam().add((RuleParamComponent) value);
3689        } else
3690          return super.setProperty(name, value);
3691        return value;
3692      }
3693
3694      @Override
3695      public Base makeProperty(int hash, String name) throws FHIRException {
3696        switch (hash) {
3697        case -341064690:  return getResource(); 
3698        case 106436749:  return addParam(); 
3699        default: return super.makeProperty(hash, name);
3700        }
3701
3702      }
3703
3704      @Override
3705      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3706        switch (hash) {
3707        case -341064690: /*resource*/ return new String[] {"Reference"};
3708        case 106436749: /*param*/ return new String[] {};
3709        default: return super.getTypesForProperty(hash, name);
3710        }
3711
3712      }
3713
3714      @Override
3715      public Base addChild(String name) throws FHIRException {
3716        if (name.equals("resource")) {
3717          this.resource = new Reference();
3718          return this.resource;
3719        }
3720        else if (name.equals("param")) {
3721          return addParam();
3722        }
3723        else
3724          return super.addChild(name);
3725      }
3726
3727      public TestScriptRuleComponent copy() {
3728        TestScriptRuleComponent dst = new TestScriptRuleComponent();
3729        copyValues(dst);
3730        dst.resource = resource == null ? null : resource.copy();
3731        if (param != null) {
3732          dst.param = new ArrayList<RuleParamComponent>();
3733          for (RuleParamComponent i : param)
3734            dst.param.add(i.copy());
3735        };
3736        return dst;
3737      }
3738
3739      @Override
3740      public boolean equalsDeep(Base other_) {
3741        if (!super.equalsDeep(other_))
3742          return false;
3743        if (!(other_ instanceof TestScriptRuleComponent))
3744          return false;
3745        TestScriptRuleComponent o = (TestScriptRuleComponent) other_;
3746        return compareDeep(resource, o.resource, true) && compareDeep(param, o.param, true);
3747      }
3748
3749      @Override
3750      public boolean equalsShallow(Base other_) {
3751        if (!super.equalsShallow(other_))
3752          return false;
3753        if (!(other_ instanceof TestScriptRuleComponent))
3754          return false;
3755        TestScriptRuleComponent o = (TestScriptRuleComponent) other_;
3756        return true;
3757      }
3758
3759      public boolean isEmpty() {
3760        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(resource, param);
3761      }
3762
3763  public String fhirType() {
3764    return "TestScript.rule";
3765
3766  }
3767
3768  }
3769
3770    @Block()
3771    public static class RuleParamComponent extends BackboneElement implements IBaseBackboneElement {
3772        /**
3773         * Descriptive name for this parameter that matches the external assert rule parameter name.
3774         */
3775        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3776        @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." )
3777        protected StringType name;
3778
3779        /**
3780         * The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3781         */
3782        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3783        @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." )
3784        protected StringType value;
3785
3786        private static final long serialVersionUID = 395259392L;
3787
3788    /**
3789     * Constructor
3790     */
3791      public RuleParamComponent() {
3792        super();
3793      }
3794
3795    /**
3796     * Constructor
3797     */
3798      public RuleParamComponent(StringType name) {
3799        super();
3800        this.name = name;
3801      }
3802
3803        /**
3804         * @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
3805         */
3806        public StringType getNameElement() { 
3807          if (this.name == null)
3808            if (Configuration.errorOnAutoCreate())
3809              throw new Error("Attempt to auto-create RuleParamComponent.name");
3810            else if (Configuration.doAutoCreate())
3811              this.name = new StringType(); // bb
3812          return this.name;
3813        }
3814
3815        public boolean hasNameElement() { 
3816          return this.name != null && !this.name.isEmpty();
3817        }
3818
3819        public boolean hasName() { 
3820          return this.name != null && !this.name.isEmpty();
3821        }
3822
3823        /**
3824         * @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
3825         */
3826        public RuleParamComponent setNameElement(StringType value) { 
3827          this.name = value;
3828          return this;
3829        }
3830
3831        /**
3832         * @return Descriptive name for this parameter that matches the external assert rule parameter name.
3833         */
3834        public String getName() { 
3835          return this.name == null ? null : this.name.getValue();
3836        }
3837
3838        /**
3839         * @param value Descriptive name for this parameter that matches the external assert rule parameter name.
3840         */
3841        public RuleParamComponent setName(String value) { 
3842            if (this.name == null)
3843              this.name = new StringType();
3844            this.name.setValue(value);
3845          return this;
3846        }
3847
3848        /**
3849         * @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
3850         */
3851        public StringType getValueElement() { 
3852          if (this.value == null)
3853            if (Configuration.errorOnAutoCreate())
3854              throw new Error("Attempt to auto-create RuleParamComponent.value");
3855            else if (Configuration.doAutoCreate())
3856              this.value = new StringType(); // bb
3857          return this.value;
3858        }
3859
3860        public boolean hasValueElement() { 
3861          return this.value != null && !this.value.isEmpty();
3862        }
3863
3864        public boolean hasValue() { 
3865          return this.value != null && !this.value.isEmpty();
3866        }
3867
3868        /**
3869         * @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
3870         */
3871        public RuleParamComponent setValueElement(StringType value) { 
3872          this.value = value;
3873          return this;
3874        }
3875
3876        /**
3877         * @return The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3878         */
3879        public String getValue() { 
3880          return this.value == null ? null : this.value.getValue();
3881        }
3882
3883        /**
3884         * @param value The explicit or dynamic value for the parameter that will be passed on to the external rule template.
3885         */
3886        public RuleParamComponent setValue(String value) { 
3887          if (Utilities.noString(value))
3888            this.value = null;
3889          else {
3890            if (this.value == null)
3891              this.value = new StringType();
3892            this.value.setValue(value);
3893          }
3894          return this;
3895        }
3896
3897        protected void listChildren(List<Property> children) {
3898          super.listChildren(children);
3899          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name));
3900          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));
3901        }
3902
3903        @Override
3904        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
3905          switch (_hash) {
3906          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name);
3907          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);
3908          default: return super.getNamedProperty(_hash, _name, _checkValid);
3909          }
3910
3911        }
3912
3913      @Override
3914      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
3915        switch (hash) {
3916        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
3917        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
3918        default: return super.getProperty(hash, name, checkValid);
3919        }
3920
3921      }
3922
3923      @Override
3924      public Base setProperty(int hash, String name, Base value) throws FHIRException {
3925        switch (hash) {
3926        case 3373707: // name
3927          this.name = castToString(value); // StringType
3928          return value;
3929        case 111972721: // value
3930          this.value = castToString(value); // StringType
3931          return value;
3932        default: return super.setProperty(hash, name, value);
3933        }
3934
3935      }
3936
3937      @Override
3938      public Base setProperty(String name, Base value) throws FHIRException {
3939        if (name.equals("name")) {
3940          this.name = castToString(value); // StringType
3941        } else if (name.equals("value")) {
3942          this.value = castToString(value); // StringType
3943        } else
3944          return super.setProperty(name, value);
3945        return value;
3946      }
3947
3948      @Override
3949      public Base makeProperty(int hash, String name) throws FHIRException {
3950        switch (hash) {
3951        case 3373707:  return getNameElement();
3952        case 111972721:  return getValueElement();
3953        default: return super.makeProperty(hash, name);
3954        }
3955
3956      }
3957
3958      @Override
3959      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
3960        switch (hash) {
3961        case 3373707: /*name*/ return new String[] {"string"};
3962        case 111972721: /*value*/ return new String[] {"string"};
3963        default: return super.getTypesForProperty(hash, name);
3964        }
3965
3966      }
3967
3968      @Override
3969      public Base addChild(String name) throws FHIRException {
3970        if (name.equals("name")) {
3971          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
3972        }
3973        else if (name.equals("value")) {
3974          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
3975        }
3976        else
3977          return super.addChild(name);
3978      }
3979
3980      public RuleParamComponent copy() {
3981        RuleParamComponent dst = new RuleParamComponent();
3982        copyValues(dst);
3983        dst.name = name == null ? null : name.copy();
3984        dst.value = value == null ? null : value.copy();
3985        return dst;
3986      }
3987
3988      @Override
3989      public boolean equalsDeep(Base other_) {
3990        if (!super.equalsDeep(other_))
3991          return false;
3992        if (!(other_ instanceof RuleParamComponent))
3993          return false;
3994        RuleParamComponent o = (RuleParamComponent) other_;
3995        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
3996      }
3997
3998      @Override
3999      public boolean equalsShallow(Base other_) {
4000        if (!super.equalsShallow(other_))
4001          return false;
4002        if (!(other_ instanceof RuleParamComponent))
4003          return false;
4004        RuleParamComponent o = (RuleParamComponent) other_;
4005        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
4006      }
4007
4008      public boolean isEmpty() {
4009        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
4010      }
4011
4012  public String fhirType() {
4013    return "TestScript.rule.param";
4014
4015  }
4016
4017  }
4018
4019    @Block()
4020    public static class TestScriptRulesetComponent extends BackboneElement implements IBaseBackboneElement {
4021        /**
4022         * Reference to the resource (containing the contents of the ruleset needed for assertions).
4023         */
4024        @Child(name = "resource", type = {Reference.class}, order=1, min=1, max=1, modifier=false, summary=false)
4025        @Description(shortDefinition="Assert ruleset resource reference", formalDefinition="Reference to the resource (containing the contents of the ruleset needed for assertions)." )
4026        protected Reference resource;
4027
4028        /**
4029         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the ruleset needed for assertions).)
4030         */
4031        protected Resource resourceTarget;
4032
4033        /**
4034         * The referenced rule within the external ruleset template.
4035         */
4036        @Child(name = "rule", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4037        @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." )
4038        protected List<RulesetRuleComponent> rule;
4039
4040        private static final long serialVersionUID = 1260261423L;
4041
4042    /**
4043     * Constructor
4044     */
4045      public TestScriptRulesetComponent() {
4046        super();
4047      }
4048
4049    /**
4050     * Constructor
4051     */
4052      public TestScriptRulesetComponent(Reference resource) {
4053        super();
4054        this.resource = resource;
4055      }
4056
4057        /**
4058         * @return {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).)
4059         */
4060        public Reference getResource() { 
4061          if (this.resource == null)
4062            if (Configuration.errorOnAutoCreate())
4063              throw new Error("Attempt to auto-create TestScriptRulesetComponent.resource");
4064            else if (Configuration.doAutoCreate())
4065              this.resource = new Reference(); // cc
4066          return this.resource;
4067        }
4068
4069        public boolean hasResource() { 
4070          return this.resource != null && !this.resource.isEmpty();
4071        }
4072
4073        /**
4074         * @param value {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).)
4075         */
4076        public TestScriptRulesetComponent setResource(Reference value)  { 
4077          this.resource = value;
4078          return this;
4079        }
4080
4081        /**
4082         * @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).)
4083         */
4084        public Resource getResourceTarget() { 
4085          return this.resourceTarget;
4086        }
4087
4088        /**
4089         * @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).)
4090         */
4091        public TestScriptRulesetComponent setResourceTarget(Resource value) { 
4092          this.resourceTarget = value;
4093          return this;
4094        }
4095
4096        /**
4097         * @return {@link #rule} (The referenced rule within the external ruleset template.)
4098         */
4099        public List<RulesetRuleComponent> getRule() { 
4100          if (this.rule == null)
4101            this.rule = new ArrayList<RulesetRuleComponent>();
4102          return this.rule;
4103        }
4104
4105        /**
4106         * @return Returns a reference to <code>this</code> for easy method chaining
4107         */
4108        public TestScriptRulesetComponent setRule(List<RulesetRuleComponent> theRule) { 
4109          this.rule = theRule;
4110          return this;
4111        }
4112
4113        public boolean hasRule() { 
4114          if (this.rule == null)
4115            return false;
4116          for (RulesetRuleComponent item : this.rule)
4117            if (!item.isEmpty())
4118              return true;
4119          return false;
4120        }
4121
4122        public RulesetRuleComponent addRule() { //3
4123          RulesetRuleComponent t = new RulesetRuleComponent();
4124          if (this.rule == null)
4125            this.rule = new ArrayList<RulesetRuleComponent>();
4126          this.rule.add(t);
4127          return t;
4128        }
4129
4130        public TestScriptRulesetComponent addRule(RulesetRuleComponent t) { //3
4131          if (t == null)
4132            return this;
4133          if (this.rule == null)
4134            this.rule = new ArrayList<RulesetRuleComponent>();
4135          this.rule.add(t);
4136          return this;
4137        }
4138
4139        /**
4140         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
4141         */
4142        public RulesetRuleComponent getRuleFirstRep() { 
4143          if (getRule().isEmpty()) {
4144            addRule();
4145          }
4146          return getRule().get(0);
4147        }
4148
4149        protected void listChildren(List<Property> children) {
4150          super.listChildren(children);
4151          children.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the ruleset needed for assertions).", 0, 1, resource));
4152          children.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule));
4153        }
4154
4155        @Override
4156        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4157          switch (_hash) {
4158          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);
4159          case 3512060: /*rule*/  return new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule);
4160          default: return super.getNamedProperty(_hash, _name, _checkValid);
4161          }
4162
4163        }
4164
4165      @Override
4166      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4167        switch (hash) {
4168        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference
4169        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // RulesetRuleComponent
4170        default: return super.getProperty(hash, name, checkValid);
4171        }
4172
4173      }
4174
4175      @Override
4176      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4177        switch (hash) {
4178        case -341064690: // resource
4179          this.resource = castToReference(value); // Reference
4180          return value;
4181        case 3512060: // rule
4182          this.getRule().add((RulesetRuleComponent) value); // RulesetRuleComponent
4183          return value;
4184        default: return super.setProperty(hash, name, value);
4185        }
4186
4187      }
4188
4189      @Override
4190      public Base setProperty(String name, Base value) throws FHIRException {
4191        if (name.equals("resource")) {
4192          this.resource = castToReference(value); // Reference
4193        } else if (name.equals("rule")) {
4194          this.getRule().add((RulesetRuleComponent) value);
4195        } else
4196          return super.setProperty(name, value);
4197        return value;
4198      }
4199
4200      @Override
4201      public Base makeProperty(int hash, String name) throws FHIRException {
4202        switch (hash) {
4203        case -341064690:  return getResource(); 
4204        case 3512060:  return addRule(); 
4205        default: return super.makeProperty(hash, name);
4206        }
4207
4208      }
4209
4210      @Override
4211      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4212        switch (hash) {
4213        case -341064690: /*resource*/ return new String[] {"Reference"};
4214        case 3512060: /*rule*/ return new String[] {};
4215        default: return super.getTypesForProperty(hash, name);
4216        }
4217
4218      }
4219
4220      @Override
4221      public Base addChild(String name) throws FHIRException {
4222        if (name.equals("resource")) {
4223          this.resource = new Reference();
4224          return this.resource;
4225        }
4226        else if (name.equals("rule")) {
4227          return addRule();
4228        }
4229        else
4230          return super.addChild(name);
4231      }
4232
4233      public TestScriptRulesetComponent copy() {
4234        TestScriptRulesetComponent dst = new TestScriptRulesetComponent();
4235        copyValues(dst);
4236        dst.resource = resource == null ? null : resource.copy();
4237        if (rule != null) {
4238          dst.rule = new ArrayList<RulesetRuleComponent>();
4239          for (RulesetRuleComponent i : rule)
4240            dst.rule.add(i.copy());
4241        };
4242        return dst;
4243      }
4244
4245      @Override
4246      public boolean equalsDeep(Base other_) {
4247        if (!super.equalsDeep(other_))
4248          return false;
4249        if (!(other_ instanceof TestScriptRulesetComponent))
4250          return false;
4251        TestScriptRulesetComponent o = (TestScriptRulesetComponent) other_;
4252        return compareDeep(resource, o.resource, true) && compareDeep(rule, o.rule, true);
4253      }
4254
4255      @Override
4256      public boolean equalsShallow(Base other_) {
4257        if (!super.equalsShallow(other_))
4258          return false;
4259        if (!(other_ instanceof TestScriptRulesetComponent))
4260          return false;
4261        TestScriptRulesetComponent o = (TestScriptRulesetComponent) other_;
4262        return true;
4263      }
4264
4265      public boolean isEmpty() {
4266        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(resource, rule);
4267      }
4268
4269  public String fhirType() {
4270    return "TestScript.ruleset";
4271
4272  }
4273
4274  }
4275
4276    @Block()
4277    public static class RulesetRuleComponent extends BackboneElement implements IBaseBackboneElement {
4278        /**
4279         * Id of the referenced rule within the external ruleset template.
4280         */
4281        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4282        @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." )
4283        protected IdType ruleId;
4284
4285        /**
4286         * Each rule template can take one or more parameters for rule evaluation.
4287         */
4288        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4289        @Description(shortDefinition="Ruleset rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
4290        protected List<RulesetRuleParamComponent> param;
4291
4292        private static final long serialVersionUID = -1399866981L;
4293
4294    /**
4295     * Constructor
4296     */
4297      public RulesetRuleComponent() {
4298        super();
4299      }
4300
4301    /**
4302     * Constructor
4303     */
4304      public RulesetRuleComponent(IdType ruleId) {
4305        super();
4306        this.ruleId = ruleId;
4307      }
4308
4309        /**
4310         * @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
4311         */
4312        public IdType getRuleIdElement() { 
4313          if (this.ruleId == null)
4314            if (Configuration.errorOnAutoCreate())
4315              throw new Error("Attempt to auto-create RulesetRuleComponent.ruleId");
4316            else if (Configuration.doAutoCreate())
4317              this.ruleId = new IdType(); // bb
4318          return this.ruleId;
4319        }
4320
4321        public boolean hasRuleIdElement() { 
4322          return this.ruleId != null && !this.ruleId.isEmpty();
4323        }
4324
4325        public boolean hasRuleId() { 
4326          return this.ruleId != null && !this.ruleId.isEmpty();
4327        }
4328
4329        /**
4330         * @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
4331         */
4332        public RulesetRuleComponent setRuleIdElement(IdType value) { 
4333          this.ruleId = value;
4334          return this;
4335        }
4336
4337        /**
4338         * @return Id of the referenced rule within the external ruleset template.
4339         */
4340        public String getRuleId() { 
4341          return this.ruleId == null ? null : this.ruleId.getValue();
4342        }
4343
4344        /**
4345         * @param value Id of the referenced rule within the external ruleset template.
4346         */
4347        public RulesetRuleComponent setRuleId(String value) { 
4348            if (this.ruleId == null)
4349              this.ruleId = new IdType();
4350            this.ruleId.setValue(value);
4351          return this;
4352        }
4353
4354        /**
4355         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
4356         */
4357        public List<RulesetRuleParamComponent> getParam() { 
4358          if (this.param == null)
4359            this.param = new ArrayList<RulesetRuleParamComponent>();
4360          return this.param;
4361        }
4362
4363        /**
4364         * @return Returns a reference to <code>this</code> for easy method chaining
4365         */
4366        public RulesetRuleComponent setParam(List<RulesetRuleParamComponent> theParam) { 
4367          this.param = theParam;
4368          return this;
4369        }
4370
4371        public boolean hasParam() { 
4372          if (this.param == null)
4373            return false;
4374          for (RulesetRuleParamComponent item : this.param)
4375            if (!item.isEmpty())
4376              return true;
4377          return false;
4378        }
4379
4380        public RulesetRuleParamComponent addParam() { //3
4381          RulesetRuleParamComponent t = new RulesetRuleParamComponent();
4382          if (this.param == null)
4383            this.param = new ArrayList<RulesetRuleParamComponent>();
4384          this.param.add(t);
4385          return t;
4386        }
4387
4388        public RulesetRuleComponent addParam(RulesetRuleParamComponent t) { //3
4389          if (t == null)
4390            return this;
4391          if (this.param == null)
4392            this.param = new ArrayList<RulesetRuleParamComponent>();
4393          this.param.add(t);
4394          return this;
4395        }
4396
4397        /**
4398         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
4399         */
4400        public RulesetRuleParamComponent getParamFirstRep() { 
4401          if (getParam().isEmpty()) {
4402            addParam();
4403          }
4404          return getParam().get(0);
4405        }
4406
4407        protected void listChildren(List<Property> children) {
4408          super.listChildren(children);
4409          children.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId));
4410          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
4411        }
4412
4413        @Override
4414        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4415          switch (_hash) {
4416          case -919875273: /*ruleId*/  return new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, 1, ruleId);
4417          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);
4418          default: return super.getNamedProperty(_hash, _name, _checkValid);
4419          }
4420
4421        }
4422
4423      @Override
4424      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4425        switch (hash) {
4426        case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType
4427        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // RulesetRuleParamComponent
4428        default: return super.getProperty(hash, name, checkValid);
4429        }
4430
4431      }
4432
4433      @Override
4434      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4435        switch (hash) {
4436        case -919875273: // ruleId
4437          this.ruleId = castToId(value); // IdType
4438          return value;
4439        case 106436749: // param
4440          this.getParam().add((RulesetRuleParamComponent) value); // RulesetRuleParamComponent
4441          return value;
4442        default: return super.setProperty(hash, name, value);
4443        }
4444
4445      }
4446
4447      @Override
4448      public Base setProperty(String name, Base value) throws FHIRException {
4449        if (name.equals("ruleId")) {
4450          this.ruleId = castToId(value); // IdType
4451        } else if (name.equals("param")) {
4452          this.getParam().add((RulesetRuleParamComponent) value);
4453        } else
4454          return super.setProperty(name, value);
4455        return value;
4456      }
4457
4458      @Override
4459      public Base makeProperty(int hash, String name) throws FHIRException {
4460        switch (hash) {
4461        case -919875273:  return getRuleIdElement();
4462        case 106436749:  return addParam(); 
4463        default: return super.makeProperty(hash, name);
4464        }
4465
4466      }
4467
4468      @Override
4469      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4470        switch (hash) {
4471        case -919875273: /*ruleId*/ return new String[] {"id"};
4472        case 106436749: /*param*/ return new String[] {};
4473        default: return super.getTypesForProperty(hash, name);
4474        }
4475
4476      }
4477
4478      @Override
4479      public Base addChild(String name) throws FHIRException {
4480        if (name.equals("ruleId")) {
4481          throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId");
4482        }
4483        else if (name.equals("param")) {
4484          return addParam();
4485        }
4486        else
4487          return super.addChild(name);
4488      }
4489
4490      public RulesetRuleComponent copy() {
4491        RulesetRuleComponent dst = new RulesetRuleComponent();
4492        copyValues(dst);
4493        dst.ruleId = ruleId == null ? null : ruleId.copy();
4494        if (param != null) {
4495          dst.param = new ArrayList<RulesetRuleParamComponent>();
4496          for (RulesetRuleParamComponent i : param)
4497            dst.param.add(i.copy());
4498        };
4499        return dst;
4500      }
4501
4502      @Override
4503      public boolean equalsDeep(Base other_) {
4504        if (!super.equalsDeep(other_))
4505          return false;
4506        if (!(other_ instanceof RulesetRuleComponent))
4507          return false;
4508        RulesetRuleComponent o = (RulesetRuleComponent) other_;
4509        return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true);
4510      }
4511
4512      @Override
4513      public boolean equalsShallow(Base other_) {
4514        if (!super.equalsShallow(other_))
4515          return false;
4516        if (!(other_ instanceof RulesetRuleComponent))
4517          return false;
4518        RulesetRuleComponent o = (RulesetRuleComponent) other_;
4519        return compareValues(ruleId, o.ruleId, true);
4520      }
4521
4522      public boolean isEmpty() {
4523        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ruleId, param);
4524      }
4525
4526  public String fhirType() {
4527    return "TestScript.ruleset.rule";
4528
4529  }
4530
4531  }
4532
4533    @Block()
4534    public static class RulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement {
4535        /**
4536         * Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4537         */
4538        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
4539        @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." )
4540        protected StringType name;
4541
4542        /**
4543         * The value for the parameter that will be passed on to the external ruleset rule template.
4544         */
4545        @Child(name = "value", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4546        @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." )
4547        protected StringType value;
4548
4549        private static final long serialVersionUID = 395259392L;
4550
4551    /**
4552     * Constructor
4553     */
4554      public RulesetRuleParamComponent() {
4555        super();
4556      }
4557
4558    /**
4559     * Constructor
4560     */
4561      public RulesetRuleParamComponent(StringType name) {
4562        super();
4563        this.name = name;
4564      }
4565
4566        /**
4567         * @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
4568         */
4569        public StringType getNameElement() { 
4570          if (this.name == null)
4571            if (Configuration.errorOnAutoCreate())
4572              throw new Error("Attempt to auto-create RulesetRuleParamComponent.name");
4573            else if (Configuration.doAutoCreate())
4574              this.name = new StringType(); // bb
4575          return this.name;
4576        }
4577
4578        public boolean hasNameElement() { 
4579          return this.name != null && !this.name.isEmpty();
4580        }
4581
4582        public boolean hasName() { 
4583          return this.name != null && !this.name.isEmpty();
4584        }
4585
4586        /**
4587         * @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
4588         */
4589        public RulesetRuleParamComponent setNameElement(StringType value) { 
4590          this.name = value;
4591          return this;
4592        }
4593
4594        /**
4595         * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4596         */
4597        public String getName() { 
4598          return this.name == null ? null : this.name.getValue();
4599        }
4600
4601        /**
4602         * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name.
4603         */
4604        public RulesetRuleParamComponent setName(String value) { 
4605            if (this.name == null)
4606              this.name = new StringType();
4607            this.name.setValue(value);
4608          return this;
4609        }
4610
4611        /**
4612         * @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
4613         */
4614        public StringType getValueElement() { 
4615          if (this.value == null)
4616            if (Configuration.errorOnAutoCreate())
4617              throw new Error("Attempt to auto-create RulesetRuleParamComponent.value");
4618            else if (Configuration.doAutoCreate())
4619              this.value = new StringType(); // bb
4620          return this.value;
4621        }
4622
4623        public boolean hasValueElement() { 
4624          return this.value != null && !this.value.isEmpty();
4625        }
4626
4627        public boolean hasValue() { 
4628          return this.value != null && !this.value.isEmpty();
4629        }
4630
4631        /**
4632         * @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
4633         */
4634        public RulesetRuleParamComponent setValueElement(StringType value) { 
4635          this.value = value;
4636          return this;
4637        }
4638
4639        /**
4640         * @return The value for the parameter that will be passed on to the external ruleset rule template.
4641         */
4642        public String getValue() { 
4643          return this.value == null ? null : this.value.getValue();
4644        }
4645
4646        /**
4647         * @param value The value for the parameter that will be passed on to the external ruleset rule template.
4648         */
4649        public RulesetRuleParamComponent setValue(String value) { 
4650          if (Utilities.noString(value))
4651            this.value = null;
4652          else {
4653            if (this.value == null)
4654              this.value = new StringType();
4655            this.value.setValue(value);
4656          }
4657          return this;
4658        }
4659
4660        protected void listChildren(List<Property> children) {
4661          super.listChildren(children);
4662          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, 1, name));
4663          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));
4664        }
4665
4666        @Override
4667        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4668          switch (_hash) {
4669          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);
4670          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);
4671          default: return super.getNamedProperty(_hash, _name, _checkValid);
4672          }
4673
4674        }
4675
4676      @Override
4677      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4678        switch (hash) {
4679        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
4680        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
4681        default: return super.getProperty(hash, name, checkValid);
4682        }
4683
4684      }
4685
4686      @Override
4687      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4688        switch (hash) {
4689        case 3373707: // name
4690          this.name = castToString(value); // StringType
4691          return value;
4692        case 111972721: // value
4693          this.value = castToString(value); // StringType
4694          return value;
4695        default: return super.setProperty(hash, name, value);
4696        }
4697
4698      }
4699
4700      @Override
4701      public Base setProperty(String name, Base value) throws FHIRException {
4702        if (name.equals("name")) {
4703          this.name = castToString(value); // StringType
4704        } else if (name.equals("value")) {
4705          this.value = castToString(value); // StringType
4706        } else
4707          return super.setProperty(name, value);
4708        return value;
4709      }
4710
4711      @Override
4712      public Base makeProperty(int hash, String name) throws FHIRException {
4713        switch (hash) {
4714        case 3373707:  return getNameElement();
4715        case 111972721:  return getValueElement();
4716        default: return super.makeProperty(hash, name);
4717        }
4718
4719      }
4720
4721      @Override
4722      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4723        switch (hash) {
4724        case 3373707: /*name*/ return new String[] {"string"};
4725        case 111972721: /*value*/ return new String[] {"string"};
4726        default: return super.getTypesForProperty(hash, name);
4727        }
4728
4729      }
4730
4731      @Override
4732      public Base addChild(String name) throws FHIRException {
4733        if (name.equals("name")) {
4734          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
4735        }
4736        else if (name.equals("value")) {
4737          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
4738        }
4739        else
4740          return super.addChild(name);
4741      }
4742
4743      public RulesetRuleParamComponent copy() {
4744        RulesetRuleParamComponent dst = new RulesetRuleParamComponent();
4745        copyValues(dst);
4746        dst.name = name == null ? null : name.copy();
4747        dst.value = value == null ? null : value.copy();
4748        return dst;
4749      }
4750
4751      @Override
4752      public boolean equalsDeep(Base other_) {
4753        if (!super.equalsDeep(other_))
4754          return false;
4755        if (!(other_ instanceof RulesetRuleParamComponent))
4756          return false;
4757        RulesetRuleParamComponent o = (RulesetRuleParamComponent) other_;
4758        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
4759      }
4760
4761      @Override
4762      public boolean equalsShallow(Base other_) {
4763        if (!super.equalsShallow(other_))
4764          return false;
4765        if (!(other_ instanceof RulesetRuleParamComponent))
4766          return false;
4767        RulesetRuleParamComponent o = (RulesetRuleParamComponent) other_;
4768        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
4769      }
4770
4771      public boolean isEmpty() {
4772        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
4773      }
4774
4775  public String fhirType() {
4776    return "TestScript.ruleset.rule.param";
4777
4778  }
4779
4780  }
4781
4782    @Block()
4783    public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement {
4784        /**
4785         * Action would contain either an operation or an assertion.
4786         */
4787        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4788        @Description(shortDefinition="A setup operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." )
4789        protected List<SetupActionComponent> action;
4790
4791        private static final long serialVersionUID = -123374486L;
4792
4793    /**
4794     * Constructor
4795     */
4796      public TestScriptSetupComponent() {
4797        super();
4798      }
4799
4800        /**
4801         * @return {@link #action} (Action would contain either an operation or an assertion.)
4802         */
4803        public List<SetupActionComponent> getAction() { 
4804          if (this.action == null)
4805            this.action = new ArrayList<SetupActionComponent>();
4806          return this.action;
4807        }
4808
4809        /**
4810         * @return Returns a reference to <code>this</code> for easy method chaining
4811         */
4812        public TestScriptSetupComponent setAction(List<SetupActionComponent> theAction) { 
4813          this.action = theAction;
4814          return this;
4815        }
4816
4817        public boolean hasAction() { 
4818          if (this.action == null)
4819            return false;
4820          for (SetupActionComponent item : this.action)
4821            if (!item.isEmpty())
4822              return true;
4823          return false;
4824        }
4825
4826        public SetupActionComponent addAction() { //3
4827          SetupActionComponent t = new SetupActionComponent();
4828          if (this.action == null)
4829            this.action = new ArrayList<SetupActionComponent>();
4830          this.action.add(t);
4831          return t;
4832        }
4833
4834        public TestScriptSetupComponent addAction(SetupActionComponent t) { //3
4835          if (t == null)
4836            return this;
4837          if (this.action == null)
4838            this.action = new ArrayList<SetupActionComponent>();
4839          this.action.add(t);
4840          return this;
4841        }
4842
4843        /**
4844         * @return The first repetition of repeating field {@link #action}, creating it if it does not already exist
4845         */
4846        public SetupActionComponent getActionFirstRep() { 
4847          if (getAction().isEmpty()) {
4848            addAction();
4849          }
4850          return getAction().get(0);
4851        }
4852
4853        protected void listChildren(List<Property> children) {
4854          super.listChildren(children);
4855          children.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
4856        }
4857
4858        @Override
4859        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
4860          switch (_hash) {
4861          case -1422950858: /*action*/  return new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action);
4862          default: return super.getNamedProperty(_hash, _name, _checkValid);
4863          }
4864
4865        }
4866
4867      @Override
4868      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
4869        switch (hash) {
4870        case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent
4871        default: return super.getProperty(hash, name, checkValid);
4872        }
4873
4874      }
4875
4876      @Override
4877      public Base setProperty(int hash, String name, Base value) throws FHIRException {
4878        switch (hash) {
4879        case -1422950858: // action
4880          this.getAction().add((SetupActionComponent) value); // SetupActionComponent
4881          return value;
4882        default: return super.setProperty(hash, name, value);
4883        }
4884
4885      }
4886
4887      @Override
4888      public Base setProperty(String name, Base value) throws FHIRException {
4889        if (name.equals("action")) {
4890          this.getAction().add((SetupActionComponent) value);
4891        } else
4892          return super.setProperty(name, value);
4893        return value;
4894      }
4895
4896      @Override
4897      public Base makeProperty(int hash, String name) throws FHIRException {
4898        switch (hash) {
4899        case -1422950858:  return addAction(); 
4900        default: return super.makeProperty(hash, name);
4901        }
4902
4903      }
4904
4905      @Override
4906      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
4907        switch (hash) {
4908        case -1422950858: /*action*/ return new String[] {};
4909        default: return super.getTypesForProperty(hash, name);
4910        }
4911
4912      }
4913
4914      @Override
4915      public Base addChild(String name) throws FHIRException {
4916        if (name.equals("action")) {
4917          return addAction();
4918        }
4919        else
4920          return super.addChild(name);
4921      }
4922
4923      public TestScriptSetupComponent copy() {
4924        TestScriptSetupComponent dst = new TestScriptSetupComponent();
4925        copyValues(dst);
4926        if (action != null) {
4927          dst.action = new ArrayList<SetupActionComponent>();
4928          for (SetupActionComponent i : action)
4929            dst.action.add(i.copy());
4930        };
4931        return dst;
4932      }
4933
4934      @Override
4935      public boolean equalsDeep(Base other_) {
4936        if (!super.equalsDeep(other_))
4937          return false;
4938        if (!(other_ instanceof TestScriptSetupComponent))
4939          return false;
4940        TestScriptSetupComponent o = (TestScriptSetupComponent) other_;
4941        return compareDeep(action, o.action, true);
4942      }
4943
4944      @Override
4945      public boolean equalsShallow(Base other_) {
4946        if (!super.equalsShallow(other_))
4947          return false;
4948        if (!(other_ instanceof TestScriptSetupComponent))
4949          return false;
4950        TestScriptSetupComponent o = (TestScriptSetupComponent) other_;
4951        return true;
4952      }
4953
4954      public boolean isEmpty() {
4955        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(action);
4956      }
4957
4958  public String fhirType() {
4959    return "TestScript.setup";
4960
4961  }
4962
4963  }
4964
4965    @Block()
4966    public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement {
4967        /**
4968         * The operation to perform.
4969         */
4970        @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
4971        @Description(shortDefinition="The setup operation to perform", formalDefinition="The operation to perform." )
4972        protected SetupActionOperationComponent operation;
4973
4974        /**
4975         * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
4976         */
4977        @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
4978        @Description(shortDefinition="The assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." )
4979        protected SetupActionAssertComponent assert_;
4980
4981        private static final long serialVersionUID = -252088305L;
4982
4983    /**
4984     * Constructor
4985     */
4986      public SetupActionComponent() {
4987        super();
4988      }
4989
4990        /**
4991         * @return {@link #operation} (The operation to perform.)
4992         */
4993        public SetupActionOperationComponent getOperation() { 
4994          if (this.operation == null)
4995            if (Configuration.errorOnAutoCreate())
4996              throw new Error("Attempt to auto-create SetupActionComponent.operation");
4997            else if (Configuration.doAutoCreate())
4998              this.operation = new SetupActionOperationComponent(); // cc
4999          return this.operation;
5000        }
5001
5002        public boolean hasOperation() { 
5003          return this.operation != null && !this.operation.isEmpty();
5004        }
5005
5006        /**
5007         * @param value {@link #operation} (The operation to perform.)
5008         */
5009        public SetupActionComponent setOperation(SetupActionOperationComponent value)  { 
5010          this.operation = value;
5011          return this;
5012        }
5013
5014        /**
5015         * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
5016         */
5017        public SetupActionAssertComponent getAssert() { 
5018          if (this.assert_ == null)
5019            if (Configuration.errorOnAutoCreate())
5020              throw new Error("Attempt to auto-create SetupActionComponent.assert_");
5021            else if (Configuration.doAutoCreate())
5022              this.assert_ = new SetupActionAssertComponent(); // cc
5023          return this.assert_;
5024        }
5025
5026        public boolean hasAssert() { 
5027          return this.assert_ != null && !this.assert_.isEmpty();
5028        }
5029
5030        /**
5031         * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
5032         */
5033        public SetupActionComponent setAssert(SetupActionAssertComponent value)  { 
5034          this.assert_ = value;
5035          return this;
5036        }
5037
5038        protected void listChildren(List<Property> children) {
5039          super.listChildren(children);
5040          children.add(new Property("operation", "", "The operation to perform.", 0, 1, operation));
5041          children.add(new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, 1, assert_));
5042        }
5043
5044        @Override
5045        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
5046          switch (_hash) {
5047          case 1662702951: /*operation*/  return new Property("operation", "", "The operation to perform.", 0, 1, operation);
5048          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_);
5049          default: return super.getNamedProperty(_hash, _name, _checkValid);
5050          }
5051
5052        }
5053
5054      @Override
5055      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
5056        switch (hash) {
5057        case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent
5058        case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent
5059        default: return super.getProperty(hash, name, checkValid);
5060        }
5061
5062      }
5063
5064      @Override
5065      public Base setProperty(int hash, String name, Base value) throws FHIRException {
5066        switch (hash) {
5067        case 1662702951: // operation
5068          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
5069          return value;
5070        case -1408208058: // assert
5071          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
5072          return value;
5073        default: return super.setProperty(hash, name, value);
5074        }
5075
5076      }
5077
5078      @Override
5079      public Base setProperty(String name, Base value) throws FHIRException {
5080        if (name.equals("operation")) {
5081          this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent
5082        } else if (name.equals("assert")) {
5083          this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent
5084        } else
5085          return super.setProperty(name, value);
5086        return value;
5087      }
5088
5089      @Override
5090      public Base makeProperty(int hash, String name) throws FHIRException {
5091        switch (hash) {
5092        case 1662702951:  return getOperation(); 
5093        case -1408208058:  return getAssert(); 
5094        default: return super.makeProperty(hash, name);
5095        }
5096
5097      }
5098
5099      @Override
5100      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
5101        switch (hash) {
5102        case 1662702951: /*operation*/ return new String[] {};
5103        case -1408208058: /*assert*/ return new String[] {};
5104        default: return super.getTypesForProperty(hash, name);
5105        }
5106
5107      }
5108
5109      @Override
5110      public Base addChild(String name) throws FHIRException {
5111        if (name.equals("operation")) {
5112          this.operation = new SetupActionOperationComponent();
5113          return this.operation;
5114        }
5115        else if (name.equals("assert")) {
5116          this.assert_ = new SetupActionAssertComponent();
5117          return this.assert_;
5118        }
5119        else
5120          return super.addChild(name);
5121      }
5122
5123      public SetupActionComponent copy() {
5124        SetupActionComponent dst = new SetupActionComponent();
5125        copyValues(dst);
5126        dst.operation = operation == null ? null : operation.copy();
5127        dst.assert_ = assert_ == null ? null : assert_.copy();
5128        return dst;
5129      }
5130
5131      @Override
5132      public boolean equalsDeep(Base other_) {
5133        if (!super.equalsDeep(other_))
5134          return false;
5135        if (!(other_ instanceof SetupActionComponent))
5136          return false;
5137        SetupActionComponent o = (SetupActionComponent) other_;
5138        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
5139      }
5140
5141      @Override
5142      public boolean equalsShallow(Base other_) {
5143        if (!super.equalsShallow(other_))
5144          return false;
5145        if (!(other_ instanceof SetupActionComponent))
5146          return false;
5147        SetupActionComponent o = (SetupActionComponent) other_;
5148        return true;
5149      }
5150
5151      public boolean isEmpty() {
5152        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(operation, assert_);
5153      }
5154
5155  public String fhirType() {
5156    return "TestScript.setup.action";
5157
5158  }
5159
5160  }
5161
5162    @Block()
5163    public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement {
5164        /**
5165         * Server interaction or operation type.
5166         */
5167        @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false)
5168        @Description(shortDefinition="The operation code type that will be executed", formalDefinition="Server interaction or operation type." )
5169        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/testscript-operation-codes")
5170        protected Coding type;
5171
5172        /**
5173         * The type of the resource.  See http://build.fhir.org/resourcelist.html.
5174         */
5175        @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
5176        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://build.fhir.org/resourcelist.html." )
5177        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
5178        protected CodeType resource;
5179
5180        /**
5181         * The label would be used for tracking/logging purposes by test engines.
5182         */
5183        @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
5184        @Description(shortDefinition="Tracking/logging operation label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
5185        protected StringType label;
5186
5187        /**
5188         * The description would be used by test engines for tracking and reporting purposes.
5189         */
5190        @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
5191        @Description(shortDefinition="Tracking/reporting operation description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
5192        protected StringType description;
5193
5194        /**
5195         * The content-type or mime-type to use for RESTful operation in the 'Accept' header.
5196         */
5197        @Child(name = "accept", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
5198        @Description(shortDefinition="xml | json | ttl | none", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Accept' header." )
5199        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/content-type")
5200        protected Enumeration<ContentType> accept;
5201
5202        /**
5203         * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
5204         */
5205        @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
5206        @Description(shortDefinition="xml | json | ttl | none", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." )
5207        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/content-type")
5208        protected Enumeration<ContentType> contentType;
5209
5210        /**
5211         * The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5212         */
5213        @Child(name = "destination", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=false)
5214        @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." )
5215        protected IntegerType destination;
5216
5217        /**
5218         * 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.
5219         */
5220        @Child(name = "encodeRequestUrl", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
5221        @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." )
5222        protected BooleanType encodeRequestUrl;
5223
5224        /**
5225         * The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5226         */
5227        @Child(name = "origin", type = {IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false)
5228        @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." )
5229        protected IntegerType origin;
5230
5231        /**
5232         * Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5233         */
5234        @Child(name = "params", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
5235        @Description(shortDefinition="Explicitly defined path parameters", formalDefinition="Path plus parameters after [type].  Used to set parts of the request URL explicitly." )
5236        protected StringType params;
5237
5238        /**
5239         * Header elements would be used to set HTTP headers.
5240         */
5241        @Child(name = "requestHeader", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5242        @Description(shortDefinition="Each operation can have one or more header elements", formalDefinition="Header elements would be used to set HTTP headers." )
5243        protected List<SetupActionOperationRequestHeaderComponent> requestHeader;
5244
5245        /**
5246         * The fixture id (maybe new) to map to the request.
5247         */
5248        @Child(name = "requestId", type = {IdType.class}, order=12, min=0, max=1, modifier=false, summary=false)
5249        @Description(shortDefinition="Fixture Id of mapped request", formalDefinition="The fixture id (maybe new) to map to the request." )
5250        protected IdType requestId;
5251
5252        /**
5253         * The fixture id (maybe new) to map to the response.
5254         */
5255        @Child(name = "responseId", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=false)
5256        @Description(shortDefinition="Fixture Id of mapped response", formalDefinition="The fixture id (maybe new) to map to the response." )
5257        protected IdType responseId;
5258
5259        /**
5260         * The id of the fixture used as the body of a PUT or POST request.
5261         */
5262        @Child(name = "sourceId", type = {IdType.class}, order=14, min=0, max=1, modifier=false, summary=false)
5263        @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." )
5264        protected IdType sourceId;
5265
5266        /**
5267         * Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5268         */
5269        @Child(name = "targetId", type = {IdType.class}, order=15, min=0, max=1, modifier=false, summary=false)
5270        @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." )
5271        protected IdType targetId;
5272
5273        /**
5274         * Complete request URL.
5275         */
5276        @Child(name = "url", type = {StringType.class}, order=16, min=0, max=1, modifier=false, summary=false)
5277        @Description(shortDefinition="Request URL", formalDefinition="Complete request URL." )
5278        protected StringType url;
5279
5280        private static final long serialVersionUID = -488909648L;
5281
5282    /**
5283     * Constructor
5284     */
5285      public SetupActionOperationComponent() {
5286        super();
5287      }
5288
5289        /**
5290         * @return {@link #type} (Server interaction or operation type.)
5291         */
5292        public Coding getType() { 
5293          if (this.type == null)
5294            if (Configuration.errorOnAutoCreate())
5295              throw new Error("Attempt to auto-create SetupActionOperationComponent.type");
5296            else if (Configuration.doAutoCreate())
5297              this.type = new Coding(); // cc
5298          return this.type;
5299        }
5300
5301        public boolean hasType() { 
5302          return this.type != null && !this.type.isEmpty();
5303        }
5304
5305        /**
5306         * @param value {@link #type} (Server interaction or operation type.)
5307         */
5308        public SetupActionOperationComponent setType(Coding value)  { 
5309          this.type = value;
5310          return this;
5311        }
5312
5313        /**
5314         * @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
5315         */
5316        public CodeType getResourceElement() { 
5317          if (this.resource == null)
5318            if (Configuration.errorOnAutoCreate())
5319              throw new Error("Attempt to auto-create SetupActionOperationComponent.resource");
5320            else if (Configuration.doAutoCreate())
5321              this.resource = new CodeType(); // bb
5322          return this.resource;
5323        }
5324
5325        public boolean hasResourceElement() { 
5326          return this.resource != null && !this.resource.isEmpty();
5327        }
5328
5329        public boolean hasResource() { 
5330          return this.resource != null && !this.resource.isEmpty();
5331        }
5332
5333        /**
5334         * @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
5335         */
5336        public SetupActionOperationComponent setResourceElement(CodeType value) { 
5337          this.resource = value;
5338          return this;
5339        }
5340
5341        /**
5342         * @return The type of the resource.  See http://build.fhir.org/resourcelist.html.
5343         */
5344        public String getResource() { 
5345          return this.resource == null ? null : this.resource.getValue();
5346        }
5347
5348        /**
5349         * @param value The type of the resource.  See http://build.fhir.org/resourcelist.html.
5350         */
5351        public SetupActionOperationComponent setResource(String value) { 
5352          if (Utilities.noString(value))
5353            this.resource = null;
5354          else {
5355            if (this.resource == null)
5356              this.resource = new CodeType();
5357            this.resource.setValue(value);
5358          }
5359          return this;
5360        }
5361
5362        /**
5363         * @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
5364         */
5365        public StringType getLabelElement() { 
5366          if (this.label == null)
5367            if (Configuration.errorOnAutoCreate())
5368              throw new Error("Attempt to auto-create SetupActionOperationComponent.label");
5369            else if (Configuration.doAutoCreate())
5370              this.label = new StringType(); // bb
5371          return this.label;
5372        }
5373
5374        public boolean hasLabelElement() { 
5375          return this.label != null && !this.label.isEmpty();
5376        }
5377
5378        public boolean hasLabel() { 
5379          return this.label != null && !this.label.isEmpty();
5380        }
5381
5382        /**
5383         * @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
5384         */
5385        public SetupActionOperationComponent setLabelElement(StringType value) { 
5386          this.label = value;
5387          return this;
5388        }
5389
5390        /**
5391         * @return The label would be used for tracking/logging purposes by test engines.
5392         */
5393        public String getLabel() { 
5394          return this.label == null ? null : this.label.getValue();
5395        }
5396
5397        /**
5398         * @param value The label would be used for tracking/logging purposes by test engines.
5399         */
5400        public SetupActionOperationComponent setLabel(String value) { 
5401          if (Utilities.noString(value))
5402            this.label = null;
5403          else {
5404            if (this.label == null)
5405              this.label = new StringType();
5406            this.label.setValue(value);
5407          }
5408          return this;
5409        }
5410
5411        /**
5412         * @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
5413         */
5414        public StringType getDescriptionElement() { 
5415          if (this.description == null)
5416            if (Configuration.errorOnAutoCreate())
5417              throw new Error("Attempt to auto-create SetupActionOperationComponent.description");
5418            else if (Configuration.doAutoCreate())
5419              this.description = new StringType(); // bb
5420          return this.description;
5421        }
5422
5423        public boolean hasDescriptionElement() { 
5424          return this.description != null && !this.description.isEmpty();
5425        }
5426
5427        public boolean hasDescription() { 
5428          return this.description != null && !this.description.isEmpty();
5429        }
5430
5431        /**
5432         * @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
5433         */
5434        public SetupActionOperationComponent setDescriptionElement(StringType value) { 
5435          this.description = value;
5436          return this;
5437        }
5438
5439        /**
5440         * @return The description would be used by test engines for tracking and reporting purposes.
5441         */
5442        public String getDescription() { 
5443          return this.description == null ? null : this.description.getValue();
5444        }
5445
5446        /**
5447         * @param value The description would be used by test engines for tracking and reporting purposes.
5448         */
5449        public SetupActionOperationComponent setDescription(String value) { 
5450          if (Utilities.noString(value))
5451            this.description = null;
5452          else {
5453            if (this.description == null)
5454              this.description = new StringType();
5455            this.description.setValue(value);
5456          }
5457          return this;
5458        }
5459
5460        /**
5461         * @return {@link #accept} (The content-type or 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
5462         */
5463        public Enumeration<ContentType> getAcceptElement() { 
5464          if (this.accept == null)
5465            if (Configuration.errorOnAutoCreate())
5466              throw new Error("Attempt to auto-create SetupActionOperationComponent.accept");
5467            else if (Configuration.doAutoCreate())
5468              this.accept = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
5469          return this.accept;
5470        }
5471
5472        public boolean hasAcceptElement() { 
5473          return this.accept != null && !this.accept.isEmpty();
5474        }
5475
5476        public boolean hasAccept() { 
5477          return this.accept != null && !this.accept.isEmpty();
5478        }
5479
5480        /**
5481         * @param value {@link #accept} (The content-type or 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
5482         */
5483        public SetupActionOperationComponent setAcceptElement(Enumeration<ContentType> value) { 
5484          this.accept = value;
5485          return this;
5486        }
5487
5488        /**
5489         * @return The content-type or mime-type to use for RESTful operation in the 'Accept' header.
5490         */
5491        public ContentType getAccept() { 
5492          return this.accept == null ? null : this.accept.getValue();
5493        }
5494
5495        /**
5496         * @param value The content-type or mime-type to use for RESTful operation in the 'Accept' header.
5497         */
5498        public SetupActionOperationComponent setAccept(ContentType value) { 
5499          if (value == null)
5500            this.accept = null;
5501          else {
5502            if (this.accept == null)
5503              this.accept = new Enumeration<ContentType>(new ContentTypeEnumFactory());
5504            this.accept.setValue(value);
5505          }
5506          return this;
5507        }
5508
5509        /**
5510         * @return {@link #contentType} (The content-type or 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
5511         */
5512        public Enumeration<ContentType> getContentTypeElement() { 
5513          if (this.contentType == null)
5514            if (Configuration.errorOnAutoCreate())
5515              throw new Error("Attempt to auto-create SetupActionOperationComponent.contentType");
5516            else if (Configuration.doAutoCreate())
5517              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
5518          return this.contentType;
5519        }
5520
5521        public boolean hasContentTypeElement() { 
5522          return this.contentType != null && !this.contentType.isEmpty();
5523        }
5524
5525        public boolean hasContentType() { 
5526          return this.contentType != null && !this.contentType.isEmpty();
5527        }
5528
5529        /**
5530         * @param value {@link #contentType} (The content-type or 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
5531         */
5532        public SetupActionOperationComponent setContentTypeElement(Enumeration<ContentType> value) { 
5533          this.contentType = value;
5534          return this;
5535        }
5536
5537        /**
5538         * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
5539         */
5540        public ContentType getContentType() { 
5541          return this.contentType == null ? null : this.contentType.getValue();
5542        }
5543
5544        /**
5545         * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
5546         */
5547        public SetupActionOperationComponent setContentType(ContentType value) { 
5548          if (value == null)
5549            this.contentType = null;
5550          else {
5551            if (this.contentType == null)
5552              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory());
5553            this.contentType.setValue(value);
5554          }
5555          return this;
5556        }
5557
5558        /**
5559         * @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
5560         */
5561        public IntegerType getDestinationElement() { 
5562          if (this.destination == null)
5563            if (Configuration.errorOnAutoCreate())
5564              throw new Error("Attempt to auto-create SetupActionOperationComponent.destination");
5565            else if (Configuration.doAutoCreate())
5566              this.destination = new IntegerType(); // bb
5567          return this.destination;
5568        }
5569
5570        public boolean hasDestinationElement() { 
5571          return this.destination != null && !this.destination.isEmpty();
5572        }
5573
5574        public boolean hasDestination() { 
5575          return this.destination != null && !this.destination.isEmpty();
5576        }
5577
5578        /**
5579         * @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
5580         */
5581        public SetupActionOperationComponent setDestinationElement(IntegerType value) { 
5582          this.destination = value;
5583          return this;
5584        }
5585
5586        /**
5587         * @return The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5588         */
5589        public int getDestination() { 
5590          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
5591        }
5592
5593        /**
5594         * @param value The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.
5595         */
5596        public SetupActionOperationComponent setDestination(int value) { 
5597            if (this.destination == null)
5598              this.destination = new IntegerType();
5599            this.destination.setValue(value);
5600          return this;
5601        }
5602
5603        /**
5604         * @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
5605         */
5606        public BooleanType getEncodeRequestUrlElement() { 
5607          if (this.encodeRequestUrl == null)
5608            if (Configuration.errorOnAutoCreate())
5609              throw new Error("Attempt to auto-create SetupActionOperationComponent.encodeRequestUrl");
5610            else if (Configuration.doAutoCreate())
5611              this.encodeRequestUrl = new BooleanType(); // bb
5612          return this.encodeRequestUrl;
5613        }
5614
5615        public boolean hasEncodeRequestUrlElement() { 
5616          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
5617        }
5618
5619        public boolean hasEncodeRequestUrl() { 
5620          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
5621        }
5622
5623        /**
5624         * @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
5625         */
5626        public SetupActionOperationComponent setEncodeRequestUrlElement(BooleanType value) { 
5627          this.encodeRequestUrl = value;
5628          return this;
5629        }
5630
5631        /**
5632         * @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.
5633         */
5634        public boolean getEncodeRequestUrl() { 
5635          return this.encodeRequestUrl == null || this.encodeRequestUrl.isEmpty() ? false : this.encodeRequestUrl.getValue();
5636        }
5637
5638        /**
5639         * @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.
5640         */
5641        public SetupActionOperationComponent setEncodeRequestUrl(boolean value) { 
5642            if (this.encodeRequestUrl == null)
5643              this.encodeRequestUrl = new BooleanType();
5644            this.encodeRequestUrl.setValue(value);
5645          return this;
5646        }
5647
5648        /**
5649         * @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
5650         */
5651        public IntegerType getOriginElement() { 
5652          if (this.origin == null)
5653            if (Configuration.errorOnAutoCreate())
5654              throw new Error("Attempt to auto-create SetupActionOperationComponent.origin");
5655            else if (Configuration.doAutoCreate())
5656              this.origin = new IntegerType(); // bb
5657          return this.origin;
5658        }
5659
5660        public boolean hasOriginElement() { 
5661          return this.origin != null && !this.origin.isEmpty();
5662        }
5663
5664        public boolean hasOrigin() { 
5665          return this.origin != null && !this.origin.isEmpty();
5666        }
5667
5668        /**
5669         * @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
5670         */
5671        public SetupActionOperationComponent setOriginElement(IntegerType value) { 
5672          this.origin = value;
5673          return this;
5674        }
5675
5676        /**
5677         * @return The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5678         */
5679        public int getOrigin() { 
5680          return this.origin == null || this.origin.isEmpty() ? 0 : this.origin.getValue();
5681        }
5682
5683        /**
5684         * @param value The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.
5685         */
5686        public SetupActionOperationComponent setOrigin(int value) { 
5687            if (this.origin == null)
5688              this.origin = new IntegerType();
5689            this.origin.setValue(value);
5690          return this;
5691        }
5692
5693        /**
5694         * @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
5695         */
5696        public StringType getParamsElement() { 
5697          if (this.params == null)
5698            if (Configuration.errorOnAutoCreate())
5699              throw new Error("Attempt to auto-create SetupActionOperationComponent.params");
5700            else if (Configuration.doAutoCreate())
5701              this.params = new StringType(); // bb
5702          return this.params;
5703        }
5704
5705        public boolean hasParamsElement() { 
5706          return this.params != null && !this.params.isEmpty();
5707        }
5708
5709        public boolean hasParams() { 
5710          return this.params != null && !this.params.isEmpty();
5711        }
5712
5713        /**
5714         * @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
5715         */
5716        public SetupActionOperationComponent setParamsElement(StringType value) { 
5717          this.params = value;
5718          return this;
5719        }
5720
5721        /**
5722         * @return Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5723         */
5724        public String getParams() { 
5725          return this.params == null ? null : this.params.getValue();
5726        }
5727
5728        /**
5729         * @param value Path plus parameters after [type].  Used to set parts of the request URL explicitly.
5730         */
5731        public SetupActionOperationComponent setParams(String value) { 
5732          if (Utilities.noString(value))
5733            this.params = null;
5734          else {
5735            if (this.params == null)
5736              this.params = new StringType();
5737            this.params.setValue(value);
5738          }
5739          return this;
5740        }
5741
5742        /**
5743         * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.)
5744         */
5745        public List<SetupActionOperationRequestHeaderComponent> getRequestHeader() { 
5746          if (this.requestHeader == null)
5747            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5748          return this.requestHeader;
5749        }
5750
5751        /**
5752         * @return Returns a reference to <code>this</code> for easy method chaining
5753         */
5754        public SetupActionOperationComponent setRequestHeader(List<SetupActionOperationRequestHeaderComponent> theRequestHeader) { 
5755          this.requestHeader = theRequestHeader;
5756          return this;
5757        }
5758
5759        public boolean hasRequestHeader() { 
5760          if (this.requestHeader == null)
5761            return false;
5762          for (SetupActionOperationRequestHeaderComponent item : this.requestHeader)
5763            if (!item.isEmpty())
5764              return true;
5765          return false;
5766        }
5767
5768        public SetupActionOperationRequestHeaderComponent addRequestHeader() { //3
5769          SetupActionOperationRequestHeaderComponent t = new SetupActionOperationRequestHeaderComponent();
5770          if (this.requestHeader == null)
5771            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5772          this.requestHeader.add(t);
5773          return t;
5774        }
5775
5776        public SetupActionOperationComponent addRequestHeader(SetupActionOperationRequestHeaderComponent t) { //3
5777          if (t == null)
5778            return this;
5779          if (this.requestHeader == null)
5780            this.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
5781          this.requestHeader.add(t);
5782          return this;
5783        }
5784
5785        /**
5786         * @return The first repetition of repeating field {@link #requestHeader}, creating it if it does not already exist
5787         */
5788        public SetupActionOperationRequestHeaderComponent getRequestHeaderFirstRep() { 
5789          if (getRequestHeader().isEmpty()) {
5790            addRequestHeader();
5791          }
5792          return getRequestHeader().get(0);
5793        }
5794
5795        /**
5796         * @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
5797         */
5798        public IdType getRequestIdElement() { 
5799          if (this.requestId == null)
5800            if (Configuration.errorOnAutoCreate())
5801              throw new Error("Attempt to auto-create SetupActionOperationComponent.requestId");
5802            else if (Configuration.doAutoCreate())
5803              this.requestId = new IdType(); // bb
5804          return this.requestId;
5805        }
5806
5807        public boolean hasRequestIdElement() { 
5808          return this.requestId != null && !this.requestId.isEmpty();
5809        }
5810
5811        public boolean hasRequestId() { 
5812          return this.requestId != null && !this.requestId.isEmpty();
5813        }
5814
5815        /**
5816         * @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
5817         */
5818        public SetupActionOperationComponent setRequestIdElement(IdType value) { 
5819          this.requestId = value;
5820          return this;
5821        }
5822
5823        /**
5824         * @return The fixture id (maybe new) to map to the request.
5825         */
5826        public String getRequestId() { 
5827          return this.requestId == null ? null : this.requestId.getValue();
5828        }
5829
5830        /**
5831         * @param value The fixture id (maybe new) to map to the request.
5832         */
5833        public SetupActionOperationComponent setRequestId(String value) { 
5834          if (Utilities.noString(value))
5835            this.requestId = null;
5836          else {
5837            if (this.requestId == null)
5838              this.requestId = new IdType();
5839            this.requestId.setValue(value);
5840          }
5841          return this;
5842        }
5843
5844        /**
5845         * @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
5846         */
5847        public IdType getResponseIdElement() { 
5848          if (this.responseId == null)
5849            if (Configuration.errorOnAutoCreate())
5850              throw new Error("Attempt to auto-create SetupActionOperationComponent.responseId");
5851            else if (Configuration.doAutoCreate())
5852              this.responseId = new IdType(); // bb
5853          return this.responseId;
5854        }
5855
5856        public boolean hasResponseIdElement() { 
5857          return this.responseId != null && !this.responseId.isEmpty();
5858        }
5859
5860        public boolean hasResponseId() { 
5861          return this.responseId != null && !this.responseId.isEmpty();
5862        }
5863
5864        /**
5865         * @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
5866         */
5867        public SetupActionOperationComponent setResponseIdElement(IdType value) { 
5868          this.responseId = value;
5869          return this;
5870        }
5871
5872        /**
5873         * @return The fixture id (maybe new) to map to the response.
5874         */
5875        public String getResponseId() { 
5876          return this.responseId == null ? null : this.responseId.getValue();
5877        }
5878
5879        /**
5880         * @param value The fixture id (maybe new) to map to the response.
5881         */
5882        public SetupActionOperationComponent setResponseId(String value) { 
5883          if (Utilities.noString(value))
5884            this.responseId = null;
5885          else {
5886            if (this.responseId == null)
5887              this.responseId = new IdType();
5888            this.responseId.setValue(value);
5889          }
5890          return this;
5891        }
5892
5893        /**
5894         * @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
5895         */
5896        public IdType getSourceIdElement() { 
5897          if (this.sourceId == null)
5898            if (Configuration.errorOnAutoCreate())
5899              throw new Error("Attempt to auto-create SetupActionOperationComponent.sourceId");
5900            else if (Configuration.doAutoCreate())
5901              this.sourceId = new IdType(); // bb
5902          return this.sourceId;
5903        }
5904
5905        public boolean hasSourceIdElement() { 
5906          return this.sourceId != null && !this.sourceId.isEmpty();
5907        }
5908
5909        public boolean hasSourceId() { 
5910          return this.sourceId != null && !this.sourceId.isEmpty();
5911        }
5912
5913        /**
5914         * @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
5915         */
5916        public SetupActionOperationComponent setSourceIdElement(IdType value) { 
5917          this.sourceId = value;
5918          return this;
5919        }
5920
5921        /**
5922         * @return The id of the fixture used as the body of a PUT or POST request.
5923         */
5924        public String getSourceId() { 
5925          return this.sourceId == null ? null : this.sourceId.getValue();
5926        }
5927
5928        /**
5929         * @param value The id of the fixture used as the body of a PUT or POST request.
5930         */
5931        public SetupActionOperationComponent setSourceId(String value) { 
5932          if (Utilities.noString(value))
5933            this.sourceId = null;
5934          else {
5935            if (this.sourceId == null)
5936              this.sourceId = new IdType();
5937            this.sourceId.setValue(value);
5938          }
5939          return this;
5940        }
5941
5942        /**
5943         * @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
5944         */
5945        public IdType getTargetIdElement() { 
5946          if (this.targetId == null)
5947            if (Configuration.errorOnAutoCreate())
5948              throw new Error("Attempt to auto-create SetupActionOperationComponent.targetId");
5949            else if (Configuration.doAutoCreate())
5950              this.targetId = new IdType(); // bb
5951          return this.targetId;
5952        }
5953
5954        public boolean hasTargetIdElement() { 
5955          return this.targetId != null && !this.targetId.isEmpty();
5956        }
5957
5958        public boolean hasTargetId() { 
5959          return this.targetId != null && !this.targetId.isEmpty();
5960        }
5961
5962        /**
5963         * @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
5964         */
5965        public SetupActionOperationComponent setTargetIdElement(IdType value) { 
5966          this.targetId = value;
5967          return this;
5968        }
5969
5970        /**
5971         * @return Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5972         */
5973        public String getTargetId() { 
5974          return this.targetId == null ? null : this.targetId.getValue();
5975        }
5976
5977        /**
5978         * @param value Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
5979         */
5980        public SetupActionOperationComponent setTargetId(String value) { 
5981          if (Utilities.noString(value))
5982            this.targetId = null;
5983          else {
5984            if (this.targetId == null)
5985              this.targetId = new IdType();
5986            this.targetId.setValue(value);
5987          }
5988          return this;
5989        }
5990
5991        /**
5992         * @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
5993         */
5994        public StringType getUrlElement() { 
5995          if (this.url == null)
5996            if (Configuration.errorOnAutoCreate())
5997              throw new Error("Attempt to auto-create SetupActionOperationComponent.url");
5998            else if (Configuration.doAutoCreate())
5999              this.url = new StringType(); // bb
6000          return this.url;
6001        }
6002
6003        public boolean hasUrlElement() { 
6004          return this.url != null && !this.url.isEmpty();
6005        }
6006
6007        public boolean hasUrl() { 
6008          return this.url != null && !this.url.isEmpty();
6009        }
6010
6011        /**
6012         * @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
6013         */
6014        public SetupActionOperationComponent setUrlElement(StringType value) { 
6015          this.url = value;
6016          return this;
6017        }
6018
6019        /**
6020         * @return Complete request URL.
6021         */
6022        public String getUrl() { 
6023          return this.url == null ? null : this.url.getValue();
6024        }
6025
6026        /**
6027         * @param value Complete request URL.
6028         */
6029        public SetupActionOperationComponent setUrl(String value) { 
6030          if (Utilities.noString(value))
6031            this.url = null;
6032          else {
6033            if (this.url == null)
6034              this.url = new StringType();
6035            this.url.setValue(value);
6036          }
6037          return this;
6038        }
6039
6040        protected void listChildren(List<Property> children) {
6041          super.listChildren(children);
6042          children.add(new Property("type", "Coding", "Server interaction or operation type.", 0, 1, type));
6043          children.add(new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource));
6044          children.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label));
6045          children.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description));
6046          children.add(new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, 1, accept));
6047          children.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType));
6048          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));
6049          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));
6050          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));
6051          children.add(new Property("params", "string", "Path plus parameters after [type].  Used to set parts of the request URL explicitly.", 0, 1, params));
6052          children.add(new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader));
6053          children.add(new Property("requestId", "id", "The fixture id (maybe new) to map to the request.", 0, 1, requestId));
6054          children.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, 1, responseId));
6055          children.add(new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, 1, sourceId));
6056          children.add(new Property("targetId", "id", "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.", 0, 1, targetId));
6057          children.add(new Property("url", "string", "Complete request URL.", 0, 1, url));
6058        }
6059
6060        @Override
6061        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6062          switch (_hash) {
6063          case 3575610: /*type*/  return new Property("type", "Coding", "Server interaction or operation type.", 0, 1, type);
6064          case -341064690: /*resource*/  return new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource);
6065          case 102727412: /*label*/  return new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label);
6066          case -1724546052: /*description*/  return new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description);
6067          case -1423461112: /*accept*/  return new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, 1, accept);
6068          case -389131437: /*contentType*/  return new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType);
6069          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);
6070          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);
6071          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);
6072          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);
6073          case 1074158076: /*requestHeader*/  return new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader);
6074          case 693933066: /*requestId*/  return new Property("requestId", "id", "The fixture id (maybe new) to map to the request.", 0, 1, requestId);
6075          case -633138884: /*responseId*/  return new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, 1, responseId);
6076          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);
6077          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);
6078          case 116079: /*url*/  return new Property("url", "string", "Complete request URL.", 0, 1, url);
6079          default: return super.getNamedProperty(_hash, _name, _checkValid);
6080          }
6081
6082        }
6083
6084      @Override
6085      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6086        switch (hash) {
6087        case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
6088        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType
6089        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
6090        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
6091        case -1423461112: /*accept*/ return this.accept == null ? new Base[0] : new Base[] {this.accept}; // Enumeration<ContentType>
6092        case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration<ContentType>
6093        case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType
6094        case -1760554218: /*encodeRequestUrl*/ return this.encodeRequestUrl == null ? new Base[0] : new Base[] {this.encodeRequestUrl}; // BooleanType
6095        case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // IntegerType
6096        case -995427962: /*params*/ return this.params == null ? new Base[0] : new Base[] {this.params}; // StringType
6097        case 1074158076: /*requestHeader*/ return this.requestHeader == null ? new Base[0] : this.requestHeader.toArray(new Base[this.requestHeader.size()]); // SetupActionOperationRequestHeaderComponent
6098        case 693933066: /*requestId*/ return this.requestId == null ? new Base[0] : new Base[] {this.requestId}; // IdType
6099        case -633138884: /*responseId*/ return this.responseId == null ? new Base[0] : new Base[] {this.responseId}; // IdType
6100        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
6101        case -441951604: /*targetId*/ return this.targetId == null ? new Base[0] : new Base[] {this.targetId}; // IdType
6102        case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // StringType
6103        default: return super.getProperty(hash, name, checkValid);
6104        }
6105
6106      }
6107
6108      @Override
6109      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6110        switch (hash) {
6111        case 3575610: // type
6112          this.type = castToCoding(value); // Coding
6113          return value;
6114        case -341064690: // resource
6115          this.resource = castToCode(value); // CodeType
6116          return value;
6117        case 102727412: // label
6118          this.label = castToString(value); // StringType
6119          return value;
6120        case -1724546052: // description
6121          this.description = castToString(value); // StringType
6122          return value;
6123        case -1423461112: // accept
6124          value = new ContentTypeEnumFactory().fromType(castToCode(value));
6125          this.accept = (Enumeration) value; // Enumeration<ContentType>
6126          return value;
6127        case -389131437: // contentType
6128          value = new ContentTypeEnumFactory().fromType(castToCode(value));
6129          this.contentType = (Enumeration) value; // Enumeration<ContentType>
6130          return value;
6131        case -1429847026: // destination
6132          this.destination = castToInteger(value); // IntegerType
6133          return value;
6134        case -1760554218: // encodeRequestUrl
6135          this.encodeRequestUrl = castToBoolean(value); // BooleanType
6136          return value;
6137        case -1008619738: // origin
6138          this.origin = castToInteger(value); // IntegerType
6139          return value;
6140        case -995427962: // params
6141          this.params = castToString(value); // StringType
6142          return value;
6143        case 1074158076: // requestHeader
6144          this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); // SetupActionOperationRequestHeaderComponent
6145          return value;
6146        case 693933066: // requestId
6147          this.requestId = castToId(value); // IdType
6148          return value;
6149        case -633138884: // responseId
6150          this.responseId = castToId(value); // IdType
6151          return value;
6152        case 1746327190: // sourceId
6153          this.sourceId = castToId(value); // IdType
6154          return value;
6155        case -441951604: // targetId
6156          this.targetId = castToId(value); // IdType
6157          return value;
6158        case 116079: // url
6159          this.url = castToString(value); // StringType
6160          return value;
6161        default: return super.setProperty(hash, name, value);
6162        }
6163
6164      }
6165
6166      @Override
6167      public Base setProperty(String name, Base value) throws FHIRException {
6168        if (name.equals("type")) {
6169          this.type = castToCoding(value); // Coding
6170        } else if (name.equals("resource")) {
6171          this.resource = castToCode(value); // CodeType
6172        } else if (name.equals("label")) {
6173          this.label = castToString(value); // StringType
6174        } else if (name.equals("description")) {
6175          this.description = castToString(value); // StringType
6176        } else if (name.equals("accept")) {
6177          value = new ContentTypeEnumFactory().fromType(castToCode(value));
6178          this.accept = (Enumeration) value; // Enumeration<ContentType>
6179        } else if (name.equals("contentType")) {
6180          value = new ContentTypeEnumFactory().fromType(castToCode(value));
6181          this.contentType = (Enumeration) value; // Enumeration<ContentType>
6182        } else if (name.equals("destination")) {
6183          this.destination = castToInteger(value); // IntegerType
6184        } else if (name.equals("encodeRequestUrl")) {
6185          this.encodeRequestUrl = castToBoolean(value); // BooleanType
6186        } else if (name.equals("origin")) {
6187          this.origin = castToInteger(value); // IntegerType
6188        } else if (name.equals("params")) {
6189          this.params = castToString(value); // StringType
6190        } else if (name.equals("requestHeader")) {
6191          this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value);
6192        } else if (name.equals("requestId")) {
6193          this.requestId = castToId(value); // IdType
6194        } else if (name.equals("responseId")) {
6195          this.responseId = castToId(value); // IdType
6196        } else if (name.equals("sourceId")) {
6197          this.sourceId = castToId(value); // IdType
6198        } else if (name.equals("targetId")) {
6199          this.targetId = castToId(value); // IdType
6200        } else if (name.equals("url")) {
6201          this.url = castToString(value); // StringType
6202        } else
6203          return super.setProperty(name, value);
6204        return value;
6205      }
6206
6207      @Override
6208      public Base makeProperty(int hash, String name) throws FHIRException {
6209        switch (hash) {
6210        case 3575610:  return getType(); 
6211        case -341064690:  return getResourceElement();
6212        case 102727412:  return getLabelElement();
6213        case -1724546052:  return getDescriptionElement();
6214        case -1423461112:  return getAcceptElement();
6215        case -389131437:  return getContentTypeElement();
6216        case -1429847026:  return getDestinationElement();
6217        case -1760554218:  return getEncodeRequestUrlElement();
6218        case -1008619738:  return getOriginElement();
6219        case -995427962:  return getParamsElement();
6220        case 1074158076:  return addRequestHeader(); 
6221        case 693933066:  return getRequestIdElement();
6222        case -633138884:  return getResponseIdElement();
6223        case 1746327190:  return getSourceIdElement();
6224        case -441951604:  return getTargetIdElement();
6225        case 116079:  return getUrlElement();
6226        default: return super.makeProperty(hash, name);
6227        }
6228
6229      }
6230
6231      @Override
6232      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6233        switch (hash) {
6234        case 3575610: /*type*/ return new String[] {"Coding"};
6235        case -341064690: /*resource*/ return new String[] {"code"};
6236        case 102727412: /*label*/ return new String[] {"string"};
6237        case -1724546052: /*description*/ return new String[] {"string"};
6238        case -1423461112: /*accept*/ return new String[] {"code"};
6239        case -389131437: /*contentType*/ return new String[] {"code"};
6240        case -1429847026: /*destination*/ return new String[] {"integer"};
6241        case -1760554218: /*encodeRequestUrl*/ return new String[] {"boolean"};
6242        case -1008619738: /*origin*/ return new String[] {"integer"};
6243        case -995427962: /*params*/ return new String[] {"string"};
6244        case 1074158076: /*requestHeader*/ return new String[] {};
6245        case 693933066: /*requestId*/ return new String[] {"id"};
6246        case -633138884: /*responseId*/ return new String[] {"id"};
6247        case 1746327190: /*sourceId*/ return new String[] {"id"};
6248        case -441951604: /*targetId*/ return new String[] {"id"};
6249        case 116079: /*url*/ return new String[] {"string"};
6250        default: return super.getTypesForProperty(hash, name);
6251        }
6252
6253      }
6254
6255      @Override
6256      public Base addChild(String name) throws FHIRException {
6257        if (name.equals("type")) {
6258          this.type = new Coding();
6259          return this.type;
6260        }
6261        else if (name.equals("resource")) {
6262          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
6263        }
6264        else if (name.equals("label")) {
6265          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
6266        }
6267        else if (name.equals("description")) {
6268          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
6269        }
6270        else if (name.equals("accept")) {
6271          throw new FHIRException("Cannot call addChild on a primitive type TestScript.accept");
6272        }
6273        else if (name.equals("contentType")) {
6274          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
6275        }
6276        else if (name.equals("destination")) {
6277          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
6278        }
6279        else if (name.equals("encodeRequestUrl")) {
6280          throw new FHIRException("Cannot call addChild on a primitive type TestScript.encodeRequestUrl");
6281        }
6282        else if (name.equals("origin")) {
6283          throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin");
6284        }
6285        else if (name.equals("params")) {
6286          throw new FHIRException("Cannot call addChild on a primitive type TestScript.params");
6287        }
6288        else if (name.equals("requestHeader")) {
6289          return addRequestHeader();
6290        }
6291        else if (name.equals("requestId")) {
6292          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestId");
6293        }
6294        else if (name.equals("responseId")) {
6295          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseId");
6296        }
6297        else if (name.equals("sourceId")) {
6298          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
6299        }
6300        else if (name.equals("targetId")) {
6301          throw new FHIRException("Cannot call addChild on a primitive type TestScript.targetId");
6302        }
6303        else if (name.equals("url")) {
6304          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
6305        }
6306        else
6307          return super.addChild(name);
6308      }
6309
6310      public SetupActionOperationComponent copy() {
6311        SetupActionOperationComponent dst = new SetupActionOperationComponent();
6312        copyValues(dst);
6313        dst.type = type == null ? null : type.copy();
6314        dst.resource = resource == null ? null : resource.copy();
6315        dst.label = label == null ? null : label.copy();
6316        dst.description = description == null ? null : description.copy();
6317        dst.accept = accept == null ? null : accept.copy();
6318        dst.contentType = contentType == null ? null : contentType.copy();
6319        dst.destination = destination == null ? null : destination.copy();
6320        dst.encodeRequestUrl = encodeRequestUrl == null ? null : encodeRequestUrl.copy();
6321        dst.origin = origin == null ? null : origin.copy();
6322        dst.params = params == null ? null : params.copy();
6323        if (requestHeader != null) {
6324          dst.requestHeader = new ArrayList<SetupActionOperationRequestHeaderComponent>();
6325          for (SetupActionOperationRequestHeaderComponent i : requestHeader)
6326            dst.requestHeader.add(i.copy());
6327        };
6328        dst.requestId = requestId == null ? null : requestId.copy();
6329        dst.responseId = responseId == null ? null : responseId.copy();
6330        dst.sourceId = sourceId == null ? null : sourceId.copy();
6331        dst.targetId = targetId == null ? null : targetId.copy();
6332        dst.url = url == null ? null : url.copy();
6333        return dst;
6334      }
6335
6336      @Override
6337      public boolean equalsDeep(Base other_) {
6338        if (!super.equalsDeep(other_))
6339          return false;
6340        if (!(other_ instanceof SetupActionOperationComponent))
6341          return false;
6342        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
6343        return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true) && compareDeep(label, o.label, true)
6344           && compareDeep(description, o.description, true) && compareDeep(accept, o.accept, true) && compareDeep(contentType, o.contentType, true)
6345           && compareDeep(destination, o.destination, true) && compareDeep(encodeRequestUrl, o.encodeRequestUrl, true)
6346           && compareDeep(origin, o.origin, true) && compareDeep(params, o.params, true) && compareDeep(requestHeader, o.requestHeader, true)
6347           && compareDeep(requestId, o.requestId, true) && compareDeep(responseId, o.responseId, true) && compareDeep(sourceId, o.sourceId, true)
6348           && compareDeep(targetId, o.targetId, true) && compareDeep(url, o.url, true);
6349      }
6350
6351      @Override
6352      public boolean equalsShallow(Base other_) {
6353        if (!super.equalsShallow(other_))
6354          return false;
6355        if (!(other_ instanceof SetupActionOperationComponent))
6356          return false;
6357        SetupActionOperationComponent o = (SetupActionOperationComponent) other_;
6358        return compareValues(resource, o.resource, true) && compareValues(label, o.label, true) && compareValues(description, o.description, true)
6359           && compareValues(accept, o.accept, true) && compareValues(contentType, o.contentType, true) && compareValues(destination, o.destination, true)
6360           && compareValues(encodeRequestUrl, o.encodeRequestUrl, true) && compareValues(origin, o.origin, true)
6361           && compareValues(params, o.params, true) && compareValues(requestId, o.requestId, true) && compareValues(responseId, o.responseId, true)
6362           && compareValues(sourceId, o.sourceId, true) && compareValues(targetId, o.targetId, true) && compareValues(url, o.url, true)
6363          ;
6364      }
6365
6366      public boolean isEmpty() {
6367        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, resource, label, description
6368          , accept, contentType, destination, encodeRequestUrl, origin, params, requestHeader
6369          , requestId, responseId, sourceId, targetId, url);
6370      }
6371
6372  public String fhirType() {
6373    return "TestScript.setup.action.operation";
6374
6375  }
6376
6377  }
6378
6379    @Block()
6380    public static class SetupActionOperationRequestHeaderComponent extends BackboneElement implements IBaseBackboneElement {
6381        /**
6382         * The HTTP header field e.g. "Accept".
6383         */
6384        @Child(name = "field", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
6385        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field e.g. \"Accept\"." )
6386        protected StringType field;
6387
6388        /**
6389         * The value of the header e.g. "application/fhir+xml".
6390         */
6391        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
6392        @Description(shortDefinition="HTTP headerfield value", formalDefinition="The value of the header e.g. \"application/fhir+xml\"." )
6393        protected StringType value;
6394
6395        private static final long serialVersionUID = 274395337L;
6396
6397    /**
6398     * Constructor
6399     */
6400      public SetupActionOperationRequestHeaderComponent() {
6401        super();
6402      }
6403
6404    /**
6405     * Constructor
6406     */
6407      public SetupActionOperationRequestHeaderComponent(StringType field, StringType value) {
6408        super();
6409        this.field = field;
6410        this.value = value;
6411      }
6412
6413        /**
6414         * @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
6415         */
6416        public StringType getFieldElement() { 
6417          if (this.field == null)
6418            if (Configuration.errorOnAutoCreate())
6419              throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.field");
6420            else if (Configuration.doAutoCreate())
6421              this.field = new StringType(); // bb
6422          return this.field;
6423        }
6424
6425        public boolean hasFieldElement() { 
6426          return this.field != null && !this.field.isEmpty();
6427        }
6428
6429        public boolean hasField() { 
6430          return this.field != null && !this.field.isEmpty();
6431        }
6432
6433        /**
6434         * @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
6435         */
6436        public SetupActionOperationRequestHeaderComponent setFieldElement(StringType value) { 
6437          this.field = value;
6438          return this;
6439        }
6440
6441        /**
6442         * @return The HTTP header field e.g. "Accept".
6443         */
6444        public String getField() { 
6445          return this.field == null ? null : this.field.getValue();
6446        }
6447
6448        /**
6449         * @param value The HTTP header field e.g. "Accept".
6450         */
6451        public SetupActionOperationRequestHeaderComponent setField(String value) { 
6452            if (this.field == null)
6453              this.field = new StringType();
6454            this.field.setValue(value);
6455          return this;
6456        }
6457
6458        /**
6459         * @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
6460         */
6461        public StringType getValueElement() { 
6462          if (this.value == null)
6463            if (Configuration.errorOnAutoCreate())
6464              throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.value");
6465            else if (Configuration.doAutoCreate())
6466              this.value = new StringType(); // bb
6467          return this.value;
6468        }
6469
6470        public boolean hasValueElement() { 
6471          return this.value != null && !this.value.isEmpty();
6472        }
6473
6474        public boolean hasValue() { 
6475          return this.value != null && !this.value.isEmpty();
6476        }
6477
6478        /**
6479         * @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
6480         */
6481        public SetupActionOperationRequestHeaderComponent setValueElement(StringType value) { 
6482          this.value = value;
6483          return this;
6484        }
6485
6486        /**
6487         * @return The value of the header e.g. "application/fhir+xml".
6488         */
6489        public String getValue() { 
6490          return this.value == null ? null : this.value.getValue();
6491        }
6492
6493        /**
6494         * @param value The value of the header e.g. "application/fhir+xml".
6495         */
6496        public SetupActionOperationRequestHeaderComponent setValue(String value) { 
6497            if (this.value == null)
6498              this.value = new StringType();
6499            this.value.setValue(value);
6500          return this;
6501        }
6502
6503        protected void listChildren(List<Property> children) {
6504          super.listChildren(children);
6505          children.add(new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, 1, field));
6506          children.add(new Property("value", "string", "The value of the header e.g. \"application/fhir+xml\".", 0, 1, value));
6507        }
6508
6509        @Override
6510        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
6511          switch (_hash) {
6512          case 97427706: /*field*/  return new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, 1, field);
6513          case 111972721: /*value*/  return new Property("value", "string", "The value of the header e.g. \"application/fhir+xml\".", 0, 1, value);
6514          default: return super.getNamedProperty(_hash, _name, _checkValid);
6515          }
6516
6517        }
6518
6519      @Override
6520      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
6521        switch (hash) {
6522        case 97427706: /*field*/ return this.field == null ? new Base[0] : new Base[] {this.field}; // StringType
6523        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
6524        default: return super.getProperty(hash, name, checkValid);
6525        }
6526
6527      }
6528
6529      @Override
6530      public Base setProperty(int hash, String name, Base value) throws FHIRException {
6531        switch (hash) {
6532        case 97427706: // field
6533          this.field = castToString(value); // StringType
6534          return value;
6535        case 111972721: // value
6536          this.value = castToString(value); // StringType
6537          return value;
6538        default: return super.setProperty(hash, name, value);
6539        }
6540
6541      }
6542
6543      @Override
6544      public Base setProperty(String name, Base value) throws FHIRException {
6545        if (name.equals("field")) {
6546          this.field = castToString(value); // StringType
6547        } else if (name.equals("value")) {
6548          this.value = castToString(value); // StringType
6549        } else
6550          return super.setProperty(name, value);
6551        return value;
6552      }
6553
6554      @Override
6555      public Base makeProperty(int hash, String name) throws FHIRException {
6556        switch (hash) {
6557        case 97427706:  return getFieldElement();
6558        case 111972721:  return getValueElement();
6559        default: return super.makeProperty(hash, name);
6560        }
6561
6562      }
6563
6564      @Override
6565      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
6566        switch (hash) {
6567        case 97427706: /*field*/ return new String[] {"string"};
6568        case 111972721: /*value*/ return new String[] {"string"};
6569        default: return super.getTypesForProperty(hash, name);
6570        }
6571
6572      }
6573
6574      @Override
6575      public Base addChild(String name) throws FHIRException {
6576        if (name.equals("field")) {
6577          throw new FHIRException("Cannot call addChild on a primitive type TestScript.field");
6578        }
6579        else if (name.equals("value")) {
6580          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
6581        }
6582        else
6583          return super.addChild(name);
6584      }
6585
6586      public SetupActionOperationRequestHeaderComponent copy() {
6587        SetupActionOperationRequestHeaderComponent dst = new SetupActionOperationRequestHeaderComponent();
6588        copyValues(dst);
6589        dst.field = field == null ? null : field.copy();
6590        dst.value = value == null ? null : value.copy();
6591        return dst;
6592      }
6593
6594      @Override
6595      public boolean equalsDeep(Base other_) {
6596        if (!super.equalsDeep(other_))
6597          return false;
6598        if (!(other_ instanceof SetupActionOperationRequestHeaderComponent))
6599          return false;
6600        SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other_;
6601        return compareDeep(field, o.field, true) && compareDeep(value, o.value, true);
6602      }
6603
6604      @Override
6605      public boolean equalsShallow(Base other_) {
6606        if (!super.equalsShallow(other_))
6607          return false;
6608        if (!(other_ instanceof SetupActionOperationRequestHeaderComponent))
6609          return false;
6610        SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other_;
6611        return compareValues(field, o.field, true) && compareValues(value, o.value, true);
6612      }
6613
6614      public boolean isEmpty() {
6615        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(field, value);
6616      }
6617
6618  public String fhirType() {
6619    return "TestScript.setup.action.operation.requestHeader";
6620
6621  }
6622
6623  }
6624
6625    @Block()
6626    public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement {
6627        /**
6628         * The label would be used for tracking/logging purposes by test engines.
6629         */
6630        @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
6631        @Description(shortDefinition="Tracking/logging assertion label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
6632        protected StringType label;
6633
6634        /**
6635         * The description would be used by test engines for tracking and reporting purposes.
6636         */
6637        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
6638        @Description(shortDefinition="Tracking/reporting assertion description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
6639        protected StringType description;
6640
6641        /**
6642         * The direction to use for the assertion.
6643         */
6644        @Child(name = "direction", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
6645        @Description(shortDefinition="response | request", formalDefinition="The direction to use for the assertion." )
6646        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-direction-codes")
6647        protected Enumeration<AssertionDirectionType> direction;
6648
6649        /**
6650         * Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6651         */
6652        @Child(name = "compareToSourceId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
6653        @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." )
6654        protected StringType compareToSourceId;
6655
6656        /**
6657         * The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6658         */
6659        @Child(name = "compareToSourceExpression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
6660        @Description(shortDefinition="The fluentpath expression to evaluate against the source fixture", formalDefinition="The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both." )
6661        protected StringType compareToSourceExpression;
6662
6663        /**
6664         * XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
6665         */
6666        @Child(name = "compareToSourcePath", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
6667        @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." )
6668        protected StringType compareToSourcePath;
6669
6670        /**
6671         * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
6672         */
6673        @Child(name = "contentType", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false)
6674        @Description(shortDefinition="xml | json | ttl | none", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." )
6675        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/content-type")
6676        protected Enumeration<ContentType> contentType;
6677
6678        /**
6679         * The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.
6680         */
6681        @Child(name = "expression", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
6682        @Description(shortDefinition="The fluentpath expression to be evaluated", formalDefinition="The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload." )
6683        protected StringType expression;
6684
6685        /**
6686         * The HTTP header field name e.g. 'Location'.
6687         */
6688        @Child(name = "headerField", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
6689        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field name e.g. 'Location'." )
6690        protected StringType headerField;
6691
6692        /**
6693         * The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
6694         */
6695        @Child(name = "minimumId", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false)
6696        @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." )
6697        protected StringType minimumId;
6698
6699        /**
6700         * Whether or not the test execution performs validation on the bundle navigation links.
6701         */
6702        @Child(name = "navigationLinks", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=false)
6703        @Description(shortDefinition="Perform validation on navigation links?", formalDefinition="Whether or not the test execution performs validation on the bundle navigation links." )
6704        protected BooleanType navigationLinks;
6705
6706        /**
6707         * The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
6708         */
6709        @Child(name = "operator", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false)
6710        @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." )
6711        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-operator-codes")
6712        protected Enumeration<AssertionOperatorType> operator;
6713
6714        /**
6715         * The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
6716         */
6717        @Child(name = "path", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false)
6718        @Description(shortDefinition="XPath or JSONPath expression", formalDefinition="The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server." )
6719        protected StringType path;
6720
6721        /**
6722         * The request method or HTTP operation code to compare against that used by the client system under test.
6723         */
6724        @Child(name = "requestMethod", type = {CodeType.class}, order=14, min=0, max=1, modifier=false, summary=false)
6725        @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." )
6726        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/http-operations")
6727        protected Enumeration<TestScriptRequestMethodCode> requestMethod;
6728
6729        /**
6730         * The value to use in a comparison against the request URL path string.
6731         */
6732        @Child(name = "requestURL", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false)
6733        @Description(shortDefinition="Request URL comparison value", formalDefinition="The value to use in a comparison against the request URL path string." )
6734        protected StringType requestURL;
6735
6736        /**
6737         * The type of the resource.  See http://build.fhir.org/resourcelist.html.
6738         */
6739        @Child(name = "resource", type = {CodeType.class}, order=16, min=0, max=1, modifier=false, summary=false)
6740        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://build.fhir.org/resourcelist.html." )
6741        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/defined-types")
6742        protected CodeType resource;
6743
6744        /**
6745         * okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
6746         */
6747        @Child(name = "response", type = {CodeType.class}, order=17, min=0, max=1, modifier=false, summary=false)
6748        @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." )
6749        @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/assert-response-code-types")
6750        protected Enumeration<AssertionResponseTypes> response;
6751
6752        /**
6753         * The value of the HTTP response code to be tested.
6754         */
6755        @Child(name = "responseCode", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false)
6756        @Description(shortDefinition="HTTP response code to test", formalDefinition="The value of the HTTP response code to be tested." )
6757        protected StringType responseCode;
6758
6759        /**
6760         * The TestScript.rule this assert will evaluate.
6761         */
6762        @Child(name = "rule", type = {}, order=19, min=0, max=1, modifier=false, summary=false)
6763        @Description(shortDefinition="The reference to a TestScript.rule", formalDefinition="The TestScript.rule this assert will evaluate." )
6764        protected ActionAssertRuleComponent rule;
6765
6766        /**
6767         * The TestScript.ruleset this assert will evaluate.
6768         */
6769        @Child(name = "ruleset", type = {}, order=20, min=0, max=1, modifier=false, summary=false)
6770        @Description(shortDefinition="The reference to a TestScript.ruleset", formalDefinition="The TestScript.ruleset this assert will evaluate." )
6771        protected ActionAssertRulesetComponent ruleset;
6772
6773        /**
6774         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
6775         */
6776        @Child(name = "sourceId", type = {IdType.class}, order=21, min=0, max=1, modifier=false, summary=false)
6777        @Description(shortDefinition="Fixture Id of source expression or headerField", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField  against." )
6778        protected IdType sourceId;
6779
6780        /**
6781         * The ID of the Profile to validate against.
6782         */
6783        @Child(name = "validateProfileId", type = {IdType.class}, order=22, min=0, max=1, modifier=false, summary=false)
6784        @Description(shortDefinition="Profile Id of validation profile reference", formalDefinition="The ID of the Profile to validate against." )
6785        protected IdType validateProfileId;
6786
6787        /**
6788         * The value to compare to.
6789         */
6790        @Child(name = "value", type = {StringType.class}, order=23, min=0, max=1, modifier=false, summary=false)
6791        @Description(shortDefinition="The value to compare to", formalDefinition="The value to compare to." )
6792        protected StringType value;
6793
6794        /**
6795         * Whether or not the test execution will produce a warning only on error for this assert.
6796         */
6797        @Child(name = "warningOnly", type = {BooleanType.class}, order=24, min=0, max=1, modifier=false, summary=false)
6798        @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." )
6799        protected BooleanType warningOnly;
6800
6801        private static final long serialVersionUID = 171718507L;
6802
6803    /**
6804     * Constructor
6805     */
6806      public SetupActionAssertComponent() {
6807        super();
6808      }
6809
6810        /**
6811         * @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
6812         */
6813        public StringType getLabelElement() { 
6814          if (this.label == null)
6815            if (Configuration.errorOnAutoCreate())
6816              throw new Error("Attempt to auto-create SetupActionAssertComponent.label");
6817            else if (Configuration.doAutoCreate())
6818              this.label = new StringType(); // bb
6819          return this.label;
6820        }
6821
6822        public boolean hasLabelElement() { 
6823          return this.label != null && !this.label.isEmpty();
6824        }
6825
6826        public boolean hasLabel() { 
6827          return this.label != null && !this.label.isEmpty();
6828        }
6829
6830        /**
6831         * @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
6832         */
6833        public SetupActionAssertComponent setLabelElement(StringType value) { 
6834          this.label = value;
6835          return this;
6836        }
6837
6838        /**
6839         * @return The label would be used for tracking/logging purposes by test engines.
6840         */
6841        public String getLabel() { 
6842          return this.label == null ? null : this.label.getValue();
6843        }
6844
6845        /**
6846         * @param value The label would be used for tracking/logging purposes by test engines.
6847         */
6848        public SetupActionAssertComponent setLabel(String value) { 
6849          if (Utilities.noString(value))
6850            this.label = null;
6851          else {
6852            if (this.label == null)
6853              this.label = new StringType();
6854            this.label.setValue(value);
6855          }
6856          return this;
6857        }
6858
6859        /**
6860         * @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
6861         */
6862        public StringType getDescriptionElement() { 
6863          if (this.description == null)
6864            if (Configuration.errorOnAutoCreate())
6865              throw new Error("Attempt to auto-create SetupActionAssertComponent.description");
6866            else if (Configuration.doAutoCreate())
6867              this.description = new StringType(); // bb
6868          return this.description;
6869        }
6870
6871        public boolean hasDescriptionElement() { 
6872          return this.description != null && !this.description.isEmpty();
6873        }
6874
6875        public boolean hasDescription() { 
6876          return this.description != null && !this.description.isEmpty();
6877        }
6878
6879        /**
6880         * @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
6881         */
6882        public SetupActionAssertComponent setDescriptionElement(StringType value) { 
6883          this.description = value;
6884          return this;
6885        }
6886
6887        /**
6888         * @return The description would be used by test engines for tracking and reporting purposes.
6889         */
6890        public String getDescription() { 
6891          return this.description == null ? null : this.description.getValue();
6892        }
6893
6894        /**
6895         * @param value The description would be used by test engines for tracking and reporting purposes.
6896         */
6897        public SetupActionAssertComponent setDescription(String value) { 
6898          if (Utilities.noString(value))
6899            this.description = null;
6900          else {
6901            if (this.description == null)
6902              this.description = new StringType();
6903            this.description.setValue(value);
6904          }
6905          return this;
6906        }
6907
6908        /**
6909         * @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
6910         */
6911        public Enumeration<AssertionDirectionType> getDirectionElement() { 
6912          if (this.direction == null)
6913            if (Configuration.errorOnAutoCreate())
6914              throw new Error("Attempt to auto-create SetupActionAssertComponent.direction");
6915            else if (Configuration.doAutoCreate())
6916              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory()); // bb
6917          return this.direction;
6918        }
6919
6920        public boolean hasDirectionElement() { 
6921          return this.direction != null && !this.direction.isEmpty();
6922        }
6923
6924        public boolean hasDirection() { 
6925          return this.direction != null && !this.direction.isEmpty();
6926        }
6927
6928        /**
6929         * @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
6930         */
6931        public SetupActionAssertComponent setDirectionElement(Enumeration<AssertionDirectionType> value) { 
6932          this.direction = value;
6933          return this;
6934        }
6935
6936        /**
6937         * @return The direction to use for the assertion.
6938         */
6939        public AssertionDirectionType getDirection() { 
6940          return this.direction == null ? null : this.direction.getValue();
6941        }
6942
6943        /**
6944         * @param value The direction to use for the assertion.
6945         */
6946        public SetupActionAssertComponent setDirection(AssertionDirectionType value) { 
6947          if (value == null)
6948            this.direction = null;
6949          else {
6950            if (this.direction == null)
6951              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory());
6952            this.direction.setValue(value);
6953          }
6954          return this;
6955        }
6956
6957        /**
6958         * @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
6959         */
6960        public StringType getCompareToSourceIdElement() { 
6961          if (this.compareToSourceId == null)
6962            if (Configuration.errorOnAutoCreate())
6963              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceId");
6964            else if (Configuration.doAutoCreate())
6965              this.compareToSourceId = new StringType(); // bb
6966          return this.compareToSourceId;
6967        }
6968
6969        public boolean hasCompareToSourceIdElement() { 
6970          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
6971        }
6972
6973        public boolean hasCompareToSourceId() { 
6974          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
6975        }
6976
6977        /**
6978         * @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
6979         */
6980        public SetupActionAssertComponent setCompareToSourceIdElement(StringType value) { 
6981          this.compareToSourceId = value;
6982          return this;
6983        }
6984
6985        /**
6986         * @return Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6987         */
6988        public String getCompareToSourceId() { 
6989          return this.compareToSourceId == null ? null : this.compareToSourceId.getValue();
6990        }
6991
6992        /**
6993         * @param value Id of the source fixture used as the contents to be evaluated by either the "source/expression" or "sourceId/path" definition.
6994         */
6995        public SetupActionAssertComponent setCompareToSourceId(String value) { 
6996          if (Utilities.noString(value))
6997            this.compareToSourceId = null;
6998          else {
6999            if (this.compareToSourceId == null)
7000              this.compareToSourceId = new StringType();
7001            this.compareToSourceId.setValue(value);
7002          }
7003          return this;
7004        }
7005
7006        /**
7007         * @return {@link #compareToSourceExpression} (The fluentpath 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
7008         */
7009        public StringType getCompareToSourceExpressionElement() { 
7010          if (this.compareToSourceExpression == null)
7011            if (Configuration.errorOnAutoCreate())
7012              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceExpression");
7013            else if (Configuration.doAutoCreate())
7014              this.compareToSourceExpression = new StringType(); // bb
7015          return this.compareToSourceExpression;
7016        }
7017
7018        public boolean hasCompareToSourceExpressionElement() { 
7019          return this.compareToSourceExpression != null && !this.compareToSourceExpression.isEmpty();
7020        }
7021
7022        public boolean hasCompareToSourceExpression() { 
7023          return this.compareToSourceExpression != null && !this.compareToSourceExpression.isEmpty();
7024        }
7025
7026        /**
7027         * @param value {@link #compareToSourceExpression} (The fluentpath 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
7028         */
7029        public SetupActionAssertComponent setCompareToSourceExpressionElement(StringType value) { 
7030          this.compareToSourceExpression = value;
7031          return this;
7032        }
7033
7034        /**
7035         * @return The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
7036         */
7037        public String getCompareToSourceExpression() { 
7038          return this.compareToSourceExpression == null ? null : this.compareToSourceExpression.getValue();
7039        }
7040
7041        /**
7042         * @param value The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.
7043         */
7044        public SetupActionAssertComponent setCompareToSourceExpression(String value) { 
7045          if (Utilities.noString(value))
7046            this.compareToSourceExpression = null;
7047          else {
7048            if (this.compareToSourceExpression == null)
7049              this.compareToSourceExpression = new StringType();
7050            this.compareToSourceExpression.setValue(value);
7051          }
7052          return this;
7053        }
7054
7055        /**
7056         * @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
7057         */
7058        public StringType getCompareToSourcePathElement() { 
7059          if (this.compareToSourcePath == null)
7060            if (Configuration.errorOnAutoCreate())
7061              throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourcePath");
7062            else if (Configuration.doAutoCreate())
7063              this.compareToSourcePath = new StringType(); // bb
7064          return this.compareToSourcePath;
7065        }
7066
7067        public boolean hasCompareToSourcePathElement() { 
7068          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
7069        }
7070
7071        public boolean hasCompareToSourcePath() { 
7072          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
7073        }
7074
7075        /**
7076         * @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
7077         */
7078        public SetupActionAssertComponent setCompareToSourcePathElement(StringType value) { 
7079          this.compareToSourcePath = value;
7080          return this;
7081        }
7082
7083        /**
7084         * @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.
7085         */
7086        public String getCompareToSourcePath() { 
7087          return this.compareToSourcePath == null ? null : this.compareToSourcePath.getValue();
7088        }
7089
7090        /**
7091         * @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.
7092         */
7093        public SetupActionAssertComponent setCompareToSourcePath(String value) { 
7094          if (Utilities.noString(value))
7095            this.compareToSourcePath = null;
7096          else {
7097            if (this.compareToSourcePath == null)
7098              this.compareToSourcePath = new StringType();
7099            this.compareToSourcePath.setValue(value);
7100          }
7101          return this;
7102        }
7103
7104        /**
7105         * @return {@link #contentType} (The content-type or 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
7106         */
7107        public Enumeration<ContentType> getContentTypeElement() { 
7108          if (this.contentType == null)
7109            if (Configuration.errorOnAutoCreate())
7110              throw new Error("Attempt to auto-create SetupActionAssertComponent.contentType");
7111            else if (Configuration.doAutoCreate())
7112              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
7113          return this.contentType;
7114        }
7115
7116        public boolean hasContentTypeElement() { 
7117          return this.contentType != null && !this.contentType.isEmpty();
7118        }
7119
7120        public boolean hasContentType() { 
7121          return this.contentType != null && !this.contentType.isEmpty();
7122        }
7123
7124        /**
7125         * @param value {@link #contentType} (The content-type or 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
7126         */
7127        public SetupActionAssertComponent setContentTypeElement(Enumeration<ContentType> value) { 
7128          this.contentType = value;
7129          return this;
7130        }
7131
7132        /**
7133         * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
7134         */
7135        public ContentType getContentType() { 
7136          return this.contentType == null ? null : this.contentType.getValue();
7137        }
7138
7139        /**
7140         * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
7141         */
7142        public SetupActionAssertComponent setContentType(ContentType value) { 
7143          if (value == null)
7144            this.contentType = null;
7145          else {
7146            if (this.contentType == null)
7147              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory());
7148            this.contentType.setValue(value);
7149          }
7150          return this;
7151        }
7152
7153        /**
7154         * @return {@link #expression} (The fluentpath 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
7155         */
7156        public StringType getExpressionElement() { 
7157          if (this.expression == null)
7158            if (Configuration.errorOnAutoCreate())
7159              throw new Error("Attempt to auto-create SetupActionAssertComponent.expression");
7160            else if (Configuration.doAutoCreate())
7161              this.expression = new StringType(); // bb
7162          return this.expression;
7163        }
7164
7165        public boolean hasExpressionElement() { 
7166          return this.expression != null && !this.expression.isEmpty();
7167        }
7168
7169        public boolean hasExpression() { 
7170          return this.expression != null && !this.expression.isEmpty();
7171        }
7172
7173        /**
7174         * @param value {@link #expression} (The fluentpath 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
7175         */
7176        public SetupActionAssertComponent setExpressionElement(StringType value) { 
7177          this.expression = value;
7178          return this;
7179        }
7180
7181        /**
7182         * @return The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.
7183         */
7184        public String getExpression() { 
7185          return this.expression == null ? null : this.expression.getValue();
7186        }
7187
7188        /**
7189         * @param value The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.
7190         */
7191        public SetupActionAssertComponent setExpression(String value) { 
7192          if (Utilities.noString(value))
7193            this.expression = null;
7194          else {
7195            if (this.expression == null)
7196              this.expression = new StringType();
7197            this.expression.setValue(value);
7198          }
7199          return this;
7200        }
7201
7202        /**
7203         * @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
7204         */
7205        public StringType getHeaderFieldElement() { 
7206          if (this.headerField == null)
7207            if (Configuration.errorOnAutoCreate())
7208              throw new Error("Attempt to auto-create SetupActionAssertComponent.headerField");
7209            else if (Configuration.doAutoCreate())
7210              this.headerField = new StringType(); // bb
7211          return this.headerField;
7212        }
7213
7214        public boolean hasHeaderFieldElement() { 
7215          return this.headerField != null && !this.headerField.isEmpty();
7216        }
7217
7218        public boolean hasHeaderField() { 
7219          return this.headerField != null && !this.headerField.isEmpty();
7220        }
7221
7222        /**
7223         * @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
7224         */
7225        public SetupActionAssertComponent setHeaderFieldElement(StringType value) { 
7226          this.headerField = value;
7227          return this;
7228        }
7229
7230        /**
7231         * @return The HTTP header field name e.g. 'Location'.
7232         */
7233        public String getHeaderField() { 
7234          return this.headerField == null ? null : this.headerField.getValue();
7235        }
7236
7237        /**
7238         * @param value The HTTP header field name e.g. 'Location'.
7239         */
7240        public SetupActionAssertComponent setHeaderField(String value) { 
7241          if (Utilities.noString(value))
7242            this.headerField = null;
7243          else {
7244            if (this.headerField == null)
7245              this.headerField = new StringType();
7246            this.headerField.setValue(value);
7247          }
7248          return this;
7249        }
7250
7251        /**
7252         * @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
7253         */
7254        public StringType getMinimumIdElement() { 
7255          if (this.minimumId == null)
7256            if (Configuration.errorOnAutoCreate())
7257              throw new Error("Attempt to auto-create SetupActionAssertComponent.minimumId");
7258            else if (Configuration.doAutoCreate())
7259              this.minimumId = new StringType(); // bb
7260          return this.minimumId;
7261        }
7262
7263        public boolean hasMinimumIdElement() { 
7264          return this.minimumId != null && !this.minimumId.isEmpty();
7265        }
7266
7267        public boolean hasMinimumId() { 
7268          return this.minimumId != null && !this.minimumId.isEmpty();
7269        }
7270
7271        /**
7272         * @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
7273         */
7274        public SetupActionAssertComponent setMinimumIdElement(StringType value) { 
7275          this.minimumId = value;
7276          return this;
7277        }
7278
7279        /**
7280         * @return The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
7281         */
7282        public String getMinimumId() { 
7283          return this.minimumId == null ? null : this.minimumId.getValue();
7284        }
7285
7286        /**
7287         * @param value The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.
7288         */
7289        public SetupActionAssertComponent setMinimumId(String value) { 
7290          if (Utilities.noString(value))
7291            this.minimumId = null;
7292          else {
7293            if (this.minimumId == null)
7294              this.minimumId = new StringType();
7295            this.minimumId.setValue(value);
7296          }
7297          return this;
7298        }
7299
7300        /**
7301         * @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
7302         */
7303        public BooleanType getNavigationLinksElement() { 
7304          if (this.navigationLinks == null)
7305            if (Configuration.errorOnAutoCreate())
7306              throw new Error("Attempt to auto-create SetupActionAssertComponent.navigationLinks");
7307            else if (Configuration.doAutoCreate())
7308              this.navigationLinks = new BooleanType(); // bb
7309          return this.navigationLinks;
7310        }
7311
7312        public boolean hasNavigationLinksElement() { 
7313          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
7314        }
7315
7316        public boolean hasNavigationLinks() { 
7317          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
7318        }
7319
7320        /**
7321         * @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
7322         */
7323        public SetupActionAssertComponent setNavigationLinksElement(BooleanType value) { 
7324          this.navigationLinks = value;
7325          return this;
7326        }
7327
7328        /**
7329         * @return Whether or not the test execution performs validation on the bundle navigation links.
7330         */
7331        public boolean getNavigationLinks() { 
7332          return this.navigationLinks == null || this.navigationLinks.isEmpty() ? false : this.navigationLinks.getValue();
7333        }
7334
7335        /**
7336         * @param value Whether or not the test execution performs validation on the bundle navigation links.
7337         */
7338        public SetupActionAssertComponent setNavigationLinks(boolean value) { 
7339            if (this.navigationLinks == null)
7340              this.navigationLinks = new BooleanType();
7341            this.navigationLinks.setValue(value);
7342          return this;
7343        }
7344
7345        /**
7346         * @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
7347         */
7348        public Enumeration<AssertionOperatorType> getOperatorElement() { 
7349          if (this.operator == null)
7350            if (Configuration.errorOnAutoCreate())
7351              throw new Error("Attempt to auto-create SetupActionAssertComponent.operator");
7352            else if (Configuration.doAutoCreate())
7353              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory()); // bb
7354          return this.operator;
7355        }
7356
7357        public boolean hasOperatorElement() { 
7358          return this.operator != null && !this.operator.isEmpty();
7359        }
7360
7361        public boolean hasOperator() { 
7362          return this.operator != null && !this.operator.isEmpty();
7363        }
7364
7365        /**
7366         * @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
7367         */
7368        public SetupActionAssertComponent setOperatorElement(Enumeration<AssertionOperatorType> value) { 
7369          this.operator = value;
7370          return this;
7371        }
7372
7373        /**
7374         * @return The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
7375         */
7376        public AssertionOperatorType getOperator() { 
7377          return this.operator == null ? null : this.operator.getValue();
7378        }
7379
7380        /**
7381         * @param value The operator type defines the conditional behavior of the assert. If not defined, the default is equals.
7382         */
7383        public SetupActionAssertComponent setOperator(AssertionOperatorType value) { 
7384          if (value == null)
7385            this.operator = null;
7386          else {
7387            if (this.operator == null)
7388              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory());
7389            this.operator.setValue(value);
7390          }
7391          return this;
7392        }
7393
7394        /**
7395         * @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
7396         */
7397        public StringType getPathElement() { 
7398          if (this.path == null)
7399            if (Configuration.errorOnAutoCreate())
7400              throw new Error("Attempt to auto-create SetupActionAssertComponent.path");
7401            else if (Configuration.doAutoCreate())
7402              this.path = new StringType(); // bb
7403          return this.path;
7404        }
7405
7406        public boolean hasPathElement() { 
7407          return this.path != null && !this.path.isEmpty();
7408        }
7409
7410        public boolean hasPath() { 
7411          return this.path != null && !this.path.isEmpty();
7412        }
7413
7414        /**
7415         * @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
7416         */
7417        public SetupActionAssertComponent setPathElement(StringType value) { 
7418          this.path = value;
7419          return this;
7420        }
7421
7422        /**
7423         * @return The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
7424         */
7425        public String getPath() { 
7426          return this.path == null ? null : this.path.getValue();
7427        }
7428
7429        /**
7430         * @param value The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
7431         */
7432        public SetupActionAssertComponent setPath(String value) { 
7433          if (Utilities.noString(value))
7434            this.path = null;
7435          else {
7436            if (this.path == null)
7437              this.path = new StringType();
7438            this.path.setValue(value);
7439          }
7440          return this;
7441        }
7442
7443        /**
7444         * @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
7445         */
7446        public Enumeration<TestScriptRequestMethodCode> getRequestMethodElement() { 
7447          if (this.requestMethod == null)
7448            if (Configuration.errorOnAutoCreate())
7449              throw new Error("Attempt to auto-create SetupActionAssertComponent.requestMethod");
7450            else if (Configuration.doAutoCreate())
7451              this.requestMethod = new Enumeration<TestScriptRequestMethodCode>(new TestScriptRequestMethodCodeEnumFactory()); // bb
7452          return this.requestMethod;
7453        }
7454
7455        public boolean hasRequestMethodElement() { 
7456          return this.requestMethod != null && !this.requestMethod.isEmpty();
7457        }
7458
7459        public boolean hasRequestMethod() { 
7460          return this.requestMethod != null && !this.requestMethod.isEmpty();
7461        }
7462
7463        /**
7464         * @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
7465         */
7466        public SetupActionAssertComponent setRequestMethodElement(Enumeration<TestScriptRequestMethodCode> value) { 
7467          this.requestMethod = value;
7468          return this;
7469        }
7470
7471        /**
7472         * @return The request method or HTTP operation code to compare against that used by the client system under test.
7473         */
7474        public TestScriptRequestMethodCode getRequestMethod() { 
7475          return this.requestMethod == null ? null : this.requestMethod.getValue();
7476        }
7477
7478        /**
7479         * @param value The request method or HTTP operation code to compare against that used by the client system under test.
7480         */
7481        public SetupActionAssertComponent setRequestMethod(TestScriptRequestMethodCode value) { 
7482          if (value == null)
7483            this.requestMethod = null;
7484          else {
7485            if (this.requestMethod == null)
7486              this.requestMethod = new Enumeration<TestScriptRequestMethodCode>(new TestScriptRequestMethodCodeEnumFactory());
7487            this.requestMethod.setValue(value);
7488          }
7489          return this;
7490        }
7491
7492        /**
7493         * @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
7494         */
7495        public StringType getRequestURLElement() { 
7496          if (this.requestURL == null)
7497            if (Configuration.errorOnAutoCreate())
7498              throw new Error("Attempt to auto-create SetupActionAssertComponent.requestURL");
7499            else if (Configuration.doAutoCreate())
7500              this.requestURL = new StringType(); // bb
7501          return this.requestURL;
7502        }
7503
7504        public boolean hasRequestURLElement() { 
7505          return this.requestURL != null && !this.requestURL.isEmpty();
7506        }
7507
7508        public boolean hasRequestURL() { 
7509          return this.requestURL != null && !this.requestURL.isEmpty();
7510        }
7511
7512        /**
7513         * @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
7514         */
7515        public SetupActionAssertComponent setRequestURLElement(StringType value) { 
7516          this.requestURL = value;
7517          return this;
7518        }
7519
7520        /**
7521         * @return The value to use in a comparison against the request URL path string.
7522         */
7523        public String getRequestURL() { 
7524          return this.requestURL == null ? null : this.requestURL.getValue();
7525        }
7526
7527        /**
7528         * @param value The value to use in a comparison against the request URL path string.
7529         */
7530        public SetupActionAssertComponent setRequestURL(String value) { 
7531          if (Utilities.noString(value))
7532            this.requestURL = null;
7533          else {
7534            if (this.requestURL == null)
7535              this.requestURL = new StringType();
7536            this.requestURL.setValue(value);
7537          }
7538          return this;
7539        }
7540
7541        /**
7542         * @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
7543         */
7544        public CodeType getResourceElement() { 
7545          if (this.resource == null)
7546            if (Configuration.errorOnAutoCreate())
7547              throw new Error("Attempt to auto-create SetupActionAssertComponent.resource");
7548            else if (Configuration.doAutoCreate())
7549              this.resource = new CodeType(); // bb
7550          return this.resource;
7551        }
7552
7553        public boolean hasResourceElement() { 
7554          return this.resource != null && !this.resource.isEmpty();
7555        }
7556
7557        public boolean hasResource() { 
7558          return this.resource != null && !this.resource.isEmpty();
7559        }
7560
7561        /**
7562         * @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
7563         */
7564        public SetupActionAssertComponent setResourceElement(CodeType value) { 
7565          this.resource = value;
7566          return this;
7567        }
7568
7569        /**
7570         * @return The type of the resource.  See http://build.fhir.org/resourcelist.html.
7571         */
7572        public String getResource() { 
7573          return this.resource == null ? null : this.resource.getValue();
7574        }
7575
7576        /**
7577         * @param value The type of the resource.  See http://build.fhir.org/resourcelist.html.
7578         */
7579        public SetupActionAssertComponent setResource(String value) { 
7580          if (Utilities.noString(value))
7581            this.resource = null;
7582          else {
7583            if (this.resource == null)
7584              this.resource = new CodeType();
7585            this.resource.setValue(value);
7586          }
7587          return this;
7588        }
7589
7590        /**
7591         * @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
7592         */
7593        public Enumeration<AssertionResponseTypes> getResponseElement() { 
7594          if (this.response == null)
7595            if (Configuration.errorOnAutoCreate())
7596              throw new Error("Attempt to auto-create SetupActionAssertComponent.response");
7597            else if (Configuration.doAutoCreate())
7598              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory()); // bb
7599          return this.response;
7600        }
7601
7602        public boolean hasResponseElement() { 
7603          return this.response != null && !this.response.isEmpty();
7604        }
7605
7606        public boolean hasResponse() { 
7607          return this.response != null && !this.response.isEmpty();
7608        }
7609
7610        /**
7611         * @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
7612         */
7613        public SetupActionAssertComponent setResponseElement(Enumeration<AssertionResponseTypes> value) { 
7614          this.response = value;
7615          return this;
7616        }
7617
7618        /**
7619         * @return okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
7620         */
7621        public AssertionResponseTypes getResponse() { 
7622          return this.response == null ? null : this.response.getValue();
7623        }
7624
7625        /**
7626         * @param value okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
7627         */
7628        public SetupActionAssertComponent setResponse(AssertionResponseTypes value) { 
7629          if (value == null)
7630            this.response = null;
7631          else {
7632            if (this.response == null)
7633              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory());
7634            this.response.setValue(value);
7635          }
7636          return this;
7637        }
7638
7639        /**
7640         * @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
7641         */
7642        public StringType getResponseCodeElement() { 
7643          if (this.responseCode == null)
7644            if (Configuration.errorOnAutoCreate())
7645              throw new Error("Attempt to auto-create SetupActionAssertComponent.responseCode");
7646            else if (Configuration.doAutoCreate())
7647              this.responseCode = new StringType(); // bb
7648          return this.responseCode;
7649        }
7650
7651        public boolean hasResponseCodeElement() { 
7652          return this.responseCode != null && !this.responseCode.isEmpty();
7653        }
7654
7655        public boolean hasResponseCode() { 
7656          return this.responseCode != null && !this.responseCode.isEmpty();
7657        }
7658
7659        /**
7660         * @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
7661         */
7662        public SetupActionAssertComponent setResponseCodeElement(StringType value) { 
7663          this.responseCode = value;
7664          return this;
7665        }
7666
7667        /**
7668         * @return The value of the HTTP response code to be tested.
7669         */
7670        public String getResponseCode() { 
7671          return this.responseCode == null ? null : this.responseCode.getValue();
7672        }
7673
7674        /**
7675         * @param value The value of the HTTP response code to be tested.
7676         */
7677        public SetupActionAssertComponent setResponseCode(String value) { 
7678          if (Utilities.noString(value))
7679            this.responseCode = null;
7680          else {
7681            if (this.responseCode == null)
7682              this.responseCode = new StringType();
7683            this.responseCode.setValue(value);
7684          }
7685          return this;
7686        }
7687
7688        /**
7689         * @return {@link #rule} (The TestScript.rule this assert will evaluate.)
7690         */
7691        public ActionAssertRuleComponent getRule() { 
7692          if (this.rule == null)
7693            if (Configuration.errorOnAutoCreate())
7694              throw new Error("Attempt to auto-create SetupActionAssertComponent.rule");
7695            else if (Configuration.doAutoCreate())
7696              this.rule = new ActionAssertRuleComponent(); // cc
7697          return this.rule;
7698        }
7699
7700        public boolean hasRule() { 
7701          return this.rule != null && !this.rule.isEmpty();
7702        }
7703
7704        /**
7705         * @param value {@link #rule} (The TestScript.rule this assert will evaluate.)
7706         */
7707        public SetupActionAssertComponent setRule(ActionAssertRuleComponent value)  { 
7708          this.rule = value;
7709          return this;
7710        }
7711
7712        /**
7713         * @return {@link #ruleset} (The TestScript.ruleset this assert will evaluate.)
7714         */
7715        public ActionAssertRulesetComponent getRuleset() { 
7716          if (this.ruleset == null)
7717            if (Configuration.errorOnAutoCreate())
7718              throw new Error("Attempt to auto-create SetupActionAssertComponent.ruleset");
7719            else if (Configuration.doAutoCreate())
7720              this.ruleset = new ActionAssertRulesetComponent(); // cc
7721          return this.ruleset;
7722        }
7723
7724        public boolean hasRuleset() { 
7725          return this.ruleset != null && !this.ruleset.isEmpty();
7726        }
7727
7728        /**
7729         * @param value {@link #ruleset} (The TestScript.ruleset this assert will evaluate.)
7730         */
7731        public SetupActionAssertComponent setRuleset(ActionAssertRulesetComponent value)  { 
7732          this.ruleset = value;
7733          return this;
7734        }
7735
7736        /**
7737         * @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
7738         */
7739        public IdType getSourceIdElement() { 
7740          if (this.sourceId == null)
7741            if (Configuration.errorOnAutoCreate())
7742              throw new Error("Attempt to auto-create SetupActionAssertComponent.sourceId");
7743            else if (Configuration.doAutoCreate())
7744              this.sourceId = new IdType(); // bb
7745          return this.sourceId;
7746        }
7747
7748        public boolean hasSourceIdElement() { 
7749          return this.sourceId != null && !this.sourceId.isEmpty();
7750        }
7751
7752        public boolean hasSourceId() { 
7753          return this.sourceId != null && !this.sourceId.isEmpty();
7754        }
7755
7756        /**
7757         * @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
7758         */
7759        public SetupActionAssertComponent setSourceIdElement(IdType value) { 
7760          this.sourceId = value;
7761          return this;
7762        }
7763
7764        /**
7765         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
7766         */
7767        public String getSourceId() { 
7768          return this.sourceId == null ? null : this.sourceId.getValue();
7769        }
7770
7771        /**
7772         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
7773         */
7774        public SetupActionAssertComponent setSourceId(String value) { 
7775          if (Utilities.noString(value))
7776            this.sourceId = null;
7777          else {
7778            if (this.sourceId == null)
7779              this.sourceId = new IdType();
7780            this.sourceId.setValue(value);
7781          }
7782          return this;
7783        }
7784
7785        /**
7786         * @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
7787         */
7788        public IdType getValidateProfileIdElement() { 
7789          if (this.validateProfileId == null)
7790            if (Configuration.errorOnAutoCreate())
7791              throw new Error("Attempt to auto-create SetupActionAssertComponent.validateProfileId");
7792            else if (Configuration.doAutoCreate())
7793              this.validateProfileId = new IdType(); // bb
7794          return this.validateProfileId;
7795        }
7796
7797        public boolean hasValidateProfileIdElement() { 
7798          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
7799        }
7800
7801        public boolean hasValidateProfileId() { 
7802          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
7803        }
7804
7805        /**
7806         * @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
7807         */
7808        public SetupActionAssertComponent setValidateProfileIdElement(IdType value) { 
7809          this.validateProfileId = value;
7810          return this;
7811        }
7812
7813        /**
7814         * @return The ID of the Profile to validate against.
7815         */
7816        public String getValidateProfileId() { 
7817          return this.validateProfileId == null ? null : this.validateProfileId.getValue();
7818        }
7819
7820        /**
7821         * @param value The ID of the Profile to validate against.
7822         */
7823        public SetupActionAssertComponent setValidateProfileId(String value) { 
7824          if (Utilities.noString(value))
7825            this.validateProfileId = null;
7826          else {
7827            if (this.validateProfileId == null)
7828              this.validateProfileId = new IdType();
7829            this.validateProfileId.setValue(value);
7830          }
7831          return this;
7832        }
7833
7834        /**
7835         * @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
7836         */
7837        public StringType getValueElement() { 
7838          if (this.value == null)
7839            if (Configuration.errorOnAutoCreate())
7840              throw new Error("Attempt to auto-create SetupActionAssertComponent.value");
7841            else if (Configuration.doAutoCreate())
7842              this.value = new StringType(); // bb
7843          return this.value;
7844        }
7845
7846        public boolean hasValueElement() { 
7847          return this.value != null && !this.value.isEmpty();
7848        }
7849
7850        public boolean hasValue() { 
7851          return this.value != null && !this.value.isEmpty();
7852        }
7853
7854        /**
7855         * @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
7856         */
7857        public SetupActionAssertComponent setValueElement(StringType value) { 
7858          this.value = value;
7859          return this;
7860        }
7861
7862        /**
7863         * @return The value to compare to.
7864         */
7865        public String getValue() { 
7866          return this.value == null ? null : this.value.getValue();
7867        }
7868
7869        /**
7870         * @param value The value to compare to.
7871         */
7872        public SetupActionAssertComponent setValue(String value) { 
7873          if (Utilities.noString(value))
7874            this.value = null;
7875          else {
7876            if (this.value == null)
7877              this.value = new StringType();
7878            this.value.setValue(value);
7879          }
7880          return this;
7881        }
7882
7883        /**
7884         * @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
7885         */
7886        public BooleanType getWarningOnlyElement() { 
7887          if (this.warningOnly == null)
7888            if (Configuration.errorOnAutoCreate())
7889              throw new Error("Attempt to auto-create SetupActionAssertComponent.warningOnly");
7890            else if (Configuration.doAutoCreate())
7891              this.warningOnly = new BooleanType(); // bb
7892          return this.warningOnly;
7893        }
7894
7895        public boolean hasWarningOnlyElement() { 
7896          return this.warningOnly != null && !this.warningOnly.isEmpty();
7897        }
7898
7899        public boolean hasWarningOnly() { 
7900          return this.warningOnly != null && !this.warningOnly.isEmpty();
7901        }
7902
7903        /**
7904         * @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
7905         */
7906        public SetupActionAssertComponent setWarningOnlyElement(BooleanType value) { 
7907          this.warningOnly = value;
7908          return this;
7909        }
7910
7911        /**
7912         * @return Whether or not the test execution will produce a warning only on error for this assert.
7913         */
7914        public boolean getWarningOnly() { 
7915          return this.warningOnly == null || this.warningOnly.isEmpty() ? false : this.warningOnly.getValue();
7916        }
7917
7918        /**
7919         * @param value Whether or not the test execution will produce a warning only on error for this assert.
7920         */
7921        public SetupActionAssertComponent setWarningOnly(boolean value) { 
7922            if (this.warningOnly == null)
7923              this.warningOnly = new BooleanType();
7924            this.warningOnly.setValue(value);
7925          return this;
7926        }
7927
7928        protected void listChildren(List<Property> children) {
7929          super.listChildren(children);
7930          children.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label));
7931          children.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description));
7932          children.add(new Property("direction", "code", "The direction to use for the assertion.", 0, 1, direction));
7933          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));
7934          children.add(new Property("compareToSourceExpression", "string", "The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourceExpression));
7935          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));
7936          children.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType));
7937          children.add(new Property("expression", "string", "The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.", 0, 1, expression));
7938          children.add(new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, 1, headerField));
7939          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));
7940          children.add(new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, 1, navigationLinks));
7941          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));
7942          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));
7943          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));
7944          children.add(new Property("requestURL", "string", "The value to use in a comparison against the request URL path string.", 0, 1, requestURL));
7945          children.add(new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource));
7946          children.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, 1, response));
7947          children.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, 1, responseCode));
7948          children.add(new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, 1, rule));
7949          children.add(new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, 1, ruleset));
7950          children.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.", 0, 1, sourceId));
7951          children.add(new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, 1, validateProfileId));
7952          children.add(new Property("value", "string", "The value to compare to.", 0, 1, value));
7953          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));
7954        }
7955
7956        @Override
7957        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
7958          switch (_hash) {
7959          case 102727412: /*label*/  return new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, 1, label);
7960          case -1724546052: /*description*/  return new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, 1, description);
7961          case -962590849: /*direction*/  return new Property("direction", "code", "The direction to use for the assertion.", 0, 1, direction);
7962          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);
7963          case -1415702669: /*compareToSourceExpression*/  return new Property("compareToSourceExpression", "string", "The fluentpath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.", 0, 1, compareToSourceExpression);
7964          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);
7965          case -389131437: /*contentType*/  return new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, 1, contentType);
7966          case -1795452264: /*expression*/  return new Property("expression", "string", "The fluentpath expression to be evaluated against the request or response message contents - HTTP headers and payload.", 0, 1, expression);
7967          case 1160732269: /*headerField*/  return new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, 1, headerField);
7968          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);
7969          case 1001488901: /*navigationLinks*/  return new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, 1, navigationLinks);
7970          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);
7971          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);
7972          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);
7973          case 37099616: /*requestURL*/  return new Property("requestURL", "string", "The value to use in a comparison against the request URL path string.", 0, 1, requestURL);
7974          case -341064690: /*resource*/  return new Property("resource", "code", "The type of the resource.  See http://build.fhir.org/resourcelist.html.", 0, 1, resource);
7975          case -340323263: /*response*/  return new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, 1, response);
7976          case 1438723534: /*responseCode*/  return new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, 1, responseCode);
7977          case 3512060: /*rule*/  return new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, 1, rule);
7978          case 1548678118: /*ruleset*/  return new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, 1, ruleset);
7979          case 1746327190: /*sourceId*/  return new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.", 0, 1, sourceId);
7980          case 1555541038: /*validateProfileId*/  return new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, 1, validateProfileId);
7981          case 111972721: /*value*/  return new Property("value", "string", "The value to compare to.", 0, 1, value);
7982          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);
7983          default: return super.getNamedProperty(_hash, _name, _checkValid);
7984          }
7985
7986        }
7987
7988      @Override
7989      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
7990        switch (hash) {
7991        case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType
7992        case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType
7993        case -962590849: /*direction*/ return this.direction == null ? new Base[0] : new Base[] {this.direction}; // Enumeration<AssertionDirectionType>
7994        case 2081856758: /*compareToSourceId*/ return this.compareToSourceId == null ? new Base[0] : new Base[] {this.compareToSourceId}; // StringType
7995        case -1415702669: /*compareToSourceExpression*/ return this.compareToSourceExpression == null ? new Base[0] : new Base[] {this.compareToSourceExpression}; // StringType
7996        case -790206144: /*compareToSourcePath*/ return this.compareToSourcePath == null ? new Base[0] : new Base[] {this.compareToSourcePath}; // StringType
7997        case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration<ContentType>
7998        case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType
7999        case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType
8000        case 818925001: /*minimumId*/ return this.minimumId == null ? new Base[0] : new Base[] {this.minimumId}; // StringType
8001        case 1001488901: /*navigationLinks*/ return this.navigationLinks == null ? new Base[0] : new Base[] {this.navigationLinks}; // BooleanType
8002        case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Enumeration<AssertionOperatorType>
8003        case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType
8004        case 1217874000: /*requestMethod*/ return this.requestMethod == null ? new Base[0] : new Base[] {this.requestMethod}; // Enumeration<TestScriptRequestMethodCode>
8005        case 37099616: /*requestURL*/ return this.requestURL == null ? new Base[0] : new Base[] {this.requestURL}; // StringType
8006        case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType
8007        case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Enumeration<AssertionResponseTypes>
8008        case 1438723534: /*responseCode*/ return this.responseCode == null ? new Base[0] : new Base[] {this.responseCode}; // StringType
8009        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : new Base[] {this.rule}; // ActionAssertRuleComponent
8010        case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // ActionAssertRulesetComponent
8011        case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType
8012        case 1555541038: /*validateProfileId*/ return this.validateProfileId == null ? new Base[0] : new Base[] {this.validateProfileId}; // IdType
8013        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
8014        case -481159832: /*warningOnly*/ return this.warningOnly == null ? new Base[0] : new Base[] {this.warningOnly}; // BooleanType
8015        default: return super.getProperty(hash, name, checkValid);
8016        }
8017
8018      }
8019
8020      @Override
8021      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8022        switch (hash) {
8023        case 102727412: // label
8024          this.label = castToString(value); // StringType
8025          return value;
8026        case -1724546052: // description
8027          this.description = castToString(value); // StringType
8028          return value;
8029        case -962590849: // direction
8030          value = new AssertionDirectionTypeEnumFactory().fromType(castToCode(value));
8031          this.direction = (Enumeration) value; // Enumeration<AssertionDirectionType>
8032          return value;
8033        case 2081856758: // compareToSourceId
8034          this.compareToSourceId = castToString(value); // StringType
8035          return value;
8036        case -1415702669: // compareToSourceExpression
8037          this.compareToSourceExpression = castToString(value); // StringType
8038          return value;
8039        case -790206144: // compareToSourcePath
8040          this.compareToSourcePath = castToString(value); // StringType
8041          return value;
8042        case -389131437: // contentType
8043          value = new ContentTypeEnumFactory().fromType(castToCode(value));
8044          this.contentType = (Enumeration) value; // Enumeration<ContentType>
8045          return value;
8046        case -1795452264: // expression
8047          this.expression = castToString(value); // StringType
8048          return value;
8049        case 1160732269: // headerField
8050          this.headerField = castToString(value); // StringType
8051          return value;
8052        case 818925001: // minimumId
8053          this.minimumId = castToString(value); // StringType
8054          return value;
8055        case 1001488901: // navigationLinks
8056          this.navigationLinks = castToBoolean(value); // BooleanType
8057          return value;
8058        case -500553564: // operator
8059          value = new AssertionOperatorTypeEnumFactory().fromType(castToCode(value));
8060          this.operator = (Enumeration) value; // Enumeration<AssertionOperatorType>
8061          return value;
8062        case 3433509: // path
8063          this.path = castToString(value); // StringType
8064          return value;
8065        case 1217874000: // requestMethod
8066          value = new TestScriptRequestMethodCodeEnumFactory().fromType(castToCode(value));
8067          this.requestMethod = (Enumeration) value; // Enumeration<TestScriptRequestMethodCode>
8068          return value;
8069        case 37099616: // requestURL
8070          this.requestURL = castToString(value); // StringType
8071          return value;
8072        case -341064690: // resource
8073          this.resource = castToCode(value); // CodeType
8074          return value;
8075        case -340323263: // response
8076          value = new AssertionResponseTypesEnumFactory().fromType(castToCode(value));
8077          this.response = (Enumeration) value; // Enumeration<AssertionResponseTypes>
8078          return value;
8079        case 1438723534: // responseCode
8080          this.responseCode = castToString(value); // StringType
8081          return value;
8082        case 3512060: // rule
8083          this.rule = (ActionAssertRuleComponent) value; // ActionAssertRuleComponent
8084          return value;
8085        case 1548678118: // ruleset
8086          this.ruleset = (ActionAssertRulesetComponent) value; // ActionAssertRulesetComponent
8087          return value;
8088        case 1746327190: // sourceId
8089          this.sourceId = castToId(value); // IdType
8090          return value;
8091        case 1555541038: // validateProfileId
8092          this.validateProfileId = castToId(value); // IdType
8093          return value;
8094        case 111972721: // value
8095          this.value = castToString(value); // StringType
8096          return value;
8097        case -481159832: // warningOnly
8098          this.warningOnly = castToBoolean(value); // BooleanType
8099          return value;
8100        default: return super.setProperty(hash, name, value);
8101        }
8102
8103      }
8104
8105      @Override
8106      public Base setProperty(String name, Base value) throws FHIRException {
8107        if (name.equals("label")) {
8108          this.label = castToString(value); // StringType
8109        } else if (name.equals("description")) {
8110          this.description = castToString(value); // StringType
8111        } else if (name.equals("direction")) {
8112          value = new AssertionDirectionTypeEnumFactory().fromType(castToCode(value));
8113          this.direction = (Enumeration) value; // Enumeration<AssertionDirectionType>
8114        } else if (name.equals("compareToSourceId")) {
8115          this.compareToSourceId = castToString(value); // StringType
8116        } else if (name.equals("compareToSourceExpression")) {
8117          this.compareToSourceExpression = castToString(value); // StringType
8118        } else if (name.equals("compareToSourcePath")) {
8119          this.compareToSourcePath = castToString(value); // StringType
8120        } else if (name.equals("contentType")) {
8121          value = new ContentTypeEnumFactory().fromType(castToCode(value));
8122          this.contentType = (Enumeration) value; // Enumeration<ContentType>
8123        } else if (name.equals("expression")) {
8124          this.expression = castToString(value); // StringType
8125        } else if (name.equals("headerField")) {
8126          this.headerField = castToString(value); // StringType
8127        } else if (name.equals("minimumId")) {
8128          this.minimumId = castToString(value); // StringType
8129        } else if (name.equals("navigationLinks")) {
8130          this.navigationLinks = castToBoolean(value); // BooleanType
8131        } else if (name.equals("operator")) {
8132          value = new AssertionOperatorTypeEnumFactory().fromType(castToCode(value));
8133          this.operator = (Enumeration) value; // Enumeration<AssertionOperatorType>
8134        } else if (name.equals("path")) {
8135          this.path = castToString(value); // StringType
8136        } else if (name.equals("requestMethod")) {
8137          value = new TestScriptRequestMethodCodeEnumFactory().fromType(castToCode(value));
8138          this.requestMethod = (Enumeration) value; // Enumeration<TestScriptRequestMethodCode>
8139        } else if (name.equals("requestURL")) {
8140          this.requestURL = castToString(value); // StringType
8141        } else if (name.equals("resource")) {
8142          this.resource = castToCode(value); // CodeType
8143        } else if (name.equals("response")) {
8144          value = new AssertionResponseTypesEnumFactory().fromType(castToCode(value));
8145          this.response = (Enumeration) value; // Enumeration<AssertionResponseTypes>
8146        } else if (name.equals("responseCode")) {
8147          this.responseCode = castToString(value); // StringType
8148        } else if (name.equals("rule")) {
8149          this.rule = (ActionAssertRuleComponent) value; // ActionAssertRuleComponent
8150        } else if (name.equals("ruleset")) {
8151          this.ruleset = (ActionAssertRulesetComponent) value; // ActionAssertRulesetComponent
8152        } else if (name.equals("sourceId")) {
8153          this.sourceId = castToId(value); // IdType
8154        } else if (name.equals("validateProfileId")) {
8155          this.validateProfileId = castToId(value); // IdType
8156        } else if (name.equals("value")) {
8157          this.value = castToString(value); // StringType
8158        } else if (name.equals("warningOnly")) {
8159          this.warningOnly = castToBoolean(value); // BooleanType
8160        } else
8161          return super.setProperty(name, value);
8162        return value;
8163      }
8164
8165      @Override
8166      public Base makeProperty(int hash, String name) throws FHIRException {
8167        switch (hash) {
8168        case 102727412:  return getLabelElement();
8169        case -1724546052:  return getDescriptionElement();
8170        case -962590849:  return getDirectionElement();
8171        case 2081856758:  return getCompareToSourceIdElement();
8172        case -1415702669:  return getCompareToSourceExpressionElement();
8173        case -790206144:  return getCompareToSourcePathElement();
8174        case -389131437:  return getContentTypeElement();
8175        case -1795452264:  return getExpressionElement();
8176        case 1160732269:  return getHeaderFieldElement();
8177        case 818925001:  return getMinimumIdElement();
8178        case 1001488901:  return getNavigationLinksElement();
8179        case -500553564:  return getOperatorElement();
8180        case 3433509:  return getPathElement();
8181        case 1217874000:  return getRequestMethodElement();
8182        case 37099616:  return getRequestURLElement();
8183        case -341064690:  return getResourceElement();
8184        case -340323263:  return getResponseElement();
8185        case 1438723534:  return getResponseCodeElement();
8186        case 3512060:  return getRule(); 
8187        case 1548678118:  return getRuleset(); 
8188        case 1746327190:  return getSourceIdElement();
8189        case 1555541038:  return getValidateProfileIdElement();
8190        case 111972721:  return getValueElement();
8191        case -481159832:  return getWarningOnlyElement();
8192        default: return super.makeProperty(hash, name);
8193        }
8194
8195      }
8196
8197      @Override
8198      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8199        switch (hash) {
8200        case 102727412: /*label*/ return new String[] {"string"};
8201        case -1724546052: /*description*/ return new String[] {"string"};
8202        case -962590849: /*direction*/ return new String[] {"code"};
8203        case 2081856758: /*compareToSourceId*/ return new String[] {"string"};
8204        case -1415702669: /*compareToSourceExpression*/ return new String[] {"string"};
8205        case -790206144: /*compareToSourcePath*/ return new String[] {"string"};
8206        case -389131437: /*contentType*/ return new String[] {"code"};
8207        case -1795452264: /*expression*/ return new String[] {"string"};
8208        case 1160732269: /*headerField*/ return new String[] {"string"};
8209        case 818925001: /*minimumId*/ return new String[] {"string"};
8210        case 1001488901: /*navigationLinks*/ return new String[] {"boolean"};
8211        case -500553564: /*operator*/ return new String[] {"code"};
8212        case 3433509: /*path*/ return new String[] {"string"};
8213        case 1217874000: /*requestMethod*/ return new String[] {"code"};
8214        case 37099616: /*requestURL*/ return new String[] {"string"};
8215        case -341064690: /*resource*/ return new String[] {"code"};
8216        case -340323263: /*response*/ return new String[] {"code"};
8217        case 1438723534: /*responseCode*/ return new String[] {"string"};
8218        case 3512060: /*rule*/ return new String[] {};
8219        case 1548678118: /*ruleset*/ return new String[] {};
8220        case 1746327190: /*sourceId*/ return new String[] {"id"};
8221        case 1555541038: /*validateProfileId*/ return new String[] {"id"};
8222        case 111972721: /*value*/ return new String[] {"string"};
8223        case -481159832: /*warningOnly*/ return new String[] {"boolean"};
8224        default: return super.getTypesForProperty(hash, name);
8225        }
8226
8227      }
8228
8229      @Override
8230      public Base addChild(String name) throws FHIRException {
8231        if (name.equals("label")) {
8232          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
8233        }
8234        else if (name.equals("description")) {
8235          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
8236        }
8237        else if (name.equals("direction")) {
8238          throw new FHIRException("Cannot call addChild on a primitive type TestScript.direction");
8239        }
8240        else if (name.equals("compareToSourceId")) {
8241          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceId");
8242        }
8243        else if (name.equals("compareToSourceExpression")) {
8244          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceExpression");
8245        }
8246        else if (name.equals("compareToSourcePath")) {
8247          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourcePath");
8248        }
8249        else if (name.equals("contentType")) {
8250          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
8251        }
8252        else if (name.equals("expression")) {
8253          throw new FHIRException("Cannot call addChild on a primitive type TestScript.expression");
8254        }
8255        else if (name.equals("headerField")) {
8256          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
8257        }
8258        else if (name.equals("minimumId")) {
8259          throw new FHIRException("Cannot call addChild on a primitive type TestScript.minimumId");
8260        }
8261        else if (name.equals("navigationLinks")) {
8262          throw new FHIRException("Cannot call addChild on a primitive type TestScript.navigationLinks");
8263        }
8264        else if (name.equals("operator")) {
8265          throw new FHIRException("Cannot call addChild on a primitive type TestScript.operator");
8266        }
8267        else if (name.equals("path")) {
8268          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
8269        }
8270        else if (name.equals("requestMethod")) {
8271          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestMethod");
8272        }
8273        else if (name.equals("requestURL")) {
8274          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requestURL");
8275        }
8276        else if (name.equals("resource")) {
8277          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
8278        }
8279        else if (name.equals("response")) {
8280          throw new FHIRException("Cannot call addChild on a primitive type TestScript.response");
8281        }
8282        else if (name.equals("responseCode")) {
8283          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseCode");
8284        }
8285        else if (name.equals("rule")) {
8286          this.rule = new ActionAssertRuleComponent();
8287          return this.rule;
8288        }
8289        else if (name.equals("ruleset")) {
8290          this.ruleset = new ActionAssertRulesetComponent();
8291          return this.ruleset;
8292        }
8293        else if (name.equals("sourceId")) {
8294          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
8295        }
8296        else if (name.equals("validateProfileId")) {
8297          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validateProfileId");
8298        }
8299        else if (name.equals("value")) {
8300          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
8301        }
8302        else if (name.equals("warningOnly")) {
8303          throw new FHIRException("Cannot call addChild on a primitive type TestScript.warningOnly");
8304        }
8305        else
8306          return super.addChild(name);
8307      }
8308
8309      public SetupActionAssertComponent copy() {
8310        SetupActionAssertComponent dst = new SetupActionAssertComponent();
8311        copyValues(dst);
8312        dst.label = label == null ? null : label.copy();
8313        dst.description = description == null ? null : description.copy();
8314        dst.direction = direction == null ? null : direction.copy();
8315        dst.compareToSourceId = compareToSourceId == null ? null : compareToSourceId.copy();
8316        dst.compareToSourceExpression = compareToSourceExpression == null ? null : compareToSourceExpression.copy();
8317        dst.compareToSourcePath = compareToSourcePath == null ? null : compareToSourcePath.copy();
8318        dst.contentType = contentType == null ? null : contentType.copy();
8319        dst.expression = expression == null ? null : expression.copy();
8320        dst.headerField = headerField == null ? null : headerField.copy();
8321        dst.minimumId = minimumId == null ? null : minimumId.copy();
8322        dst.navigationLinks = navigationLinks == null ? null : navigationLinks.copy();
8323        dst.operator = operator == null ? null : operator.copy();
8324        dst.path = path == null ? null : path.copy();
8325        dst.requestMethod = requestMethod == null ? null : requestMethod.copy();
8326        dst.requestURL = requestURL == null ? null : requestURL.copy();
8327        dst.resource = resource == null ? null : resource.copy();
8328        dst.response = response == null ? null : response.copy();
8329        dst.responseCode = responseCode == null ? null : responseCode.copy();
8330        dst.rule = rule == null ? null : rule.copy();
8331        dst.ruleset = ruleset == null ? null : ruleset.copy();
8332        dst.sourceId = sourceId == null ? null : sourceId.copy();
8333        dst.validateProfileId = validateProfileId == null ? null : validateProfileId.copy();
8334        dst.value = value == null ? null : value.copy();
8335        dst.warningOnly = warningOnly == null ? null : warningOnly.copy();
8336        return dst;
8337      }
8338
8339      @Override
8340      public boolean equalsDeep(Base other_) {
8341        if (!super.equalsDeep(other_))
8342          return false;
8343        if (!(other_ instanceof SetupActionAssertComponent))
8344          return false;
8345        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
8346        return compareDeep(label, o.label, true) && compareDeep(description, o.description, true) && compareDeep(direction, o.direction, true)
8347           && compareDeep(compareToSourceId, o.compareToSourceId, true) && compareDeep(compareToSourceExpression, o.compareToSourceExpression, true)
8348           && compareDeep(compareToSourcePath, o.compareToSourcePath, true) && compareDeep(contentType, o.contentType, true)
8349           && compareDeep(expression, o.expression, true) && compareDeep(headerField, o.headerField, true)
8350           && compareDeep(minimumId, o.minimumId, true) && compareDeep(navigationLinks, o.navigationLinks, true)
8351           && compareDeep(operator, o.operator, true) && compareDeep(path, o.path, true) && compareDeep(requestMethod, o.requestMethod, true)
8352           && compareDeep(requestURL, o.requestURL, true) && compareDeep(resource, o.resource, true) && compareDeep(response, o.response, true)
8353           && compareDeep(responseCode, o.responseCode, true) && compareDeep(rule, o.rule, true) && compareDeep(ruleset, o.ruleset, true)
8354           && compareDeep(sourceId, o.sourceId, true) && compareDeep(validateProfileId, o.validateProfileId, true)
8355           && compareDeep(value, o.value, true) && compareDeep(warningOnly, o.warningOnly, true);
8356      }
8357
8358      @Override
8359      public boolean equalsShallow(Base other_) {
8360        if (!super.equalsShallow(other_))
8361          return false;
8362        if (!(other_ instanceof SetupActionAssertComponent))
8363          return false;
8364        SetupActionAssertComponent o = (SetupActionAssertComponent) other_;
8365        return compareValues(label, o.label, true) && compareValues(description, o.description, true) && compareValues(direction, o.direction, true)
8366           && compareValues(compareToSourceId, o.compareToSourceId, true) && compareValues(compareToSourceExpression, o.compareToSourceExpression, true)
8367           && compareValues(compareToSourcePath, o.compareToSourcePath, true) && compareValues(contentType, o.contentType, true)
8368           && compareValues(expression, o.expression, true) && compareValues(headerField, o.headerField, true)
8369           && compareValues(minimumId, o.minimumId, true) && compareValues(navigationLinks, o.navigationLinks, true)
8370           && compareValues(operator, o.operator, true) && compareValues(path, o.path, true) && compareValues(requestMethod, o.requestMethod, true)
8371           && compareValues(requestURL, o.requestURL, true) && compareValues(resource, o.resource, true) && compareValues(response, o.response, true)
8372           && compareValues(responseCode, o.responseCode, true) && compareValues(sourceId, o.sourceId, true) && compareValues(validateProfileId, o.validateProfileId, true)
8373           && compareValues(value, o.value, true) && compareValues(warningOnly, o.warningOnly, true);
8374      }
8375
8376      public boolean isEmpty() {
8377        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(label, description, direction
8378          , compareToSourceId, compareToSourceExpression, compareToSourcePath, contentType, expression
8379          , headerField, minimumId, navigationLinks, operator, path, requestMethod, requestURL
8380          , resource, response, responseCode, rule, ruleset, sourceId, validateProfileId
8381          , value, warningOnly);
8382      }
8383
8384  public String fhirType() {
8385    return "TestScript.setup.action.assert";
8386
8387  }
8388
8389  }
8390
8391    @Block()
8392    public static class ActionAssertRuleComponent extends BackboneElement implements IBaseBackboneElement {
8393        /**
8394         * The TestScript.rule id value this assert will evaluate.
8395         */
8396        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8397        @Description(shortDefinition="Id of the TestScript.rule", formalDefinition="The TestScript.rule id value this assert will evaluate." )
8398        protected IdType ruleId;
8399
8400        /**
8401         * Each rule template can take one or more parameters for rule evaluation.
8402         */
8403        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8404        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
8405        protected List<ActionAssertRuleParamComponent> param;
8406
8407        private static final long serialVersionUID = -1860715431L;
8408
8409    /**
8410     * Constructor
8411     */
8412      public ActionAssertRuleComponent() {
8413        super();
8414      }
8415
8416    /**
8417     * Constructor
8418     */
8419      public ActionAssertRuleComponent(IdType ruleId) {
8420        super();
8421        this.ruleId = ruleId;
8422      }
8423
8424        /**
8425         * @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
8426         */
8427        public IdType getRuleIdElement() { 
8428          if (this.ruleId == null)
8429            if (Configuration.errorOnAutoCreate())
8430              throw new Error("Attempt to auto-create ActionAssertRuleComponent.ruleId");
8431            else if (Configuration.doAutoCreate())
8432              this.ruleId = new IdType(); // bb
8433          return this.ruleId;
8434        }
8435
8436        public boolean hasRuleIdElement() { 
8437          return this.ruleId != null && !this.ruleId.isEmpty();
8438        }
8439
8440        public boolean hasRuleId() { 
8441          return this.ruleId != null && !this.ruleId.isEmpty();
8442        }
8443
8444        /**
8445         * @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
8446         */
8447        public ActionAssertRuleComponent setRuleIdElement(IdType value) { 
8448          this.ruleId = value;
8449          return this;
8450        }
8451
8452        /**
8453         * @return The TestScript.rule id value this assert will evaluate.
8454         */
8455        public String getRuleId() { 
8456          return this.ruleId == null ? null : this.ruleId.getValue();
8457        }
8458
8459        /**
8460         * @param value The TestScript.rule id value this assert will evaluate.
8461         */
8462        public ActionAssertRuleComponent setRuleId(String value) { 
8463            if (this.ruleId == null)
8464              this.ruleId = new IdType();
8465            this.ruleId.setValue(value);
8466          return this;
8467        }
8468
8469        /**
8470         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
8471         */
8472        public List<ActionAssertRuleParamComponent> getParam() { 
8473          if (this.param == null)
8474            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8475          return this.param;
8476        }
8477
8478        /**
8479         * @return Returns a reference to <code>this</code> for easy method chaining
8480         */
8481        public ActionAssertRuleComponent setParam(List<ActionAssertRuleParamComponent> theParam) { 
8482          this.param = theParam;
8483          return this;
8484        }
8485
8486        public boolean hasParam() { 
8487          if (this.param == null)
8488            return false;
8489          for (ActionAssertRuleParamComponent item : this.param)
8490            if (!item.isEmpty())
8491              return true;
8492          return false;
8493        }
8494
8495        public ActionAssertRuleParamComponent addParam() { //3
8496          ActionAssertRuleParamComponent t = new ActionAssertRuleParamComponent();
8497          if (this.param == null)
8498            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8499          this.param.add(t);
8500          return t;
8501        }
8502
8503        public ActionAssertRuleComponent addParam(ActionAssertRuleParamComponent t) { //3
8504          if (t == null)
8505            return this;
8506          if (this.param == null)
8507            this.param = new ArrayList<ActionAssertRuleParamComponent>();
8508          this.param.add(t);
8509          return this;
8510        }
8511
8512        /**
8513         * @return The first repetition of repeating field {@link #param}, creating it if it does not already exist
8514         */
8515        public ActionAssertRuleParamComponent getParamFirstRep() { 
8516          if (getParam().isEmpty()) {
8517            addParam();
8518          }
8519          return getParam().get(0);
8520        }
8521
8522        protected void listChildren(List<Property> children) {
8523          super.listChildren(children);
8524          children.add(new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, 1, ruleId));
8525          children.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param));
8526        }
8527
8528        @Override
8529        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8530          switch (_hash) {
8531          case -919875273: /*ruleId*/  return new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, 1, ruleId);
8532          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);
8533          default: return super.getNamedProperty(_hash, _name, _checkValid);
8534          }
8535
8536        }
8537
8538      @Override
8539      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8540        switch (hash) {
8541        case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType
8542        case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // ActionAssertRuleParamComponent
8543        default: return super.getProperty(hash, name, checkValid);
8544        }
8545
8546      }
8547
8548      @Override
8549      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8550        switch (hash) {
8551        case -919875273: // ruleId
8552          this.ruleId = castToId(value); // IdType
8553          return value;
8554        case 106436749: // param
8555          this.getParam().add((ActionAssertRuleParamComponent) value); // ActionAssertRuleParamComponent
8556          return value;
8557        default: return super.setProperty(hash, name, value);
8558        }
8559
8560      }
8561
8562      @Override
8563      public Base setProperty(String name, Base value) throws FHIRException {
8564        if (name.equals("ruleId")) {
8565          this.ruleId = castToId(value); // IdType
8566        } else if (name.equals("param")) {
8567          this.getParam().add((ActionAssertRuleParamComponent) value);
8568        } else
8569          return super.setProperty(name, value);
8570        return value;
8571      }
8572
8573      @Override
8574      public Base makeProperty(int hash, String name) throws FHIRException {
8575        switch (hash) {
8576        case -919875273:  return getRuleIdElement();
8577        case 106436749:  return addParam(); 
8578        default: return super.makeProperty(hash, name);
8579        }
8580
8581      }
8582
8583      @Override
8584      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8585        switch (hash) {
8586        case -919875273: /*ruleId*/ return new String[] {"id"};
8587        case 106436749: /*param*/ return new String[] {};
8588        default: return super.getTypesForProperty(hash, name);
8589        }
8590
8591      }
8592
8593      @Override
8594      public Base addChild(String name) throws FHIRException {
8595        if (name.equals("ruleId")) {
8596          throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId");
8597        }
8598        else if (name.equals("param")) {
8599          return addParam();
8600        }
8601        else
8602          return super.addChild(name);
8603      }
8604
8605      public ActionAssertRuleComponent copy() {
8606        ActionAssertRuleComponent dst = new ActionAssertRuleComponent();
8607        copyValues(dst);
8608        dst.ruleId = ruleId == null ? null : ruleId.copy();
8609        if (param != null) {
8610          dst.param = new ArrayList<ActionAssertRuleParamComponent>();
8611          for (ActionAssertRuleParamComponent i : param)
8612            dst.param.add(i.copy());
8613        };
8614        return dst;
8615      }
8616
8617      @Override
8618      public boolean equalsDeep(Base other_) {
8619        if (!super.equalsDeep(other_))
8620          return false;
8621        if (!(other_ instanceof ActionAssertRuleComponent))
8622          return false;
8623        ActionAssertRuleComponent o = (ActionAssertRuleComponent) other_;
8624        return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true);
8625      }
8626
8627      @Override
8628      public boolean equalsShallow(Base other_) {
8629        if (!super.equalsShallow(other_))
8630          return false;
8631        if (!(other_ instanceof ActionAssertRuleComponent))
8632          return false;
8633        ActionAssertRuleComponent o = (ActionAssertRuleComponent) other_;
8634        return compareValues(ruleId, o.ruleId, true);
8635      }
8636
8637      public boolean isEmpty() {
8638        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(ruleId, param);
8639      }
8640
8641  public String fhirType() {
8642    return "TestScript.setup.action.assert.rule";
8643
8644  }
8645
8646  }
8647
8648    @Block()
8649    public static class ActionAssertRuleParamComponent extends BackboneElement implements IBaseBackboneElement {
8650        /**
8651         * Descriptive name for this parameter that matches the external assert rule parameter name.
8652         */
8653        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8654        @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." )
8655        protected StringType name;
8656
8657        /**
8658         * The value for the parameter that will be passed on to the external rule template.
8659         */
8660        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
8661        @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." )
8662        protected StringType value;
8663
8664        private static final long serialVersionUID = 395259392L;
8665
8666    /**
8667     * Constructor
8668     */
8669      public ActionAssertRuleParamComponent() {
8670        super();
8671      }
8672
8673    /**
8674     * Constructor
8675     */
8676      public ActionAssertRuleParamComponent(StringType name, StringType value) {
8677        super();
8678        this.name = name;
8679        this.value = value;
8680      }
8681
8682        /**
8683         * @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
8684         */
8685        public StringType getNameElement() { 
8686          if (this.name == null)
8687            if (Configuration.errorOnAutoCreate())
8688              throw new Error("Attempt to auto-create ActionAssertRuleParamComponent.name");
8689            else if (Configuration.doAutoCreate())
8690              this.name = new StringType(); // bb
8691          return this.name;
8692        }
8693
8694        public boolean hasNameElement() { 
8695          return this.name != null && !this.name.isEmpty();
8696        }
8697
8698        public boolean hasName() { 
8699          return this.name != null && !this.name.isEmpty();
8700        }
8701
8702        /**
8703         * @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
8704         */
8705        public ActionAssertRuleParamComponent setNameElement(StringType value) { 
8706          this.name = value;
8707          return this;
8708        }
8709
8710        /**
8711         * @return Descriptive name for this parameter that matches the external assert rule parameter name.
8712         */
8713        public String getName() { 
8714          return this.name == null ? null : this.name.getValue();
8715        }
8716
8717        /**
8718         * @param value Descriptive name for this parameter that matches the external assert rule parameter name.
8719         */
8720        public ActionAssertRuleParamComponent setName(String value) { 
8721            if (this.name == null)
8722              this.name = new StringType();
8723            this.name.setValue(value);
8724          return this;
8725        }
8726
8727        /**
8728         * @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
8729         */
8730        public StringType getValueElement() { 
8731          if (this.value == null)
8732            if (Configuration.errorOnAutoCreate())
8733              throw new Error("Attempt to auto-create ActionAssertRuleParamComponent.value");
8734            else if (Configuration.doAutoCreate())
8735              this.value = new StringType(); // bb
8736          return this.value;
8737        }
8738
8739        public boolean hasValueElement() { 
8740          return this.value != null && !this.value.isEmpty();
8741        }
8742
8743        public boolean hasValue() { 
8744          return this.value != null && !this.value.isEmpty();
8745        }
8746
8747        /**
8748         * @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
8749         */
8750        public ActionAssertRuleParamComponent setValueElement(StringType value) { 
8751          this.value = value;
8752          return this;
8753        }
8754
8755        /**
8756         * @return The value for the parameter that will be passed on to the external rule template.
8757         */
8758        public String getValue() { 
8759          return this.value == null ? null : this.value.getValue();
8760        }
8761
8762        /**
8763         * @param value The value for the parameter that will be passed on to the external rule template.
8764         */
8765        public ActionAssertRuleParamComponent setValue(String value) { 
8766            if (this.value == null)
8767              this.value = new StringType();
8768            this.value.setValue(value);
8769          return this;
8770        }
8771
8772        protected void listChildren(List<Property> children) {
8773          super.listChildren(children);
8774          children.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name));
8775          children.add(new Property("value", "string", "The value for the parameter that will be passed on to the external rule template.", 0, 1, value));
8776        }
8777
8778        @Override
8779        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
8780          switch (_hash) {
8781          case 3373707: /*name*/  return new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, 1, name);
8782          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);
8783          default: return super.getNamedProperty(_hash, _name, _checkValid);
8784          }
8785
8786        }
8787
8788      @Override
8789      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
8790        switch (hash) {
8791        case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType
8792        case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType
8793        default: return super.getProperty(hash, name, checkValid);
8794        }
8795
8796      }
8797
8798      @Override
8799      public Base setProperty(int hash, String name, Base value) throws FHIRException {
8800        switch (hash) {
8801        case 3373707: // name
8802          this.name = castToString(value); // StringType
8803          return value;
8804        case 111972721: // value
8805          this.value = castToString(value); // StringType
8806          return value;
8807        default: return super.setProperty(hash, name, value);
8808        }
8809
8810      }
8811
8812      @Override
8813      public Base setProperty(String name, Base value) throws FHIRException {
8814        if (name.equals("name")) {
8815          this.name = castToString(value); // StringType
8816        } else if (name.equals("value")) {
8817          this.value = castToString(value); // StringType
8818        } else
8819          return super.setProperty(name, value);
8820        return value;
8821      }
8822
8823      @Override
8824      public Base makeProperty(int hash, String name) throws FHIRException {
8825        switch (hash) {
8826        case 3373707:  return getNameElement();
8827        case 111972721:  return getValueElement();
8828        default: return super.makeProperty(hash, name);
8829        }
8830
8831      }
8832
8833      @Override
8834      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
8835        switch (hash) {
8836        case 3373707: /*name*/ return new String[] {"string"};
8837        case 111972721: /*value*/ return new String[] {"string"};
8838        default: return super.getTypesForProperty(hash, name);
8839        }
8840
8841      }
8842
8843      @Override
8844      public Base addChild(String name) throws FHIRException {
8845        if (name.equals("name")) {
8846          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
8847        }
8848        else if (name.equals("value")) {
8849          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
8850        }
8851        else
8852          return super.addChild(name);
8853      }
8854
8855      public ActionAssertRuleParamComponent copy() {
8856        ActionAssertRuleParamComponent dst = new ActionAssertRuleParamComponent();
8857        copyValues(dst);
8858        dst.name = name == null ? null : name.copy();
8859        dst.value = value == null ? null : value.copy();
8860        return dst;
8861      }
8862
8863      @Override
8864      public boolean equalsDeep(Base other_) {
8865        if (!super.equalsDeep(other_))
8866          return false;
8867        if (!(other_ instanceof ActionAssertRuleParamComponent))
8868          return false;
8869        ActionAssertRuleParamComponent o = (ActionAssertRuleParamComponent) other_;
8870        return compareDeep(name, o.name, true) && compareDeep(value, o.value, true);
8871      }
8872
8873      @Override
8874      public boolean equalsShallow(Base other_) {
8875        if (!super.equalsShallow(other_))
8876          return false;
8877        if (!(other_ instanceof ActionAssertRuleParamComponent))
8878          return false;
8879        ActionAssertRuleParamComponent o = (ActionAssertRuleParamComponent) other_;
8880        return compareValues(name, o.name, true) && compareValues(value, o.value, true);
8881      }
8882
8883      public boolean isEmpty() {
8884        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(name, value);
8885      }
8886
8887  public String fhirType() {
8888    return "TestScript.setup.action.assert.rule.param";
8889
8890  }
8891
8892  }
8893
8894    @Block()
8895    public static class ActionAssertRulesetComponent extends BackboneElement implements IBaseBackboneElement {
8896        /**
8897         * The TestScript.ruleset id value this assert will evaluate.
8898         */
8899        @Child(name = "rulesetId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
8900        @Description(shortDefinition="Id of the TestScript.ruleset", formalDefinition="The TestScript.ruleset id value this assert will evaluate." )
8901        protected IdType rulesetId;
8902
8903        /**
8904         * The referenced rule within the external ruleset template.
8905         */
8906        @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
8907        @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." )
8908        protected List<ActionAssertRulesetRuleComponent> rule;
8909
8910        private static final long serialVersionUID = -976736025L;
8911
8912    /**
8913     * Constructor
8914     */
8915      public ActionAssertRulesetComponent() {
8916        super();
8917      }
8918
8919    /**
8920     * Constructor
8921     */
8922      public ActionAssertRulesetComponent(IdType rulesetId) {
8923        super();
8924        this.rulesetId = rulesetId;
8925      }
8926
8927        /**
8928         * @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
8929         */
8930        public IdType getRulesetIdElement() { 
8931          if (this.rulesetId == null)
8932            if (Configuration.errorOnAutoCreate())
8933              throw new Error("Attempt to auto-create ActionAssertRulesetComponent.rulesetId");
8934            else if (Configuration.doAutoCreate())
8935              this.rulesetId = new IdType(); // bb
8936          return this.rulesetId;
8937        }
8938
8939        public boolean hasRulesetIdElement() { 
8940          return this.rulesetId != null && !this.rulesetId.isEmpty();
8941        }
8942
8943        public boolean hasRulesetId() { 
8944          return this.rulesetId != null && !this.rulesetId.isEmpty();
8945        }
8946
8947        /**
8948         * @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
8949         */
8950        public ActionAssertRulesetComponent setRulesetIdElement(IdType value) { 
8951          this.rulesetId = value;
8952          return this;
8953        }
8954
8955        /**
8956         * @return The TestScript.ruleset id value this assert will evaluate.
8957         */
8958        public String getRulesetId() { 
8959          return this.rulesetId == null ? null : this.rulesetId.getValue();
8960        }
8961
8962        /**
8963         * @param value The TestScript.ruleset id value this assert will evaluate.
8964         */
8965        public ActionAssertRulesetComponent setRulesetId(String value) { 
8966            if (this.rulesetId == null)
8967              this.rulesetId = new IdType();
8968            this.rulesetId.setValue(value);
8969          return this;
8970        }
8971
8972        /**
8973         * @return {@link #rule} (The referenced rule within the external ruleset template.)
8974         */
8975        public List<ActionAssertRulesetRuleComponent> getRule() { 
8976          if (this.rule == null)
8977            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
8978          return this.rule;
8979        }
8980
8981        /**
8982         * @return Returns a reference to <code>this</code> for easy method chaining
8983         */
8984        public ActionAssertRulesetComponent setRule(List<ActionAssertRulesetRuleComponent> theRule) { 
8985          this.rule = theRule;
8986          return this;
8987        }
8988
8989        public boolean hasRule() { 
8990          if (this.rule == null)
8991            return false;
8992          for (ActionAssertRulesetRuleComponent item : this.rule)
8993            if (!item.isEmpty())
8994              return true;
8995          return false;
8996        }
8997
8998        public ActionAssertRulesetRuleComponent addRule() { //3
8999          ActionAssertRulesetRuleComponent t = new ActionAssertRulesetRuleComponent();
9000          if (this.rule == null)
9001            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
9002          this.rule.add(t);
9003          return t;
9004        }
9005
9006        public ActionAssertRulesetComponent addRule(ActionAssertRulesetRuleComponent t) { //3
9007          if (t == null)
9008            return this;
9009          if (this.rule == null)
9010            this.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
9011          this.rule.add(t);
9012          return this;
9013        }
9014
9015        /**
9016         * @return The first repetition of repeating field {@link #rule}, creating it if it does not already exist
9017         */
9018        public ActionAssertRulesetRuleComponent getRuleFirstRep() { 
9019          if (getRule().isEmpty()) {
9020            addRule();
9021          }
9022          return getRule().get(0);
9023        }
9024
9025        protected void listChildren(List<Property> children) {
9026          super.listChildren(children);
9027          children.add(new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, 1, rulesetId));
9028          children.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule));
9029        }
9030
9031        @Override
9032        public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
9033          switch (_hash) {
9034          case -2073977951: /*rulesetId*/  return new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, 1, rulesetId);
9035          case 3512060: /*rule*/  return new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule);
9036          default: return super.getNamedProperty(_hash, _name, _checkValid);
9037          }
9038
9039        }
9040
9041      @Override
9042      public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
9043        switch (hash) {
9044        case -2073977951: /*rulesetId*/ return this.rulesetId == null ? new Base[0] : new Base[] {this.rulesetId}; // IdType
9045        case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ActionAssertRulesetRuleComponent
9046        default: return super.getProperty(hash, name, checkValid);
9047        }
9048
9049      }
9050
9051      @Override
9052      public Base setProperty(int hash, String name, Base value) throws FHIRException {
9053        switch (hash) {
9054        case -2073977951: // rulesetId
9055          this.rulesetId = castToId(value); // IdType
9056          return value;
9057        case 3512060: // rule
9058          this.getRule().add((ActionAssertRulesetRuleComponent) value); // ActionAssertRulesetRuleComponent
9059          return value;
9060        default: return super.setProperty(hash, name, value);
9061        }
9062
9063      }
9064
9065      @Override
9066      public Base setProperty(String name, Base value) throws FHIRException {
9067        if (name.equals("rulesetId")) {
9068          this.rulesetId = castToId(value); // IdType
9069        } else if (name.equals("rule")) {
9070          this.getRule().add((ActionAssertRulesetRuleComponent) value);
9071        } else
9072          return super.setProperty(name, value);
9073        return value;
9074      }
9075
9076      @Override
9077      public Base makeProperty(int hash, String name) throws FHIRException {
9078        switch (hash) {
9079        case -2073977951:  return getRulesetIdElement();
9080        case 3512060:  return addRule(); 
9081        default: return super.makeProperty(hash, name);
9082        }
9083
9084      }
9085
9086      @Override
9087      public String[] getTypesForProperty(int hash, String name) throws FHIRException {
9088        switch (hash) {
9089        case -2073977951: /*rulesetId*/ return new String[] {"id"};
9090        case 3512060: /*rule*/ return new String[] {};
9091        default: return super.getTypesForProperty(hash, name);
9092        }
9093
9094      }
9095
9096      @Override
9097      public Base addChild(String name) throws FHIRException {
9098        if (name.equals("rulesetId")) {
9099          throw new FHIRException("Cannot call addChild on a primitive type TestScript.rulesetId");
9100        }
9101        else if (name.equals("rule")) {
9102          return addRule();
9103        }
9104        else
9105          return super.addChild(name);
9106      }
9107
9108      public ActionAssertRulesetComponent copy() {
9109        ActionAssertRulesetComponent dst = new ActionAssertRulesetComponent();
9110        copyValues(dst);
9111        dst.rulesetId = rulesetId == null ? null : rulesetId.copy();
9112        if (rule != null) {
9113          dst.rule = new ArrayList<ActionAssertRulesetRuleComponent>();
9114          for (ActionAssertRulesetRuleComponent i : rule)
9115            dst.rule.add(i.copy());
9116        };
9117        return dst;
9118      }
9119
9120      @Override
9121      public boolean equalsDeep(Base other_) {
9122        if (!super.equalsDeep(other_))
9123          return false;
9124        if (!(other_ instanceof ActionAssertRulesetComponent))
9125          return false;
9126        ActionAssertRulesetComponent o = (ActionAssertRulesetComponent) other_;
9127        return compareDeep(rulesetId, o.rulesetId, true) && compareDeep(rule, o.rule, true);
9128      }
9129
9130      @Override
9131      public boolean equalsShallow(Base other_) {
9132        if (!super.equalsShallow(other_))
9133          return false;
9134        if (!(other_ instanceof ActionAssertRulesetComponent))
9135          return false;
9136        ActionAssertRulesetComponent o = (ActionAssertRulesetComponent) other_;
9137        return compareValues(rulesetId, o.rulesetId, true);
9138      }
9139
9140      public boolean isEmpty() {
9141        return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(rulesetId, rule);
9142      }
9143
9144  public String fhirType() {
9145    return "TestScript.setup.action.assert.ruleset";
9146
9147  }
9148
9149  }
9150
9151    @Block()
9152    public static class ActionAssertRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement {
9153        /**
9154         * Id of the referenced rule within the external ruleset template.
9155         */
9156        @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false)
9157        @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." )
9158        protected IdType ruleId;
9159
9160        /**
9161         * Each rule template can take one or more parameters for rule evaluation.
9162         */
9163        @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
9164        @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." )
9165        protected List<ActionAssertRulesetRuleParamComponent> param;
9166
9167        private static final long serialVersionUID = -1850698529L;
9168
9169    /**
9170     * Constructor
9171     */
9172      public ActionAssertRulesetRuleComponent() {
9173        super();
9174      }
9175
9176    /**
9177     * Constructor
9178     */
9179      public ActionAssertRulesetRuleComponent(IdType ruleId) {
9180        super();
9181        this.ruleId = ruleId;
9182      }
9183
9184        /**
9185         * @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
9186         */
9187        public IdType getRuleIdElement() { 
9188          if (this.ruleId == null)
9189            if (Configuration.errorOnAutoCreate())
9190              throw new Error("Attempt to auto-create ActionAssertRulesetRuleComponent.ruleId");
9191            else if (Configuration.doAutoCreate())
9192              this.ruleId = new IdType(); // bb
9193          return this.ruleId;
9194        }
9195
9196        public boolean hasRuleIdElement() { 
9197          return this.ruleId != null && !this.ruleId.isEmpty();
9198        }
9199
9200        public boolean hasRuleId() { 
9201          return this.ruleId != null && !this.ruleId.isEmpty();
9202        }
9203
9204        /**
9205         * @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
9206         */
9207        public ActionAssertRulesetRuleComponent setRuleIdElement(IdType value) { 
9208          this.ruleId = value;
9209          return this;
9210        }
9211
9212        /**
9213         * @return Id of the referenced rule within the external ruleset template.
9214         */
9215        public String getRuleId() { 
9216          return this.ruleId == null ? null : this.ruleId.getValue();
9217        }
9218
9219        /**
9220         * @param value Id of the referenced rule within the external ruleset template.
9221         */
9222        public ActionAssertRulesetRuleComponent setRuleId(String value) { 
9223            if (this.ruleId == null)
9224              this.ruleId = new IdType();
9225            this.ruleId.setValue(value);
9226          return this;
9227        }
9228
9229        /**
9230         * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.)
9231         */
9232        public List<ActionAssertRulesetRuleParamComponent> getParam() {