001package org.hl7.fhir.dstu2.model;
002
003
004
005
006/*
007  Copyright (c) 2011+, HL7, Inc.
008  All rights reserved.
009  
010  Redistribution and use in source and binary forms, with or without modification, 
011  are permitted provided that the following conditions are met:
012  
013   * Redistributions of source code must retain the above copyright notice, this 
014     list of conditions and the following disclaimer.
015   * Redistributions in binary form must reproduce the above copyright notice, 
016     this list of conditions and the following disclaimer in the documentation 
017     and/or other materials provided with the distribution.
018   * Neither the name of HL7 nor the names of its contributors may be used to 
019     endorse or promote products derived from this software without specific 
020     prior written permission.
021  
022  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
023  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
024  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
025  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
026  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
027  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
028  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
029  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
030  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
031  POSSIBILITY OF SUCH DAMAGE.
032  
033*/
034
035// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
036import java.util.ArrayList;
037import java.util.Date;
038import java.util.List;
039
040import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatus;
041import org.hl7.fhir.dstu2.model.Enumerations.ConformanceResourceStatusEnumFactory;
042import ca.uhn.fhir.model.api.annotation.Block;
043import ca.uhn.fhir.model.api.annotation.Child;
044import ca.uhn.fhir.model.api.annotation.Description;
045import ca.uhn.fhir.model.api.annotation.ResourceDef;
046import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
047import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
048import org.hl7.fhir.exceptions.FHIRException;
049import org.hl7.fhir.utilities.Utilities;
050/**
051 * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification.
052 */
053@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript")
054public class TestScript extends DomainResource {
055
056    public enum ContentType {
057        /**
058         * XML content-type corresponding to the application/xml+fhir mime-type.
059         */
060        XML, 
061        /**
062         * JSON content-type corresponding to the application/json+fhir mime-type.
063         */
064        JSON, 
065        /**
066         * added to help the parsers
067         */
068        NULL;
069        public static ContentType fromCode(String codeString) throws FHIRException {
070            if (codeString == null || "".equals(codeString))
071                return null;
072        if ("xml".equals(codeString))
073          return XML;
074        if ("json".equals(codeString))
075          return JSON;
076        throw new FHIRException("Unknown ContentType code '"+codeString+"'");
077        }
078        public String toCode() {
079          switch (this) {
080            case XML: return "xml";
081            case JSON: return "json";
082            default: return "?";
083          }
084        }
085        public String getSystem() {
086          switch (this) {
087            case XML: return "http://hl7.org/fhir/content-type";
088            case JSON: return "http://hl7.org/fhir/content-type";
089            default: return "?";
090          }
091        }
092        public String getDefinition() {
093          switch (this) {
094            case XML: return "XML content-type corresponding to the application/xml+fhir mime-type.";
095            case JSON: return "JSON content-type corresponding to the application/json+fhir mime-type.";
096            default: return "?";
097          }
098        }
099        public String getDisplay() {
100          switch (this) {
101            case XML: return "xml";
102            case JSON: return "json";
103            default: return "?";
104          }
105        }
106    }
107
108  public static class ContentTypeEnumFactory implements EnumFactory<ContentType> {
109    public ContentType fromCode(String codeString) throws IllegalArgumentException {
110      if (codeString == null || "".equals(codeString))
111            if (codeString == null || "".equals(codeString))
112                return null;
113        if ("xml".equals(codeString))
114          return ContentType.XML;
115        if ("json".equals(codeString))
116          return ContentType.JSON;
117        throw new IllegalArgumentException("Unknown ContentType code '"+codeString+"'");
118        }
119        public Enumeration<ContentType> fromType(Base code) throws FHIRException {
120          if (code == null || code.isEmpty())
121            return null;
122          String codeString = ((PrimitiveType) code).asStringValue();
123          if (codeString == null || "".equals(codeString))
124            return null;
125        if ("xml".equals(codeString))
126          return new Enumeration<ContentType>(this, ContentType.XML);
127        if ("json".equals(codeString))
128          return new Enumeration<ContentType>(this, ContentType.JSON);
129        throw new FHIRException("Unknown ContentType code '"+codeString+"'");
130        }
131    public String toCode(ContentType code) {
132      if (code == ContentType.XML)
133        return "xml";
134      if (code == ContentType.JSON)
135        return "json";
136      return "?";
137      }
138    }
139
140    public enum AssertionDirectionType {
141        /**
142         * The assertion is evaluated on the response. This is the default value.
143         */
144        RESPONSE, 
145        /**
146         * The assertion is evaluated on the request.
147         */
148        REQUEST, 
149        /**
150         * added to help the parsers
151         */
152        NULL;
153        public static AssertionDirectionType fromCode(String codeString) throws FHIRException {
154            if (codeString == null || "".equals(codeString))
155                return null;
156        if ("response".equals(codeString))
157          return RESPONSE;
158        if ("request".equals(codeString))
159          return REQUEST;
160        throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
161        }
162        public String toCode() {
163          switch (this) {
164            case RESPONSE: return "response";
165            case REQUEST: return "request";
166            default: return "?";
167          }
168        }
169        public String getSystem() {
170          switch (this) {
171            case RESPONSE: return "http://hl7.org/fhir/assert-direction-codes";
172            case REQUEST: return "http://hl7.org/fhir/assert-direction-codes";
173            default: return "?";
174          }
175        }
176        public String getDefinition() {
177          switch (this) {
178            case RESPONSE: return "The assertion is evaluated on the response. This is the default value.";
179            case REQUEST: return "The assertion is evaluated on the request.";
180            default: return "?";
181          }
182        }
183        public String getDisplay() {
184          switch (this) {
185            case RESPONSE: return "response";
186            case REQUEST: return "request";
187            default: return "?";
188          }
189        }
190    }
191
192  public static class AssertionDirectionTypeEnumFactory implements EnumFactory<AssertionDirectionType> {
193    public AssertionDirectionType fromCode(String codeString) throws IllegalArgumentException {
194      if (codeString == null || "".equals(codeString))
195            if (codeString == null || "".equals(codeString))
196                return null;
197        if ("response".equals(codeString))
198          return AssertionDirectionType.RESPONSE;
199        if ("request".equals(codeString))
200          return AssertionDirectionType.REQUEST;
201        throw new IllegalArgumentException("Unknown AssertionDirectionType code '"+codeString+"'");
202        }
203        public Enumeration<AssertionDirectionType> fromType(Base code) throws FHIRException {
204          if (code == null || code.isEmpty())
205            return null;
206          String codeString = ((PrimitiveType) code).asStringValue();
207          if (codeString == null || "".equals(codeString))
208            return null;
209        if ("response".equals(codeString))
210          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.RESPONSE);
211        if ("request".equals(codeString))
212          return new Enumeration<AssertionDirectionType>(this, AssertionDirectionType.REQUEST);
213        throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'");
214        }
215    public String toCode(AssertionDirectionType code) {
216      if (code == AssertionDirectionType.RESPONSE)
217        return "response";
218      if (code == AssertionDirectionType.REQUEST)
219        return "request";
220      return "?";
221      }
222    }
223
224    public enum AssertionOperatorType {
225        /**
226         * Default value. Equals comparison.
227         */
228        EQUALS, 
229        /**
230         * Not equals comparison.
231         */
232        NOTEQUALS, 
233        /**
234         * Compare value within a known set of values.
235         */
236        IN, 
237        /**
238         * Compare value not within a known set of values.
239         */
240        NOTIN, 
241        /**
242         * Compare value to be greater than a known value.
243         */
244        GREATERTHAN, 
245        /**
246         * Compare value to be less than a known value.
247         */
248        LESSTHAN, 
249        /**
250         * Compare value is empty.
251         */
252        EMPTY, 
253        /**
254         * Compare value is not empty.
255         */
256        NOTEMPTY, 
257        /**
258         * Compare value string contains a known value.
259         */
260        CONTAINS, 
261        /**
262         * Compare value string does not contain a known value.
263         */
264        NOTCONTAINS, 
265        /**
266         * added to help the parsers
267         */
268        NULL;
269        public static AssertionOperatorType fromCode(String codeString) throws FHIRException {
270            if (codeString == null || "".equals(codeString))
271                return null;
272        if ("equals".equals(codeString))
273          return EQUALS;
274        if ("notEquals".equals(codeString))
275          return NOTEQUALS;
276        if ("in".equals(codeString))
277          return IN;
278        if ("notIn".equals(codeString))
279          return NOTIN;
280        if ("greaterThan".equals(codeString))
281          return GREATERTHAN;
282        if ("lessThan".equals(codeString))
283          return LESSTHAN;
284        if ("empty".equals(codeString))
285          return EMPTY;
286        if ("notEmpty".equals(codeString))
287          return NOTEMPTY;
288        if ("contains".equals(codeString))
289          return CONTAINS;
290        if ("notContains".equals(codeString))
291          return NOTCONTAINS;
292        throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
293        }
294        public String toCode() {
295          switch (this) {
296            case EQUALS: return "equals";
297            case NOTEQUALS: return "notEquals";
298            case IN: return "in";
299            case NOTIN: return "notIn";
300            case GREATERTHAN: return "greaterThan";
301            case LESSTHAN: return "lessThan";
302            case EMPTY: return "empty";
303            case NOTEMPTY: return "notEmpty";
304            case CONTAINS: return "contains";
305            case NOTCONTAINS: return "notContains";
306            default: return "?";
307          }
308        }
309        public String getSystem() {
310          switch (this) {
311            case EQUALS: return "http://hl7.org/fhir/assert-operator-codes";
312            case NOTEQUALS: return "http://hl7.org/fhir/assert-operator-codes";
313            case IN: return "http://hl7.org/fhir/assert-operator-codes";
314            case NOTIN: return "http://hl7.org/fhir/assert-operator-codes";
315            case GREATERTHAN: return "http://hl7.org/fhir/assert-operator-codes";
316            case LESSTHAN: return "http://hl7.org/fhir/assert-operator-codes";
317            case EMPTY: return "http://hl7.org/fhir/assert-operator-codes";
318            case NOTEMPTY: return "http://hl7.org/fhir/assert-operator-codes";
319            case CONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
320            case NOTCONTAINS: return "http://hl7.org/fhir/assert-operator-codes";
321            default: return "?";
322          }
323        }
324        public String getDefinition() {
325          switch (this) {
326            case EQUALS: return "Default value. Equals comparison.";
327            case NOTEQUALS: return "Not equals comparison.";
328            case IN: return "Compare value within a known set of values.";
329            case NOTIN: return "Compare value not within a known set of values.";
330            case GREATERTHAN: return "Compare value to be greater than a known value.";
331            case LESSTHAN: return "Compare value to be less than a known value.";
332            case EMPTY: return "Compare value is empty.";
333            case NOTEMPTY: return "Compare value is not empty.";
334            case CONTAINS: return "Compare value string contains a known value.";
335            case NOTCONTAINS: return "Compare value string does not contain a known value.";
336            default: return "?";
337          }
338        }
339        public String getDisplay() {
340          switch (this) {
341            case EQUALS: return "equals";
342            case NOTEQUALS: return "notEquals";
343            case IN: return "in";
344            case NOTIN: return "notIn";
345            case GREATERTHAN: return "greaterThan";
346            case LESSTHAN: return "lessThan";
347            case EMPTY: return "empty";
348            case NOTEMPTY: return "notEmpty";
349            case CONTAINS: return "contains";
350            case NOTCONTAINS: return "notContains";
351            default: return "?";
352          }
353        }
354    }
355
356  public static class AssertionOperatorTypeEnumFactory implements EnumFactory<AssertionOperatorType> {
357    public AssertionOperatorType fromCode(String codeString) throws IllegalArgumentException {
358      if (codeString == null || "".equals(codeString))
359            if (codeString == null || "".equals(codeString))
360                return null;
361        if ("equals".equals(codeString))
362          return AssertionOperatorType.EQUALS;
363        if ("notEquals".equals(codeString))
364          return AssertionOperatorType.NOTEQUALS;
365        if ("in".equals(codeString))
366          return AssertionOperatorType.IN;
367        if ("notIn".equals(codeString))
368          return AssertionOperatorType.NOTIN;
369        if ("greaterThan".equals(codeString))
370          return AssertionOperatorType.GREATERTHAN;
371        if ("lessThan".equals(codeString))
372          return AssertionOperatorType.LESSTHAN;
373        if ("empty".equals(codeString))
374          return AssertionOperatorType.EMPTY;
375        if ("notEmpty".equals(codeString))
376          return AssertionOperatorType.NOTEMPTY;
377        if ("contains".equals(codeString))
378          return AssertionOperatorType.CONTAINS;
379        if ("notContains".equals(codeString))
380          return AssertionOperatorType.NOTCONTAINS;
381        throw new IllegalArgumentException("Unknown AssertionOperatorType code '"+codeString+"'");
382        }
383        public Enumeration<AssertionOperatorType> fromType(Base code) throws FHIRException {
384          if (code == null || code.isEmpty())
385            return null;
386          String codeString = ((PrimitiveType) code).asStringValue();
387          if (codeString == null || "".equals(codeString))
388            return null;
389        if ("equals".equals(codeString))
390          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EQUALS);
391        if ("notEquals".equals(codeString))
392          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEQUALS);
393        if ("in".equals(codeString))
394          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.IN);
395        if ("notIn".equals(codeString))
396          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTIN);
397        if ("greaterThan".equals(codeString))
398          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.GREATERTHAN);
399        if ("lessThan".equals(codeString))
400          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.LESSTHAN);
401        if ("empty".equals(codeString))
402          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.EMPTY);
403        if ("notEmpty".equals(codeString))
404          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTEMPTY);
405        if ("contains".equals(codeString))
406          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.CONTAINS);
407        if ("notContains".equals(codeString))
408          return new Enumeration<AssertionOperatorType>(this, AssertionOperatorType.NOTCONTAINS);
409        throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'");
410        }
411    public String toCode(AssertionOperatorType code) {
412      if (code == AssertionOperatorType.EQUALS)
413        return "equals";
414      if (code == AssertionOperatorType.NOTEQUALS)
415        return "notEquals";
416      if (code == AssertionOperatorType.IN)
417        return "in";
418      if (code == AssertionOperatorType.NOTIN)
419        return "notIn";
420      if (code == AssertionOperatorType.GREATERTHAN)
421        return "greaterThan";
422      if (code == AssertionOperatorType.LESSTHAN)
423        return "lessThan";
424      if (code == AssertionOperatorType.EMPTY)
425        return "empty";
426      if (code == AssertionOperatorType.NOTEMPTY)
427        return "notEmpty";
428      if (code == AssertionOperatorType.CONTAINS)
429        return "contains";
430      if (code == AssertionOperatorType.NOTCONTAINS)
431        return "notContains";
432      return "?";
433      }
434    }
435
436    public enum AssertionResponseTypes {
437        /**
438         * Response code is 200.
439         */
440        OKAY, 
441        /**
442         * Response code is 201.
443         */
444        CREATED, 
445        /**
446         * Response code is 204.
447         */
448        NOCONTENT, 
449        /**
450         * Response code is 304.
451         */
452        NOTMODIFIED, 
453        /**
454         * Response code is 400.
455         */
456        BAD, 
457        /**
458         * Response code is 403.
459         */
460        FORBIDDEN, 
461        /**
462         * Response code is 404.
463         */
464        NOTFOUND, 
465        /**
466         * Response code is 405.
467         */
468        METHODNOTALLOWED, 
469        /**
470         * Response code is 409.
471         */
472        CONFLICT, 
473        /**
474         * Response code is 410.
475         */
476        GONE, 
477        /**
478         * Response code is 412.
479         */
480        PRECONDITIONFAILED, 
481        /**
482         * Response code is 422.
483         */
484        UNPROCESSABLE, 
485        /**
486         * added to help the parsers
487         */
488        NULL;
489        public static AssertionResponseTypes fromCode(String codeString) throws FHIRException {
490            if (codeString == null || "".equals(codeString))
491                return null;
492        if ("okay".equals(codeString))
493          return OKAY;
494        if ("created".equals(codeString))
495          return CREATED;
496        if ("noContent".equals(codeString))
497          return NOCONTENT;
498        if ("notModified".equals(codeString))
499          return NOTMODIFIED;
500        if ("bad".equals(codeString))
501          return BAD;
502        if ("forbidden".equals(codeString))
503          return FORBIDDEN;
504        if ("notFound".equals(codeString))
505          return NOTFOUND;
506        if ("methodNotAllowed".equals(codeString))
507          return METHODNOTALLOWED;
508        if ("conflict".equals(codeString))
509          return CONFLICT;
510        if ("gone".equals(codeString))
511          return GONE;
512        if ("preconditionFailed".equals(codeString))
513          return PRECONDITIONFAILED;
514        if ("unprocessable".equals(codeString))
515          return UNPROCESSABLE;
516        throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
517        }
518        public String toCode() {
519          switch (this) {
520            case OKAY: return "okay";
521            case CREATED: return "created";
522            case NOCONTENT: return "noContent";
523            case NOTMODIFIED: return "notModified";
524            case BAD: return "bad";
525            case FORBIDDEN: return "forbidden";
526            case NOTFOUND: return "notFound";
527            case METHODNOTALLOWED: return "methodNotAllowed";
528            case CONFLICT: return "conflict";
529            case GONE: return "gone";
530            case PRECONDITIONFAILED: return "preconditionFailed";
531            case UNPROCESSABLE: return "unprocessable";
532            default: return "?";
533          }
534        }
535        public String getSystem() {
536          switch (this) {
537            case OKAY: return "http://hl7.org/fhir/assert-response-code-types";
538            case CREATED: return "http://hl7.org/fhir/assert-response-code-types";
539            case NOCONTENT: return "http://hl7.org/fhir/assert-response-code-types";
540            case NOTMODIFIED: return "http://hl7.org/fhir/assert-response-code-types";
541            case BAD: return "http://hl7.org/fhir/assert-response-code-types";
542            case FORBIDDEN: return "http://hl7.org/fhir/assert-response-code-types";
543            case NOTFOUND: return "http://hl7.org/fhir/assert-response-code-types";
544            case METHODNOTALLOWED: return "http://hl7.org/fhir/assert-response-code-types";
545            case CONFLICT: return "http://hl7.org/fhir/assert-response-code-types";
546            case GONE: return "http://hl7.org/fhir/assert-response-code-types";
547            case PRECONDITIONFAILED: return "http://hl7.org/fhir/assert-response-code-types";
548            case UNPROCESSABLE: return "http://hl7.org/fhir/assert-response-code-types";
549            default: return "?";
550          }
551        }
552        public String getDefinition() {
553          switch (this) {
554            case OKAY: return "Response code is 200.";
555            case CREATED: return "Response code is 201.";
556            case NOCONTENT: return "Response code is 204.";
557            case NOTMODIFIED: return "Response code is 304.";
558            case BAD: return "Response code is 400.";
559            case FORBIDDEN: return "Response code is 403.";
560            case NOTFOUND: return "Response code is 404.";
561            case METHODNOTALLOWED: return "Response code is 405.";
562            case CONFLICT: return "Response code is 409.";
563            case GONE: return "Response code is 410.";
564            case PRECONDITIONFAILED: return "Response code is 412.";
565            case UNPROCESSABLE: return "Response code is 422.";
566            default: return "?";
567          }
568        }
569        public String getDisplay() {
570          switch (this) {
571            case OKAY: return "okay";
572            case CREATED: return "created";
573            case NOCONTENT: return "noContent";
574            case NOTMODIFIED: return "notModified";
575            case BAD: return "bad";
576            case FORBIDDEN: return "forbidden";
577            case NOTFOUND: return "notFound";
578            case METHODNOTALLOWED: return "methodNotAllowed";
579            case CONFLICT: return "conflict";
580            case GONE: return "gone";
581            case PRECONDITIONFAILED: return "preconditionFailed";
582            case UNPROCESSABLE: return "unprocessable";
583            default: return "?";
584          }
585        }
586    }
587
588  public static class AssertionResponseTypesEnumFactory implements EnumFactory<AssertionResponseTypes> {
589    public AssertionResponseTypes fromCode(String codeString) throws IllegalArgumentException {
590      if (codeString == null || "".equals(codeString))
591            if (codeString == null || "".equals(codeString))
592                return null;
593        if ("okay".equals(codeString))
594          return AssertionResponseTypes.OKAY;
595        if ("created".equals(codeString))
596          return AssertionResponseTypes.CREATED;
597        if ("noContent".equals(codeString))
598          return AssertionResponseTypes.NOCONTENT;
599        if ("notModified".equals(codeString))
600          return AssertionResponseTypes.NOTMODIFIED;
601        if ("bad".equals(codeString))
602          return AssertionResponseTypes.BAD;
603        if ("forbidden".equals(codeString))
604          return AssertionResponseTypes.FORBIDDEN;
605        if ("notFound".equals(codeString))
606          return AssertionResponseTypes.NOTFOUND;
607        if ("methodNotAllowed".equals(codeString))
608          return AssertionResponseTypes.METHODNOTALLOWED;
609        if ("conflict".equals(codeString))
610          return AssertionResponseTypes.CONFLICT;
611        if ("gone".equals(codeString))
612          return AssertionResponseTypes.GONE;
613        if ("preconditionFailed".equals(codeString))
614          return AssertionResponseTypes.PRECONDITIONFAILED;
615        if ("unprocessable".equals(codeString))
616          return AssertionResponseTypes.UNPROCESSABLE;
617        throw new IllegalArgumentException("Unknown AssertionResponseTypes code '"+codeString+"'");
618        }
619        public Enumeration<AssertionResponseTypes> fromType(Base code) throws FHIRException {
620          if (code == null || code.isEmpty())
621            return null;
622          String codeString = ((PrimitiveType) code).asStringValue();
623          if (codeString == null || "".equals(codeString))
624            return null;
625        if ("okay".equals(codeString))
626          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.OKAY);
627        if ("created".equals(codeString))
628          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CREATED);
629        if ("noContent".equals(codeString))
630          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOCONTENT);
631        if ("notModified".equals(codeString))
632          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTMODIFIED);
633        if ("bad".equals(codeString))
634          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.BAD);
635        if ("forbidden".equals(codeString))
636          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.FORBIDDEN);
637        if ("notFound".equals(codeString))
638          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.NOTFOUND);
639        if ("methodNotAllowed".equals(codeString))
640          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.METHODNOTALLOWED);
641        if ("conflict".equals(codeString))
642          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.CONFLICT);
643        if ("gone".equals(codeString))
644          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.GONE);
645        if ("preconditionFailed".equals(codeString))
646          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.PRECONDITIONFAILED);
647        if ("unprocessable".equals(codeString))
648          return new Enumeration<AssertionResponseTypes>(this, AssertionResponseTypes.UNPROCESSABLE);
649        throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'");
650        }
651    public String toCode(AssertionResponseTypes code) {
652      if (code == AssertionResponseTypes.OKAY)
653        return "okay";
654      if (code == AssertionResponseTypes.CREATED)
655        return "created";
656      if (code == AssertionResponseTypes.NOCONTENT)
657        return "noContent";
658      if (code == AssertionResponseTypes.NOTMODIFIED)
659        return "notModified";
660      if (code == AssertionResponseTypes.BAD)
661        return "bad";
662      if (code == AssertionResponseTypes.FORBIDDEN)
663        return "forbidden";
664      if (code == AssertionResponseTypes.NOTFOUND)
665        return "notFound";
666      if (code == AssertionResponseTypes.METHODNOTALLOWED)
667        return "methodNotAllowed";
668      if (code == AssertionResponseTypes.CONFLICT)
669        return "conflict";
670      if (code == AssertionResponseTypes.GONE)
671        return "gone";
672      if (code == AssertionResponseTypes.PRECONDITIONFAILED)
673        return "preconditionFailed";
674      if (code == AssertionResponseTypes.UNPROCESSABLE)
675        return "unprocessable";
676      return "?";
677      }
678    }
679
680    @Block()
681    public static class TestScriptContactComponent extends BackboneElement implements IBaseBackboneElement {
682        /**
683         * The name of an individual to contact regarding the Test Script.
684         */
685        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
686        @Description(shortDefinition="Name of a individual to contact", formalDefinition="The name of an individual to contact regarding the Test Script." )
687        protected StringType name;
688
689        /**
690         * Contact details for individual (if a name was provided) or the publisher.
691         */
692        @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
693        @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." )
694        protected List<ContactPoint> telecom;
695
696        private static final long serialVersionUID = -1179697803L;
697
698    /*
699     * Constructor
700     */
701      public TestScriptContactComponent() {
702        super();
703      }
704
705        /**
706         * @return {@link #name} (The name of an individual to contact regarding the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
707         */
708        public StringType getNameElement() { 
709          if (this.name == null)
710            if (Configuration.errorOnAutoCreate())
711              throw new Error("Attempt to auto-create TestScriptContactComponent.name");
712            else if (Configuration.doAutoCreate())
713              this.name = new StringType(); // bb
714          return this.name;
715        }
716
717        public boolean hasNameElement() { 
718          return this.name != null && !this.name.isEmpty();
719        }
720
721        public boolean hasName() { 
722          return this.name != null && !this.name.isEmpty();
723        }
724
725        /**
726         * @param value {@link #name} (The name of an individual to contact regarding the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
727         */
728        public TestScriptContactComponent setNameElement(StringType value) { 
729          this.name = value;
730          return this;
731        }
732
733        /**
734         * @return The name of an individual to contact regarding the Test Script.
735         */
736        public String getName() { 
737          return this.name == null ? null : this.name.getValue();
738        }
739
740        /**
741         * @param value The name of an individual to contact regarding the Test Script.
742         */
743        public TestScriptContactComponent setName(String value) { 
744          if (Utilities.noString(value))
745            this.name = null;
746          else {
747            if (this.name == null)
748              this.name = new StringType();
749            this.name.setValue(value);
750          }
751          return this;
752        }
753
754        /**
755         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
756         */
757        public List<ContactPoint> getTelecom() { 
758          if (this.telecom == null)
759            this.telecom = new ArrayList<ContactPoint>();
760          return this.telecom;
761        }
762
763        public boolean hasTelecom() { 
764          if (this.telecom == null)
765            return false;
766          for (ContactPoint item : this.telecom)
767            if (!item.isEmpty())
768              return true;
769          return false;
770        }
771
772        /**
773         * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.)
774         */
775    // syntactic sugar
776        public ContactPoint addTelecom() { //3
777          ContactPoint t = new ContactPoint();
778          if (this.telecom == null)
779            this.telecom = new ArrayList<ContactPoint>();
780          this.telecom.add(t);
781          return t;
782        }
783
784    // syntactic sugar
785        public TestScriptContactComponent addTelecom(ContactPoint t) { //3
786          if (t == null)
787            return this;
788          if (this.telecom == null)
789            this.telecom = new ArrayList<ContactPoint>();
790          this.telecom.add(t);
791          return this;
792        }
793
794        protected void listChildren(List<Property> childrenList) {
795          super.listChildren(childrenList);
796          childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the Test Script.", 0, java.lang.Integer.MAX_VALUE, name));
797          childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom));
798        }
799
800      @Override
801      public void setProperty(String name, Base value) throws FHIRException {
802        if (name.equals("name"))
803          this.name = castToString(value); // StringType
804        else if (name.equals("telecom"))
805          this.getTelecom().add(castToContactPoint(value));
806        else
807          super.setProperty(name, value);
808      }
809
810      @Override
811      public Base addChild(String name) throws FHIRException {
812        if (name.equals("name")) {
813          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
814        }
815        else if (name.equals("telecom")) {
816          return addTelecom();
817        }
818        else
819          return super.addChild(name);
820      }
821
822      public TestScriptContactComponent copy() {
823        TestScriptContactComponent dst = new TestScriptContactComponent();
824        copyValues(dst);
825        dst.name = name == null ? null : name.copy();
826        if (telecom != null) {
827          dst.telecom = new ArrayList<ContactPoint>();
828          for (ContactPoint i : telecom)
829            dst.telecom.add(i.copy());
830        };
831        return dst;
832      }
833
834      @Override
835      public boolean equalsDeep(Base other) {
836        if (!super.equalsDeep(other))
837          return false;
838        if (!(other instanceof TestScriptContactComponent))
839          return false;
840        TestScriptContactComponent o = (TestScriptContactComponent) other;
841        return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true);
842      }
843
844      @Override
845      public boolean equalsShallow(Base other) {
846        if (!super.equalsShallow(other))
847          return false;
848        if (!(other instanceof TestScriptContactComponent))
849          return false;
850        TestScriptContactComponent o = (TestScriptContactComponent) other;
851        return compareValues(name, o.name, true);
852      }
853
854      public boolean isEmpty() {
855        return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty())
856          ;
857      }
858
859  public String fhirType() {
860    return "TestScript.contact";
861
862  }
863
864  }
865
866    @Block()
867    public static class TestScriptMetadataComponent extends BackboneElement implements IBaseBackboneElement {
868        /**
869         * A link to the FHIR specification that this test is covering.
870         */
871        @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
872        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="A link to the FHIR specification that this test is covering." )
873        protected List<TestScriptMetadataLinkComponent> link;
874
875        /**
876         * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
877         */
878        @Child(name = "capability", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
879        @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." )
880        protected List<TestScriptMetadataCapabilityComponent> capability;
881
882        private static final long serialVersionUID = 745183328L;
883
884    /*
885     * Constructor
886     */
887      public TestScriptMetadataComponent() {
888        super();
889      }
890
891        /**
892         * @return {@link #link} (A link to the FHIR specification that this test is covering.)
893         */
894        public List<TestScriptMetadataLinkComponent> getLink() { 
895          if (this.link == null)
896            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
897          return this.link;
898        }
899
900        public boolean hasLink() { 
901          if (this.link == null)
902            return false;
903          for (TestScriptMetadataLinkComponent item : this.link)
904            if (!item.isEmpty())
905              return true;
906          return false;
907        }
908
909        /**
910         * @return {@link #link} (A link to the FHIR specification that this test is covering.)
911         */
912    // syntactic sugar
913        public TestScriptMetadataLinkComponent addLink() { //3
914          TestScriptMetadataLinkComponent t = new TestScriptMetadataLinkComponent();
915          if (this.link == null)
916            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
917          this.link.add(t);
918          return t;
919        }
920
921    // syntactic sugar
922        public TestScriptMetadataComponent addLink(TestScriptMetadataLinkComponent t) { //3
923          if (t == null)
924            return this;
925          if (this.link == null)
926            this.link = new ArrayList<TestScriptMetadataLinkComponent>();
927          this.link.add(t);
928          return this;
929        }
930
931        /**
932         * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
933         */
934        public List<TestScriptMetadataCapabilityComponent> getCapability() { 
935          if (this.capability == null)
936            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
937          return this.capability;
938        }
939
940        public boolean hasCapability() { 
941          if (this.capability == null)
942            return false;
943          for (TestScriptMetadataCapabilityComponent item : this.capability)
944            if (!item.isEmpty())
945              return true;
946          return false;
947        }
948
949        /**
950         * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
951         */
952    // syntactic sugar
953        public TestScriptMetadataCapabilityComponent addCapability() { //3
954          TestScriptMetadataCapabilityComponent t = new TestScriptMetadataCapabilityComponent();
955          if (this.capability == null)
956            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
957          this.capability.add(t);
958          return t;
959        }
960
961    // syntactic sugar
962        public TestScriptMetadataComponent addCapability(TestScriptMetadataCapabilityComponent t) { //3
963          if (t == null)
964            return this;
965          if (this.capability == null)
966            this.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
967          this.capability.add(t);
968          return this;
969        }
970
971        protected void listChildren(List<Property> childrenList) {
972          super.listChildren(childrenList);
973          childrenList.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link));
974          childrenList.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));
975        }
976
977      @Override
978      public void setProperty(String name, Base value) throws FHIRException {
979        if (name.equals("link"))
980          this.getLink().add((TestScriptMetadataLinkComponent) value);
981        else if (name.equals("capability"))
982          this.getCapability().add((TestScriptMetadataCapabilityComponent) value);
983        else
984          super.setProperty(name, value);
985      }
986
987      @Override
988      public Base addChild(String name) throws FHIRException {
989        if (name.equals("link")) {
990          return addLink();
991        }
992        else if (name.equals("capability")) {
993          return addCapability();
994        }
995        else
996          return super.addChild(name);
997      }
998
999      public TestScriptMetadataComponent copy() {
1000        TestScriptMetadataComponent dst = new TestScriptMetadataComponent();
1001        copyValues(dst);
1002        if (link != null) {
1003          dst.link = new ArrayList<TestScriptMetadataLinkComponent>();
1004          for (TestScriptMetadataLinkComponent i : link)
1005            dst.link.add(i.copy());
1006        };
1007        if (capability != null) {
1008          dst.capability = new ArrayList<TestScriptMetadataCapabilityComponent>();
1009          for (TestScriptMetadataCapabilityComponent i : capability)
1010            dst.capability.add(i.copy());
1011        };
1012        return dst;
1013      }
1014
1015      @Override
1016      public boolean equalsDeep(Base other) {
1017        if (!super.equalsDeep(other))
1018          return false;
1019        if (!(other instanceof TestScriptMetadataComponent))
1020          return false;
1021        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other;
1022        return compareDeep(link, o.link, true) && compareDeep(capability, o.capability, true);
1023      }
1024
1025      @Override
1026      public boolean equalsShallow(Base other) {
1027        if (!super.equalsShallow(other))
1028          return false;
1029        if (!(other instanceof TestScriptMetadataComponent))
1030          return false;
1031        TestScriptMetadataComponent o = (TestScriptMetadataComponent) other;
1032        return true;
1033      }
1034
1035      public boolean isEmpty() {
1036        return super.isEmpty() && (link == null || link.isEmpty()) && (capability == null || capability.isEmpty())
1037          ;
1038      }
1039
1040  public String fhirType() {
1041    return "TestScript.metadata";
1042
1043  }
1044
1045  }
1046
1047    @Block()
1048    public static class TestScriptMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement {
1049        /**
1050         * URL to a particular requirement or feature within the FHIR specification.
1051         */
1052        @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1053        @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." )
1054        protected UriType url;
1055
1056        /**
1057         * Short description of the link.
1058         */
1059        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1060        @Description(shortDefinition="Short description", formalDefinition="Short description of the link." )
1061        protected StringType description;
1062
1063        private static final long serialVersionUID = 213372298L;
1064
1065    /*
1066     * Constructor
1067     */
1068      public TestScriptMetadataLinkComponent() {
1069        super();
1070      }
1071
1072    /*
1073     * Constructor
1074     */
1075      public TestScriptMetadataLinkComponent(UriType url) {
1076        super();
1077        this.url = url;
1078      }
1079
1080        /**
1081         * @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
1082         */
1083        public UriType getUrlElement() { 
1084          if (this.url == null)
1085            if (Configuration.errorOnAutoCreate())
1086              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.url");
1087            else if (Configuration.doAutoCreate())
1088              this.url = new UriType(); // bb
1089          return this.url;
1090        }
1091
1092        public boolean hasUrlElement() { 
1093          return this.url != null && !this.url.isEmpty();
1094        }
1095
1096        public boolean hasUrl() { 
1097          return this.url != null && !this.url.isEmpty();
1098        }
1099
1100        /**
1101         * @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
1102         */
1103        public TestScriptMetadataLinkComponent setUrlElement(UriType value) { 
1104          this.url = value;
1105          return this;
1106        }
1107
1108        /**
1109         * @return URL to a particular requirement or feature within the FHIR specification.
1110         */
1111        public String getUrl() { 
1112          return this.url == null ? null : this.url.getValue();
1113        }
1114
1115        /**
1116         * @param value URL to a particular requirement or feature within the FHIR specification.
1117         */
1118        public TestScriptMetadataLinkComponent setUrl(String value) { 
1119            if (this.url == null)
1120              this.url = new UriType();
1121            this.url.setValue(value);
1122          return this;
1123        }
1124
1125        /**
1126         * @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
1127         */
1128        public StringType getDescriptionElement() { 
1129          if (this.description == null)
1130            if (Configuration.errorOnAutoCreate())
1131              throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.description");
1132            else if (Configuration.doAutoCreate())
1133              this.description = new StringType(); // bb
1134          return this.description;
1135        }
1136
1137        public boolean hasDescriptionElement() { 
1138          return this.description != null && !this.description.isEmpty();
1139        }
1140
1141        public boolean hasDescription() { 
1142          return this.description != null && !this.description.isEmpty();
1143        }
1144
1145        /**
1146         * @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
1147         */
1148        public TestScriptMetadataLinkComponent setDescriptionElement(StringType value) { 
1149          this.description = value;
1150          return this;
1151        }
1152
1153        /**
1154         * @return Short description of the link.
1155         */
1156        public String getDescription() { 
1157          return this.description == null ? null : this.description.getValue();
1158        }
1159
1160        /**
1161         * @param value Short description of the link.
1162         */
1163        public TestScriptMetadataLinkComponent setDescription(String value) { 
1164          if (Utilities.noString(value))
1165            this.description = null;
1166          else {
1167            if (this.description == null)
1168              this.description = new StringType();
1169            this.description.setValue(value);
1170          }
1171          return this;
1172        }
1173
1174        protected void listChildren(List<Property> childrenList) {
1175          super.listChildren(childrenList);
1176          childrenList.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, java.lang.Integer.MAX_VALUE, url));
1177          childrenList.add(new Property("description", "string", "Short description of the link.", 0, java.lang.Integer.MAX_VALUE, description));
1178        }
1179
1180      @Override
1181      public void setProperty(String name, Base value) throws FHIRException {
1182        if (name.equals("url"))
1183          this.url = castToUri(value); // UriType
1184        else if (name.equals("description"))
1185          this.description = castToString(value); // StringType
1186        else
1187          super.setProperty(name, value);
1188      }
1189
1190      @Override
1191      public Base addChild(String name) throws FHIRException {
1192        if (name.equals("url")) {
1193          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
1194        }
1195        else if (name.equals("description")) {
1196          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
1197        }
1198        else
1199          return super.addChild(name);
1200      }
1201
1202      public TestScriptMetadataLinkComponent copy() {
1203        TestScriptMetadataLinkComponent dst = new TestScriptMetadataLinkComponent();
1204        copyValues(dst);
1205        dst.url = url == null ? null : url.copy();
1206        dst.description = description == null ? null : description.copy();
1207        return dst;
1208      }
1209
1210      @Override
1211      public boolean equalsDeep(Base other) {
1212        if (!super.equalsDeep(other))
1213          return false;
1214        if (!(other instanceof TestScriptMetadataLinkComponent))
1215          return false;
1216        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other;
1217        return compareDeep(url, o.url, true) && compareDeep(description, o.description, true);
1218      }
1219
1220      @Override
1221      public boolean equalsShallow(Base other) {
1222        if (!super.equalsShallow(other))
1223          return false;
1224        if (!(other instanceof TestScriptMetadataLinkComponent))
1225          return false;
1226        TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other;
1227        return compareValues(url, o.url, true) && compareValues(description, o.description, true);
1228      }
1229
1230      public boolean isEmpty() {
1231        return super.isEmpty() && (url == null || url.isEmpty()) && (description == null || description.isEmpty())
1232          ;
1233      }
1234
1235  public String fhirType() {
1236    return "TestScript.metadata.link";
1237
1238  }
1239
1240  }
1241
1242    @Block()
1243    public static class TestScriptMetadataCapabilityComponent extends BackboneElement implements IBaseBackboneElement {
1244        /**
1245         * Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1246         */
1247        @Child(name = "required", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1248        @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." )
1249        protected BooleanType required;
1250
1251        /**
1252         * Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1253         */
1254        @Child(name = "validated", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1255        @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." )
1256        protected BooleanType validated;
1257
1258        /**
1259         * Description of the capabilities that this test script is requiring the server to support.
1260         */
1261        @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1262        @Description(shortDefinition="The expected capabilities of the server", formalDefinition="Description of the capabilities that this test script is requiring the server to support." )
1263        protected StringType description;
1264
1265        /**
1266         * Which server these requirements apply to.
1267         */
1268        @Child(name = "destination", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1269        @Description(shortDefinition="Which server these requirements apply to", formalDefinition="Which server these requirements apply to." )
1270        protected IntegerType destination;
1271
1272        /**
1273         * Links to the FHIR specification that describes this interaction and the resources involved in more detail.
1274         */
1275        @Child(name = "link", type = {UriType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
1276        @Description(shortDefinition="Links to the FHIR specification", formalDefinition="Links to the FHIR specification that describes this interaction and the resources involved in more detail." )
1277        protected List<UriType> link;
1278
1279        /**
1280         * Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.
1281         */
1282        @Child(name = "conformance", type = {Conformance.class}, order=6, min=1, max=1, modifier=false, summary=false)
1283        @Description(shortDefinition="Required Conformance", formalDefinition="Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped." )
1284        protected Reference conformance;
1285
1286        /**
1287         * The actual object that is the target of the reference (Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.)
1288         */
1289        protected Conformance conformanceTarget;
1290
1291        private static final long serialVersionUID = 1318523355L;
1292
1293    /*
1294     * Constructor
1295     */
1296      public TestScriptMetadataCapabilityComponent() {
1297        super();
1298      }
1299
1300    /*
1301     * Constructor
1302     */
1303      public TestScriptMetadataCapabilityComponent(Reference conformance) {
1304        super();
1305        this.conformance = conformance;
1306      }
1307
1308        /**
1309         * @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
1310         */
1311        public BooleanType getRequiredElement() { 
1312          if (this.required == null)
1313            if (Configuration.errorOnAutoCreate())
1314              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.required");
1315            else if (Configuration.doAutoCreate())
1316              this.required = new BooleanType(); // bb
1317          return this.required;
1318        }
1319
1320        public boolean hasRequiredElement() { 
1321          return this.required != null && !this.required.isEmpty();
1322        }
1323
1324        public boolean hasRequired() { 
1325          return this.required != null && !this.required.isEmpty();
1326        }
1327
1328        /**
1329         * @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
1330         */
1331        public TestScriptMetadataCapabilityComponent setRequiredElement(BooleanType value) { 
1332          this.required = value;
1333          return this;
1334        }
1335
1336        /**
1337         * @return Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1338         */
1339        public boolean getRequired() { 
1340          return this.required == null || this.required.isEmpty() ? false : this.required.getValue();
1341        }
1342
1343        /**
1344         * @param value Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.
1345         */
1346        public TestScriptMetadataCapabilityComponent setRequired(boolean value) { 
1347            if (this.required == null)
1348              this.required = new BooleanType();
1349            this.required.setValue(value);
1350          return this;
1351        }
1352
1353        /**
1354         * @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
1355         */
1356        public BooleanType getValidatedElement() { 
1357          if (this.validated == null)
1358            if (Configuration.errorOnAutoCreate())
1359              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.validated");
1360            else if (Configuration.doAutoCreate())
1361              this.validated = new BooleanType(); // bb
1362          return this.validated;
1363        }
1364
1365        public boolean hasValidatedElement() { 
1366          return this.validated != null && !this.validated.isEmpty();
1367        }
1368
1369        public boolean hasValidated() { 
1370          return this.validated != null && !this.validated.isEmpty();
1371        }
1372
1373        /**
1374         * @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
1375         */
1376        public TestScriptMetadataCapabilityComponent setValidatedElement(BooleanType value) { 
1377          this.validated = value;
1378          return this;
1379        }
1380
1381        /**
1382         * @return Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1383         */
1384        public boolean getValidated() { 
1385          return this.validated == null || this.validated.isEmpty() ? false : this.validated.getValue();
1386        }
1387
1388        /**
1389         * @param value Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.
1390         */
1391        public TestScriptMetadataCapabilityComponent setValidated(boolean value) { 
1392            if (this.validated == null)
1393              this.validated = new BooleanType();
1394            this.validated.setValue(value);
1395          return this;
1396        }
1397
1398        /**
1399         * @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
1400         */
1401        public StringType getDescriptionElement() { 
1402          if (this.description == null)
1403            if (Configuration.errorOnAutoCreate())
1404              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.description");
1405            else if (Configuration.doAutoCreate())
1406              this.description = new StringType(); // bb
1407          return this.description;
1408        }
1409
1410        public boolean hasDescriptionElement() { 
1411          return this.description != null && !this.description.isEmpty();
1412        }
1413
1414        public boolean hasDescription() { 
1415          return this.description != null && !this.description.isEmpty();
1416        }
1417
1418        /**
1419         * @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
1420         */
1421        public TestScriptMetadataCapabilityComponent setDescriptionElement(StringType value) { 
1422          this.description = value;
1423          return this;
1424        }
1425
1426        /**
1427         * @return Description of the capabilities that this test script is requiring the server to support.
1428         */
1429        public String getDescription() { 
1430          return this.description == null ? null : this.description.getValue();
1431        }
1432
1433        /**
1434         * @param value Description of the capabilities that this test script is requiring the server to support.
1435         */
1436        public TestScriptMetadataCapabilityComponent setDescription(String value) { 
1437          if (Utilities.noString(value))
1438            this.description = null;
1439          else {
1440            if (this.description == null)
1441              this.description = new StringType();
1442            this.description.setValue(value);
1443          }
1444          return this;
1445        }
1446
1447        /**
1448         * @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
1449         */
1450        public IntegerType getDestinationElement() { 
1451          if (this.destination == null)
1452            if (Configuration.errorOnAutoCreate())
1453              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.destination");
1454            else if (Configuration.doAutoCreate())
1455              this.destination = new IntegerType(); // bb
1456          return this.destination;
1457        }
1458
1459        public boolean hasDestinationElement() { 
1460          return this.destination != null && !this.destination.isEmpty();
1461        }
1462
1463        public boolean hasDestination() { 
1464          return this.destination != null && !this.destination.isEmpty();
1465        }
1466
1467        /**
1468         * @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
1469         */
1470        public TestScriptMetadataCapabilityComponent setDestinationElement(IntegerType value) { 
1471          this.destination = value;
1472          return this;
1473        }
1474
1475        /**
1476         * @return Which server these requirements apply to.
1477         */
1478        public int getDestination() { 
1479          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
1480        }
1481
1482        /**
1483         * @param value Which server these requirements apply to.
1484         */
1485        public TestScriptMetadataCapabilityComponent setDestination(int value) { 
1486            if (this.destination == null)
1487              this.destination = new IntegerType();
1488            this.destination.setValue(value);
1489          return this;
1490        }
1491
1492        /**
1493         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
1494         */
1495        public List<UriType> getLink() { 
1496          if (this.link == null)
1497            this.link = new ArrayList<UriType>();
1498          return this.link;
1499        }
1500
1501        public boolean hasLink() { 
1502          if (this.link == null)
1503            return false;
1504          for (UriType item : this.link)
1505            if (!item.isEmpty())
1506              return true;
1507          return false;
1508        }
1509
1510        /**
1511         * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
1512         */
1513    // syntactic sugar
1514        public UriType addLinkElement() {//2 
1515          UriType t = new UriType();
1516          if (this.link == null)
1517            this.link = new ArrayList<UriType>();
1518          this.link.add(t);
1519          return t;
1520        }
1521
1522        /**
1523         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
1524         */
1525        public TestScriptMetadataCapabilityComponent addLink(String value) { //1
1526          UriType t = new UriType();
1527          t.setValue(value);
1528          if (this.link == null)
1529            this.link = new ArrayList<UriType>();
1530          this.link.add(t);
1531          return this;
1532        }
1533
1534        /**
1535         * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.)
1536         */
1537        public boolean hasLink(String value) { 
1538          if (this.link == null)
1539            return false;
1540          for (UriType v : this.link)
1541            if (v.equals(value)) // uri
1542              return true;
1543          return false;
1544        }
1545
1546        /**
1547         * @return {@link #conformance} (Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.)
1548         */
1549        public Reference getConformance() { 
1550          if (this.conformance == null)
1551            if (Configuration.errorOnAutoCreate())
1552              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance");
1553            else if (Configuration.doAutoCreate())
1554              this.conformance = new Reference(); // cc
1555          return this.conformance;
1556        }
1557
1558        public boolean hasConformance() { 
1559          return this.conformance != null && !this.conformance.isEmpty();
1560        }
1561
1562        /**
1563         * @param value {@link #conformance} (Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.)
1564         */
1565        public TestScriptMetadataCapabilityComponent setConformance(Reference value) { 
1566          this.conformance = value;
1567          return this;
1568        }
1569
1570        /**
1571         * @return {@link #conformance} 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 conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.)
1572         */
1573        public Conformance getConformanceTarget() { 
1574          if (this.conformanceTarget == null)
1575            if (Configuration.errorOnAutoCreate())
1576              throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance");
1577            else if (Configuration.doAutoCreate())
1578              this.conformanceTarget = new Conformance(); // aa
1579          return this.conformanceTarget;
1580        }
1581
1582        /**
1583         * @param value {@link #conformance} 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 conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.)
1584         */
1585        public TestScriptMetadataCapabilityComponent setConformanceTarget(Conformance value) { 
1586          this.conformanceTarget = value;
1587          return this;
1588        }
1589
1590        protected void listChildren(List<Property> childrenList) {
1591          super.listChildren(childrenList);
1592          childrenList.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, java.lang.Integer.MAX_VALUE, required));
1593          childrenList.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, java.lang.Integer.MAX_VALUE, validated));
1594          childrenList.add(new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, java.lang.Integer.MAX_VALUE, description));
1595          childrenList.add(new Property("destination", "integer", "Which server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, destination));
1596          childrenList.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));
1597          childrenList.add(new Property("conformance", "Reference(Conformance)", "Minimum conformance required of server for test script to execute successfully.   If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.", 0, java.lang.Integer.MAX_VALUE, conformance));
1598        }
1599
1600      @Override
1601      public void setProperty(String name, Base value) throws FHIRException {
1602        if (name.equals("required"))
1603          this.required = castToBoolean(value); // BooleanType
1604        else if (name.equals("validated"))
1605          this.validated = castToBoolean(value); // BooleanType
1606        else if (name.equals("description"))
1607          this.description = castToString(value); // StringType
1608        else if (name.equals("destination"))
1609          this.destination = castToInteger(value); // IntegerType
1610        else if (name.equals("link"))
1611          this.getLink().add(castToUri(value));
1612        else if (name.equals("conformance"))
1613          this.conformance = castToReference(value); // Reference
1614        else
1615          super.setProperty(name, value);
1616      }
1617
1618      @Override
1619      public Base addChild(String name) throws FHIRException {
1620        if (name.equals("required")) {
1621          throw new FHIRException("Cannot call addChild on a primitive type TestScript.required");
1622        }
1623        else if (name.equals("validated")) {
1624          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validated");
1625        }
1626        else if (name.equals("description")) {
1627          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
1628        }
1629        else if (name.equals("destination")) {
1630          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
1631        }
1632        else if (name.equals("link")) {
1633          throw new FHIRException("Cannot call addChild on a primitive type TestScript.link");
1634        }
1635        else if (name.equals("conformance")) {
1636          this.conformance = new Reference();
1637          return this.conformance;
1638        }
1639        else
1640          return super.addChild(name);
1641      }
1642
1643      public TestScriptMetadataCapabilityComponent copy() {
1644        TestScriptMetadataCapabilityComponent dst = new TestScriptMetadataCapabilityComponent();
1645        copyValues(dst);
1646        dst.required = required == null ? null : required.copy();
1647        dst.validated = validated == null ? null : validated.copy();
1648        dst.description = description == null ? null : description.copy();
1649        dst.destination = destination == null ? null : destination.copy();
1650        if (link != null) {
1651          dst.link = new ArrayList<UriType>();
1652          for (UriType i : link)
1653            dst.link.add(i.copy());
1654        };
1655        dst.conformance = conformance == null ? null : conformance.copy();
1656        return dst;
1657      }
1658
1659      @Override
1660      public boolean equalsDeep(Base other) {
1661        if (!super.equalsDeep(other))
1662          return false;
1663        if (!(other instanceof TestScriptMetadataCapabilityComponent))
1664          return false;
1665        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other;
1666        return compareDeep(required, o.required, true) && compareDeep(validated, o.validated, true) && compareDeep(description, o.description, true)
1667           && compareDeep(destination, o.destination, true) && compareDeep(link, o.link, true) && compareDeep(conformance, o.conformance, true)
1668          ;
1669      }
1670
1671      @Override
1672      public boolean equalsShallow(Base other) {
1673        if (!super.equalsShallow(other))
1674          return false;
1675        if (!(other instanceof TestScriptMetadataCapabilityComponent))
1676          return false;
1677        TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other;
1678        return compareValues(required, o.required, true) && compareValues(validated, o.validated, true) && compareValues(description, o.description, true)
1679           && compareValues(destination, o.destination, true) && compareValues(link, o.link, true);
1680      }
1681
1682      public boolean isEmpty() {
1683        return super.isEmpty() && (required == null || required.isEmpty()) && (validated == null || validated.isEmpty())
1684           && (description == null || description.isEmpty()) && (destination == null || destination.isEmpty())
1685           && (link == null || link.isEmpty()) && (conformance == null || conformance.isEmpty());
1686      }
1687
1688  public String fhirType() {
1689    return "TestScript.metadata.capability";
1690
1691  }
1692
1693  }
1694
1695    @Block()
1696    public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement {
1697        /**
1698         * 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.
1699         */
1700        @Child(name = "autocreate", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false)
1701        @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." )
1702        protected BooleanType autocreate;
1703
1704        /**
1705         * 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.
1706         */
1707        @Child(name = "autodelete", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1708        @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." )
1709        protected BooleanType autodelete;
1710
1711        /**
1712         * Reference to the resource (containing the contents of the resource needed for operations).
1713         */
1714        @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false)
1715        @Description(shortDefinition="Reference of the resource", formalDefinition="Reference to the resource (containing the contents of the resource needed for operations)." )
1716        protected Reference resource;
1717
1718        /**
1719         * The actual object that is the target of the reference (Reference to the resource (containing the contents of the resource needed for operations).)
1720         */
1721        protected Resource resourceTarget;
1722
1723        private static final long serialVersionUID = 1110683307L;
1724
1725    /*
1726     * Constructor
1727     */
1728      public TestScriptFixtureComponent() {
1729        super();
1730      }
1731
1732        /**
1733         * @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
1734         */
1735        public BooleanType getAutocreateElement() { 
1736          if (this.autocreate == null)
1737            if (Configuration.errorOnAutoCreate())
1738              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate");
1739            else if (Configuration.doAutoCreate())
1740              this.autocreate = new BooleanType(); // bb
1741          return this.autocreate;
1742        }
1743
1744        public boolean hasAutocreateElement() { 
1745          return this.autocreate != null && !this.autocreate.isEmpty();
1746        }
1747
1748        public boolean hasAutocreate() { 
1749          return this.autocreate != null && !this.autocreate.isEmpty();
1750        }
1751
1752        /**
1753         * @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
1754         */
1755        public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { 
1756          this.autocreate = value;
1757          return this;
1758        }
1759
1760        /**
1761         * @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.
1762         */
1763        public boolean getAutocreate() { 
1764          return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue();
1765        }
1766
1767        /**
1768         * @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.
1769         */
1770        public TestScriptFixtureComponent setAutocreate(boolean value) { 
1771            if (this.autocreate == null)
1772              this.autocreate = new BooleanType();
1773            this.autocreate.setValue(value);
1774          return this;
1775        }
1776
1777        /**
1778         * @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
1779         */
1780        public BooleanType getAutodeleteElement() { 
1781          if (this.autodelete == null)
1782            if (Configuration.errorOnAutoCreate())
1783              throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete");
1784            else if (Configuration.doAutoCreate())
1785              this.autodelete = new BooleanType(); // bb
1786          return this.autodelete;
1787        }
1788
1789        public boolean hasAutodeleteElement() { 
1790          return this.autodelete != null && !this.autodelete.isEmpty();
1791        }
1792
1793        public boolean hasAutodelete() { 
1794          return this.autodelete != null && !this.autodelete.isEmpty();
1795        }
1796
1797        /**
1798         * @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
1799         */
1800        public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { 
1801          this.autodelete = value;
1802          return this;
1803        }
1804
1805        /**
1806         * @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.
1807         */
1808        public boolean getAutodelete() { 
1809          return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue();
1810        }
1811
1812        /**
1813         * @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.
1814         */
1815        public TestScriptFixtureComponent setAutodelete(boolean value) { 
1816            if (this.autodelete == null)
1817              this.autodelete = new BooleanType();
1818            this.autodelete.setValue(value);
1819          return this;
1820        }
1821
1822        /**
1823         * @return {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
1824         */
1825        public Reference getResource() { 
1826          if (this.resource == null)
1827            if (Configuration.errorOnAutoCreate())
1828              throw new Error("Attempt to auto-create TestScriptFixtureComponent.resource");
1829            else if (Configuration.doAutoCreate())
1830              this.resource = new Reference(); // cc
1831          return this.resource;
1832        }
1833
1834        public boolean hasResource() { 
1835          return this.resource != null && !this.resource.isEmpty();
1836        }
1837
1838        /**
1839         * @param value {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).)
1840         */
1841        public TestScriptFixtureComponent setResource(Reference value) { 
1842          this.resource = value;
1843          return this;
1844        }
1845
1846        /**
1847         * @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).)
1848         */
1849        public Resource getResourceTarget() { 
1850          return this.resourceTarget;
1851        }
1852
1853        /**
1854         * @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).)
1855         */
1856        public TestScriptFixtureComponent setResourceTarget(Resource value) { 
1857          this.resourceTarget = value;
1858          return this;
1859        }
1860
1861        protected void listChildren(List<Property> childrenList) {
1862          super.listChildren(childrenList);
1863          childrenList.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, java.lang.Integer.MAX_VALUE, autocreate));
1864          childrenList.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, java.lang.Integer.MAX_VALUE, autodelete));
1865          childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, java.lang.Integer.MAX_VALUE, resource));
1866        }
1867
1868      @Override
1869      public void setProperty(String name, Base value) throws FHIRException {
1870        if (name.equals("autocreate"))
1871          this.autocreate = castToBoolean(value); // BooleanType
1872        else if (name.equals("autodelete"))
1873          this.autodelete = castToBoolean(value); // BooleanType
1874        else if (name.equals("resource"))
1875          this.resource = castToReference(value); // Reference
1876        else
1877          super.setProperty(name, value);
1878      }
1879
1880      @Override
1881      public Base addChild(String name) throws FHIRException {
1882        if (name.equals("autocreate")) {
1883          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autocreate");
1884        }
1885        else if (name.equals("autodelete")) {
1886          throw new FHIRException("Cannot call addChild on a primitive type TestScript.autodelete");
1887        }
1888        else if (name.equals("resource")) {
1889          this.resource = new Reference();
1890          return this.resource;
1891        }
1892        else
1893          return super.addChild(name);
1894      }
1895
1896      public TestScriptFixtureComponent copy() {
1897        TestScriptFixtureComponent dst = new TestScriptFixtureComponent();
1898        copyValues(dst);
1899        dst.autocreate = autocreate == null ? null : autocreate.copy();
1900        dst.autodelete = autodelete == null ? null : autodelete.copy();
1901        dst.resource = resource == null ? null : resource.copy();
1902        return dst;
1903      }
1904
1905      @Override
1906      public boolean equalsDeep(Base other) {
1907        if (!super.equalsDeep(other))
1908          return false;
1909        if (!(other instanceof TestScriptFixtureComponent))
1910          return false;
1911        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other;
1912        return compareDeep(autocreate, o.autocreate, true) && compareDeep(autodelete, o.autodelete, true)
1913           && compareDeep(resource, o.resource, true);
1914      }
1915
1916      @Override
1917      public boolean equalsShallow(Base other) {
1918        if (!super.equalsShallow(other))
1919          return false;
1920        if (!(other instanceof TestScriptFixtureComponent))
1921          return false;
1922        TestScriptFixtureComponent o = (TestScriptFixtureComponent) other;
1923        return compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true)
1924          ;
1925      }
1926
1927      public boolean isEmpty() {
1928        return super.isEmpty() && (autocreate == null || autocreate.isEmpty()) && (autodelete == null || autodelete.isEmpty())
1929           && (resource == null || resource.isEmpty());
1930      }
1931
1932  public String fhirType() {
1933    return "TestScript.fixture";
1934
1935  }
1936
1937  }
1938
1939    @Block()
1940    public static class TestScriptVariableComponent extends BackboneElement implements IBaseBackboneElement {
1941        /**
1942         * Descriptive name for this variable.
1943         */
1944        @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
1945        @Description(shortDefinition="Descriptive name for this variable", formalDefinition="Descriptive name for this variable." )
1946        protected StringType name;
1947
1948        /**
1949         * Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
1950         */
1951        @Child(name = "headerField", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
1952        @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." )
1953        protected StringType headerField;
1954
1955        /**
1956         * XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.
1957         */
1958        @Child(name = "path", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
1959        @Description(shortDefinition="XPath or JSONPath against the fixture body", formalDefinition="XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both." )
1960        protected StringType path;
1961
1962        /**
1963         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
1964         */
1965        @Child(name = "sourceId", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=false)
1966        @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." )
1967        protected IdType sourceId;
1968
1969        private static final long serialVersionUID = 1128806685L;
1970
1971    /*
1972     * Constructor
1973     */
1974      public TestScriptVariableComponent() {
1975        super();
1976      }
1977
1978    /*
1979     * Constructor
1980     */
1981      public TestScriptVariableComponent(StringType name) {
1982        super();
1983        this.name = name;
1984      }
1985
1986        /**
1987         * @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
1988         */
1989        public StringType getNameElement() { 
1990          if (this.name == null)
1991            if (Configuration.errorOnAutoCreate())
1992              throw new Error("Attempt to auto-create TestScriptVariableComponent.name");
1993            else if (Configuration.doAutoCreate())
1994              this.name = new StringType(); // bb
1995          return this.name;
1996        }
1997
1998        public boolean hasNameElement() { 
1999          return this.name != null && !this.name.isEmpty();
2000        }
2001
2002        public boolean hasName() { 
2003          return this.name != null && !this.name.isEmpty();
2004        }
2005
2006        /**
2007         * @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
2008         */
2009        public TestScriptVariableComponent setNameElement(StringType value) { 
2010          this.name = value;
2011          return this;
2012        }
2013
2014        /**
2015         * @return Descriptive name for this variable.
2016         */
2017        public String getName() { 
2018          return this.name == null ? null : this.name.getValue();
2019        }
2020
2021        /**
2022         * @param value Descriptive name for this variable.
2023         */
2024        public TestScriptVariableComponent setName(String value) { 
2025            if (this.name == null)
2026              this.name = new StringType();
2027            this.name.setValue(value);
2028          return this;
2029        }
2030
2031        /**
2032         * @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
2033         */
2034        public StringType getHeaderFieldElement() { 
2035          if (this.headerField == null)
2036            if (Configuration.errorOnAutoCreate())
2037              throw new Error("Attempt to auto-create TestScriptVariableComponent.headerField");
2038            else if (Configuration.doAutoCreate())
2039              this.headerField = new StringType(); // bb
2040          return this.headerField;
2041        }
2042
2043        public boolean hasHeaderFieldElement() { 
2044          return this.headerField != null && !this.headerField.isEmpty();
2045        }
2046
2047        public boolean hasHeaderField() { 
2048          return this.headerField != null && !this.headerField.isEmpty();
2049        }
2050
2051        /**
2052         * @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
2053         */
2054        public TestScriptVariableComponent setHeaderFieldElement(StringType value) { 
2055          this.headerField = value;
2056          return this;
2057        }
2058
2059        /**
2060         * @return Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2061         */
2062        public String getHeaderField() { 
2063          return this.headerField == null ? null : this.headerField.getValue();
2064        }
2065
2066        /**
2067         * @param value Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.
2068         */
2069        public TestScriptVariableComponent setHeaderField(String value) { 
2070          if (Utilities.noString(value))
2071            this.headerField = null;
2072          else {
2073            if (this.headerField == null)
2074              this.headerField = new StringType();
2075            this.headerField.setValue(value);
2076          }
2077          return this;
2078        }
2079
2080        /**
2081         * @return {@link #path} (XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
2082         */
2083        public StringType getPathElement() { 
2084          if (this.path == null)
2085            if (Configuration.errorOnAutoCreate())
2086              throw new Error("Attempt to auto-create TestScriptVariableComponent.path");
2087            else if (Configuration.doAutoCreate())
2088              this.path = new StringType(); // bb
2089          return this.path;
2090        }
2091
2092        public boolean hasPathElement() { 
2093          return this.path != null && !this.path.isEmpty();
2094        }
2095
2096        public boolean hasPath() { 
2097          return this.path != null && !this.path.isEmpty();
2098        }
2099
2100        /**
2101         * @param value {@link #path} (XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value
2102         */
2103        public TestScriptVariableComponent setPathElement(StringType value) { 
2104          this.path = value;
2105          return this;
2106        }
2107
2108        /**
2109         * @return XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.
2110         */
2111        public String getPath() { 
2112          return this.path == null ? null : this.path.getValue();
2113        }
2114
2115        /**
2116         * @param value XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.
2117         */
2118        public TestScriptVariableComponent setPath(String value) { 
2119          if (Utilities.noString(value))
2120            this.path = null;
2121          else {
2122            if (this.path == null)
2123              this.path = new StringType();
2124            this.path.setValue(value);
2125          }
2126          return this;
2127        }
2128
2129        /**
2130         * @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
2131         */
2132        public IdType getSourceIdElement() { 
2133          if (this.sourceId == null)
2134            if (Configuration.errorOnAutoCreate())
2135              throw new Error("Attempt to auto-create TestScriptVariableComponent.sourceId");
2136            else if (Configuration.doAutoCreate())
2137              this.sourceId = new IdType(); // bb
2138          return this.sourceId;
2139        }
2140
2141        public boolean hasSourceIdElement() { 
2142          return this.sourceId != null && !this.sourceId.isEmpty();
2143        }
2144
2145        public boolean hasSourceId() { 
2146          return this.sourceId != null && !this.sourceId.isEmpty();
2147        }
2148
2149        /**
2150         * @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
2151         */
2152        public TestScriptVariableComponent setSourceIdElement(IdType value) { 
2153          this.sourceId = value;
2154          return this;
2155        }
2156
2157        /**
2158         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
2159         */
2160        public String getSourceId() { 
2161          return this.sourceId == null ? null : this.sourceId.getValue();
2162        }
2163
2164        /**
2165         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.
2166         */
2167        public TestScriptVariableComponent setSourceId(String value) { 
2168          if (Utilities.noString(value))
2169            this.sourceId = null;
2170          else {
2171            if (this.sourceId == null)
2172              this.sourceId = new IdType();
2173            this.sourceId.setValue(value);
2174          }
2175          return this;
2176        }
2177
2178        protected void listChildren(List<Property> childrenList) {
2179          super.listChildren(childrenList);
2180          childrenList.add(new Property("name", "string", "Descriptive name for this variable.", 0, java.lang.Integer.MAX_VALUE, name));
2181          childrenList.add(new Property("headerField", "string", "Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.", 0, java.lang.Integer.MAX_VALUE, headerField));
2182          childrenList.add(new Property("path", "string", "XPath or JSONPath against the fixture body.  When variables are defined, either headerField must be specified or path, but not both.", 0, java.lang.Integer.MAX_VALUE, path));
2183          childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.", 0, java.lang.Integer.MAX_VALUE, sourceId));
2184        }
2185
2186      @Override
2187      public void setProperty(String name, Base value) throws FHIRException {
2188        if (name.equals("name"))
2189          this.name = castToString(value); // StringType
2190        else if (name.equals("headerField"))
2191          this.headerField = castToString(value); // StringType
2192        else if (name.equals("path"))
2193          this.path = castToString(value); // StringType
2194        else if (name.equals("sourceId"))
2195          this.sourceId = castToId(value); // IdType
2196        else
2197          super.setProperty(name, value);
2198      }
2199
2200      @Override
2201      public Base addChild(String name) throws FHIRException {
2202        if (name.equals("name")) {
2203          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
2204        }
2205        else if (name.equals("headerField")) {
2206          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
2207        }
2208        else if (name.equals("path")) {
2209          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
2210        }
2211        else if (name.equals("sourceId")) {
2212          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
2213        }
2214        else
2215          return super.addChild(name);
2216      }
2217
2218      public TestScriptVariableComponent copy() {
2219        TestScriptVariableComponent dst = new TestScriptVariableComponent();
2220        copyValues(dst);
2221        dst.name = name == null ? null : name.copy();
2222        dst.headerField = headerField == null ? null : headerField.copy();
2223        dst.path = path == null ? null : path.copy();
2224        dst.sourceId = sourceId == null ? null : sourceId.copy();
2225        return dst;
2226      }
2227
2228      @Override
2229      public boolean equalsDeep(Base other) {
2230        if (!super.equalsDeep(other))
2231          return false;
2232        if (!(other instanceof TestScriptVariableComponent))
2233          return false;
2234        TestScriptVariableComponent o = (TestScriptVariableComponent) other;
2235        return compareDeep(name, o.name, true) && compareDeep(headerField, o.headerField, true) && compareDeep(path, o.path, true)
2236           && compareDeep(sourceId, o.sourceId, true);
2237      }
2238
2239      @Override
2240      public boolean equalsShallow(Base other) {
2241        if (!super.equalsShallow(other))
2242          return false;
2243        if (!(other instanceof TestScriptVariableComponent))
2244          return false;
2245        TestScriptVariableComponent o = (TestScriptVariableComponent) other;
2246        return compareValues(name, o.name, true) && compareValues(headerField, o.headerField, true) && compareValues(path, o.path, true)
2247           && compareValues(sourceId, o.sourceId, true);
2248      }
2249
2250      public boolean isEmpty() {
2251        return super.isEmpty() && (name == null || name.isEmpty()) && (headerField == null || headerField.isEmpty())
2252           && (path == null || path.isEmpty()) && (sourceId == null || sourceId.isEmpty());
2253      }
2254
2255  public String fhirType() {
2256    return "TestScript.variable";
2257
2258  }
2259
2260  }
2261
2262    @Block()
2263    public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement {
2264        /**
2265         * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
2266         */
2267        @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
2268        @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." )
2269        protected TestScriptMetadataComponent metadata;
2270
2271        /**
2272         * Action would contain either an operation or an assertion.
2273         */
2274        @Child(name = "action", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2275        @Description(shortDefinition="A setup operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." )
2276        protected List<TestScriptSetupActionComponent> action;
2277
2278        private static final long serialVersionUID = -1836543723L;
2279
2280    /*
2281     * Constructor
2282     */
2283      public TestScriptSetupComponent() {
2284        super();
2285      }
2286
2287        /**
2288         * @return {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
2289         */
2290        public TestScriptMetadataComponent getMetadata() { 
2291          if (this.metadata == null)
2292            if (Configuration.errorOnAutoCreate())
2293              throw new Error("Attempt to auto-create TestScriptSetupComponent.metadata");
2294            else if (Configuration.doAutoCreate())
2295              this.metadata = new TestScriptMetadataComponent(); // cc
2296          return this.metadata;
2297        }
2298
2299        public boolean hasMetadata() { 
2300          return this.metadata != null && !this.metadata.isEmpty();
2301        }
2302
2303        /**
2304         * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
2305         */
2306        public TestScriptSetupComponent setMetadata(TestScriptMetadataComponent value) { 
2307          this.metadata = value;
2308          return this;
2309        }
2310
2311        /**
2312         * @return {@link #action} (Action would contain either an operation or an assertion.)
2313         */
2314        public List<TestScriptSetupActionComponent> getAction() { 
2315          if (this.action == null)
2316            this.action = new ArrayList<TestScriptSetupActionComponent>();
2317          return this.action;
2318        }
2319
2320        public boolean hasAction() { 
2321          if (this.action == null)
2322            return false;
2323          for (TestScriptSetupActionComponent item : this.action)
2324            if (!item.isEmpty())
2325              return true;
2326          return false;
2327        }
2328
2329        /**
2330         * @return {@link #action} (Action would contain either an operation or an assertion.)
2331         */
2332    // syntactic sugar
2333        public TestScriptSetupActionComponent addAction() { //3
2334          TestScriptSetupActionComponent t = new TestScriptSetupActionComponent();
2335          if (this.action == null)
2336            this.action = new ArrayList<TestScriptSetupActionComponent>();
2337          this.action.add(t);
2338          return t;
2339        }
2340
2341    // syntactic sugar
2342        public TestScriptSetupComponent addAction(TestScriptSetupActionComponent t) { //3
2343          if (t == null)
2344            return this;
2345          if (this.action == null)
2346            this.action = new ArrayList<TestScriptSetupActionComponent>();
2347          this.action.add(t);
2348          return this;
2349        }
2350
2351        protected void listChildren(List<Property> childrenList) {
2352          super.listChildren(childrenList);
2353          childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata));
2354          childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
2355        }
2356
2357      @Override
2358      public void setProperty(String name, Base value) throws FHIRException {
2359        if (name.equals("metadata"))
2360          this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent
2361        else if (name.equals("action"))
2362          this.getAction().add((TestScriptSetupActionComponent) value);
2363        else
2364          super.setProperty(name, value);
2365      }
2366
2367      @Override
2368      public Base addChild(String name) throws FHIRException {
2369        if (name.equals("metadata")) {
2370          this.metadata = new TestScriptMetadataComponent();
2371          return this.metadata;
2372        }
2373        else if (name.equals("action")) {
2374          return addAction();
2375        }
2376        else
2377          return super.addChild(name);
2378      }
2379
2380      public TestScriptSetupComponent copy() {
2381        TestScriptSetupComponent dst = new TestScriptSetupComponent();
2382        copyValues(dst);
2383        dst.metadata = metadata == null ? null : metadata.copy();
2384        if (action != null) {
2385          dst.action = new ArrayList<TestScriptSetupActionComponent>();
2386          for (TestScriptSetupActionComponent i : action)
2387            dst.action.add(i.copy());
2388        };
2389        return dst;
2390      }
2391
2392      @Override
2393      public boolean equalsDeep(Base other) {
2394        if (!super.equalsDeep(other))
2395          return false;
2396        if (!(other instanceof TestScriptSetupComponent))
2397          return false;
2398        TestScriptSetupComponent o = (TestScriptSetupComponent) other;
2399        return compareDeep(metadata, o.metadata, true) && compareDeep(action, o.action, true);
2400      }
2401
2402      @Override
2403      public boolean equalsShallow(Base other) {
2404        if (!super.equalsShallow(other))
2405          return false;
2406        if (!(other instanceof TestScriptSetupComponent))
2407          return false;
2408        TestScriptSetupComponent o = (TestScriptSetupComponent) other;
2409        return true;
2410      }
2411
2412      public boolean isEmpty() {
2413        return super.isEmpty() && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty())
2414          ;
2415      }
2416
2417  public String fhirType() {
2418    return "TestScript.setup";
2419
2420  }
2421
2422  }
2423
2424    @Block()
2425    public static class TestScriptSetupActionComponent extends BackboneElement implements IBaseBackboneElement {
2426        /**
2427         * The operation to perform.
2428         */
2429        @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false)
2430        @Description(shortDefinition="The setup operation to perform", formalDefinition="The operation to perform." )
2431        protected TestScriptSetupActionOperationComponent operation;
2432
2433        /**
2434         * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
2435         */
2436        @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false)
2437        @Description(shortDefinition="The assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." )
2438        protected TestScriptSetupActionAssertComponent assert_;
2439
2440        private static final long serialVersionUID = 1411550037L;
2441
2442    /*
2443     * Constructor
2444     */
2445      public TestScriptSetupActionComponent() {
2446        super();
2447      }
2448
2449        /**
2450         * @return {@link #operation} (The operation to perform.)
2451         */
2452        public TestScriptSetupActionOperationComponent getOperation() { 
2453          if (this.operation == null)
2454            if (Configuration.errorOnAutoCreate())
2455              throw new Error("Attempt to auto-create TestScriptSetupActionComponent.operation");
2456            else if (Configuration.doAutoCreate())
2457              this.operation = new TestScriptSetupActionOperationComponent(); // cc
2458          return this.operation;
2459        }
2460
2461        public boolean hasOperation() { 
2462          return this.operation != null && !this.operation.isEmpty();
2463        }
2464
2465        /**
2466         * @param value {@link #operation} (The operation to perform.)
2467         */
2468        public TestScriptSetupActionComponent setOperation(TestScriptSetupActionOperationComponent value) { 
2469          this.operation = value;
2470          return this;
2471        }
2472
2473        /**
2474         * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
2475         */
2476        public TestScriptSetupActionAssertComponent getAssert() { 
2477          if (this.assert_ == null)
2478            if (Configuration.errorOnAutoCreate())
2479              throw new Error("Attempt to auto-create TestScriptSetupActionComponent.assert_");
2480            else if (Configuration.doAutoCreate())
2481              this.assert_ = new TestScriptSetupActionAssertComponent(); // cc
2482          return this.assert_;
2483        }
2484
2485        public boolean hasAssert() { 
2486          return this.assert_ != null && !this.assert_.isEmpty();
2487        }
2488
2489        /**
2490         * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
2491         */
2492        public TestScriptSetupActionComponent setAssert(TestScriptSetupActionAssertComponent value) { 
2493          this.assert_ = value;
2494          return this;
2495        }
2496
2497        protected void listChildren(List<Property> childrenList) {
2498          super.listChildren(childrenList);
2499          childrenList.add(new Property("operation", "", "The operation to perform.", 0, java.lang.Integer.MAX_VALUE, operation));
2500          childrenList.add(new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_));
2501        }
2502
2503      @Override
2504      public void setProperty(String name, Base value) throws FHIRException {
2505        if (name.equals("operation"))
2506          this.operation = (TestScriptSetupActionOperationComponent) value; // TestScriptSetupActionOperationComponent
2507        else if (name.equals("assert"))
2508          this.assert_ = (TestScriptSetupActionAssertComponent) value; // TestScriptSetupActionAssertComponent
2509        else
2510          super.setProperty(name, value);
2511      }
2512
2513      @Override
2514      public Base addChild(String name) throws FHIRException {
2515        if (name.equals("operation")) {
2516          this.operation = new TestScriptSetupActionOperationComponent();
2517          return this.operation;
2518        }
2519        else if (name.equals("assert")) {
2520          this.assert_ = new TestScriptSetupActionAssertComponent();
2521          return this.assert_;
2522        }
2523        else
2524          return super.addChild(name);
2525      }
2526
2527      public TestScriptSetupActionComponent copy() {
2528        TestScriptSetupActionComponent dst = new TestScriptSetupActionComponent();
2529        copyValues(dst);
2530        dst.operation = operation == null ? null : operation.copy();
2531        dst.assert_ = assert_ == null ? null : assert_.copy();
2532        return dst;
2533      }
2534
2535      @Override
2536      public boolean equalsDeep(Base other) {
2537        if (!super.equalsDeep(other))
2538          return false;
2539        if (!(other instanceof TestScriptSetupActionComponent))
2540          return false;
2541        TestScriptSetupActionComponent o = (TestScriptSetupActionComponent) other;
2542        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
2543      }
2544
2545      @Override
2546      public boolean equalsShallow(Base other) {
2547        if (!super.equalsShallow(other))
2548          return false;
2549        if (!(other instanceof TestScriptSetupActionComponent))
2550          return false;
2551        TestScriptSetupActionComponent o = (TestScriptSetupActionComponent) other;
2552        return true;
2553      }
2554
2555      public boolean isEmpty() {
2556        return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty())
2557          ;
2558      }
2559
2560  public String fhirType() {
2561    return "TestScript.setup.action";
2562
2563  }
2564
2565  }
2566
2567    @Block()
2568    public static class TestScriptSetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement {
2569        /**
2570         * Server interaction or operation type.
2571         */
2572        @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false)
2573        @Description(shortDefinition="The setup operation type that will be executed", formalDefinition="Server interaction or operation type." )
2574        protected Coding type;
2575
2576        /**
2577         * The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
2578         */
2579        @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
2580        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html." )
2581        protected CodeType resource;
2582
2583        /**
2584         * The label would be used for tracking/logging purposes by test engines.
2585         */
2586        @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false)
2587        @Description(shortDefinition="Tracking/logging operation label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
2588        protected StringType label;
2589
2590        /**
2591         * The description would be used by test engines for tracking and reporting purposes.
2592         */
2593        @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
2594        @Description(shortDefinition="Tracking/reporting operation description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
2595        protected StringType description;
2596
2597        /**
2598         * The content-type or mime-type to use for RESTful operation in the 'Accept' header.
2599         */
2600        @Child(name = "accept", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false)
2601        @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Accept' header." )
2602        protected Enumeration<ContentType> accept;
2603
2604        /**
2605         * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
2606         */
2607        @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
2608        @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." )
2609        protected Enumeration<ContentType> contentType;
2610
2611        /**
2612         * Which server to perform the operation on.
2613         */
2614        @Child(name = "destination", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=false)
2615        @Description(shortDefinition="Which server to perform the operation on", formalDefinition="Which server to perform the operation on." )
2616        protected IntegerType destination;
2617
2618        /**
2619         * 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.
2620         */
2621        @Child(name = "encodeRequestUrl", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false)
2622        @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." )
2623        protected BooleanType encodeRequestUrl;
2624
2625        /**
2626         * Path plus parameters after [type].  Used to set parts of the request URL explicitly.
2627         */
2628        @Child(name = "params", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false)
2629        @Description(shortDefinition="Explicitly defined path parameters", formalDefinition="Path plus parameters after [type].  Used to set parts of the request URL explicitly." )
2630        protected StringType params;
2631
2632        /**
2633         * Header elements would be used to set HTTP headers.
2634         */
2635        @Child(name = "requestHeader", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
2636        @Description(shortDefinition="Each operation can have one ore more header elements", formalDefinition="Header elements would be used to set HTTP headers." )
2637        protected List<TestScriptSetupActionOperationRequestHeaderComponent> requestHeader;
2638
2639        /**
2640         * The fixture id (maybe new) to map to the response.
2641         */
2642        @Child(name = "responseId", type = {IdType.class}, order=11, min=0, max=1, modifier=false, summary=false)
2643        @Description(shortDefinition="Fixture Id of mapped response", formalDefinition="The fixture id (maybe new) to map to the response." )
2644        protected IdType responseId;
2645
2646        /**
2647         * The id of the fixture used as the body of a PUT or POST request.
2648         */
2649        @Child(name = "sourceId", type = {IdType.class}, order=12, min=0, max=1, modifier=false, summary=false)
2650        @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." )
2651        protected IdType sourceId;
2652
2653        /**
2654         * Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
2655         */
2656        @Child(name = "targetId", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=false)
2657        @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." )
2658        protected IdType targetId;
2659
2660        /**
2661         * Complete request URL.
2662         */
2663        @Child(name = "url", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
2664        @Description(shortDefinition="Request URL", formalDefinition="Complete request URL." )
2665        protected StringType url;
2666
2667        private static final long serialVersionUID = -590188078L;
2668
2669    /*
2670     * Constructor
2671     */
2672      public TestScriptSetupActionOperationComponent() {
2673        super();
2674      }
2675
2676        /**
2677         * @return {@link #type} (Server interaction or operation type.)
2678         */
2679        public Coding getType() { 
2680          if (this.type == null)
2681            if (Configuration.errorOnAutoCreate())
2682              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.type");
2683            else if (Configuration.doAutoCreate())
2684              this.type = new Coding(); // cc
2685          return this.type;
2686        }
2687
2688        public boolean hasType() { 
2689          return this.type != null && !this.type.isEmpty();
2690        }
2691
2692        /**
2693         * @param value {@link #type} (Server interaction or operation type.)
2694         */
2695        public TestScriptSetupActionOperationComponent setType(Coding value) { 
2696          this.type = value;
2697          return this;
2698        }
2699
2700        /**
2701         * @return {@link #resource} (The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
2702         */
2703        public CodeType getResourceElement() { 
2704          if (this.resource == null)
2705            if (Configuration.errorOnAutoCreate())
2706              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.resource");
2707            else if (Configuration.doAutoCreate())
2708              this.resource = new CodeType(); // bb
2709          return this.resource;
2710        }
2711
2712        public boolean hasResourceElement() { 
2713          return this.resource != null && !this.resource.isEmpty();
2714        }
2715
2716        public boolean hasResource() { 
2717          return this.resource != null && !this.resource.isEmpty();
2718        }
2719
2720        /**
2721         * @param value {@link #resource} (The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
2722         */
2723        public TestScriptSetupActionOperationComponent setResourceElement(CodeType value) { 
2724          this.resource = value;
2725          return this;
2726        }
2727
2728        /**
2729         * @return The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
2730         */
2731        public String getResource() { 
2732          return this.resource == null ? null : this.resource.getValue();
2733        }
2734
2735        /**
2736         * @param value The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
2737         */
2738        public TestScriptSetupActionOperationComponent setResource(String value) { 
2739          if (Utilities.noString(value))
2740            this.resource = null;
2741          else {
2742            if (this.resource == null)
2743              this.resource = new CodeType();
2744            this.resource.setValue(value);
2745          }
2746          return this;
2747        }
2748
2749        /**
2750         * @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
2751         */
2752        public StringType getLabelElement() { 
2753          if (this.label == null)
2754            if (Configuration.errorOnAutoCreate())
2755              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.label");
2756            else if (Configuration.doAutoCreate())
2757              this.label = new StringType(); // bb
2758          return this.label;
2759        }
2760
2761        public boolean hasLabelElement() { 
2762          return this.label != null && !this.label.isEmpty();
2763        }
2764
2765        public boolean hasLabel() { 
2766          return this.label != null && !this.label.isEmpty();
2767        }
2768
2769        /**
2770         * @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
2771         */
2772        public TestScriptSetupActionOperationComponent setLabelElement(StringType value) { 
2773          this.label = value;
2774          return this;
2775        }
2776
2777        /**
2778         * @return The label would be used for tracking/logging purposes by test engines.
2779         */
2780        public String getLabel() { 
2781          return this.label == null ? null : this.label.getValue();
2782        }
2783
2784        /**
2785         * @param value The label would be used for tracking/logging purposes by test engines.
2786         */
2787        public TestScriptSetupActionOperationComponent setLabel(String value) { 
2788          if (Utilities.noString(value))
2789            this.label = null;
2790          else {
2791            if (this.label == null)
2792              this.label = new StringType();
2793            this.label.setValue(value);
2794          }
2795          return this;
2796        }
2797
2798        /**
2799         * @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
2800         */
2801        public StringType getDescriptionElement() { 
2802          if (this.description == null)
2803            if (Configuration.errorOnAutoCreate())
2804              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.description");
2805            else if (Configuration.doAutoCreate())
2806              this.description = new StringType(); // bb
2807          return this.description;
2808        }
2809
2810        public boolean hasDescriptionElement() { 
2811          return this.description != null && !this.description.isEmpty();
2812        }
2813
2814        public boolean hasDescription() { 
2815          return this.description != null && !this.description.isEmpty();
2816        }
2817
2818        /**
2819         * @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
2820         */
2821        public TestScriptSetupActionOperationComponent setDescriptionElement(StringType value) { 
2822          this.description = value;
2823          return this;
2824        }
2825
2826        /**
2827         * @return The description would be used by test engines for tracking and reporting purposes.
2828         */
2829        public String getDescription() { 
2830          return this.description == null ? null : this.description.getValue();
2831        }
2832
2833        /**
2834         * @param value The description would be used by test engines for tracking and reporting purposes.
2835         */
2836        public TestScriptSetupActionOperationComponent setDescription(String value) { 
2837          if (Utilities.noString(value))
2838            this.description = null;
2839          else {
2840            if (this.description == null)
2841              this.description = new StringType();
2842            this.description.setValue(value);
2843          }
2844          return this;
2845        }
2846
2847        /**
2848         * @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
2849         */
2850        public Enumeration<ContentType> getAcceptElement() { 
2851          if (this.accept == null)
2852            if (Configuration.errorOnAutoCreate())
2853              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.accept");
2854            else if (Configuration.doAutoCreate())
2855              this.accept = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
2856          return this.accept;
2857        }
2858
2859        public boolean hasAcceptElement() { 
2860          return this.accept != null && !this.accept.isEmpty();
2861        }
2862
2863        public boolean hasAccept() { 
2864          return this.accept != null && !this.accept.isEmpty();
2865        }
2866
2867        /**
2868         * @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
2869         */
2870        public TestScriptSetupActionOperationComponent setAcceptElement(Enumeration<ContentType> value) { 
2871          this.accept = value;
2872          return this;
2873        }
2874
2875        /**
2876         * @return The content-type or mime-type to use for RESTful operation in the 'Accept' header.
2877         */
2878        public ContentType getAccept() { 
2879          return this.accept == null ? null : this.accept.getValue();
2880        }
2881
2882        /**
2883         * @param value The content-type or mime-type to use for RESTful operation in the 'Accept' header.
2884         */
2885        public TestScriptSetupActionOperationComponent setAccept(ContentType value) { 
2886          if (value == null)
2887            this.accept = null;
2888          else {
2889            if (this.accept == null)
2890              this.accept = new Enumeration<ContentType>(new ContentTypeEnumFactory());
2891            this.accept.setValue(value);
2892          }
2893          return this;
2894        }
2895
2896        /**
2897         * @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
2898         */
2899        public Enumeration<ContentType> getContentTypeElement() { 
2900          if (this.contentType == null)
2901            if (Configuration.errorOnAutoCreate())
2902              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.contentType");
2903            else if (Configuration.doAutoCreate())
2904              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
2905          return this.contentType;
2906        }
2907
2908        public boolean hasContentTypeElement() { 
2909          return this.contentType != null && !this.contentType.isEmpty();
2910        }
2911
2912        public boolean hasContentType() { 
2913          return this.contentType != null && !this.contentType.isEmpty();
2914        }
2915
2916        /**
2917         * @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
2918         */
2919        public TestScriptSetupActionOperationComponent setContentTypeElement(Enumeration<ContentType> value) { 
2920          this.contentType = value;
2921          return this;
2922        }
2923
2924        /**
2925         * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
2926         */
2927        public ContentType getContentType() { 
2928          return this.contentType == null ? null : this.contentType.getValue();
2929        }
2930
2931        /**
2932         * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
2933         */
2934        public TestScriptSetupActionOperationComponent setContentType(ContentType value) { 
2935          if (value == null)
2936            this.contentType = null;
2937          else {
2938            if (this.contentType == null)
2939              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory());
2940            this.contentType.setValue(value);
2941          }
2942          return this;
2943        }
2944
2945        /**
2946         * @return {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
2947         */
2948        public IntegerType getDestinationElement() { 
2949          if (this.destination == null)
2950            if (Configuration.errorOnAutoCreate())
2951              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.destination");
2952            else if (Configuration.doAutoCreate())
2953              this.destination = new IntegerType(); // bb
2954          return this.destination;
2955        }
2956
2957        public boolean hasDestinationElement() { 
2958          return this.destination != null && !this.destination.isEmpty();
2959        }
2960
2961        public boolean hasDestination() { 
2962          return this.destination != null && !this.destination.isEmpty();
2963        }
2964
2965        /**
2966         * @param value {@link #destination} (Which server to perform the operation on.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value
2967         */
2968        public TestScriptSetupActionOperationComponent setDestinationElement(IntegerType value) { 
2969          this.destination = value;
2970          return this;
2971        }
2972
2973        /**
2974         * @return Which server to perform the operation on.
2975         */
2976        public int getDestination() { 
2977          return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue();
2978        }
2979
2980        /**
2981         * @param value Which server to perform the operation on.
2982         */
2983        public TestScriptSetupActionOperationComponent setDestination(int value) { 
2984            if (this.destination == null)
2985              this.destination = new IntegerType();
2986            this.destination.setValue(value);
2987          return this;
2988        }
2989
2990        /**
2991         * @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
2992         */
2993        public BooleanType getEncodeRequestUrlElement() { 
2994          if (this.encodeRequestUrl == null)
2995            if (Configuration.errorOnAutoCreate())
2996              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.encodeRequestUrl");
2997            else if (Configuration.doAutoCreate())
2998              this.encodeRequestUrl = new BooleanType(); // bb
2999          return this.encodeRequestUrl;
3000        }
3001
3002        public boolean hasEncodeRequestUrlElement() { 
3003          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
3004        }
3005
3006        public boolean hasEncodeRequestUrl() { 
3007          return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty();
3008        }
3009
3010        /**
3011         * @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
3012         */
3013        public TestScriptSetupActionOperationComponent setEncodeRequestUrlElement(BooleanType value) { 
3014          this.encodeRequestUrl = value;
3015          return this;
3016        }
3017
3018        /**
3019         * @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.
3020         */
3021        public boolean getEncodeRequestUrl() { 
3022          return this.encodeRequestUrl == null || this.encodeRequestUrl.isEmpty() ? false : this.encodeRequestUrl.getValue();
3023        }
3024
3025        /**
3026         * @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.
3027         */
3028        public TestScriptSetupActionOperationComponent setEncodeRequestUrl(boolean value) { 
3029            if (this.encodeRequestUrl == null)
3030              this.encodeRequestUrl = new BooleanType();
3031            this.encodeRequestUrl.setValue(value);
3032          return this;
3033        }
3034
3035        /**
3036         * @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
3037         */
3038        public StringType getParamsElement() { 
3039          if (this.params == null)
3040            if (Configuration.errorOnAutoCreate())
3041              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.params");
3042            else if (Configuration.doAutoCreate())
3043              this.params = new StringType(); // bb
3044          return this.params;
3045        }
3046
3047        public boolean hasParamsElement() { 
3048          return this.params != null && !this.params.isEmpty();
3049        }
3050
3051        public boolean hasParams() { 
3052          return this.params != null && !this.params.isEmpty();
3053        }
3054
3055        /**
3056         * @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
3057         */
3058        public TestScriptSetupActionOperationComponent setParamsElement(StringType value) { 
3059          this.params = value;
3060          return this;
3061        }
3062
3063        /**
3064         * @return Path plus parameters after [type].  Used to set parts of the request URL explicitly.
3065         */
3066        public String getParams() { 
3067          return this.params == null ? null : this.params.getValue();
3068        }
3069
3070        /**
3071         * @param value Path plus parameters after [type].  Used to set parts of the request URL explicitly.
3072         */
3073        public TestScriptSetupActionOperationComponent setParams(String value) { 
3074          if (Utilities.noString(value))
3075            this.params = null;
3076          else {
3077            if (this.params == null)
3078              this.params = new StringType();
3079            this.params.setValue(value);
3080          }
3081          return this;
3082        }
3083
3084        /**
3085         * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.)
3086         */
3087        public List<TestScriptSetupActionOperationRequestHeaderComponent> getRequestHeader() { 
3088          if (this.requestHeader == null)
3089            this.requestHeader = new ArrayList<TestScriptSetupActionOperationRequestHeaderComponent>();
3090          return this.requestHeader;
3091        }
3092
3093        public boolean hasRequestHeader() { 
3094          if (this.requestHeader == null)
3095            return false;
3096          for (TestScriptSetupActionOperationRequestHeaderComponent item : this.requestHeader)
3097            if (!item.isEmpty())
3098              return true;
3099          return false;
3100        }
3101
3102        /**
3103         * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.)
3104         */
3105    // syntactic sugar
3106        public TestScriptSetupActionOperationRequestHeaderComponent addRequestHeader() { //3
3107          TestScriptSetupActionOperationRequestHeaderComponent t = new TestScriptSetupActionOperationRequestHeaderComponent();
3108          if (this.requestHeader == null)
3109            this.requestHeader = new ArrayList<TestScriptSetupActionOperationRequestHeaderComponent>();
3110          this.requestHeader.add(t);
3111          return t;
3112        }
3113
3114    // syntactic sugar
3115        public TestScriptSetupActionOperationComponent addRequestHeader(TestScriptSetupActionOperationRequestHeaderComponent t) { //3
3116          if (t == null)
3117            return this;
3118          if (this.requestHeader == null)
3119            this.requestHeader = new ArrayList<TestScriptSetupActionOperationRequestHeaderComponent>();
3120          this.requestHeader.add(t);
3121          return this;
3122        }
3123
3124        /**
3125         * @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
3126         */
3127        public IdType getResponseIdElement() { 
3128          if (this.responseId == null)
3129            if (Configuration.errorOnAutoCreate())
3130              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.responseId");
3131            else if (Configuration.doAutoCreate())
3132              this.responseId = new IdType(); // bb
3133          return this.responseId;
3134        }
3135
3136        public boolean hasResponseIdElement() { 
3137          return this.responseId != null && !this.responseId.isEmpty();
3138        }
3139
3140        public boolean hasResponseId() { 
3141          return this.responseId != null && !this.responseId.isEmpty();
3142        }
3143
3144        /**
3145         * @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
3146         */
3147        public TestScriptSetupActionOperationComponent setResponseIdElement(IdType value) { 
3148          this.responseId = value;
3149          return this;
3150        }
3151
3152        /**
3153         * @return The fixture id (maybe new) to map to the response.
3154         */
3155        public String getResponseId() { 
3156          return this.responseId == null ? null : this.responseId.getValue();
3157        }
3158
3159        /**
3160         * @param value The fixture id (maybe new) to map to the response.
3161         */
3162        public TestScriptSetupActionOperationComponent setResponseId(String value) { 
3163          if (Utilities.noString(value))
3164            this.responseId = null;
3165          else {
3166            if (this.responseId == null)
3167              this.responseId = new IdType();
3168            this.responseId.setValue(value);
3169          }
3170          return this;
3171        }
3172
3173        /**
3174         * @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
3175         */
3176        public IdType getSourceIdElement() { 
3177          if (this.sourceId == null)
3178            if (Configuration.errorOnAutoCreate())
3179              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.sourceId");
3180            else if (Configuration.doAutoCreate())
3181              this.sourceId = new IdType(); // bb
3182          return this.sourceId;
3183        }
3184
3185        public boolean hasSourceIdElement() { 
3186          return this.sourceId != null && !this.sourceId.isEmpty();
3187        }
3188
3189        public boolean hasSourceId() { 
3190          return this.sourceId != null && !this.sourceId.isEmpty();
3191        }
3192
3193        /**
3194         * @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
3195         */
3196        public TestScriptSetupActionOperationComponent setSourceIdElement(IdType value) { 
3197          this.sourceId = value;
3198          return this;
3199        }
3200
3201        /**
3202         * @return The id of the fixture used as the body of a PUT or POST request.
3203         */
3204        public String getSourceId() { 
3205          return this.sourceId == null ? null : this.sourceId.getValue();
3206        }
3207
3208        /**
3209         * @param value The id of the fixture used as the body of a PUT or POST request.
3210         */
3211        public TestScriptSetupActionOperationComponent setSourceId(String value) { 
3212          if (Utilities.noString(value))
3213            this.sourceId = null;
3214          else {
3215            if (this.sourceId == null)
3216              this.sourceId = new IdType();
3217            this.sourceId.setValue(value);
3218          }
3219          return this;
3220        }
3221
3222        /**
3223         * @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
3224         */
3225        public IdType getTargetIdElement() { 
3226          if (this.targetId == null)
3227            if (Configuration.errorOnAutoCreate())
3228              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.targetId");
3229            else if (Configuration.doAutoCreate())
3230              this.targetId = new IdType(); // bb
3231          return this.targetId;
3232        }
3233
3234        public boolean hasTargetIdElement() { 
3235          return this.targetId != null && !this.targetId.isEmpty();
3236        }
3237
3238        public boolean hasTargetId() { 
3239          return this.targetId != null && !this.targetId.isEmpty();
3240        }
3241
3242        /**
3243         * @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
3244         */
3245        public TestScriptSetupActionOperationComponent setTargetIdElement(IdType value) { 
3246          this.targetId = value;
3247          return this;
3248        }
3249
3250        /**
3251         * @return Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
3252         */
3253        public String getTargetId() { 
3254          return this.targetId == null ? null : this.targetId.getValue();
3255        }
3256
3257        /**
3258         * @param value Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.
3259         */
3260        public TestScriptSetupActionOperationComponent setTargetId(String value) { 
3261          if (Utilities.noString(value))
3262            this.targetId = null;
3263          else {
3264            if (this.targetId == null)
3265              this.targetId = new IdType();
3266            this.targetId.setValue(value);
3267          }
3268          return this;
3269        }
3270
3271        /**
3272         * @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
3273         */
3274        public StringType getUrlElement() { 
3275          if (this.url == null)
3276            if (Configuration.errorOnAutoCreate())
3277              throw new Error("Attempt to auto-create TestScriptSetupActionOperationComponent.url");
3278            else if (Configuration.doAutoCreate())
3279              this.url = new StringType(); // bb
3280          return this.url;
3281        }
3282
3283        public boolean hasUrlElement() { 
3284          return this.url != null && !this.url.isEmpty();
3285        }
3286
3287        public boolean hasUrl() { 
3288          return this.url != null && !this.url.isEmpty();
3289        }
3290
3291        /**
3292         * @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
3293         */
3294        public TestScriptSetupActionOperationComponent setUrlElement(StringType value) { 
3295          this.url = value;
3296          return this;
3297        }
3298
3299        /**
3300         * @return Complete request URL.
3301         */
3302        public String getUrl() { 
3303          return this.url == null ? null : this.url.getValue();
3304        }
3305
3306        /**
3307         * @param value Complete request URL.
3308         */
3309        public TestScriptSetupActionOperationComponent setUrl(String value) { 
3310          if (Utilities.noString(value))
3311            this.url = null;
3312          else {
3313            if (this.url == null)
3314              this.url = new StringType();
3315            this.url.setValue(value);
3316          }
3317          return this;
3318        }
3319
3320        protected void listChildren(List<Property> childrenList) {
3321          super.listChildren(childrenList);
3322          childrenList.add(new Property("type", "Coding", "Server interaction or operation type.", 0, java.lang.Integer.MAX_VALUE, type));
3323          childrenList.add(new Property("resource", "code", "The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource));
3324          childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label));
3325          childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description));
3326          childrenList.add(new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, java.lang.Integer.MAX_VALUE, accept));
3327          childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType));
3328          childrenList.add(new Property("destination", "integer", "Which server to perform the operation on.", 0, java.lang.Integer.MAX_VALUE, destination));
3329          childrenList.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, java.lang.Integer.MAX_VALUE, encodeRequestUrl));
3330          childrenList.add(new Property("params", "string", "Path plus parameters after [type].  Used to set parts of the request URL explicitly.", 0, java.lang.Integer.MAX_VALUE, params));
3331          childrenList.add(new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader));
3332          childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId));
3333          childrenList.add(new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, java.lang.Integer.MAX_VALUE, sourceId));
3334          childrenList.add(new Property("targetId", "id", "Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.", 0, java.lang.Integer.MAX_VALUE, targetId));
3335          childrenList.add(new Property("url", "string", "Complete request URL.", 0, java.lang.Integer.MAX_VALUE, url));
3336        }
3337
3338      @Override
3339      public void setProperty(String name, Base value) throws FHIRException {
3340        if (name.equals("type"))
3341          this.type = castToCoding(value); // Coding
3342        else if (name.equals("resource"))
3343          this.resource = castToCode(value); // CodeType
3344        else if (name.equals("label"))
3345          this.label = castToString(value); // StringType
3346        else if (name.equals("description"))
3347          this.description = castToString(value); // StringType
3348        else if (name.equals("accept"))
3349          this.accept = new ContentTypeEnumFactory().fromType(value); // Enumeration<ContentType>
3350        else if (name.equals("contentType"))
3351          this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration<ContentType>
3352        else if (name.equals("destination"))
3353          this.destination = castToInteger(value); // IntegerType
3354        else if (name.equals("encodeRequestUrl"))
3355          this.encodeRequestUrl = castToBoolean(value); // BooleanType
3356        else if (name.equals("params"))
3357          this.params = castToString(value); // StringType
3358        else if (name.equals("requestHeader"))
3359          this.getRequestHeader().add((TestScriptSetupActionOperationRequestHeaderComponent) value);
3360        else if (name.equals("responseId"))
3361          this.responseId = castToId(value); // IdType
3362        else if (name.equals("sourceId"))
3363          this.sourceId = castToId(value); // IdType
3364        else if (name.equals("targetId"))
3365          this.targetId = castToId(value); // IdType
3366        else if (name.equals("url"))
3367          this.url = castToString(value); // StringType
3368        else
3369          super.setProperty(name, value);
3370      }
3371
3372      @Override
3373      public Base addChild(String name) throws FHIRException {
3374        if (name.equals("type")) {
3375          this.type = new Coding();
3376          return this.type;
3377        }
3378        else if (name.equals("resource")) {
3379          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
3380        }
3381        else if (name.equals("label")) {
3382          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
3383        }
3384        else if (name.equals("description")) {
3385          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
3386        }
3387        else if (name.equals("accept")) {
3388          throw new FHIRException("Cannot call addChild on a primitive type TestScript.accept");
3389        }
3390        else if (name.equals("contentType")) {
3391          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
3392        }
3393        else if (name.equals("destination")) {
3394          throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination");
3395        }
3396        else if (name.equals("encodeRequestUrl")) {
3397          throw new FHIRException("Cannot call addChild on a primitive type TestScript.encodeRequestUrl");
3398        }
3399        else if (name.equals("params")) {
3400          throw new FHIRException("Cannot call addChild on a primitive type TestScript.params");
3401        }
3402        else if (name.equals("requestHeader")) {
3403          return addRequestHeader();
3404        }
3405        else if (name.equals("responseId")) {
3406          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseId");
3407        }
3408        else if (name.equals("sourceId")) {
3409          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
3410        }
3411        else if (name.equals("targetId")) {
3412          throw new FHIRException("Cannot call addChild on a primitive type TestScript.targetId");
3413        }
3414        else if (name.equals("url")) {
3415          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
3416        }
3417        else
3418          return super.addChild(name);
3419      }
3420
3421      public TestScriptSetupActionOperationComponent copy() {
3422        TestScriptSetupActionOperationComponent dst = new TestScriptSetupActionOperationComponent();
3423        copyValues(dst);
3424        dst.type = type == null ? null : type.copy();
3425        dst.resource = resource == null ? null : resource.copy();
3426        dst.label = label == null ? null : label.copy();
3427        dst.description = description == null ? null : description.copy();
3428        dst.accept = accept == null ? null : accept.copy();
3429        dst.contentType = contentType == null ? null : contentType.copy();
3430        dst.destination = destination == null ? null : destination.copy();
3431        dst.encodeRequestUrl = encodeRequestUrl == null ? null : encodeRequestUrl.copy();
3432        dst.params = params == null ? null : params.copy();
3433        if (requestHeader != null) {
3434          dst.requestHeader = new ArrayList<TestScriptSetupActionOperationRequestHeaderComponent>();
3435          for (TestScriptSetupActionOperationRequestHeaderComponent i : requestHeader)
3436            dst.requestHeader.add(i.copy());
3437        };
3438        dst.responseId = responseId == null ? null : responseId.copy();
3439        dst.sourceId = sourceId == null ? null : sourceId.copy();
3440        dst.targetId = targetId == null ? null : targetId.copy();
3441        dst.url = url == null ? null : url.copy();
3442        return dst;
3443      }
3444
3445      @Override
3446      public boolean equalsDeep(Base other) {
3447        if (!super.equalsDeep(other))
3448          return false;
3449        if (!(other instanceof TestScriptSetupActionOperationComponent))
3450          return false;
3451        TestScriptSetupActionOperationComponent o = (TestScriptSetupActionOperationComponent) other;
3452        return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true) && compareDeep(label, o.label, true)
3453           && compareDeep(description, o.description, true) && compareDeep(accept, o.accept, true) && compareDeep(contentType, o.contentType, true)
3454           && compareDeep(destination, o.destination, true) && compareDeep(encodeRequestUrl, o.encodeRequestUrl, true)
3455           && compareDeep(params, o.params, true) && compareDeep(requestHeader, o.requestHeader, true) && compareDeep(responseId, o.responseId, true)
3456           && compareDeep(sourceId, o.sourceId, true) && compareDeep(targetId, o.targetId, true) && compareDeep(url, o.url, true)
3457          ;
3458      }
3459
3460      @Override
3461      public boolean equalsShallow(Base other) {
3462        if (!super.equalsShallow(other))
3463          return false;
3464        if (!(other instanceof TestScriptSetupActionOperationComponent))
3465          return false;
3466        TestScriptSetupActionOperationComponent o = (TestScriptSetupActionOperationComponent) other;
3467        return compareValues(resource, o.resource, true) && compareValues(label, o.label, true) && compareValues(description, o.description, true)
3468           && compareValues(accept, o.accept, true) && compareValues(contentType, o.contentType, true) && compareValues(destination, o.destination, true)
3469           && compareValues(encodeRequestUrl, o.encodeRequestUrl, true) && compareValues(params, o.params, true)
3470           && compareValues(responseId, o.responseId, true) && compareValues(sourceId, o.sourceId, true) && compareValues(targetId, o.targetId, true)
3471           && compareValues(url, o.url, true);
3472      }
3473
3474      public boolean isEmpty() {
3475        return super.isEmpty() && (type == null || type.isEmpty()) && (resource == null || resource.isEmpty())
3476           && (label == null || label.isEmpty()) && (description == null || description.isEmpty()) && (accept == null || accept.isEmpty())
3477           && (contentType == null || contentType.isEmpty()) && (destination == null || destination.isEmpty())
3478           && (encodeRequestUrl == null || encodeRequestUrl.isEmpty()) && (params == null || params.isEmpty())
3479           && (requestHeader == null || requestHeader.isEmpty()) && (responseId == null || responseId.isEmpty())
3480           && (sourceId == null || sourceId.isEmpty()) && (targetId == null || targetId.isEmpty()) && (url == null || url.isEmpty())
3481          ;
3482      }
3483
3484  public String fhirType() {
3485    return "TestScript.setup.action.operation";
3486
3487  }
3488
3489  }
3490
3491    @Block()
3492    public static class TestScriptSetupActionOperationRequestHeaderComponent extends BackboneElement implements IBaseBackboneElement {
3493        /**
3494         * The HTTP header field e.g. "Accept".
3495         */
3496        @Child(name = "field", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false)
3497        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field e.g. \"Accept\"." )
3498        protected StringType field;
3499
3500        /**
3501         * The value of the header e.g. "application/xml".
3502         */
3503        @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false)
3504        @Description(shortDefinition="HTTP headerfield value", formalDefinition="The value of the header e.g. \"application/xml\"." )
3505        protected StringType value;
3506
3507        private static final long serialVersionUID = 274395337L;
3508
3509    /*
3510     * Constructor
3511     */
3512      public TestScriptSetupActionOperationRequestHeaderComponent() {
3513        super();
3514      }
3515
3516    /*
3517     * Constructor
3518     */
3519      public TestScriptSetupActionOperationRequestHeaderComponent(StringType field, StringType value) {
3520        super();
3521        this.field = field;
3522        this.value = value;
3523      }
3524
3525        /**
3526         * @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
3527         */
3528        public StringType getFieldElement() { 
3529          if (this.field == null)
3530            if (Configuration.errorOnAutoCreate())
3531              throw new Error("Attempt to auto-create TestScriptSetupActionOperationRequestHeaderComponent.field");
3532            else if (Configuration.doAutoCreate())
3533              this.field = new StringType(); // bb
3534          return this.field;
3535        }
3536
3537        public boolean hasFieldElement() { 
3538          return this.field != null && !this.field.isEmpty();
3539        }
3540
3541        public boolean hasField() { 
3542          return this.field != null && !this.field.isEmpty();
3543        }
3544
3545        /**
3546         * @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
3547         */
3548        public TestScriptSetupActionOperationRequestHeaderComponent setFieldElement(StringType value) { 
3549          this.field = value;
3550          return this;
3551        }
3552
3553        /**
3554         * @return The HTTP header field e.g. "Accept".
3555         */
3556        public String getField() { 
3557          return this.field == null ? null : this.field.getValue();
3558        }
3559
3560        /**
3561         * @param value The HTTP header field e.g. "Accept".
3562         */
3563        public TestScriptSetupActionOperationRequestHeaderComponent setField(String value) { 
3564            if (this.field == null)
3565              this.field = new StringType();
3566            this.field.setValue(value);
3567          return this;
3568        }
3569
3570        /**
3571         * @return {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3572         */
3573        public StringType getValueElement() { 
3574          if (this.value == null)
3575            if (Configuration.errorOnAutoCreate())
3576              throw new Error("Attempt to auto-create TestScriptSetupActionOperationRequestHeaderComponent.value");
3577            else if (Configuration.doAutoCreate())
3578              this.value = new StringType(); // bb
3579          return this.value;
3580        }
3581
3582        public boolean hasValueElement() { 
3583          return this.value != null && !this.value.isEmpty();
3584        }
3585
3586        public boolean hasValue() { 
3587          return this.value != null && !this.value.isEmpty();
3588        }
3589
3590        /**
3591         * @param value {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
3592         */
3593        public TestScriptSetupActionOperationRequestHeaderComponent setValueElement(StringType value) { 
3594          this.value = value;
3595          return this;
3596        }
3597
3598        /**
3599         * @return The value of the header e.g. "application/xml".
3600         */
3601        public String getValue() { 
3602          return this.value == null ? null : this.value.getValue();
3603        }
3604
3605        /**
3606         * @param value The value of the header e.g. "application/xml".
3607         */
3608        public TestScriptSetupActionOperationRequestHeaderComponent setValue(String value) { 
3609            if (this.value == null)
3610              this.value = new StringType();
3611            this.value.setValue(value);
3612          return this;
3613        }
3614
3615        protected void listChildren(List<Property> childrenList) {
3616          super.listChildren(childrenList);
3617          childrenList.add(new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, java.lang.Integer.MAX_VALUE, field));
3618          childrenList.add(new Property("value", "string", "The value of the header e.g. \"application/xml\".", 0, java.lang.Integer.MAX_VALUE, value));
3619        }
3620
3621      @Override
3622      public void setProperty(String name, Base value) throws FHIRException {
3623        if (name.equals("field"))
3624          this.field = castToString(value); // StringType
3625        else if (name.equals("value"))
3626          this.value = castToString(value); // StringType
3627        else
3628          super.setProperty(name, value);
3629      }
3630
3631      @Override
3632      public Base addChild(String name) throws FHIRException {
3633        if (name.equals("field")) {
3634          throw new FHIRException("Cannot call addChild on a primitive type TestScript.field");
3635        }
3636        else if (name.equals("value")) {
3637          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
3638        }
3639        else
3640          return super.addChild(name);
3641      }
3642
3643      public TestScriptSetupActionOperationRequestHeaderComponent copy() {
3644        TestScriptSetupActionOperationRequestHeaderComponent dst = new TestScriptSetupActionOperationRequestHeaderComponent();
3645        copyValues(dst);
3646        dst.field = field == null ? null : field.copy();
3647        dst.value = value == null ? null : value.copy();
3648        return dst;
3649      }
3650
3651      @Override
3652      public boolean equalsDeep(Base other) {
3653        if (!super.equalsDeep(other))
3654          return false;
3655        if (!(other instanceof TestScriptSetupActionOperationRequestHeaderComponent))
3656          return false;
3657        TestScriptSetupActionOperationRequestHeaderComponent o = (TestScriptSetupActionOperationRequestHeaderComponent) other;
3658        return compareDeep(field, o.field, true) && compareDeep(value, o.value, true);
3659      }
3660
3661      @Override
3662      public boolean equalsShallow(Base other) {
3663        if (!super.equalsShallow(other))
3664          return false;
3665        if (!(other instanceof TestScriptSetupActionOperationRequestHeaderComponent))
3666          return false;
3667        TestScriptSetupActionOperationRequestHeaderComponent o = (TestScriptSetupActionOperationRequestHeaderComponent) other;
3668        return compareValues(field, o.field, true) && compareValues(value, o.value, true);
3669      }
3670
3671      public boolean isEmpty() {
3672        return super.isEmpty() && (field == null || field.isEmpty()) && (value == null || value.isEmpty())
3673          ;
3674      }
3675
3676  public String fhirType() {
3677    return "TestScript.setup.action.operation.requestHeader";
3678
3679  }
3680
3681  }
3682
3683    @Block()
3684    public static class TestScriptSetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement {
3685        /**
3686         * The label would be used for tracking/logging purposes by test engines.
3687         */
3688        @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
3689        @Description(shortDefinition="Tracking/logging assertion label", formalDefinition="The label would be used for tracking/logging purposes by test engines." )
3690        protected StringType label;
3691
3692        /**
3693         * The description would be used by test engines for tracking and reporting purposes.
3694         */
3695        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
3696        @Description(shortDefinition="Tracking/reporting assertion description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." )
3697        protected StringType description;
3698
3699        /**
3700         * The direction to use for the assertion.
3701         */
3702        @Child(name = "direction", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false)
3703        @Description(shortDefinition="response | request", formalDefinition="The direction to use for the assertion." )
3704        protected Enumeration<AssertionDirectionType> direction;
3705
3706        /**
3707         * Id of fixture used to compare the "sourceId/path" evaluations to.
3708         */
3709        @Child(name = "compareToSourceId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false)
3710        @Description(shortDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to." )
3711        protected StringType compareToSourceId;
3712
3713        /**
3714         * XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.
3715         */
3716        @Child(name = "compareToSourcePath", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
3717        @Description(shortDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to." )
3718        protected StringType compareToSourcePath;
3719
3720        /**
3721         * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
3722         */
3723        @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false)
3724        @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." )
3725        protected Enumeration<ContentType> contentType;
3726
3727        /**
3728         * The HTTP header field name e.g. 'Location'.
3729         */
3730        @Child(name = "headerField", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false)
3731        @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field name e.g. 'Location'." )
3732        protected StringType headerField;
3733
3734        /**
3735         * The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.
3736         */
3737        @Child(name = "minimumId", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false)
3738        @Description(shortDefinition="Fixture Id of minimum content resource", formalDefinition="The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId." )
3739        protected StringType minimumId;
3740
3741        /**
3742         * Whether or not the test execution performs validation on the bundle navigation links.
3743         */
3744        @Child(name = "navigationLinks", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false)
3745        @Description(shortDefinition="Perform validation on navigation links?", formalDefinition="Whether or not the test execution performs validation on the bundle navigation links." )
3746        protected BooleanType navigationLinks;
3747
3748        /**
3749         * The operator type.
3750         */
3751        @Child(name = "operator", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=false)
3752        @Description(shortDefinition="equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains", formalDefinition="The operator type." )
3753        protected Enumeration<AssertionOperatorType> operator;
3754
3755        /**
3756         * The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
3757         */
3758        @Child(name = "path", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
3759        @Description(shortDefinition="XPath or JSONPath expression", formalDefinition="The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server." )
3760        protected StringType path;
3761
3762        /**
3763         * The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
3764         */
3765        @Child(name = "resource", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false)
3766        @Description(shortDefinition="Resource type", formalDefinition="The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html." )
3767        protected CodeType resource;
3768
3769        /**
3770         * okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
3771         */
3772        @Child(name = "response", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false)
3773        @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." )
3774        protected Enumeration<AssertionResponseTypes> response;
3775
3776        /**
3777         * The value of the HTTP response code to be tested.
3778         */
3779        @Child(name = "responseCode", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false)
3780        @Description(shortDefinition="HTTP response code to test", formalDefinition="The value of the HTTP response code to be tested." )
3781        protected StringType responseCode;
3782
3783        /**
3784         * Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
3785         */
3786        @Child(name = "sourceId", type = {IdType.class}, order=15, min=0, max=1, modifier=false, summary=false)
3787        @Description(shortDefinition="Fixture Id of source expression or headerField", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField  against." )
3788        protected IdType sourceId;
3789
3790        /**
3791         * The ID of the Profile to validate against.
3792         */
3793        @Child(name = "validateProfileId", type = {IdType.class}, order=16, min=0, max=1, modifier=false, summary=false)
3794        @Description(shortDefinition="Profile Id of validation profile reference", formalDefinition="The ID of the Profile to validate against." )
3795        protected IdType validateProfileId;
3796
3797        /**
3798         * The value to compare to.
3799         */
3800        @Child(name = "value", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false)
3801        @Description(shortDefinition="The value to compare to", formalDefinition="The value to compare to." )
3802        protected StringType value;
3803
3804        /**
3805         * Whether or not the test execution will produce a warning only on error for this assert.
3806         */
3807        @Child(name = "warningOnly", type = {BooleanType.class}, order=18, min=0, max=1, modifier=false, summary=false)
3808        @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." )
3809        protected BooleanType warningOnly;
3810
3811        private static final long serialVersionUID = -607939856L;
3812
3813    /*
3814     * Constructor
3815     */
3816      public TestScriptSetupActionAssertComponent() {
3817        super();
3818      }
3819
3820        /**
3821         * @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
3822         */
3823        public StringType getLabelElement() { 
3824          if (this.label == null)
3825            if (Configuration.errorOnAutoCreate())
3826              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.label");
3827            else if (Configuration.doAutoCreate())
3828              this.label = new StringType(); // bb
3829          return this.label;
3830        }
3831
3832        public boolean hasLabelElement() { 
3833          return this.label != null && !this.label.isEmpty();
3834        }
3835
3836        public boolean hasLabel() { 
3837          return this.label != null && !this.label.isEmpty();
3838        }
3839
3840        /**
3841         * @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
3842         */
3843        public TestScriptSetupActionAssertComponent setLabelElement(StringType value) { 
3844          this.label = value;
3845          return this;
3846        }
3847
3848        /**
3849         * @return The label would be used for tracking/logging purposes by test engines.
3850         */
3851        public String getLabel() { 
3852          return this.label == null ? null : this.label.getValue();
3853        }
3854
3855        /**
3856         * @param value The label would be used for tracking/logging purposes by test engines.
3857         */
3858        public TestScriptSetupActionAssertComponent setLabel(String value) { 
3859          if (Utilities.noString(value))
3860            this.label = null;
3861          else {
3862            if (this.label == null)
3863              this.label = new StringType();
3864            this.label.setValue(value);
3865          }
3866          return this;
3867        }
3868
3869        /**
3870         * @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
3871         */
3872        public StringType getDescriptionElement() { 
3873          if (this.description == null)
3874            if (Configuration.errorOnAutoCreate())
3875              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.description");
3876            else if (Configuration.doAutoCreate())
3877              this.description = new StringType(); // bb
3878          return this.description;
3879        }
3880
3881        public boolean hasDescriptionElement() { 
3882          return this.description != null && !this.description.isEmpty();
3883        }
3884
3885        public boolean hasDescription() { 
3886          return this.description != null && !this.description.isEmpty();
3887        }
3888
3889        /**
3890         * @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
3891         */
3892        public TestScriptSetupActionAssertComponent setDescriptionElement(StringType value) { 
3893          this.description = value;
3894          return this;
3895        }
3896
3897        /**
3898         * @return The description would be used by test engines for tracking and reporting purposes.
3899         */
3900        public String getDescription() { 
3901          return this.description == null ? null : this.description.getValue();
3902        }
3903
3904        /**
3905         * @param value The description would be used by test engines for tracking and reporting purposes.
3906         */
3907        public TestScriptSetupActionAssertComponent setDescription(String value) { 
3908          if (Utilities.noString(value))
3909            this.description = null;
3910          else {
3911            if (this.description == null)
3912              this.description = new StringType();
3913            this.description.setValue(value);
3914          }
3915          return this;
3916        }
3917
3918        /**
3919         * @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
3920         */
3921        public Enumeration<AssertionDirectionType> getDirectionElement() { 
3922          if (this.direction == null)
3923            if (Configuration.errorOnAutoCreate())
3924              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.direction");
3925            else if (Configuration.doAutoCreate())
3926              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory()); // bb
3927          return this.direction;
3928        }
3929
3930        public boolean hasDirectionElement() { 
3931          return this.direction != null && !this.direction.isEmpty();
3932        }
3933
3934        public boolean hasDirection() { 
3935          return this.direction != null && !this.direction.isEmpty();
3936        }
3937
3938        /**
3939         * @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
3940         */
3941        public TestScriptSetupActionAssertComponent setDirectionElement(Enumeration<AssertionDirectionType> value) { 
3942          this.direction = value;
3943          return this;
3944        }
3945
3946        /**
3947         * @return The direction to use for the assertion.
3948         */
3949        public AssertionDirectionType getDirection() { 
3950          return this.direction == null ? null : this.direction.getValue();
3951        }
3952
3953        /**
3954         * @param value The direction to use for the assertion.
3955         */
3956        public TestScriptSetupActionAssertComponent setDirection(AssertionDirectionType value) { 
3957          if (value == null)
3958            this.direction = null;
3959          else {
3960            if (this.direction == null)
3961              this.direction = new Enumeration<AssertionDirectionType>(new AssertionDirectionTypeEnumFactory());
3962            this.direction.setValue(value);
3963          }
3964          return this;
3965        }
3966
3967        /**
3968         * @return {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value
3969         */
3970        public StringType getCompareToSourceIdElement() { 
3971          if (this.compareToSourceId == null)
3972            if (Configuration.errorOnAutoCreate())
3973              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.compareToSourceId");
3974            else if (Configuration.doAutoCreate())
3975              this.compareToSourceId = new StringType(); // bb
3976          return this.compareToSourceId;
3977        }
3978
3979        public boolean hasCompareToSourceIdElement() { 
3980          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
3981        }
3982
3983        public boolean hasCompareToSourceId() { 
3984          return this.compareToSourceId != null && !this.compareToSourceId.isEmpty();
3985        }
3986
3987        /**
3988         * @param value {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value
3989         */
3990        public TestScriptSetupActionAssertComponent setCompareToSourceIdElement(StringType value) { 
3991          this.compareToSourceId = value;
3992          return this;
3993        }
3994
3995        /**
3996         * @return Id of fixture used to compare the "sourceId/path" evaluations to.
3997         */
3998        public String getCompareToSourceId() { 
3999          return this.compareToSourceId == null ? null : this.compareToSourceId.getValue();
4000        }
4001
4002        /**
4003         * @param value Id of fixture used to compare the "sourceId/path" evaluations to.
4004         */
4005        public TestScriptSetupActionAssertComponent setCompareToSourceId(String value) { 
4006          if (Utilities.noString(value))
4007            this.compareToSourceId = null;
4008          else {
4009            if (this.compareToSourceId == null)
4010              this.compareToSourceId = new StringType();
4011            this.compareToSourceId.setValue(value);
4012          }
4013          return this;
4014        }
4015
4016        /**
4017         * @return {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value
4018         */
4019        public StringType getCompareToSourcePathElement() { 
4020          if (this.compareToSourcePath == null)
4021            if (Configuration.errorOnAutoCreate())
4022              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.compareToSourcePath");
4023            else if (Configuration.doAutoCreate())
4024              this.compareToSourcePath = new StringType(); // bb
4025          return this.compareToSourcePath;
4026        }
4027
4028        public boolean hasCompareToSourcePathElement() { 
4029          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
4030        }
4031
4032        public boolean hasCompareToSourcePath() { 
4033          return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty();
4034        }
4035
4036        /**
4037         * @param value {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value
4038         */
4039        public TestScriptSetupActionAssertComponent setCompareToSourcePathElement(StringType value) { 
4040          this.compareToSourcePath = value;
4041          return this;
4042        }
4043
4044        /**
4045         * @return XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.
4046         */
4047        public String getCompareToSourcePath() { 
4048          return this.compareToSourcePath == null ? null : this.compareToSourcePath.getValue();
4049        }
4050
4051        /**
4052         * @param value XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.
4053         */
4054        public TestScriptSetupActionAssertComponent setCompareToSourcePath(String value) { 
4055          if (Utilities.noString(value))
4056            this.compareToSourcePath = null;
4057          else {
4058            if (this.compareToSourcePath == null)
4059              this.compareToSourcePath = new StringType();
4060            this.compareToSourcePath.setValue(value);
4061          }
4062          return this;
4063        }
4064
4065        /**
4066         * @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
4067         */
4068        public Enumeration<ContentType> getContentTypeElement() { 
4069          if (this.contentType == null)
4070            if (Configuration.errorOnAutoCreate())
4071              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.contentType");
4072            else if (Configuration.doAutoCreate())
4073              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory()); // bb
4074          return this.contentType;
4075        }
4076
4077        public boolean hasContentTypeElement() { 
4078          return this.contentType != null && !this.contentType.isEmpty();
4079        }
4080
4081        public boolean hasContentType() { 
4082          return this.contentType != null && !this.contentType.isEmpty();
4083        }
4084
4085        /**
4086         * @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
4087         */
4088        public TestScriptSetupActionAssertComponent setContentTypeElement(Enumeration<ContentType> value) { 
4089          this.contentType = value;
4090          return this;
4091        }
4092
4093        /**
4094         * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
4095         */
4096        public ContentType getContentType() { 
4097          return this.contentType == null ? null : this.contentType.getValue();
4098        }
4099
4100        /**
4101         * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.
4102         */
4103        public TestScriptSetupActionAssertComponent setContentType(ContentType value) { 
4104          if (value == null)
4105            this.contentType = null;
4106          else {
4107            if (this.contentType == null)
4108              this.contentType = new Enumeration<ContentType>(new ContentTypeEnumFactory());
4109            this.contentType.setValue(value);
4110          }
4111          return this;
4112        }
4113
4114        /**
4115         * @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
4116         */
4117        public StringType getHeaderFieldElement() { 
4118          if (this.headerField == null)
4119            if (Configuration.errorOnAutoCreate())
4120              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.headerField");
4121            else if (Configuration.doAutoCreate())
4122              this.headerField = new StringType(); // bb
4123          return this.headerField;
4124        }
4125
4126        public boolean hasHeaderFieldElement() { 
4127          return this.headerField != null && !this.headerField.isEmpty();
4128        }
4129
4130        public boolean hasHeaderField() { 
4131          return this.headerField != null && !this.headerField.isEmpty();
4132        }
4133
4134        /**
4135         * @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
4136         */
4137        public TestScriptSetupActionAssertComponent setHeaderFieldElement(StringType value) { 
4138          this.headerField = value;
4139          return this;
4140        }
4141
4142        /**
4143         * @return The HTTP header field name e.g. 'Location'.
4144         */
4145        public String getHeaderField() { 
4146          return this.headerField == null ? null : this.headerField.getValue();
4147        }
4148
4149        /**
4150         * @param value The HTTP header field name e.g. 'Location'.
4151         */
4152        public TestScriptSetupActionAssertComponent setHeaderField(String value) { 
4153          if (Utilities.noString(value))
4154            this.headerField = null;
4155          else {
4156            if (this.headerField == null)
4157              this.headerField = new StringType();
4158            this.headerField.setValue(value);
4159          }
4160          return this;
4161        }
4162
4163        /**
4164         * @return {@link #minimumId} (The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value
4165         */
4166        public StringType getMinimumIdElement() { 
4167          if (this.minimumId == null)
4168            if (Configuration.errorOnAutoCreate())
4169              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.minimumId");
4170            else if (Configuration.doAutoCreate())
4171              this.minimumId = new StringType(); // bb
4172          return this.minimumId;
4173        }
4174
4175        public boolean hasMinimumIdElement() { 
4176          return this.minimumId != null && !this.minimumId.isEmpty();
4177        }
4178
4179        public boolean hasMinimumId() { 
4180          return this.minimumId != null && !this.minimumId.isEmpty();
4181        }
4182
4183        /**
4184         * @param value {@link #minimumId} (The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value
4185         */
4186        public TestScriptSetupActionAssertComponent setMinimumIdElement(StringType value) { 
4187          this.minimumId = value;
4188          return this;
4189        }
4190
4191        /**
4192         * @return The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.
4193         */
4194        public String getMinimumId() { 
4195          return this.minimumId == null ? null : this.minimumId.getValue();
4196        }
4197
4198        /**
4199         * @param value The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.
4200         */
4201        public TestScriptSetupActionAssertComponent setMinimumId(String value) { 
4202          if (Utilities.noString(value))
4203            this.minimumId = null;
4204          else {
4205            if (this.minimumId == null)
4206              this.minimumId = new StringType();
4207            this.minimumId.setValue(value);
4208          }
4209          return this;
4210        }
4211
4212        /**
4213         * @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
4214         */
4215        public BooleanType getNavigationLinksElement() { 
4216          if (this.navigationLinks == null)
4217            if (Configuration.errorOnAutoCreate())
4218              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.navigationLinks");
4219            else if (Configuration.doAutoCreate())
4220              this.navigationLinks = new BooleanType(); // bb
4221          return this.navigationLinks;
4222        }
4223
4224        public boolean hasNavigationLinksElement() { 
4225          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
4226        }
4227
4228        public boolean hasNavigationLinks() { 
4229          return this.navigationLinks != null && !this.navigationLinks.isEmpty();
4230        }
4231
4232        /**
4233         * @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
4234         */
4235        public TestScriptSetupActionAssertComponent setNavigationLinksElement(BooleanType value) { 
4236          this.navigationLinks = value;
4237          return this;
4238        }
4239
4240        /**
4241         * @return Whether or not the test execution performs validation on the bundle navigation links.
4242         */
4243        public boolean getNavigationLinks() { 
4244          return this.navigationLinks == null || this.navigationLinks.isEmpty() ? false : this.navigationLinks.getValue();
4245        }
4246
4247        /**
4248         * @param value Whether or not the test execution performs validation on the bundle navigation links.
4249         */
4250        public TestScriptSetupActionAssertComponent setNavigationLinks(boolean value) { 
4251            if (this.navigationLinks == null)
4252              this.navigationLinks = new BooleanType();
4253            this.navigationLinks.setValue(value);
4254          return this;
4255        }
4256
4257        /**
4258         * @return {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value
4259         */
4260        public Enumeration<AssertionOperatorType> getOperatorElement() { 
4261          if (this.operator == null)
4262            if (Configuration.errorOnAutoCreate())
4263              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.operator");
4264            else if (Configuration.doAutoCreate())
4265              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory()); // bb
4266          return this.operator;
4267        }
4268
4269        public boolean hasOperatorElement() { 
4270          return this.operator != null && !this.operator.isEmpty();
4271        }
4272
4273        public boolean hasOperator() { 
4274          return this.operator != null && !this.operator.isEmpty();
4275        }
4276
4277        /**
4278         * @param value {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value
4279         */
4280        public TestScriptSetupActionAssertComponent setOperatorElement(Enumeration<AssertionOperatorType> value) { 
4281          this.operator = value;
4282          return this;
4283        }
4284
4285        /**
4286         * @return The operator type.
4287         */
4288        public AssertionOperatorType getOperator() { 
4289          return this.operator == null ? null : this.operator.getValue();
4290        }
4291
4292        /**
4293         * @param value The operator type.
4294         */
4295        public TestScriptSetupActionAssertComponent setOperator(AssertionOperatorType value) { 
4296          if (value == null)
4297            this.operator = null;
4298          else {
4299            if (this.operator == null)
4300              this.operator = new Enumeration<AssertionOperatorType>(new AssertionOperatorTypeEnumFactory());
4301            this.operator.setValue(value);
4302          }
4303          return this;
4304        }
4305
4306        /**
4307         * @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
4308         */
4309        public StringType getPathElement() { 
4310          if (this.path == null)
4311            if (Configuration.errorOnAutoCreate())
4312              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.path");
4313            else if (Configuration.doAutoCreate())
4314              this.path = new StringType(); // bb
4315          return this.path;
4316        }
4317
4318        public boolean hasPathElement() { 
4319          return this.path != null && !this.path.isEmpty();
4320        }
4321
4322        public boolean hasPath() { 
4323          return this.path != null && !this.path.isEmpty();
4324        }
4325
4326        /**
4327         * @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
4328         */
4329        public TestScriptSetupActionAssertComponent setPathElement(StringType value) { 
4330          this.path = value;
4331          return this;
4332        }
4333
4334        /**
4335         * @return The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
4336         */
4337        public String getPath() { 
4338          return this.path == null ? null : this.path.getValue();
4339        }
4340
4341        /**
4342         * @param value The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.
4343         */
4344        public TestScriptSetupActionAssertComponent setPath(String value) { 
4345          if (Utilities.noString(value))
4346            this.path = null;
4347          else {
4348            if (this.path == null)
4349              this.path = new StringType();
4350            this.path.setValue(value);
4351          }
4352          return this;
4353        }
4354
4355        /**
4356         * @return {@link #resource} (The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
4357         */
4358        public CodeType getResourceElement() { 
4359          if (this.resource == null)
4360            if (Configuration.errorOnAutoCreate())
4361              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.resource");
4362            else if (Configuration.doAutoCreate())
4363              this.resource = new CodeType(); // bb
4364          return this.resource;
4365        }
4366
4367        public boolean hasResourceElement() { 
4368          return this.resource != null && !this.resource.isEmpty();
4369        }
4370
4371        public boolean hasResource() { 
4372          return this.resource != null && !this.resource.isEmpty();
4373        }
4374
4375        /**
4376         * @param value {@link #resource} (The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value
4377         */
4378        public TestScriptSetupActionAssertComponent setResourceElement(CodeType value) { 
4379          this.resource = value;
4380          return this;
4381        }
4382
4383        /**
4384         * @return The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
4385         */
4386        public String getResource() { 
4387          return this.resource == null ? null : this.resource.getValue();
4388        }
4389
4390        /**
4391         * @param value The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.
4392         */
4393        public TestScriptSetupActionAssertComponent setResource(String value) { 
4394          if (Utilities.noString(value))
4395            this.resource = null;
4396          else {
4397            if (this.resource == null)
4398              this.resource = new CodeType();
4399            this.resource.setValue(value);
4400          }
4401          return this;
4402        }
4403
4404        /**
4405         * @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
4406         */
4407        public Enumeration<AssertionResponseTypes> getResponseElement() { 
4408          if (this.response == null)
4409            if (Configuration.errorOnAutoCreate())
4410              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.response");
4411            else if (Configuration.doAutoCreate())
4412              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory()); // bb
4413          return this.response;
4414        }
4415
4416        public boolean hasResponseElement() { 
4417          return this.response != null && !this.response.isEmpty();
4418        }
4419
4420        public boolean hasResponse() { 
4421          return this.response != null && !this.response.isEmpty();
4422        }
4423
4424        /**
4425         * @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
4426         */
4427        public TestScriptSetupActionAssertComponent setResponseElement(Enumeration<AssertionResponseTypes> value) { 
4428          this.response = value;
4429          return this;
4430        }
4431
4432        /**
4433         * @return okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
4434         */
4435        public AssertionResponseTypes getResponse() { 
4436          return this.response == null ? null : this.response.getValue();
4437        }
4438
4439        /**
4440         * @param value okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.
4441         */
4442        public TestScriptSetupActionAssertComponent setResponse(AssertionResponseTypes value) { 
4443          if (value == null)
4444            this.response = null;
4445          else {
4446            if (this.response == null)
4447              this.response = new Enumeration<AssertionResponseTypes>(new AssertionResponseTypesEnumFactory());
4448            this.response.setValue(value);
4449          }
4450          return this;
4451        }
4452
4453        /**
4454         * @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
4455         */
4456        public StringType getResponseCodeElement() { 
4457          if (this.responseCode == null)
4458            if (Configuration.errorOnAutoCreate())
4459              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.responseCode");
4460            else if (Configuration.doAutoCreate())
4461              this.responseCode = new StringType(); // bb
4462          return this.responseCode;
4463        }
4464
4465        public boolean hasResponseCodeElement() { 
4466          return this.responseCode != null && !this.responseCode.isEmpty();
4467        }
4468
4469        public boolean hasResponseCode() { 
4470          return this.responseCode != null && !this.responseCode.isEmpty();
4471        }
4472
4473        /**
4474         * @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
4475         */
4476        public TestScriptSetupActionAssertComponent setResponseCodeElement(StringType value) { 
4477          this.responseCode = value;
4478          return this;
4479        }
4480
4481        /**
4482         * @return The value of the HTTP response code to be tested.
4483         */
4484        public String getResponseCode() { 
4485          return this.responseCode == null ? null : this.responseCode.getValue();
4486        }
4487
4488        /**
4489         * @param value The value of the HTTP response code to be tested.
4490         */
4491        public TestScriptSetupActionAssertComponent setResponseCode(String value) { 
4492          if (Utilities.noString(value))
4493            this.responseCode = null;
4494          else {
4495            if (this.responseCode == null)
4496              this.responseCode = new StringType();
4497            this.responseCode.setValue(value);
4498          }
4499          return this;
4500        }
4501
4502        /**
4503         * @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
4504         */
4505        public IdType getSourceIdElement() { 
4506          if (this.sourceId == null)
4507            if (Configuration.errorOnAutoCreate())
4508              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.sourceId");
4509            else if (Configuration.doAutoCreate())
4510              this.sourceId = new IdType(); // bb
4511          return this.sourceId;
4512        }
4513
4514        public boolean hasSourceIdElement() { 
4515          return this.sourceId != null && !this.sourceId.isEmpty();
4516        }
4517
4518        public boolean hasSourceId() { 
4519          return this.sourceId != null && !this.sourceId.isEmpty();
4520        }
4521
4522        /**
4523         * @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
4524         */
4525        public TestScriptSetupActionAssertComponent setSourceIdElement(IdType value) { 
4526          this.sourceId = value;
4527          return this;
4528        }
4529
4530        /**
4531         * @return Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
4532         */
4533        public String getSourceId() { 
4534          return this.sourceId == null ? null : this.sourceId.getValue();
4535        }
4536
4537        /**
4538         * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField  against.
4539         */
4540        public TestScriptSetupActionAssertComponent setSourceId(String value) { 
4541          if (Utilities.noString(value))
4542            this.sourceId = null;
4543          else {
4544            if (this.sourceId == null)
4545              this.sourceId = new IdType();
4546            this.sourceId.setValue(value);
4547          }
4548          return this;
4549        }
4550
4551        /**
4552         * @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
4553         */
4554        public IdType getValidateProfileIdElement() { 
4555          if (this.validateProfileId == null)
4556            if (Configuration.errorOnAutoCreate())
4557              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.validateProfileId");
4558            else if (Configuration.doAutoCreate())
4559              this.validateProfileId = new IdType(); // bb
4560          return this.validateProfileId;
4561        }
4562
4563        public boolean hasValidateProfileIdElement() { 
4564          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
4565        }
4566
4567        public boolean hasValidateProfileId() { 
4568          return this.validateProfileId != null && !this.validateProfileId.isEmpty();
4569        }
4570
4571        /**
4572         * @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
4573         */
4574        public TestScriptSetupActionAssertComponent setValidateProfileIdElement(IdType value) { 
4575          this.validateProfileId = value;
4576          return this;
4577        }
4578
4579        /**
4580         * @return The ID of the Profile to validate against.
4581         */
4582        public String getValidateProfileId() { 
4583          return this.validateProfileId == null ? null : this.validateProfileId.getValue();
4584        }
4585
4586        /**
4587         * @param value The ID of the Profile to validate against.
4588         */
4589        public TestScriptSetupActionAssertComponent setValidateProfileId(String value) { 
4590          if (Utilities.noString(value))
4591            this.validateProfileId = null;
4592          else {
4593            if (this.validateProfileId == null)
4594              this.validateProfileId = new IdType();
4595            this.validateProfileId.setValue(value);
4596          }
4597          return this;
4598        }
4599
4600        /**
4601         * @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
4602         */
4603        public StringType getValueElement() { 
4604          if (this.value == null)
4605            if (Configuration.errorOnAutoCreate())
4606              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.value");
4607            else if (Configuration.doAutoCreate())
4608              this.value = new StringType(); // bb
4609          return this.value;
4610        }
4611
4612        public boolean hasValueElement() { 
4613          return this.value != null && !this.value.isEmpty();
4614        }
4615
4616        public boolean hasValue() { 
4617          return this.value != null && !this.value.isEmpty();
4618        }
4619
4620        /**
4621         * @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
4622         */
4623        public TestScriptSetupActionAssertComponent setValueElement(StringType value) { 
4624          this.value = value;
4625          return this;
4626        }
4627
4628        /**
4629         * @return The value to compare to.
4630         */
4631        public String getValue() { 
4632          return this.value == null ? null : this.value.getValue();
4633        }
4634
4635        /**
4636         * @param value The value to compare to.
4637         */
4638        public TestScriptSetupActionAssertComponent setValue(String value) { 
4639          if (Utilities.noString(value))
4640            this.value = null;
4641          else {
4642            if (this.value == null)
4643              this.value = new StringType();
4644            this.value.setValue(value);
4645          }
4646          return this;
4647        }
4648
4649        /**
4650         * @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
4651         */
4652        public BooleanType getWarningOnlyElement() { 
4653          if (this.warningOnly == null)
4654            if (Configuration.errorOnAutoCreate())
4655              throw new Error("Attempt to auto-create TestScriptSetupActionAssertComponent.warningOnly");
4656            else if (Configuration.doAutoCreate())
4657              this.warningOnly = new BooleanType(); // bb
4658          return this.warningOnly;
4659        }
4660
4661        public boolean hasWarningOnlyElement() { 
4662          return this.warningOnly != null && !this.warningOnly.isEmpty();
4663        }
4664
4665        public boolean hasWarningOnly() { 
4666          return this.warningOnly != null && !this.warningOnly.isEmpty();
4667        }
4668
4669        /**
4670         * @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
4671         */
4672        public TestScriptSetupActionAssertComponent setWarningOnlyElement(BooleanType value) { 
4673          this.warningOnly = value;
4674          return this;
4675        }
4676
4677        /**
4678         * @return Whether or not the test execution will produce a warning only on error for this assert.
4679         */
4680        public boolean getWarningOnly() { 
4681          return this.warningOnly == null || this.warningOnly.isEmpty() ? false : this.warningOnly.getValue();
4682        }
4683
4684        /**
4685         * @param value Whether or not the test execution will produce a warning only on error for this assert.
4686         */
4687        public TestScriptSetupActionAssertComponent setWarningOnly(boolean value) { 
4688            if (this.warningOnly == null)
4689              this.warningOnly = new BooleanType();
4690            this.warningOnly.setValue(value);
4691          return this;
4692        }
4693
4694        protected void listChildren(List<Property> childrenList) {
4695          super.listChildren(childrenList);
4696          childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label));
4697          childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description));
4698          childrenList.add(new Property("direction", "code", "The direction to use for the assertion.", 0, java.lang.Integer.MAX_VALUE, direction));
4699          childrenList.add(new Property("compareToSourceId", "string", "Id of fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourceId));
4700          childrenList.add(new Property("compareToSourcePath", "string", "XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourcePath));
4701          childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType));
4702          childrenList.add(new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, java.lang.Integer.MAX_VALUE, headerField));
4703          childrenList.add(new Property("minimumId", "string", "The ID of a fixture.  Asserts that the response contains at a minimumId the fixture specified by minimumId.", 0, java.lang.Integer.MAX_VALUE, minimumId));
4704          childrenList.add(new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, java.lang.Integer.MAX_VALUE, navigationLinks));
4705          childrenList.add(new Property("operator", "code", "The operator type.", 0, java.lang.Integer.MAX_VALUE, operator));
4706          childrenList.add(new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, java.lang.Integer.MAX_VALUE, path));
4707          childrenList.add(new Property("resource", "code", "The type of the resource.  See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource));
4708          childrenList.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, java.lang.Integer.MAX_VALUE, response));
4709          childrenList.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, java.lang.Integer.MAX_VALUE, responseCode));
4710          childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField  against.", 0, java.lang.Integer.MAX_VALUE, sourceId));
4711          childrenList.add(new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, java.lang.Integer.MAX_VALUE, validateProfileId));
4712          childrenList.add(new Property("value", "string", "The value to compare to.", 0, java.lang.Integer.MAX_VALUE, value));
4713          childrenList.add(new Property("warningOnly", "boolean", "Whether or not the test execution will produce a warning only on error for this assert.", 0, java.lang.Integer.MAX_VALUE, warningOnly));
4714        }
4715
4716      @Override
4717      public void setProperty(String name, Base value) throws FHIRException {
4718        if (name.equals("label"))
4719          this.label = castToString(value); // StringType
4720        else if (name.equals("description"))
4721          this.description = castToString(value); // StringType
4722        else if (name.equals("direction"))
4723          this.direction = new AssertionDirectionTypeEnumFactory().fromType(value); // Enumeration<AssertionDirectionType>
4724        else if (name.equals("compareToSourceId"))
4725          this.compareToSourceId = castToString(value); // StringType
4726        else if (name.equals("compareToSourcePath"))
4727          this.compareToSourcePath = castToString(value); // StringType
4728        else if (name.equals("contentType"))
4729          this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration<ContentType>
4730        else if (name.equals("headerField"))
4731          this.headerField = castToString(value); // StringType
4732        else if (name.equals("minimumId"))
4733          this.minimumId = castToString(value); // StringType
4734        else if (name.equals("navigationLinks"))
4735          this.navigationLinks = castToBoolean(value); // BooleanType
4736        else if (name.equals("operator"))
4737          this.operator = new AssertionOperatorTypeEnumFactory().fromType(value); // Enumeration<AssertionOperatorType>
4738        else if (name.equals("path"))
4739          this.path = castToString(value); // StringType
4740        else if (name.equals("resource"))
4741          this.resource = castToCode(value); // CodeType
4742        else if (name.equals("response"))
4743          this.response = new AssertionResponseTypesEnumFactory().fromType(value); // Enumeration<AssertionResponseTypes>
4744        else if (name.equals("responseCode"))
4745          this.responseCode = castToString(value); // StringType
4746        else if (name.equals("sourceId"))
4747          this.sourceId = castToId(value); // IdType
4748        else if (name.equals("validateProfileId"))
4749          this.validateProfileId = castToId(value); // IdType
4750        else if (name.equals("value"))
4751          this.value = castToString(value); // StringType
4752        else if (name.equals("warningOnly"))
4753          this.warningOnly = castToBoolean(value); // BooleanType
4754        else
4755          super.setProperty(name, value);
4756      }
4757
4758      @Override
4759      public Base addChild(String name) throws FHIRException {
4760        if (name.equals("label")) {
4761          throw new FHIRException("Cannot call addChild on a primitive type TestScript.label");
4762        }
4763        else if (name.equals("description")) {
4764          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
4765        }
4766        else if (name.equals("direction")) {
4767          throw new FHIRException("Cannot call addChild on a primitive type TestScript.direction");
4768        }
4769        else if (name.equals("compareToSourceId")) {
4770          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceId");
4771        }
4772        else if (name.equals("compareToSourcePath")) {
4773          throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourcePath");
4774        }
4775        else if (name.equals("contentType")) {
4776          throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType");
4777        }
4778        else if (name.equals("headerField")) {
4779          throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField");
4780        }
4781        else if (name.equals("minimumId")) {
4782          throw new FHIRException("Cannot call addChild on a primitive type TestScript.minimumId");
4783        }
4784        else if (name.equals("navigationLinks")) {
4785          throw new FHIRException("Cannot call addChild on a primitive type TestScript.navigationLinks");
4786        }
4787        else if (name.equals("operator")) {
4788          throw new FHIRException("Cannot call addChild on a primitive type TestScript.operator");
4789        }
4790        else if (name.equals("path")) {
4791          throw new FHIRException("Cannot call addChild on a primitive type TestScript.path");
4792        }
4793        else if (name.equals("resource")) {
4794          throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource");
4795        }
4796        else if (name.equals("response")) {
4797          throw new FHIRException("Cannot call addChild on a primitive type TestScript.response");
4798        }
4799        else if (name.equals("responseCode")) {
4800          throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseCode");
4801        }
4802        else if (name.equals("sourceId")) {
4803          throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId");
4804        }
4805        else if (name.equals("validateProfileId")) {
4806          throw new FHIRException("Cannot call addChild on a primitive type TestScript.validateProfileId");
4807        }
4808        else if (name.equals("value")) {
4809          throw new FHIRException("Cannot call addChild on a primitive type TestScript.value");
4810        }
4811        else if (name.equals("warningOnly")) {
4812          throw new FHIRException("Cannot call addChild on a primitive type TestScript.warningOnly");
4813        }
4814        else
4815          return super.addChild(name);
4816      }
4817
4818      public TestScriptSetupActionAssertComponent copy() {
4819        TestScriptSetupActionAssertComponent dst = new TestScriptSetupActionAssertComponent();
4820        copyValues(dst);
4821        dst.label = label == null ? null : label.copy();
4822        dst.description = description == null ? null : description.copy();
4823        dst.direction = direction == null ? null : direction.copy();
4824        dst.compareToSourceId = compareToSourceId == null ? null : compareToSourceId.copy();
4825        dst.compareToSourcePath = compareToSourcePath == null ? null : compareToSourcePath.copy();
4826        dst.contentType = contentType == null ? null : contentType.copy();
4827        dst.headerField = headerField == null ? null : headerField.copy();
4828        dst.minimumId = minimumId == null ? null : minimumId.copy();
4829        dst.navigationLinks = navigationLinks == null ? null : navigationLinks.copy();
4830        dst.operator = operator == null ? null : operator.copy();
4831        dst.path = path == null ? null : path.copy();
4832        dst.resource = resource == null ? null : resource.copy();
4833        dst.response = response == null ? null : response.copy();
4834        dst.responseCode = responseCode == null ? null : responseCode.copy();
4835        dst.sourceId = sourceId == null ? null : sourceId.copy();
4836        dst.validateProfileId = validateProfileId == null ? null : validateProfileId.copy();
4837        dst.value = value == null ? null : value.copy();
4838        dst.warningOnly = warningOnly == null ? null : warningOnly.copy();
4839        return dst;
4840      }
4841
4842      @Override
4843      public boolean equalsDeep(Base other) {
4844        if (!super.equalsDeep(other))
4845          return false;
4846        if (!(other instanceof TestScriptSetupActionAssertComponent))
4847          return false;
4848        TestScriptSetupActionAssertComponent o = (TestScriptSetupActionAssertComponent) other;
4849        return compareDeep(label, o.label, true) && compareDeep(description, o.description, true) && compareDeep(direction, o.direction, true)
4850           && compareDeep(compareToSourceId, o.compareToSourceId, true) && compareDeep(compareToSourcePath, o.compareToSourcePath, true)
4851           && compareDeep(contentType, o.contentType, true) && compareDeep(headerField, o.headerField, true)
4852           && compareDeep(minimumId, o.minimumId, true) && compareDeep(navigationLinks, o.navigationLinks, true)
4853           && compareDeep(operator, o.operator, true) && compareDeep(path, o.path, true) && compareDeep(resource, o.resource, true)
4854           && compareDeep(response, o.response, true) && compareDeep(responseCode, o.responseCode, true) && compareDeep(sourceId, o.sourceId, true)
4855           && compareDeep(validateProfileId, o.validateProfileId, true) && compareDeep(value, o.value, true)
4856           && compareDeep(warningOnly, o.warningOnly, true);
4857      }
4858
4859      @Override
4860      public boolean equalsShallow(Base other) {
4861        if (!super.equalsShallow(other))
4862          return false;
4863        if (!(other instanceof TestScriptSetupActionAssertComponent))
4864          return false;
4865        TestScriptSetupActionAssertComponent o = (TestScriptSetupActionAssertComponent) other;
4866        return compareValues(label, o.label, true) && compareValues(description, o.description, true) && compareValues(direction, o.direction, true)
4867           && compareValues(compareToSourceId, o.compareToSourceId, true) && compareValues(compareToSourcePath, o.compareToSourcePath, true)
4868           && compareValues(contentType, o.contentType, true) && compareValues(headerField, o.headerField, true)
4869           && compareValues(minimumId, o.minimumId, true) && compareValues(navigationLinks, o.navigationLinks, true)
4870           && compareValues(operator, o.operator, true) && compareValues(path, o.path, true) && compareValues(resource, o.resource, true)
4871           && compareValues(response, o.response, true) && compareValues(responseCode, o.responseCode, true) && compareValues(sourceId, o.sourceId, true)
4872           && compareValues(validateProfileId, o.validateProfileId, true) && compareValues(value, o.value, true)
4873           && compareValues(warningOnly, o.warningOnly, true);
4874      }
4875
4876      public boolean isEmpty() {
4877        return super.isEmpty() && (label == null || label.isEmpty()) && (description == null || description.isEmpty())
4878           && (direction == null || direction.isEmpty()) && (compareToSourceId == null || compareToSourceId.isEmpty())
4879           && (compareToSourcePath == null || compareToSourcePath.isEmpty()) && (contentType == null || contentType.isEmpty())
4880           && (headerField == null || headerField.isEmpty()) && (minimumId == null || minimumId.isEmpty())
4881           && (navigationLinks == null || navigationLinks.isEmpty()) && (operator == null || operator.isEmpty())
4882           && (path == null || path.isEmpty()) && (resource == null || resource.isEmpty()) && (response == null || response.isEmpty())
4883           && (responseCode == null || responseCode.isEmpty()) && (sourceId == null || sourceId.isEmpty())
4884           && (validateProfileId == null || validateProfileId.isEmpty()) && (value == null || value.isEmpty())
4885           && (warningOnly == null || warningOnly.isEmpty());
4886      }
4887
4888  public String fhirType() {
4889    return "TestScript.setup.action.assert";
4890
4891  }
4892
4893  }
4894
4895    @Block()
4896    public static class TestScriptTestComponent extends BackboneElement implements IBaseBackboneElement {
4897        /**
4898         * The name of this test used for tracking/logging purposes by test engines.
4899         */
4900        @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false)
4901        @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." )
4902        protected StringType name;
4903
4904        /**
4905         * A short description of the test used by test engines for tracking and reporting purposes.
4906         */
4907        @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false)
4908        @Description(shortDefinition="Tracking/reporting short description of the test", formalDefinition="A short description of the test used by test engines for tracking and reporting purposes." )
4909        protected StringType description;
4910
4911        /**
4912         * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.
4913         */
4914        @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=3, min=0, max=1, modifier=false, summary=false)
4915        @Description(shortDefinition="Capabilities  that are expected 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." )
4916        protected TestScriptMetadataComponent metadata;
4917
4918        /**
4919         * Action would contain either an operation or an assertion.
4920         */
4921        @Child(name = "action", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
4922        @Description(shortDefinition="A test operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." )
4923        protected List<TestScriptTestActionComponent> action;
4924
4925        private static final long serialVersionUID = 408339297L;
4926
4927    /*
4928     * Constructor
4929     */
4930      public TestScriptTestComponent() {
4931        super();
4932      }
4933
4934        /**
4935         * @return {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4936         */
4937        public StringType getNameElement() { 
4938          if (this.name == null)
4939            if (Configuration.errorOnAutoCreate())
4940              throw new Error("Attempt to auto-create TestScriptTestComponent.name");
4941            else if (Configuration.doAutoCreate())
4942              this.name = new StringType(); // bb
4943          return this.name;
4944        }
4945
4946        public boolean hasNameElement() { 
4947          return this.name != null && !this.name.isEmpty();
4948        }
4949
4950        public boolean hasName() { 
4951          return this.name != null && !this.name.isEmpty();
4952        }
4953
4954        /**
4955         * @param value {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
4956         */
4957        public TestScriptTestComponent setNameElement(StringType value) { 
4958          this.name = value;
4959          return this;
4960        }
4961
4962        /**
4963         * @return The name of this test used for tracking/logging purposes by test engines.
4964         */
4965        public String getName() { 
4966          return this.name == null ? null : this.name.getValue();
4967        }
4968
4969        /**
4970         * @param value The name of this test used for tracking/logging purposes by test engines.
4971         */
4972        public TestScriptTestComponent setName(String value) { 
4973          if (Utilities.noString(value))
4974            this.name = null;
4975          else {
4976            if (this.name == null)
4977              this.name = new StringType();
4978            this.name.setValue(value);
4979          }
4980          return this;
4981        }
4982
4983        /**
4984         * @return {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
4985         */
4986        public StringType getDescriptionElement() { 
4987          if (this.description == null)
4988            if (Configuration.errorOnAutoCreate())
4989              throw new Error("Attempt to auto-create TestScriptTestComponent.description");
4990            else if (Configuration.doAutoCreate())
4991              this.description = new StringType(); // bb
4992          return this.description;
4993        }
4994
4995        public boolean hasDescriptionElement() { 
4996          return this.description != null && !this.description.isEmpty();
4997        }
4998
4999        public boolean hasDescription() { 
5000          return this.description != null && !this.description.isEmpty();
5001        }
5002
5003        /**
5004         * @param value {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
5005         */
5006        public TestScriptTestComponent setDescriptionElement(StringType value) { 
5007          this.description = value;
5008          return this;
5009        }
5010
5011        /**
5012         * @return A short description of the test used by test engines for tracking and reporting purposes.
5013         */
5014        public String getDescription() { 
5015          return this.description == null ? null : this.description.getValue();
5016        }
5017
5018        /**
5019         * @param value A short description of the test used by test engines for tracking and reporting purposes.
5020         */
5021        public TestScriptTestComponent setDescription(String value) { 
5022          if (Utilities.noString(value))
5023            this.description = null;
5024          else {
5025            if (this.description == null)
5026              this.description = new StringType();
5027            this.description.setValue(value);
5028          }
5029          return this;
5030        }
5031
5032        /**
5033         * @return {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
5034         */
5035        public TestScriptMetadataComponent getMetadata() { 
5036          if (this.metadata == null)
5037            if (Configuration.errorOnAutoCreate())
5038              throw new Error("Attempt to auto-create TestScriptTestComponent.metadata");
5039            else if (Configuration.doAutoCreate())
5040              this.metadata = new TestScriptMetadataComponent(); // cc
5041          return this.metadata;
5042        }
5043
5044        public boolean hasMetadata() { 
5045          return this.metadata != null && !this.metadata.isEmpty();
5046        }
5047
5048        /**
5049         * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.)
5050         */
5051        public TestScriptTestComponent setMetadata(TestScriptMetadataComponent value) { 
5052          this.metadata = value;
5053          return this;
5054        }
5055
5056        /**
5057         * @return {@link #action} (Action would contain either an operation or an assertion.)
5058         */
5059        public List<TestScriptTestActionComponent> getAction() { 
5060          if (this.action == null)
5061            this.action = new ArrayList<TestScriptTestActionComponent>();
5062          return this.action;
5063        }
5064
5065        public boolean hasAction() { 
5066          if (this.action == null)
5067            return false;
5068          for (TestScriptTestActionComponent item : this.action)
5069            if (!item.isEmpty())
5070              return true;
5071          return false;
5072        }
5073
5074        /**
5075         * @return {@link #action} (Action would contain either an operation or an assertion.)
5076         */
5077    // syntactic sugar
5078        public TestScriptTestActionComponent addAction() { //3
5079          TestScriptTestActionComponent t = new TestScriptTestActionComponent();
5080          if (this.action == null)
5081            this.action = new ArrayList<TestScriptTestActionComponent>();
5082          this.action.add(t);
5083          return t;
5084        }
5085
5086    // syntactic sugar
5087        public TestScriptTestComponent addAction(TestScriptTestActionComponent t) { //3
5088          if (t == null)
5089            return this;
5090          if (this.action == null)
5091            this.action = new ArrayList<TestScriptTestActionComponent>();
5092          this.action.add(t);
5093          return this;
5094        }
5095
5096        protected void listChildren(List<Property> childrenList) {
5097          super.listChildren(childrenList);
5098          childrenList.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, name));
5099          childrenList.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description));
5100          childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata));
5101          childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action));
5102        }
5103
5104      @Override
5105      public void setProperty(String name, Base value) throws FHIRException {
5106        if (name.equals("name"))
5107          this.name = castToString(value); // StringType
5108        else if (name.equals("description"))
5109          this.description = castToString(value); // StringType
5110        else if (name.equals("metadata"))
5111          this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent
5112        else if (name.equals("action"))
5113          this.getAction().add((TestScriptTestActionComponent) value);
5114        else
5115          super.setProperty(name, value);
5116      }
5117
5118      @Override
5119      public Base addChild(String name) throws FHIRException {
5120        if (name.equals("name")) {
5121          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
5122        }
5123        else if (name.equals("description")) {
5124          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
5125        }
5126        else if (name.equals("metadata")) {
5127          this.metadata = new TestScriptMetadataComponent();
5128          return this.metadata;
5129        }
5130        else if (name.equals("action")) {
5131          return addAction();
5132        }
5133        else
5134          return super.addChild(name);
5135      }
5136
5137      public TestScriptTestComponent copy() {
5138        TestScriptTestComponent dst = new TestScriptTestComponent();
5139        copyValues(dst);
5140        dst.name = name == null ? null : name.copy();
5141        dst.description = description == null ? null : description.copy();
5142        dst.metadata = metadata == null ? null : metadata.copy();
5143        if (action != null) {
5144          dst.action = new ArrayList<TestScriptTestActionComponent>();
5145          for (TestScriptTestActionComponent i : action)
5146            dst.action.add(i.copy());
5147        };
5148        return dst;
5149      }
5150
5151      @Override
5152      public boolean equalsDeep(Base other) {
5153        if (!super.equalsDeep(other))
5154          return false;
5155        if (!(other instanceof TestScriptTestComponent))
5156          return false;
5157        TestScriptTestComponent o = (TestScriptTestComponent) other;
5158        return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(metadata, o.metadata, true)
5159           && compareDeep(action, o.action, true);
5160      }
5161
5162      @Override
5163      public boolean equalsShallow(Base other) {
5164        if (!super.equalsShallow(other))
5165          return false;
5166        if (!(other instanceof TestScriptTestComponent))
5167          return false;
5168        TestScriptTestComponent o = (TestScriptTestComponent) other;
5169        return compareValues(name, o.name, true) && compareValues(description, o.description, true);
5170      }
5171
5172      public boolean isEmpty() {
5173        return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty())
5174           && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty());
5175      }
5176
5177  public String fhirType() {
5178    return "TestScript.test";
5179
5180  }
5181
5182  }
5183
5184    @Block()
5185    public static class TestScriptTestActionComponent extends BackboneElement implements IBaseBackboneElement {
5186        /**
5187         * An operation would involve a REST request to a server.
5188         */
5189        @Child(name = "operation", type = {TestScriptSetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
5190        @Description(shortDefinition="The setup operation to perform", formalDefinition="An operation would involve a REST request to a server." )
5191        protected TestScriptSetupActionOperationComponent operation;
5192
5193        /**
5194         * Evaluates the results of previous operations to determine if the server under test behaves appropriately.
5195         */
5196        @Child(name = "assert", type = {TestScriptSetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false)
5197        @Description(shortDefinition="The setup assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." )
5198        protected TestScriptSetupActionAssertComponent assert_;
5199
5200        private static final long serialVersionUID = 1411550037L;
5201
5202    /*
5203     * Constructor
5204     */
5205      public TestScriptTestActionComponent() {
5206        super();
5207      }
5208
5209        /**
5210         * @return {@link #operation} (An operation would involve a REST request to a server.)
5211         */
5212        public TestScriptSetupActionOperationComponent getOperation() { 
5213          if (this.operation == null)
5214            if (Configuration.errorOnAutoCreate())
5215              throw new Error("Attempt to auto-create TestScriptTestActionComponent.operation");
5216            else if (Configuration.doAutoCreate())
5217              this.operation = new TestScriptSetupActionOperationComponent(); // cc
5218          return this.operation;
5219        }
5220
5221        public boolean hasOperation() { 
5222          return this.operation != null && !this.operation.isEmpty();
5223        }
5224
5225        /**
5226         * @param value {@link #operation} (An operation would involve a REST request to a server.)
5227         */
5228        public TestScriptTestActionComponent setOperation(TestScriptSetupActionOperationComponent value) { 
5229          this.operation = value;
5230          return this;
5231        }
5232
5233        /**
5234         * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
5235         */
5236        public TestScriptSetupActionAssertComponent getAssert() { 
5237          if (this.assert_ == null)
5238            if (Configuration.errorOnAutoCreate())
5239              throw new Error("Attempt to auto-create TestScriptTestActionComponent.assert_");
5240            else if (Configuration.doAutoCreate())
5241              this.assert_ = new TestScriptSetupActionAssertComponent(); // cc
5242          return this.assert_;
5243        }
5244
5245        public boolean hasAssert() { 
5246          return this.assert_ != null && !this.assert_.isEmpty();
5247        }
5248
5249        /**
5250         * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.)
5251         */
5252        public TestScriptTestActionComponent setAssert(TestScriptSetupActionAssertComponent value) { 
5253          this.assert_ = value;
5254          return this;
5255        }
5256
5257        protected void listChildren(List<Property> childrenList) {
5258          super.listChildren(childrenList);
5259          childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation));
5260          childrenList.add(new Property("assert", "@TestScript.setup.action.assert", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_));
5261        }
5262
5263      @Override
5264      public void setProperty(String name, Base value) throws FHIRException {
5265        if (name.equals("operation"))
5266          this.operation = (TestScriptSetupActionOperationComponent) value; // TestScriptSetupActionOperationComponent
5267        else if (name.equals("assert"))
5268          this.assert_ = (TestScriptSetupActionAssertComponent) value; // TestScriptSetupActionAssertComponent
5269        else
5270          super.setProperty(name, value);
5271      }
5272
5273      @Override
5274      public Base addChild(String name) throws FHIRException {
5275        if (name.equals("operation")) {
5276          this.operation = new TestScriptSetupActionOperationComponent();
5277          return this.operation;
5278        }
5279        else if (name.equals("assert")) {
5280          this.assert_ = new TestScriptSetupActionAssertComponent();
5281          return this.assert_;
5282        }
5283        else
5284          return super.addChild(name);
5285      }
5286
5287      public TestScriptTestActionComponent copy() {
5288        TestScriptTestActionComponent dst = new TestScriptTestActionComponent();
5289        copyValues(dst);
5290        dst.operation = operation == null ? null : operation.copy();
5291        dst.assert_ = assert_ == null ? null : assert_.copy();
5292        return dst;
5293      }
5294
5295      @Override
5296      public boolean equalsDeep(Base other) {
5297        if (!super.equalsDeep(other))
5298          return false;
5299        if (!(other instanceof TestScriptTestActionComponent))
5300          return false;
5301        TestScriptTestActionComponent o = (TestScriptTestActionComponent) other;
5302        return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true);
5303      }
5304
5305      @Override
5306      public boolean equalsShallow(Base other) {
5307        if (!super.equalsShallow(other))
5308          return false;
5309        if (!(other instanceof TestScriptTestActionComponent))
5310          return false;
5311        TestScriptTestActionComponent o = (TestScriptTestActionComponent) other;
5312        return true;
5313      }
5314
5315      public boolean isEmpty() {
5316        return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty())
5317          ;
5318      }
5319
5320  public String fhirType() {
5321    return "TestScript.test.action";
5322
5323  }
5324
5325  }
5326
5327    @Block()
5328    public static class TestScriptTeardownComponent extends BackboneElement implements IBaseBackboneElement {
5329        /**
5330         * The teardown action will only contain an operation.
5331         */
5332        @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5333        @Description(shortDefinition="One or more teardown operations to perform", formalDefinition="The teardown action will only contain an operation." )
5334        protected List<TestScriptTeardownActionComponent> action;
5335
5336        private static final long serialVersionUID = 1850225254L;
5337
5338    /*
5339     * Constructor
5340     */
5341      public TestScriptTeardownComponent() {
5342        super();
5343      }
5344
5345        /**
5346         * @return {@link #action} (The teardown action will only contain an operation.)
5347         */
5348        public List<TestScriptTeardownActionComponent> getAction() { 
5349          if (this.action == null)
5350            this.action = new ArrayList<TestScriptTeardownActionComponent>();
5351          return this.action;
5352        }
5353
5354        public boolean hasAction() { 
5355          if (this.action == null)
5356            return false;
5357          for (TestScriptTeardownActionComponent item : this.action)
5358            if (!item.isEmpty())
5359              return true;
5360          return false;
5361        }
5362
5363        /**
5364         * @return {@link #action} (The teardown action will only contain an operation.)
5365         */
5366    // syntactic sugar
5367        public TestScriptTeardownActionComponent addAction() { //3
5368          TestScriptTeardownActionComponent t = new TestScriptTeardownActionComponent();
5369          if (this.action == null)
5370            this.action = new ArrayList<TestScriptTeardownActionComponent>();
5371          this.action.add(t);
5372          return t;
5373        }
5374
5375    // syntactic sugar
5376        public TestScriptTeardownComponent addAction(TestScriptTeardownActionComponent t) { //3
5377          if (t == null)
5378            return this;
5379          if (this.action == null)
5380            this.action = new ArrayList<TestScriptTeardownActionComponent>();
5381          this.action.add(t);
5382          return this;
5383        }
5384
5385        protected void listChildren(List<Property> childrenList) {
5386          super.listChildren(childrenList);
5387          childrenList.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action));
5388        }
5389
5390      @Override
5391      public void setProperty(String name, Base value) throws FHIRException {
5392        if (name.equals("action"))
5393          this.getAction().add((TestScriptTeardownActionComponent) value);
5394        else
5395          super.setProperty(name, value);
5396      }
5397
5398      @Override
5399      public Base addChild(String name) throws FHIRException {
5400        if (name.equals("action")) {
5401          return addAction();
5402        }
5403        else
5404          return super.addChild(name);
5405      }
5406
5407      public TestScriptTeardownComponent copy() {
5408        TestScriptTeardownComponent dst = new TestScriptTeardownComponent();
5409        copyValues(dst);
5410        if (action != null) {
5411          dst.action = new ArrayList<TestScriptTeardownActionComponent>();
5412          for (TestScriptTeardownActionComponent i : action)
5413            dst.action.add(i.copy());
5414        };
5415        return dst;
5416      }
5417
5418      @Override
5419      public boolean equalsDeep(Base other) {
5420        if (!super.equalsDeep(other))
5421          return false;
5422        if (!(other instanceof TestScriptTeardownComponent))
5423          return false;
5424        TestScriptTeardownComponent o = (TestScriptTeardownComponent) other;
5425        return compareDeep(action, o.action, true);
5426      }
5427
5428      @Override
5429      public boolean equalsShallow(Base other) {
5430        if (!super.equalsShallow(other))
5431          return false;
5432        if (!(other instanceof TestScriptTeardownComponent))
5433          return false;
5434        TestScriptTeardownComponent o = (TestScriptTeardownComponent) other;
5435        return true;
5436      }
5437
5438      public boolean isEmpty() {
5439        return super.isEmpty() && (action == null || action.isEmpty());
5440      }
5441
5442  public String fhirType() {
5443    return "TestScript.teardown";
5444
5445  }
5446
5447  }
5448
5449    @Block()
5450    public static class TestScriptTeardownActionComponent extends BackboneElement implements IBaseBackboneElement {
5451        /**
5452         * An operation would involve a REST request to a server.
5453         */
5454        @Child(name = "operation", type = {TestScriptSetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false)
5455        @Description(shortDefinition="The teardown operation to perform", formalDefinition="An operation would involve a REST request to a server." )
5456        protected TestScriptSetupActionOperationComponent operation;
5457
5458        private static final long serialVersionUID = 1684092023L;
5459
5460    /*
5461     * Constructor
5462     */
5463      public TestScriptTeardownActionComponent() {
5464        super();
5465      }
5466
5467        /**
5468         * @return {@link #operation} (An operation would involve a REST request to a server.)
5469         */
5470        public TestScriptSetupActionOperationComponent getOperation() { 
5471          if (this.operation == null)
5472            if (Configuration.errorOnAutoCreate())
5473              throw new Error("Attempt to auto-create TestScriptTeardownActionComponent.operation");
5474            else if (Configuration.doAutoCreate())
5475              this.operation = new TestScriptSetupActionOperationComponent(); // cc
5476          return this.operation;
5477        }
5478
5479        public boolean hasOperation() { 
5480          return this.operation != null && !this.operation.isEmpty();
5481        }
5482
5483        /**
5484         * @param value {@link #operation} (An operation would involve a REST request to a server.)
5485         */
5486        public TestScriptTeardownActionComponent setOperation(TestScriptSetupActionOperationComponent value) { 
5487          this.operation = value;
5488          return this;
5489        }
5490
5491        protected void listChildren(List<Property> childrenList) {
5492          super.listChildren(childrenList);
5493          childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation));
5494        }
5495
5496      @Override
5497      public void setProperty(String name, Base value) throws FHIRException {
5498        if (name.equals("operation"))
5499          this.operation = (TestScriptSetupActionOperationComponent) value; // TestScriptSetupActionOperationComponent
5500        else
5501          super.setProperty(name, value);
5502      }
5503
5504      @Override
5505      public Base addChild(String name) throws FHIRException {
5506        if (name.equals("operation")) {
5507          this.operation = new TestScriptSetupActionOperationComponent();
5508          return this.operation;
5509        }
5510        else
5511          return super.addChild(name);
5512      }
5513
5514      public TestScriptTeardownActionComponent copy() {
5515        TestScriptTeardownActionComponent dst = new TestScriptTeardownActionComponent();
5516        copyValues(dst);
5517        dst.operation = operation == null ? null : operation.copy();
5518        return dst;
5519      }
5520
5521      @Override
5522      public boolean equalsDeep(Base other) {
5523        if (!super.equalsDeep(other))
5524          return false;
5525        if (!(other instanceof TestScriptTeardownActionComponent))
5526          return false;
5527        TestScriptTeardownActionComponent o = (TestScriptTeardownActionComponent) other;
5528        return compareDeep(operation, o.operation, true);
5529      }
5530
5531      @Override
5532      public boolean equalsShallow(Base other) {
5533        if (!super.equalsShallow(other))
5534          return false;
5535        if (!(other instanceof TestScriptTeardownActionComponent))
5536          return false;
5537        TestScriptTeardownActionComponent o = (TestScriptTeardownActionComponent) other;
5538        return true;
5539      }
5540
5541      public boolean isEmpty() {
5542        return super.isEmpty() && (operation == null || operation.isEmpty());
5543      }
5544
5545  public String fhirType() {
5546    return "TestScript.teardown.action";
5547
5548  }
5549
5550  }
5551
5552    /**
5553     * An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.
5554     */
5555    @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true)
5556    @Description(shortDefinition="Absolute URL used to reference this TestScript", formalDefinition="An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published." )
5557    protected UriType url;
5558
5559    /**
5560     * The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.
5561     */
5562    @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true)
5563    @Description(shortDefinition="Logical id for this version of the TestScript", formalDefinition="The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually." )
5564    protected StringType version;
5565
5566    /**
5567     * A free text natural language name identifying the TestScript.
5568     */
5569    @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true)
5570    @Description(shortDefinition="Informal name for this TestScript", formalDefinition="A free text natural language name identifying the TestScript." )
5571    protected StringType name;
5572
5573    /**
5574     * The status of the TestScript.
5575     */
5576    @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true)
5577    @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the TestScript." )
5578    protected Enumeration<ConformanceResourceStatus> status;
5579
5580    /**
5581     * Identifier for the TestScript assigned for external purposes outside the context of FHIR.
5582     */
5583    @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true)
5584    @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestScript assigned for external purposes outside the context of FHIR." )
5585    protected Identifier identifier;
5586
5587    /**
5588     * This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
5589     */
5590    @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true)
5591    @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." )
5592    protected BooleanType experimental;
5593
5594    /**
5595     * The name of the individual or organization that published the Test Script.
5596     */
5597    @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
5598    @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the Test Script." )
5599    protected StringType publisher;
5600
5601    /**
5602     * Contacts to assist a user in finding and communicating with the publisher.
5603     */
5604    @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5605    @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." )
5606    protected List<TestScriptContactComponent> contact;
5607
5608    /**
5609     * The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.
5610     */
5611    @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true)
5612    @Description(shortDefinition="Date for this version of the TestScript", formalDefinition="The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change." )
5613    protected DateTimeType date;
5614
5615    /**
5616     * A free text natural language description of the TestScript and its use.
5617     */
5618    @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true)
5619    @Description(shortDefinition="Natural language description of the TestScript", formalDefinition="A free text natural language description of the TestScript and its use." )
5620    protected StringType description;
5621
5622    /**
5623     * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.
5624     */
5625    @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
5626    @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts." )
5627    protected List<CodeableConcept> useContext;
5628
5629    /**
5630     * Explains why this Test Script is needed and why it's been constrained as it has.
5631     */
5632    @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false)
5633    @Description(shortDefinition="Scope and Usage this Test Script is for", formalDefinition="Explains why this Test Script is needed and why it's been constrained as it has." )
5634    protected StringType requirements;
5635
5636    /**
5637     * A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.
5638     */
5639    @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false)
5640    @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." )
5641    protected StringType copyright;
5642
5643    /**
5644     * The required capability must exist and are assumed to function correctly on the FHIR server being tested.
5645     */
5646    @Child(name = "metadata", type = {}, order=13, min=0, max=1, modifier=false, summary=false)
5647    @Description(shortDefinition="Required capability that is assumed to function correctly on the FHIR server being tested", formalDefinition="The required capability must exist and are assumed to function correctly on the FHIR server being tested." )
5648    protected TestScriptMetadataComponent metadata;
5649
5650    /**
5651     * If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.
5652     */
5653    @Child(name = "multiserver", type = {BooleanType.class}, order=14, min=0, max=1, modifier=false, summary=false)
5654    @Description(shortDefinition="Whether or not the tests apply to more than one FHIR server", formalDefinition="If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified." )
5655    protected BooleanType multiserver;
5656
5657    /**
5658     * Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.
5659     */
5660    @Child(name = "fixture", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5661    @Description(shortDefinition="Fixture in the test script - by reference (uri)", formalDefinition="Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute." )
5662    protected List<TestScriptFixtureComponent> fixture;
5663
5664    /**
5665     * Reference to the profile to be used for validation.
5666     */
5667    @Child(name = "profile", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5668    @Description(shortDefinition="Reference of the validation profile", formalDefinition="Reference to the profile to be used for validation." )
5669    protected List<Reference> profile;
5670    /**
5671     * The actual objects that are the target of the reference (Reference to the profile to be used for validation.)
5672     */
5673    protected List<Resource> profileTarget;
5674
5675
5676    /**
5677     * Variable is set based either on element value in response body or on header field value in the response headers.
5678     */
5679    @Child(name = "variable", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5680    @Description(shortDefinition="Placeholder for evaluated elements", formalDefinition="Variable is set based either on element value in response body or on header field value in the response headers." )
5681    protected List<TestScriptVariableComponent> variable;
5682
5683    /**
5684     * A series of required setup operations before tests are executed.
5685     */
5686    @Child(name = "setup", type = {}, order=18, min=0, max=1, modifier=false, summary=false)
5687    @Description(shortDefinition="A series of required setup operations before tests are executed", formalDefinition="A series of required setup operations before tests are executed." )
5688    protected TestScriptSetupComponent setup;
5689
5690    /**
5691     * A test in this script.
5692     */
5693    @Child(name = "test", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
5694    @Description(shortDefinition="A test in this script", formalDefinition="A test in this script." )
5695    protected List<TestScriptTestComponent> test;
5696
5697    /**
5698     * A series of operations required to clean up after the all the tests are executed (successfully or otherwise).
5699     */
5700    @Child(name = "teardown", type = {}, order=20, min=0, max=1, modifier=false, summary=false)
5701    @Description(shortDefinition="A series of required clean up steps", formalDefinition="A series of operations required to clean up after the all the tests are executed (successfully or otherwise)." )
5702    protected TestScriptTeardownComponent teardown;
5703
5704    private static final long serialVersionUID = -2049162917L;
5705
5706  /*
5707   * Constructor
5708   */
5709    public TestScript() {
5710      super();
5711    }
5712
5713  /*
5714   * Constructor
5715   */
5716    public TestScript(UriType url, StringType name, Enumeration<ConformanceResourceStatus> status) {
5717      super();
5718      this.url = url;
5719      this.name = name;
5720      this.status = status;
5721    }
5722
5723    /**
5724     * @return {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5725     */
5726    public UriType getUrlElement() { 
5727      if (this.url == null)
5728        if (Configuration.errorOnAutoCreate())
5729          throw new Error("Attempt to auto-create TestScript.url");
5730        else if (Configuration.doAutoCreate())
5731          this.url = new UriType(); // bb
5732      return this.url;
5733    }
5734
5735    public boolean hasUrlElement() { 
5736      return this.url != null && !this.url.isEmpty();
5737    }
5738
5739    public boolean hasUrl() { 
5740      return this.url != null && !this.url.isEmpty();
5741    }
5742
5743    /**
5744     * @param value {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value
5745     */
5746    public TestScript setUrlElement(UriType value) { 
5747      this.url = value;
5748      return this;
5749    }
5750
5751    /**
5752     * @return An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.
5753     */
5754    public String getUrl() { 
5755      return this.url == null ? null : this.url.getValue();
5756    }
5757
5758    /**
5759     * @param value An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.
5760     */
5761    public TestScript setUrl(String value) { 
5762        if (this.url == null)
5763          this.url = new UriType();
5764        this.url.setValue(value);
5765      return this;
5766    }
5767
5768    /**
5769     * @return {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5770     */
5771    public StringType getVersionElement() { 
5772      if (this.version == null)
5773        if (Configuration.errorOnAutoCreate())
5774          throw new Error("Attempt to auto-create TestScript.version");
5775        else if (Configuration.doAutoCreate())
5776          this.version = new StringType(); // bb
5777      return this.version;
5778    }
5779
5780    public boolean hasVersionElement() { 
5781      return this.version != null && !this.version.isEmpty();
5782    }
5783
5784    public boolean hasVersion() { 
5785      return this.version != null && !this.version.isEmpty();
5786    }
5787
5788    /**
5789     * @param value {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value
5790     */
5791    public TestScript setVersionElement(StringType value) { 
5792      this.version = value;
5793      return this;
5794    }
5795
5796    /**
5797     * @return The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.
5798     */
5799    public String getVersion() { 
5800      return this.version == null ? null : this.version.getValue();
5801    }
5802
5803    /**
5804     * @param value The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.
5805     */
5806    public TestScript setVersion(String value) { 
5807      if (Utilities.noString(value))
5808        this.version = null;
5809      else {
5810        if (this.version == null)
5811          this.version = new StringType();
5812        this.version.setValue(value);
5813      }
5814      return this;
5815    }
5816
5817    /**
5818     * @return {@link #name} (A free text natural language name identifying the TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5819     */
5820    public StringType getNameElement() { 
5821      if (this.name == null)
5822        if (Configuration.errorOnAutoCreate())
5823          throw new Error("Attempt to auto-create TestScript.name");
5824        else if (Configuration.doAutoCreate())
5825          this.name = new StringType(); // bb
5826      return this.name;
5827    }
5828
5829    public boolean hasNameElement() { 
5830      return this.name != null && !this.name.isEmpty();
5831    }
5832
5833    public boolean hasName() { 
5834      return this.name != null && !this.name.isEmpty();
5835    }
5836
5837    /**
5838     * @param value {@link #name} (A free text natural language name identifying the TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value
5839     */
5840    public TestScript setNameElement(StringType value) { 
5841      this.name = value;
5842      return this;
5843    }
5844
5845    /**
5846     * @return A free text natural language name identifying the TestScript.
5847     */
5848    public String getName() { 
5849      return this.name == null ? null : this.name.getValue();
5850    }
5851
5852    /**
5853     * @param value A free text natural language name identifying the TestScript.
5854     */
5855    public TestScript setName(String value) { 
5856        if (this.name == null)
5857          this.name = new StringType();
5858        this.name.setValue(value);
5859      return this;
5860    }
5861
5862    /**
5863     * @return {@link #status} (The status of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5864     */
5865    public Enumeration<ConformanceResourceStatus> getStatusElement() { 
5866      if (this.status == null)
5867        if (Configuration.errorOnAutoCreate())
5868          throw new Error("Attempt to auto-create TestScript.status");
5869        else if (Configuration.doAutoCreate())
5870          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory()); // bb
5871      return this.status;
5872    }
5873
5874    public boolean hasStatusElement() { 
5875      return this.status != null && !this.status.isEmpty();
5876    }
5877
5878    public boolean hasStatus() { 
5879      return this.status != null && !this.status.isEmpty();
5880    }
5881
5882    /**
5883     * @param value {@link #status} (The status of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value
5884     */
5885    public TestScript setStatusElement(Enumeration<ConformanceResourceStatus> value) { 
5886      this.status = value;
5887      return this;
5888    }
5889
5890    /**
5891     * @return The status of the TestScript.
5892     */
5893    public ConformanceResourceStatus getStatus() { 
5894      return this.status == null ? null : this.status.getValue();
5895    }
5896
5897    /**
5898     * @param value The status of the TestScript.
5899     */
5900    public TestScript setStatus(ConformanceResourceStatus value) { 
5901        if (this.status == null)
5902          this.status = new Enumeration<ConformanceResourceStatus>(new ConformanceResourceStatusEnumFactory());
5903        this.status.setValue(value);
5904      return this;
5905    }
5906
5907    /**
5908     * @return {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.)
5909     */
5910    public Identifier getIdentifier() { 
5911      if (this.identifier == null)
5912        if (Configuration.errorOnAutoCreate())
5913          throw new Error("Attempt to auto-create TestScript.identifier");
5914        else if (Configuration.doAutoCreate())
5915          this.identifier = new Identifier(); // cc
5916      return this.identifier;
5917    }
5918
5919    public boolean hasIdentifier() { 
5920      return this.identifier != null && !this.identifier.isEmpty();
5921    }
5922
5923    /**
5924     * @param value {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.)
5925     */
5926    public TestScript setIdentifier(Identifier value) { 
5927      this.identifier = value;
5928      return this;
5929    }
5930
5931    /**
5932     * @return {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5933     */
5934    public BooleanType getExperimentalElement() { 
5935      if (this.experimental == null)
5936        if (Configuration.errorOnAutoCreate())
5937          throw new Error("Attempt to auto-create TestScript.experimental");
5938        else if (Configuration.doAutoCreate())
5939          this.experimental = new BooleanType(); // bb
5940      return this.experimental;
5941    }
5942
5943    public boolean hasExperimentalElement() { 
5944      return this.experimental != null && !this.experimental.isEmpty();
5945    }
5946
5947    public boolean hasExperimental() { 
5948      return this.experimental != null && !this.experimental.isEmpty();
5949    }
5950
5951    /**
5952     * @param value {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value
5953     */
5954    public TestScript setExperimentalElement(BooleanType value) { 
5955      this.experimental = value;
5956      return this;
5957    }
5958
5959    /**
5960     * @return This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
5961     */
5962    public boolean getExperimental() { 
5963      return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue();
5964    }
5965
5966    /**
5967     * @param value This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.
5968     */
5969    public TestScript setExperimental(boolean value) { 
5970        if (this.experimental == null)
5971          this.experimental = new BooleanType();
5972        this.experimental.setValue(value);
5973      return this;
5974    }
5975
5976    /**
5977     * @return {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5978     */
5979    public StringType getPublisherElement() { 
5980      if (this.publisher == null)
5981        if (Configuration.errorOnAutoCreate())
5982          throw new Error("Attempt to auto-create TestScript.publisher");
5983        else if (Configuration.doAutoCreate())
5984          this.publisher = new StringType(); // bb
5985      return this.publisher;
5986    }
5987
5988    public boolean hasPublisherElement() { 
5989      return this.publisher != null && !this.publisher.isEmpty();
5990    }
5991
5992    public boolean hasPublisher() { 
5993      return this.publisher != null && !this.publisher.isEmpty();
5994    }
5995
5996    /**
5997     * @param value {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value
5998     */
5999    public TestScript setPublisherElement(StringType value) { 
6000      this.publisher = value;
6001      return this;
6002    }
6003
6004    /**
6005     * @return The name of the individual or organization that published the Test Script.
6006     */
6007    public String getPublisher() { 
6008      return this.publisher == null ? null : this.publisher.getValue();
6009    }
6010
6011    /**
6012     * @param value The name of the individual or organization that published the Test Script.
6013     */
6014    public TestScript setPublisher(String value) { 
6015      if (Utilities.noString(value))
6016        this.publisher = null;
6017      else {
6018        if (this.publisher == null)
6019          this.publisher = new StringType();
6020        this.publisher.setValue(value);
6021      }
6022      return this;
6023    }
6024
6025    /**
6026     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
6027     */
6028    public List<TestScriptContactComponent> getContact() { 
6029      if (this.contact == null)
6030        this.contact = new ArrayList<TestScriptContactComponent>();
6031      return this.contact;
6032    }
6033
6034    public boolean hasContact() { 
6035      if (this.contact == null)
6036        return false;
6037      for (TestScriptContactComponent item : this.contact)
6038        if (!item.isEmpty())
6039          return true;
6040      return false;
6041    }
6042
6043    /**
6044     * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.)
6045     */
6046    // syntactic sugar
6047    public TestScriptContactComponent addContact() { //3
6048      TestScriptContactComponent t = new TestScriptContactComponent();
6049      if (this.contact == null)
6050        this.contact = new ArrayList<TestScriptContactComponent>();
6051      this.contact.add(t);
6052      return t;
6053    }
6054
6055    // syntactic sugar
6056    public TestScript addContact(TestScriptContactComponent t) { //3
6057      if (t == null)
6058        return this;
6059      if (this.contact == null)
6060        this.contact = new ArrayList<TestScriptContactComponent>();
6061      this.contact.add(t);
6062      return this;
6063    }
6064
6065    /**
6066     * @return {@link #date} (The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
6067     */
6068    public DateTimeType getDateElement() { 
6069      if (this.date == null)
6070        if (Configuration.errorOnAutoCreate())
6071          throw new Error("Attempt to auto-create TestScript.date");
6072        else if (Configuration.doAutoCreate())
6073          this.date = new DateTimeType(); // bb
6074      return this.date;
6075    }
6076
6077    public boolean hasDateElement() { 
6078      return this.date != null && !this.date.isEmpty();
6079    }
6080
6081    public boolean hasDate() { 
6082      return this.date != null && !this.date.isEmpty();
6083    }
6084
6085    /**
6086     * @param value {@link #date} (The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value
6087     */
6088    public TestScript setDateElement(DateTimeType value) { 
6089      this.date = value;
6090      return this;
6091    }
6092
6093    /**
6094     * @return The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.
6095     */
6096    public Date getDate() { 
6097      return this.date == null ? null : this.date.getValue();
6098    }
6099
6100    /**
6101     * @param value The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.
6102     */
6103    public TestScript setDate(Date value) { 
6104      if (value == null)
6105        this.date = null;
6106      else {
6107        if (this.date == null)
6108          this.date = new DateTimeType();
6109        this.date.setValue(value);
6110      }
6111      return this;
6112    }
6113
6114    /**
6115     * @return {@link #description} (A free text natural language description of the TestScript and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
6116     */
6117    public StringType getDescriptionElement() { 
6118      if (this.description == null)
6119        if (Configuration.errorOnAutoCreate())
6120          throw new Error("Attempt to auto-create TestScript.description");
6121        else if (Configuration.doAutoCreate())
6122          this.description = new StringType(); // bb
6123      return this.description;
6124    }
6125
6126    public boolean hasDescriptionElement() { 
6127      return this.description != null && !this.description.isEmpty();
6128    }
6129
6130    public boolean hasDescription() { 
6131      return this.description != null && !this.description.isEmpty();
6132    }
6133
6134    /**
6135     * @param value {@link #description} (A free text natural language description of the TestScript and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value
6136     */
6137    public TestScript setDescriptionElement(StringType value) { 
6138      this.description = value;
6139      return this;
6140    }
6141
6142    /**
6143     * @return A free text natural language description of the TestScript and its use.
6144     */
6145    public String getDescription() { 
6146      return this.description == null ? null : this.description.getValue();
6147    }
6148
6149    /**
6150     * @param value A free text natural language description of the TestScript and its use.
6151     */
6152    public TestScript setDescription(String value) { 
6153      if (Utilities.noString(value))
6154        this.description = null;
6155      else {
6156        if (this.description == null)
6157          this.description = new StringType();
6158        this.description.setValue(value);
6159      }
6160      return this;
6161    }
6162
6163    /**
6164     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.)
6165     */
6166    public List<CodeableConcept> getUseContext() { 
6167      if (this.useContext == null)
6168        this.useContext = new ArrayList<CodeableConcept>();
6169      return this.useContext;
6170    }
6171
6172    public boolean hasUseContext() { 
6173      if (this.useContext == null)
6174        return false;
6175      for (CodeableConcept item : this.useContext)
6176        if (!item.isEmpty())
6177          return true;
6178      return false;
6179    }
6180
6181    /**
6182     * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.)
6183     */
6184    // syntactic sugar
6185    public CodeableConcept addUseContext() { //3
6186      CodeableConcept t = new CodeableConcept();
6187      if (this.useContext == null)
6188        this.useContext = new ArrayList<CodeableConcept>();
6189      this.useContext.add(t);
6190      return t;
6191    }
6192
6193    // syntactic sugar
6194    public TestScript addUseContext(CodeableConcept t) { //3
6195      if (t == null)
6196        return this;
6197      if (this.useContext == null)
6198        this.useContext = new ArrayList<CodeableConcept>();
6199      this.useContext.add(t);
6200      return this;
6201    }
6202
6203    /**
6204     * @return {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
6205     */
6206    public StringType getRequirementsElement() { 
6207      if (this.requirements == null)
6208        if (Configuration.errorOnAutoCreate())
6209          throw new Error("Attempt to auto-create TestScript.requirements");
6210        else if (Configuration.doAutoCreate())
6211          this.requirements = new StringType(); // bb
6212      return this.requirements;
6213    }
6214
6215    public boolean hasRequirementsElement() { 
6216      return this.requirements != null && !this.requirements.isEmpty();
6217    }
6218
6219    public boolean hasRequirements() { 
6220      return this.requirements != null && !this.requirements.isEmpty();
6221    }
6222
6223    /**
6224     * @param value {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value
6225     */
6226    public TestScript setRequirementsElement(StringType value) { 
6227      this.requirements = value;
6228      return this;
6229    }
6230
6231    /**
6232     * @return Explains why this Test Script is needed and why it's been constrained as it has.
6233     */
6234    public String getRequirements() { 
6235      return this.requirements == null ? null : this.requirements.getValue();
6236    }
6237
6238    /**
6239     * @param value Explains why this Test Script is needed and why it's been constrained as it has.
6240     */
6241    public TestScript setRequirements(String value) { 
6242      if (Utilities.noString(value))
6243        this.requirements = null;
6244      else {
6245        if (this.requirements == null)
6246          this.requirements = new StringType();
6247        this.requirements.setValue(value);
6248      }
6249      return this;
6250    }
6251
6252    /**
6253     * @return {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
6254     */
6255    public StringType getCopyrightElement() { 
6256      if (this.copyright == null)
6257        if (Configuration.errorOnAutoCreate())
6258          throw new Error("Attempt to auto-create TestScript.copyright");
6259        else if (Configuration.doAutoCreate())
6260          this.copyright = new StringType(); // bb
6261      return this.copyright;
6262    }
6263
6264    public boolean hasCopyrightElement() { 
6265      return this.copyright != null && !this.copyright.isEmpty();
6266    }
6267
6268    public boolean hasCopyright() { 
6269      return this.copyright != null && !this.copyright.isEmpty();
6270    }
6271
6272    /**
6273     * @param value {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value
6274     */
6275    public TestScript setCopyrightElement(StringType value) { 
6276      this.copyright = value;
6277      return this;
6278    }
6279
6280    /**
6281     * @return A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.
6282     */
6283    public String getCopyright() { 
6284      return this.copyright == null ? null : this.copyright.getValue();
6285    }
6286
6287    /**
6288     * @param value A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.
6289     */
6290    public TestScript setCopyright(String value) { 
6291      if (Utilities.noString(value))
6292        this.copyright = null;
6293      else {
6294        if (this.copyright == null)
6295          this.copyright = new StringType();
6296        this.copyright.setValue(value);
6297      }
6298      return this;
6299    }
6300
6301    /**
6302     * @return {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.)
6303     */
6304    public TestScriptMetadataComponent getMetadata() { 
6305      if (this.metadata == null)
6306        if (Configuration.errorOnAutoCreate())
6307          throw new Error("Attempt to auto-create TestScript.metadata");
6308        else if (Configuration.doAutoCreate())
6309          this.metadata = new TestScriptMetadataComponent(); // cc
6310      return this.metadata;
6311    }
6312
6313    public boolean hasMetadata() { 
6314      return this.metadata != null && !this.metadata.isEmpty();
6315    }
6316
6317    /**
6318     * @param value {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.)
6319     */
6320    public TestScript setMetadata(TestScriptMetadataComponent value) { 
6321      this.metadata = value;
6322      return this;
6323    }
6324
6325    /**
6326     * @return {@link #multiserver} (If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.). This is the underlying object with id, value and extensions. The accessor "getMultiserver" gives direct access to the value
6327     */
6328    public BooleanType getMultiserverElement() { 
6329      if (this.multiserver == null)
6330        if (Configuration.errorOnAutoCreate())
6331          throw new Error("Attempt to auto-create TestScript.multiserver");
6332        else if (Configuration.doAutoCreate())
6333          this.multiserver = new BooleanType(); // bb
6334      return this.multiserver;
6335    }
6336
6337    public boolean hasMultiserverElement() { 
6338      return this.multiserver != null && !this.multiserver.isEmpty();
6339    }
6340
6341    public boolean hasMultiserver() { 
6342      return this.multiserver != null && !this.multiserver.isEmpty();
6343    }
6344
6345    /**
6346     * @param value {@link #multiserver} (If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.). This is the underlying object with id, value and extensions. The accessor "getMultiserver" gives direct access to the value
6347     */
6348    public TestScript setMultiserverElement(BooleanType value) { 
6349      this.multiserver = value;
6350      return this;
6351    }
6352
6353    /**
6354     * @return If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.
6355     */
6356    public boolean getMultiserver() { 
6357      return this.multiserver == null || this.multiserver.isEmpty() ? false : this.multiserver.getValue();
6358    }
6359
6360    /**
6361     * @param value If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.
6362     */
6363    public TestScript setMultiserver(boolean value) { 
6364        if (this.multiserver == null)
6365          this.multiserver = new BooleanType();
6366        this.multiserver.setValue(value);
6367      return this;
6368    }
6369
6370    /**
6371     * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.)
6372     */
6373    public List<TestScriptFixtureComponent> getFixture() { 
6374      if (this.fixture == null)
6375        this.fixture = new ArrayList<TestScriptFixtureComponent>();
6376      return this.fixture;
6377    }
6378
6379    public boolean hasFixture() { 
6380      if (this.fixture == null)
6381        return false;
6382      for (TestScriptFixtureComponent item : this.fixture)
6383        if (!item.isEmpty())
6384          return true;
6385      return false;
6386    }
6387
6388    /**
6389     * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.)
6390     */
6391    // syntactic sugar
6392    public TestScriptFixtureComponent addFixture() { //3
6393      TestScriptFixtureComponent t = new TestScriptFixtureComponent();
6394      if (this.fixture == null)
6395        this.fixture = new ArrayList<TestScriptFixtureComponent>();
6396      this.fixture.add(t);
6397      return t;
6398    }
6399
6400    // syntactic sugar
6401    public TestScript addFixture(TestScriptFixtureComponent t) { //3
6402      if (t == null)
6403        return this;
6404      if (this.fixture == null)
6405        this.fixture = new ArrayList<TestScriptFixtureComponent>();
6406      this.fixture.add(t);
6407      return this;
6408    }
6409
6410    /**
6411     * @return {@link #profile} (Reference to the profile to be used for validation.)
6412     */
6413    public List<Reference> getProfile() { 
6414      if (this.profile == null)
6415        this.profile = new ArrayList<Reference>();
6416      return this.profile;
6417    }
6418
6419    public boolean hasProfile() { 
6420      if (this.profile == null)
6421        return false;
6422      for (Reference item : this.profile)
6423        if (!item.isEmpty())
6424          return true;
6425      return false;
6426    }
6427
6428    /**
6429     * @return {@link #profile} (Reference to the profile to be used for validation.)
6430     */
6431    // syntactic sugar
6432    public Reference addProfile() { //3
6433      Reference t = new Reference();
6434      if (this.profile == null)
6435        this.profile = new ArrayList<Reference>();
6436      this.profile.add(t);
6437      return t;
6438    }
6439
6440    // syntactic sugar
6441    public TestScript addProfile(Reference t) { //3
6442      if (t == null)
6443        return this;
6444      if (this.profile == null)
6445        this.profile = new ArrayList<Reference>();
6446      this.profile.add(t);
6447      return this;
6448    }
6449
6450    /**
6451     * @return {@link #profile} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to the profile to be used for validation.)
6452     */
6453    public List<Resource> getProfileTarget() { 
6454      if (this.profileTarget == null)
6455        this.profileTarget = new ArrayList<Resource>();
6456      return this.profileTarget;
6457    }
6458
6459    /**
6460     * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.)
6461     */
6462    public List<TestScriptVariableComponent> getVariable() { 
6463      if (this.variable == null)
6464        this.variable = new ArrayList<TestScriptVariableComponent>();
6465      return this.variable;
6466    }
6467
6468    public boolean hasVariable() { 
6469      if (this.variable == null)
6470        return false;
6471      for (TestScriptVariableComponent item : this.variable)
6472        if (!item.isEmpty())
6473          return true;
6474      return false;
6475    }
6476
6477    /**
6478     * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.)
6479     */
6480    // syntactic sugar
6481    public TestScriptVariableComponent addVariable() { //3
6482      TestScriptVariableComponent t = new TestScriptVariableComponent();
6483      if (this.variable == null)
6484        this.variable = new ArrayList<TestScriptVariableComponent>();
6485      this.variable.add(t);
6486      return t;
6487    }
6488
6489    // syntactic sugar
6490    public TestScript addVariable(TestScriptVariableComponent t) { //3
6491      if (t == null)
6492        return this;
6493      if (this.variable == null)
6494        this.variable = new ArrayList<TestScriptVariableComponent>();
6495      this.variable.add(t);
6496      return this;
6497    }
6498
6499    /**
6500     * @return {@link #setup} (A series of required setup operations before tests are executed.)
6501     */
6502    public TestScriptSetupComponent getSetup() { 
6503      if (this.setup == null)
6504        if (Configuration.errorOnAutoCreate())
6505          throw new Error("Attempt to auto-create TestScript.setup");
6506        else if (Configuration.doAutoCreate())
6507          this.setup = new TestScriptSetupComponent(); // cc
6508      return this.setup;
6509    }
6510
6511    public boolean hasSetup() { 
6512      return this.setup != null && !this.setup.isEmpty();
6513    }
6514
6515    /**
6516     * @param value {@link #setup} (A series of required setup operations before tests are executed.)
6517     */
6518    public TestScript setSetup(TestScriptSetupComponent value) { 
6519      this.setup = value;
6520      return this;
6521    }
6522
6523    /**
6524     * @return {@link #test} (A test in this script.)
6525     */
6526    public List<TestScriptTestComponent> getTest() { 
6527      if (this.test == null)
6528        this.test = new ArrayList<TestScriptTestComponent>();
6529      return this.test;
6530    }
6531
6532    public boolean hasTest() { 
6533      if (this.test == null)
6534        return false;
6535      for (TestScriptTestComponent item : this.test)
6536        if (!item.isEmpty())
6537          return true;
6538      return false;
6539    }
6540
6541    /**
6542     * @return {@link #test} (A test in this script.)
6543     */
6544    // syntactic sugar
6545    public TestScriptTestComponent addTest() { //3
6546      TestScriptTestComponent t = new TestScriptTestComponent();
6547      if (this.test == null)
6548        this.test = new ArrayList<TestScriptTestComponent>();
6549      this.test.add(t);
6550      return t;
6551    }
6552
6553    // syntactic sugar
6554    public TestScript addTest(TestScriptTestComponent t) { //3
6555      if (t == null)
6556        return this;
6557      if (this.test == null)
6558        this.test = new ArrayList<TestScriptTestComponent>();
6559      this.test.add(t);
6560      return this;
6561    }
6562
6563    /**
6564     * @return {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).)
6565     */
6566    public TestScriptTeardownComponent getTeardown() { 
6567      if (this.teardown == null)
6568        if (Configuration.errorOnAutoCreate())
6569          throw new Error("Attempt to auto-create TestScript.teardown");
6570        else if (Configuration.doAutoCreate())
6571          this.teardown = new TestScriptTeardownComponent(); // cc
6572      return this.teardown;
6573    }
6574
6575    public boolean hasTeardown() { 
6576      return this.teardown != null && !this.teardown.isEmpty();
6577    }
6578
6579    /**
6580     * @param value {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).)
6581     */
6582    public TestScript setTeardown(TestScriptTeardownComponent value) { 
6583      this.teardown = value;
6584      return this;
6585    }
6586
6587      protected void listChildren(List<Property> childrenList) {
6588        super.listChildren(childrenList);
6589        childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url));
6590        childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.", 0, java.lang.Integer.MAX_VALUE, version));
6591        childrenList.add(new Property("name", "string", "A free text natural language name identifying the TestScript.", 0, java.lang.Integer.MAX_VALUE, name));
6592        childrenList.add(new Property("status", "code", "The status of the TestScript.", 0, java.lang.Integer.MAX_VALUE, status));
6593        childrenList.add(new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier));
6594        childrenList.add(new Property("experimental", "boolean", "This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental));
6595        childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the Test Script.", 0, java.lang.Integer.MAX_VALUE, publisher));
6596        childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact));
6597        childrenList.add(new Property("date", "dateTime", "The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.", 0, java.lang.Integer.MAX_VALUE, date));
6598        childrenList.add(new Property("description", "string", "A free text natural language description of the TestScript and its use.", 0, java.lang.Integer.MAX_VALUE, description));
6599        childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.", 0, java.lang.Integer.MAX_VALUE, useContext));
6600        childrenList.add(new Property("requirements", "string", "Explains why this Test Script is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements));
6601        childrenList.add(new Property("copyright", "string", "A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright));
6602        childrenList.add(new Property("metadata", "", "The required capability must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata));
6603        childrenList.add(new Property("multiserver", "boolean", "If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults to false if value is unspecified.", 0, java.lang.Integer.MAX_VALUE, multiserver));
6604        childrenList.add(new Property("fixture", "", "Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture));
6605        childrenList.add(new Property("profile", "Reference(Any)", "Reference to the profile to be used for validation.", 0, java.lang.Integer.MAX_VALUE, profile));
6606        childrenList.add(new Property("variable", "", "Variable is set based either on element value in response body or on header field value in the response headers.", 0, java.lang.Integer.MAX_VALUE, variable));
6607        childrenList.add(new Property("setup", "", "A series of required setup operations before tests are executed.", 0, java.lang.Integer.MAX_VALUE, setup));
6608        childrenList.add(new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test));
6609        childrenList.add(new Property("teardown", "", "A series of operations required to clean up after the all the tests are executed (successfully or otherwise).", 0, java.lang.Integer.MAX_VALUE, teardown));
6610      }
6611
6612      @Override
6613      public void setProperty(String name, Base value) throws FHIRException {
6614        if (name.equals("url"))
6615          this.url = castToUri(value); // UriType
6616        else if (name.equals("version"))
6617          this.version = castToString(value); // StringType
6618        else if (name.equals("name"))
6619          this.name = castToString(value); // StringType
6620        else if (name.equals("status"))
6621          this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration<ConformanceResourceStatus>
6622        else if (name.equals("identifier"))
6623          this.identifier = castToIdentifier(value); // Identifier
6624        else if (name.equals("experimental"))
6625          this.experimental = castToBoolean(value); // BooleanType
6626        else if (name.equals("publisher"))
6627          this.publisher = castToString(value); // StringType
6628        else if (name.equals("contact"))
6629          this.getContact().add((TestScriptContactComponent) value);
6630        else if (name.equals("date"))
6631          this.date = castToDateTime(value); // DateTimeType
6632        else if (name.equals("description"))
6633          this.description = castToString(value); // StringType
6634        else if (name.equals("useContext"))
6635          this.getUseContext().add(castToCodeableConcept(value));
6636        else if (name.equals("requirements"))
6637          this.requirements = castToString(value); // StringType
6638        else if (name.equals("copyright"))
6639          this.copyright = castToString(value); // StringType
6640        else if (name.equals("metadata"))
6641          this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent
6642        else if (name.equals("multiserver"))
6643          this.multiserver = castToBoolean(value); // BooleanType
6644        else if (name.equals("fixture"))
6645          this.getFixture().add((TestScriptFixtureComponent) value);
6646        else if (name.equals("profile"))
6647          this.getProfile().add(castToReference(value));
6648        else if (name.equals("variable"))
6649          this.getVariable().add((TestScriptVariableComponent) value);
6650        else if (name.equals("setup"))
6651          this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent
6652        else if (name.equals("test"))
6653          this.getTest().add((TestScriptTestComponent) value);
6654        else if (name.equals("teardown"))
6655          this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent
6656        else
6657          super.setProperty(name, value);
6658      }
6659
6660      @Override
6661      public Base addChild(String name) throws FHIRException {
6662        if (name.equals("url")) {
6663          throw new FHIRException("Cannot call addChild on a primitive type TestScript.url");
6664        }
6665        else if (name.equals("version")) {
6666          throw new FHIRException("Cannot call addChild on a primitive type TestScript.version");
6667        }
6668        else if (name.equals("name")) {
6669          throw new FHIRException("Cannot call addChild on a primitive type TestScript.name");
6670        }
6671        else if (name.equals("status")) {
6672          throw new FHIRException("Cannot call addChild on a primitive type TestScript.status");
6673        }
6674        else if (name.equals("identifier")) {
6675          this.identifier = new Identifier();
6676          return this.identifier;
6677        }
6678        else if (name.equals("experimental")) {
6679          throw new FHIRException("Cannot call addChild on a primitive type TestScript.experimental");
6680        }
6681        else if (name.equals("publisher")) {
6682          throw new FHIRException("Cannot call addChild on a primitive type TestScript.publisher");
6683        }
6684        else if (name.equals("contact")) {
6685          return addContact();
6686        }
6687        else if (name.equals("date")) {
6688          throw new FHIRException("Cannot call addChild on a primitive type TestScript.date");
6689        }
6690        else if (name.equals("description")) {
6691          throw new FHIRException("Cannot call addChild on a primitive type TestScript.description");
6692        }
6693        else if (name.equals("useContext")) {
6694          return addUseContext();
6695        }
6696        else if (name.equals("requirements")) {
6697          throw new FHIRException("Cannot call addChild on a primitive type TestScript.requirements");
6698        }
6699        else if (name.equals("copyright")) {
6700          throw new FHIRException("Cannot call addChild on a primitive type TestScript.copyright");
6701        }
6702        else if (name.equals("metadata")) {
6703          this.metadata = new TestScriptMetadataComponent();
6704          return this.metadata;
6705        }
6706        else if (name.equals("multiserver")) {
6707          throw new FHIRException("Cannot call addChild on a primitive type TestScript.multiserver");
6708        }
6709        else if (name.equals("fixture")) {
6710          return addFixture();
6711        }
6712        else if (name.equals("profile")) {
6713          return addProfile();
6714        }
6715        else if (name.equals("variable")) {
6716          return addVariable();
6717        }
6718        else if (name.equals("setup")) {
6719          this.setup = new TestScriptSetupComponent();
6720          return this.setup;
6721        }
6722        else if (name.equals("test")) {
6723          return addTest();
6724        }
6725        else if (name.equals("teardown")) {
6726          this.teardown = new TestScriptTeardownComponent();
6727          return this.teardown;
6728        }
6729        else
6730          return super.addChild(name);
6731      }
6732
6733  public String fhirType() {
6734    return "TestScript";
6735
6736  }
6737
6738      public TestScript copy() {
6739        TestScript dst = new TestScript();
6740        copyValues(dst);
6741        dst.url = url == null ? null : url.copy();
6742        dst.version = version == null ? null : version.copy();
6743        dst.name = name == null ? null : name.copy();
6744        dst.status = status == null ? null : status.copy();
6745        dst.identifier = identifier == null ? null : identifier.copy();
6746        dst.experimental = experimental == null ? null : experimental.copy();
6747        dst.publisher = publisher == null ? null : publisher.copy();
6748        if (contact != null) {
6749          dst.contact = new ArrayList<TestScriptContactComponent>();
6750          for (TestScriptContactComponent i : contact)
6751            dst.contact.add(i.copy());
6752        };
6753        dst.date = date == null ? null : date.copy();
6754        dst.description = description == null ? null : description.copy();
6755        if (useContext != null) {
6756          dst.useContext = new ArrayList<CodeableConcept>();
6757          for (CodeableConcept i : useContext)
6758            dst.useContext.add(i.copy());
6759        };
6760        dst.requirements = requirements == null ? null : requirements.copy();
6761        dst.copyright = copyright == null ? null : copyright.copy();
6762        dst.metadata = metadata == null ? null : metadata.copy();
6763        dst.multiserver = multiserver == null ? null : multiserver.copy();
6764        if (fixture != null) {
6765          dst.fixture = new ArrayList<TestScriptFixtureComponent>();
6766          for (TestScriptFixtureComponent i : fixture)
6767            dst.fixture.add(i.copy());
6768        };
6769        if (profile != null) {
6770          dst.profile = new ArrayList<Reference>();
6771          for (Reference i : profile)
6772            dst.profile.add(i.copy());
6773        };
6774        if (variable != null) {
6775          dst.variable = new ArrayList<TestScriptVariableComponent>();
6776          for (TestScriptVariableComponent i : variable)
6777            dst.variable.add(i.copy());
6778        };
6779        dst.setup = setup == null ? null : setup.copy();
6780        if (test != null) {
6781          dst.test = new ArrayList<TestScriptTestComponent>();
6782          for (TestScriptTestComponent i : test)
6783            dst.test.add(i.copy());
6784        };
6785        dst.teardown = teardown == null ? null : teardown.copy();
6786        return dst;
6787      }
6788
6789      protected TestScript typedCopy() {
6790        return copy();
6791      }
6792
6793      @Override
6794      public boolean equalsDeep(Base other) {
6795        if (!super.equalsDeep(other))
6796          return false;
6797        if (!(other instanceof TestScript))
6798          return false;
6799        TestScript o = (TestScript) other;
6800        return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true)
6801           && compareDeep(status, o.status, true) && compareDeep(identifier, o.identifier, true) && compareDeep(experimental, o.experimental, true)
6802           && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true)
6803           && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true)
6804           && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true)
6805           && compareDeep(metadata, o.metadata, true) && compareDeep(multiserver, o.multiserver, true) && compareDeep(fixture, o.fixture, true)
6806           && compareDeep(profile, o.profile, true) && compareDeep(variable, o.variable, true) && compareDeep(setup, o.setup, true)
6807           && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true);
6808      }
6809
6810      @Override
6811      public boolean equalsShallow(Base other) {
6812        if (!super.equalsShallow(other))
6813          return false;
6814        if (!(other instanceof TestScript))
6815          return false;
6816        TestScript o = (TestScript) other;
6817        return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true)
6818           && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true)
6819           && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true)
6820           && compareValues(copyright, o.copyright, true) && compareValues(multiserver, o.multiserver, true);
6821      }
6822
6823      public boolean isEmpty() {
6824        return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty())
6825           && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty())
6826           && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty())
6827           && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty())
6828           && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty())
6829           && (copyright == null || copyright.isEmpty()) && (metadata == null || metadata.isEmpty())
6830           && (multiserver == null || multiserver.isEmpty()) && (fixture == null || fixture.isEmpty())
6831           && (profile == null || profile.isEmpty()) && (variable == null || variable.isEmpty()) && (setup == null || setup.isEmpty())
6832           && (test == null || test.isEmpty()) && (teardown == null || teardown.isEmpty());
6833      }
6834
6835  @Override
6836  public ResourceType getResourceType() {
6837    return ResourceType.TestScript;
6838   }
6839
6840  @SearchParamDefinition(name="identifier", path="TestScript.identifier", description="External identifier", type="token" )
6841  public static final String SP_IDENTIFIER = "identifier";
6842  @SearchParamDefinition(name="testscript-test-capability", path="TestScript.test.metadata.capability.description", description="TestScript test required and validated capability", type="string" )
6843  public static final String SP_TESTSCRIPTTESTCAPABILITY = "testscript-test-capability";
6844  @SearchParamDefinition(name="testscript-setup-capability", path="TestScript.setup.metadata.capability.description", description="TestScript setup required and validated capability", type="string" )
6845  public static final String SP_TESTSCRIPTSETUPCAPABILITY = "testscript-setup-capability";
6846  @SearchParamDefinition(name="name", path="TestScript.name", description="Informal name for this TestScript", type="string" )
6847  public static final String SP_NAME = "name";
6848  @SearchParamDefinition(name="description", path="TestScript.description", description="Natural language description of the TestScript", type="string" )
6849  public static final String SP_DESCRIPTION = "description";
6850  @SearchParamDefinition(name="testscript-capability", path="TestScript.metadata.capability.description", description="TestScript required and validated capability", type="string" )
6851  public static final String SP_TESTSCRIPTCAPABILITY = "testscript-capability";
6852  @SearchParamDefinition(name="url", path="TestScript.url", description="Absolute URL used to reference this TestScript", type="uri" )
6853  public static final String SP_URL = "url";
6854
6855}