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