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