001package org.hl7.fhir.convertors.conv10_30.resources10_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext10_30;
004import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30;
008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30;
009import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
010import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
011import org.hl7.fhir.exceptions.FHIRException;
012
013public class TestScript10_30 {
014
015  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> src) throws FHIRException {
016    if (src == null || src.isEmpty())
017      return null;
018    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionTypeEnumFactory());
019    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
020    switch (src.getValue()) {
021      case RESPONSE:
022        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.RESPONSE);
023        break;
024      case REQUEST:
025        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.REQUEST);
026        break;
027      default:
028        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType.NULL);
029        break;
030    }
031    return tgt;
032  }
033
034  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionDirectionType> src) throws FHIRException {
035    if (src == null || src.isEmpty())
036      return null;
037    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionTypeEnumFactory());
038    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
039    switch (src.getValue()) {
040      case RESPONSE:
041        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE);
042        break;
043      case REQUEST:
044        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST);
045        break;
046      default:
047        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL);
048        break;
049    }
050    return tgt;
051  }
052
053  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> src) throws FHIRException {
054    if (src == null || src.isEmpty())
055      return null;
056    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorTypeEnumFactory());
057    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
058    switch (src.getValue()) {
059      case EQUALS:
060        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS);
061        break;
062      case NOTEQUALS:
063        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS);
064        break;
065      case IN:
066        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN);
067        break;
068      case NOTIN:
069        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN);
070        break;
071      case GREATERTHAN:
072        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN);
073        break;
074      case LESSTHAN:
075        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN);
076        break;
077      case EMPTY:
078        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY);
079        break;
080      case NOTEMPTY:
081        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY);
082        break;
083      case CONTAINS:
084        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS);
085        break;
086      case NOTCONTAINS:
087        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS);
088        break;
089      default:
090        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL);
091        break;
092    }
093    return tgt;
094  }
095
096  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> src) throws FHIRException {
097    if (src == null || src.isEmpty())
098      return null;
099    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorTypeEnumFactory());
100    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
101    switch (src.getValue()) {
102      case EQUALS:
103        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EQUALS);
104        break;
105      case NOTEQUALS:
106        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEQUALS);
107        break;
108      case IN:
109        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.IN);
110        break;
111      case NOTIN:
112        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTIN);
113        break;
114      case GREATERTHAN:
115        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.GREATERTHAN);
116        break;
117      case LESSTHAN:
118        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.LESSTHAN);
119        break;
120      case EMPTY:
121        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.EMPTY);
122        break;
123      case NOTEMPTY:
124        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTEMPTY);
125        break;
126      case CONTAINS:
127        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.CONTAINS);
128        break;
129      case NOTCONTAINS:
130        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NOTCONTAINS);
131        break;
132      default:
133        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionOperatorType.NULL);
134        break;
135    }
136    return tgt;
137  }
138
139  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
140    if (src == null || src.isEmpty())
141      return null;
142    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypesEnumFactory());
143    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
144    switch (src.getValue()) {
145      case OKAY:
146        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.OKAY);
147        break;
148      case CREATED:
149        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CREATED);
150        break;
151      case NOCONTENT:
152        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOCONTENT);
153        break;
154      case NOTMODIFIED:
155        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
156        break;
157      case BAD:
158        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.BAD);
159        break;
160      case FORBIDDEN:
161        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.FORBIDDEN);
162        break;
163      case NOTFOUND:
164        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NOTFOUND);
165        break;
166      case METHODNOTALLOWED:
167        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
168        break;
169      case CONFLICT:
170        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.CONFLICT);
171        break;
172      case GONE:
173        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.GONE);
174        break;
175      case PRECONDITIONFAILED:
176        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
177        break;
178      case UNPROCESSABLE:
179        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.UNPROCESSABLE);
180        break;
181      default:
182        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes.NULL);
183        break;
184    }
185    return tgt;
186  }
187
188  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
189    if (src == null || src.isEmpty())
190      return null;
191    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypesEnumFactory());
192    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
193    switch (src.getValue()) {
194      case OKAY:
195        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY);
196        break;
197      case CREATED:
198        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED);
199        break;
200      case NOCONTENT:
201        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT);
202        break;
203      case NOTMODIFIED:
204        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
205        break;
206      case BAD:
207        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD);
208        break;
209      case FORBIDDEN:
210        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN);
211        break;
212      case NOTFOUND:
213        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND);
214        break;
215      case METHODNOTALLOWED:
216        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
217        break;
218      case CONFLICT:
219        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT);
220        break;
221      case GONE:
222        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE);
223        break;
224      case PRECONDITIONFAILED:
225        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
226        break;
227      case UNPROCESSABLE:
228        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE);
229        break;
230      default:
231        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL);
232        break;
233    }
234    return tgt;
235  }
236
237  static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> src) throws FHIRException {
238    if (src == null || src.isEmpty())
239      return null;
240    org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.TestScript.ContentTypeEnumFactory());
241    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
242    switch (src.getValue()) {
243      case XML:
244        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.XML);
245        break;
246      case JSON:
247        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.JSON);
248        break;
249      default:
250        tgt.setValue(org.hl7.fhir.dstu2.model.TestScript.ContentType.NULL);
251        break;
252    }
253    return tgt;
254  }
255
256  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.TestScript.ContentType> src) throws FHIRException {
257    if (src == null || src.isEmpty())
258      return null;
259    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.ContentTypeEnumFactory());
260    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
261    switch (src.getValue()) {
262      case XML:
263        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML);
264        break;
265      case JSON:
266        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON);
267        break;
268      default:
269        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL);
270        break;
271    }
272    return tgt;
273  }
274
275  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent src) throws FHIRException {
276    if (src == null || src.isEmpty())
277      return null;
278    org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent();
279    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
280    if (src.hasLabelElement())
281      tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
282    if (src.hasDescriptionElement())
283      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
284    if (src.hasDirection())
285      tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
286    if (src.hasCompareToSourceIdElement())
287      tgt.setCompareToSourceIdElement(String10_30.convertString(src.getCompareToSourceIdElement()));
288    if (src.hasCompareToSourcePathElement())
289      tgt.setCompareToSourcePathElement(String10_30.convertString(src.getCompareToSourcePathElement()));
290    if (src.hasContentType())
291      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
292    if (src.hasHeaderFieldElement())
293      tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement()));
294    if (src.hasMinimumIdElement())
295      tgt.setMinimumIdElement(String10_30.convertString(src.getMinimumIdElement()));
296    if (src.hasNavigationLinksElement())
297      tgt.setNavigationLinksElement(Boolean10_30.convertBoolean(src.getNavigationLinksElement()));
298    if (src.hasOperator())
299      tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
300    if (src.hasPathElement())
301      tgt.setPathElement(String10_30.convertString(src.getPathElement()));
302    if (src.hasResourceElement())
303      tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement()));
304    if (src.hasResponse())
305      tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
306    if (src.hasResponseCodeElement())
307      tgt.setResponseCodeElement(String10_30.convertString(src.getResponseCodeElement()));
308    if (src.hasSourceIdElement())
309      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
310    if (src.hasValidateProfileIdElement())
311      tgt.setValidateProfileIdElement(Id10_30.convertId(src.getValidateProfileIdElement()));
312    if (src.hasValueElement())
313      tgt.setValueElement(String10_30.convertString(src.getValueElement()));
314    if (src.hasWarningOnlyElement())
315      tgt.setWarningOnlyElement(Boolean10_30.convertBoolean(src.getWarningOnlyElement()));
316    return tgt;
317  }
318
319  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException {
320    if (src == null || src.isEmpty())
321      return null;
322    org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionAssertComponent();
323    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
324    if (src.hasLabelElement())
325      tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
326    if (src.hasDescriptionElement())
327      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
328    if (src.hasDirection())
329      tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
330    if (src.hasCompareToSourceIdElement())
331      tgt.setCompareToSourceIdElement(String10_30.convertString(src.getCompareToSourceIdElement()));
332    if (src.hasCompareToSourcePathElement())
333      tgt.setCompareToSourcePathElement(String10_30.convertString(src.getCompareToSourcePathElement()));
334    if (src.hasContentType())
335      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
336    if (src.hasHeaderFieldElement())
337      tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement()));
338    if (src.hasMinimumIdElement())
339      tgt.setMinimumIdElement(String10_30.convertString(src.getMinimumIdElement()));
340    if (src.hasNavigationLinksElement())
341      tgt.setNavigationLinksElement(Boolean10_30.convertBoolean(src.getNavigationLinksElement()));
342    if (src.hasOperator())
343      tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
344    if (src.hasPathElement())
345      tgt.setPathElement(String10_30.convertString(src.getPathElement()));
346    if (src.hasResourceElement())
347      tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement()));
348    if (src.hasResponse())
349      tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
350    if (src.hasResponseCodeElement())
351      tgt.setResponseCodeElement(String10_30.convertString(src.getResponseCodeElement()));
352    if (src.hasSourceIdElement())
353      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
354    if (src.hasValidateProfileIdElement())
355      tgt.setValidateProfileIdElement(Id10_30.convertId(src.getValidateProfileIdElement()));
356    if (src.hasValueElement())
357      tgt.setValueElement(String10_30.convertString(src.getValueElement()));
358    if (src.hasWarningOnlyElement())
359      tgt.setWarningOnlyElement(Boolean10_30.convertBoolean(src.getWarningOnlyElement()));
360    return tgt;
361  }
362
363  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent src) throws FHIRException {
364    if (src == null || src.isEmpty())
365      return null;
366    org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent();
367    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
368    if (src.hasOperation())
369      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
370    if (src.hasAssert())
371      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
372    return tgt;
373  }
374
375  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent src) throws FHIRException {
376    if (src == null || src.isEmpty())
377      return null;
378    org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent();
379    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
380    if (src.hasOperation())
381      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
382    if (src.hasAssert())
383      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
384    return tgt;
385  }
386
387  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent src) throws FHIRException {
388    if (src == null || src.isEmpty())
389      return null;
390    org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent();
391    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
392    if (src.hasType())
393      tgt.setType(Coding10_30.convertCoding(src.getType()));
394    if (src.hasResourceElement())
395      tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement()));
396    if (src.hasLabelElement())
397      tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
398    if (src.hasDescriptionElement())
399      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
400    if (src.hasAccept())
401      tgt.setAcceptElement(convertContentType(src.getAcceptElement()));
402    if (src.hasContentType())
403      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
404    if (src.hasDestinationElement())
405      tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement()));
406    if (src.hasEncodeRequestUrlElement())
407      tgt.setEncodeRequestUrlElement(Boolean10_30.convertBoolean(src.getEncodeRequestUrlElement()));
408    if (src.hasParamsElement())
409      tgt.setParamsElement(String10_30.convertString(src.getParamsElement()));
410    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
411      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
412    if (src.hasResponseIdElement())
413      tgt.setResponseIdElement(Id10_30.convertId(src.getResponseIdElement()));
414    if (src.hasSourceIdElement())
415      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
416    if (src.hasTargetId())
417      tgt.setTargetId(src.getTargetId());
418    if (src.hasUrlElement())
419      tgt.setUrlElement(String10_30.convertString(src.getUrlElement()));
420    return tgt;
421  }
422
423  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationComponent src) throws FHIRException {
424    if (src == null || src.isEmpty())
425      return null;
426    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent();
427    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
428    if (src.hasType())
429      tgt.setType(Coding10_30.convertCoding(src.getType()));
430    if (src.hasResourceElement())
431      tgt.setResourceElement(Code10_30.convertCode(src.getResourceElement()));
432    if (src.hasLabelElement())
433      tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
434    if (src.hasDescriptionElement())
435      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
436    if (src.hasAccept())
437      tgt.setAcceptElement(convertContentType(src.getAcceptElement()));
438    if (src.hasContentType())
439      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
440    if (src.hasDestinationElement())
441      tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement()));
442    if (src.hasEncodeRequestUrlElement())
443      tgt.setEncodeRequestUrlElement(Boolean10_30.convertBoolean(src.getEncodeRequestUrlElement()));
444    if (src.hasParamsElement())
445      tgt.setParamsElement(String10_30.convertString(src.getParamsElement()));
446    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
447      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
448    if (src.hasResponseIdElement())
449      tgt.setResponseIdElement(Id10_30.convertId(src.getResponseIdElement()));
450    if (src.hasSourceIdElement())
451      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
452    if (src.hasTargetId())
453      tgt.setTargetId(src.getTargetId());
454    if (src.hasUrlElement())
455      tgt.setUrlElement(String10_30.convertString(src.getUrlElement()));
456    return tgt;
457  }
458
459  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent src) throws FHIRException {
460    if (src == null || src.isEmpty())
461      return null;
462    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent();
463    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
464    if (src.hasFieldElement())
465      tgt.setFieldElement(String10_30.convertString(src.getFieldElement()));
466    if (src.hasValueElement())
467      tgt.setValueElement(String10_30.convertString(src.getValueElement()));
468    return tgt;
469  }
470
471  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException {
472    if (src == null || src.isEmpty())
473      return null;
474    org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionOperationRequestHeaderComponent();
475    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
476    if (src.hasFieldElement())
477      tgt.setFieldElement(String10_30.convertString(src.getFieldElement()));
478    if (src.hasValueElement())
479      tgt.setValueElement(String10_30.convertString(src.getValueElement()));
480    return tgt;
481  }
482
483  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent src) throws FHIRException {
484    if (src == null || src.isEmpty())
485      return null;
486    org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent();
487    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
488    if (src.hasOperation())
489      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
490    return tgt;
491  }
492
493  public static org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent src) throws FHIRException {
494    if (src == null || src.isEmpty())
495      return null;
496    org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent();
497    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
498    if (src.hasOperation())
499      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
500    return tgt;
501  }
502
503  public static org.hl7.fhir.dstu3.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent src) throws FHIRException {
504    if (src == null || src.isEmpty())
505      return null;
506    org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent();
507    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
508    if (src.hasOperation())
509      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
510    if (src.hasAssert())
511      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
512    return tgt;
513  }
514
515  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestScript.TestActionComponent src) throws FHIRException {
516    if (src == null || src.isEmpty())
517      return null;
518    org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent();
519    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
520    if (src.hasOperation())
521      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
522    if (src.hasAssert())
523      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
524    return tgt;
525  }
526
527  public static org.hl7.fhir.dstu2.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException {
528    if (src == null || src.isEmpty())
529      return null;
530    org.hl7.fhir.dstu2.model.TestScript tgt = new org.hl7.fhir.dstu2.model.TestScript();
531    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
532    if (src.hasUrlElement())
533      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
534    if (src.hasVersionElement())
535      tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
536    if (src.hasNameElement())
537      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
538    if (src.hasStatus())
539      tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
540    if (src.hasIdentifier())
541      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
542    if (src.hasExperimental())
543      tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
544    if (src.hasPublisherElement())
545      tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
546    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
547      tgt.addContact(convertTestScriptContactComponent(t));
548    if (src.hasDate())
549      tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
550    if (src.hasDescription())
551      tgt.setDescription(src.getDescription());
552    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
553      if (t.hasValueCodeableConcept())
554        tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
555    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
556      tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
557    if (src.hasPurpose())
558      tgt.setRequirements(src.getPurpose());
559    if (src.hasCopyright())
560      tgt.setCopyright(src.getCopyright());
561    if (src.hasMetadata())
562      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
563    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
564      tgt.addFixture(convertTestScriptFixtureComponent(t));
565    for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(Reference10_30.convertReference(t));
566    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable())
567      tgt.addVariable(convertTestScriptVariableComponent(t));
568    if (src.hasSetup())
569      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
570    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest())
571      tgt.addTest(convertTestScriptTestComponent(t));
572    if (src.hasTeardown())
573      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
574    return tgt;
575  }
576
577  public static org.hl7.fhir.dstu3.model.TestScript convertTestScript(org.hl7.fhir.dstu2.model.TestScript src) throws FHIRException {
578    if (src == null || src.isEmpty())
579      return null;
580    org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript();
581    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
582    if (src.hasUrlElement())
583      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
584    if (src.hasVersionElement())
585      tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
586    if (src.hasNameElement())
587      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
588    if (src.hasStatus())
589      tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
590    if (src.hasIdentifier())
591      tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
592    if (src.hasExperimental())
593      tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
594    if (src.hasPublisherElement())
595      tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
596    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent t : src.getContact())
597      tgt.addContact(convertTestScriptContactComponent(t));
598    if (src.hasDate())
599      tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
600    if (src.hasDescription())
601      tgt.setDescription(src.getDescription());
602    for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext())
603      if (VersionConvertor_10_30.isJurisdiction(t))
604        tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
605      else
606        tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
607    if (src.hasRequirements())
608      tgt.setPurpose(src.getRequirements());
609    if (src.hasCopyright())
610      tgt.setCopyright(src.getCopyright());
611    if (src.hasMetadata())
612      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
613    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
614      tgt.addFixture(convertTestScriptFixtureComponent(t));
615    for (org.hl7.fhir.dstu2.model.Reference t : src.getProfile()) tgt.addProfile(Reference10_30.convertReference(t));
616    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent t : src.getVariable())
617      tgt.addVariable(convertTestScriptVariableComponent(t));
618    if (src.hasSetup())
619      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
620    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent t : src.getTest())
621      tgt.addTest(convertTestScriptTestComponent(t));
622    if (src.hasTeardown())
623      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
624    return tgt;
625  }
626
627  public static org.hl7.fhir.dstu3.model.ContactDetail convertTestScriptContactComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent src) throws FHIRException {
628    if (src == null || src.isEmpty())
629      return null;
630    org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
631    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
632    if (src.hasNameElement())
633      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
634    for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom())
635      tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
636    return tgt;
637  }
638
639  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent convertTestScriptContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
640    if (src == null || src.isEmpty())
641      return null;
642    org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptContactComponent();
643    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
644    if (src.hasNameElement())
645      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
646    for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
647      tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
648    return tgt;
649  }
650
651  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
652    if (src == null || src.isEmpty())
653      return null;
654    org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent();
655    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
656    if (src.hasAutocreateElement())
657      tgt.setAutocreateElement(Boolean10_30.convertBoolean(src.getAutocreateElement()));
658    if (src.hasAutodeleteElement())
659      tgt.setAutodeleteElement(Boolean10_30.convertBoolean(src.getAutodeleteElement()));
660    if (src.hasResource())
661      tgt.setResource(Reference10_30.convertReference(src.getResource()));
662    return tgt;
663  }
664
665  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
666    if (src == null || src.isEmpty())
667      return null;
668    org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent();
669    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
670    if (src.hasAutocreateElement())
671      tgt.setAutocreateElement(Boolean10_30.convertBoolean(src.getAutocreateElement()));
672    if (src.hasAutodeleteElement())
673      tgt.setAutodeleteElement(Boolean10_30.convertBoolean(src.getAutodeleteElement()));
674    if (src.hasResource())
675      tgt.setResource(Reference10_30.convertReference(src.getResource()));
676    return tgt;
677  }
678
679  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
680    if (src == null || src.isEmpty())
681      return null;
682    org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent();
683    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
684    if (src.hasRequiredElement())
685      tgt.setRequiredElement(Boolean10_30.convertBoolean(src.getRequiredElement()));
686    if (src.hasValidatedElement())
687      tgt.setValidatedElement(Boolean10_30.convertBoolean(src.getValidatedElement()));
688    if (src.hasDescriptionElement())
689      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
690    if (src.hasDestinationElement())
691      tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement()));
692    for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
693    if (src.hasCapabilities())
694      tgt.setConformance(Reference10_30.convertReference(src.getCapabilities()));
695    return tgt;
696  }
697
698  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
699    if (src == null || src.isEmpty())
700      return null;
701    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent();
702    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
703    if (src.hasRequiredElement())
704      tgt.setRequiredElement(Boolean10_30.convertBoolean(src.getRequiredElement()));
705    if (src.hasValidatedElement())
706      tgt.setValidatedElement(Boolean10_30.convertBoolean(src.getValidatedElement()));
707    if (src.hasDescriptionElement())
708      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
709    if (src.hasDestinationElement())
710      tgt.setDestinationElement(Integer10_30.convertInteger(src.getDestinationElement()));
711    for (org.hl7.fhir.dstu2.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
712    if (src.hasConformance())
713      tgt.setCapabilities(Reference10_30.convertReference(src.getConformance()));
714    return tgt;
715  }
716
717  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
718    if (src == null || src.isEmpty())
719      return null;
720    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent();
721    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
722    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
723      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
724    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
725      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
726    return tgt;
727  }
728
729  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
730    if (src == null || src.isEmpty())
731      return null;
732    org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent();
733    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
734    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
735      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
736    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
737      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
738    return tgt;
739  }
740
741  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
742    if (src == null || src.isEmpty())
743      return null;
744    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent();
745    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
746    if (src.hasUrlElement())
747      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
748    if (src.hasDescriptionElement())
749      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
750    return tgt;
751  }
752
753  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
754    if (src == null || src.isEmpty())
755      return null;
756    org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataLinkComponent();
757    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
758    if (src.hasUrlElement())
759      tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
760    if (src.hasDescriptionElement())
761      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
762    return tgt;
763  }
764
765  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
766    if (src == null || src.isEmpty())
767      return null;
768    org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent();
769    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
770    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupActionComponent t : src.getAction())
771      tgt.addAction(convertSetupActionComponent(t));
772    return tgt;
773  }
774
775  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
776    if (src == null || src.isEmpty())
777      return null;
778    org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent();
779    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
780    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction())
781      tgt.addAction(convertSetupActionComponent(t));
782    return tgt;
783  }
784
785  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
786    if (src == null || src.isEmpty())
787      return null;
788    org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent();
789    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
790    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownActionComponent t : src.getAction())
791      tgt.addAction(convertTeardownActionComponent(t));
792    return tgt;
793  }
794
795  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
796    if (src == null || src.isEmpty())
797      return null;
798    org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTeardownComponent();
799    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
800    for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction())
801      tgt.addAction(convertTeardownActionComponent(t));
802    return tgt;
803  }
804
805  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent src) throws FHIRException {
806    if (src == null || src.isEmpty())
807      return null;
808    org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent();
809    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
810    if (src.hasNameElement())
811      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
812    if (src.hasDescriptionElement())
813      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
814    for (org.hl7.fhir.dstu2.model.TestScript.TestScriptTestActionComponent t : src.getAction())
815      tgt.addAction(convertTestActionComponent(t));
816    return tgt;
817  }
818
819  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent src) throws FHIRException {
820    if (src == null || src.isEmpty())
821      return null;
822    org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptTestComponent();
823    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
824    if (src.hasNameElement())
825      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
826    if (src.hasDescriptionElement())
827      tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
828    for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction())
829      tgt.addAction(convertTestActionComponent(t));
830    return tgt;
831  }
832
833  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
834    if (src == null || src.isEmpty())
835      return null;
836    org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent();
837    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
838    if (src.hasNameElement())
839      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
840    if (src.hasHeaderFieldElement())
841      tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement()));
842    if (src.hasPathElement())
843      tgt.setPathElement(String10_30.convertString(src.getPathElement()));
844    if (src.hasSourceIdElement())
845      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
846    return tgt;
847  }
848
849  public static org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
850    if (src == null || src.isEmpty())
851      return null;
852    org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2.model.TestScript.TestScriptVariableComponent();
853    ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
854    if (src.hasNameElement())
855      tgt.setNameElement(String10_30.convertString(src.getNameElement()));
856    if (src.hasHeaderFieldElement())
857      tgt.setHeaderFieldElement(String10_30.convertString(src.getHeaderFieldElement()));
858    if (src.hasPathElement())
859      tgt.setPathElement(String10_30.convertString(src.getPathElement()));
860    if (src.hasSourceIdElement())
861      tgt.setSourceIdElement(Id10_30.convertId(src.getSourceIdElement()));
862    return tgt;
863  }
864}