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