001package org.hl7.fhir.convertors.conv14_30.resources14_30;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_30;
004import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
005import org.hl7.fhir.convertors.conv14_30.datatypes14_30.Reference14_30;
006import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.CodeableConcept14_30;
007import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.ContactPoint14_30;
008import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.Identifier14_30;
009import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.*;
010import org.hl7.fhir.exceptions.FHIRException;
011
012public class TestScript14_30 {
013
014  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType> src) throws FHIRException {
015    if (src == null || src.isEmpty())
016      return null;
017    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());
018    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
019    switch (src.getValue()) {
020      case RESPONSE:
021        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE);
022        break;
023      case REQUEST:
024        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST);
025        break;
026      default:
027        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL);
028        break;
029    }
030    return tgt;
031  }
032
033  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> src) throws FHIRException {
034    if (src == null || src.isEmpty())
035      return null;
036    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionTypeEnumFactory());
037    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
038    switch (src.getValue()) {
039      case RESPONSE:
040        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.RESPONSE);
041        break;
042      case REQUEST:
043        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.REQUEST);
044        break;
045      default:
046        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionDirectionType.NULL);
047        break;
048    }
049    return tgt;
050  }
051
052  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> src) throws FHIRException {
053    if (src == null || src.isEmpty())
054      return null;
055    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorTypeEnumFactory());
056    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
057    switch (src.getValue()) {
058      case EQUALS:
059        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EQUALS);
060        break;
061      case NOTEQUALS:
062        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEQUALS);
063        break;
064      case IN:
065        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.IN);
066        break;
067      case NOTIN:
068        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTIN);
069        break;
070      case GREATERTHAN:
071        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.GREATERTHAN);
072        break;
073      case LESSTHAN:
074        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.LESSTHAN);
075        break;
076      case EMPTY:
077        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.EMPTY);
078        break;
079      case NOTEMPTY:
080        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTEMPTY);
081        break;
082      case CONTAINS:
083        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.CONTAINS);
084        break;
085      case NOTCONTAINS:
086        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NOTCONTAINS);
087        break;
088      default:
089        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType.NULL);
090        break;
091    }
092    return tgt;
093  }
094
095  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionOperatorType> src) throws FHIRException {
096    if (src == null || src.isEmpty())
097      return null;
098    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());
099    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
100    switch (src.getValue()) {
101      case EQUALS:
102        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS);
103        break;
104      case NOTEQUALS:
105        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS);
106        break;
107      case IN:
108        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN);
109        break;
110      case NOTIN:
111        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN);
112        break;
113      case GREATERTHAN:
114        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN);
115        break;
116      case LESSTHAN:
117        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN);
118        break;
119      case EMPTY:
120        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY);
121        break;
122      case NOTEMPTY:
123        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY);
124        break;
125      case CONTAINS:
126        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS);
127        break;
128      case NOTCONTAINS:
129        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS);
130        break;
131      default:
132        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL);
133        break;
134    }
135    return tgt;
136  }
137
138  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
139    if (src == null || src.isEmpty())
140      return null;
141    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());
142    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
143    switch (src.getValue()) {
144      case OKAY:
145        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY);
146        break;
147      case CREATED:
148        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED);
149        break;
150      case NOCONTENT:
151        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT);
152        break;
153      case NOTMODIFIED:
154        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
155        break;
156      case BAD:
157        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD);
158        break;
159      case FORBIDDEN:
160        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN);
161        break;
162      case NOTFOUND:
163        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND);
164        break;
165      case METHODNOTALLOWED:
166        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
167        break;
168      case CONFLICT:
169        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT);
170        break;
171      case GONE:
172        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE);
173        break;
174      case PRECONDITIONFAILED:
175        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
176        break;
177      case UNPROCESSABLE:
178        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE);
179        break;
180      default:
181        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL);
182        break;
183    }
184    return tgt;
185  }
186
187  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
188    if (src == null || src.isEmpty())
189      return null;
190    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypesEnumFactory());
191    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
192    switch (src.getValue()) {
193      case OKAY:
194        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.OKAY);
195        break;
196      case CREATED:
197        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CREATED);
198        break;
199      case NOCONTENT:
200        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOCONTENT);
201        break;
202      case NOTMODIFIED:
203        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
204        break;
205      case BAD:
206        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.BAD);
207        break;
208      case FORBIDDEN:
209        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.FORBIDDEN);
210        break;
211      case NOTFOUND:
212        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NOTFOUND);
213        break;
214      case METHODNOTALLOWED:
215        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
216        break;
217      case CONFLICT:
218        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.CONFLICT);
219        break;
220      case GONE:
221        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.GONE);
222        break;
223      case PRECONDITIONFAILED:
224        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
225        break;
226      case UNPROCESSABLE:
227        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.UNPROCESSABLE);
228        break;
229      default:
230        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.AssertionResponseTypes.NULL);
231        break;
232    }
233    return tgt;
234  }
235
236  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.ContentType> src) throws FHIRException {
237    if (src == null || src.isEmpty())
238      return null;
239    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());
240    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
241    switch (src.getValue()) {
242      case XML:
243        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.XML);
244        break;
245      case JSON:
246        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON);
247        break;
248      default:
249        tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.ContentType.NULL);
250        break;
251    }
252    return tgt;
253  }
254
255  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.ContentType> convertContentType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.ContentType> src) throws FHIRException {
256    if (src == null || src.isEmpty())
257      return null;
258    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.TestScript.ContentType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.TestScript.ContentTypeEnumFactory());
259    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
260    switch (src.getValue()) {
261      case XML:
262        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.XML);
263        break;
264      case JSON:
265        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.JSON);
266        break;
267      default:
268        tgt.setValue(org.hl7.fhir.dstu2016may.model.TestScript.ContentType.NULL);
269        break;
270    }
271    return tgt;
272  }
273
274  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException {
275    if (src == null || src.isEmpty())
276      return null;
277    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertComponent();
278    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
279    if (src.hasLabel())
280      tgt.setLabelElement(String14_30.convertString(src.getLabelElement()));
281    if (src.hasDescription())
282      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
283    if (src.hasDirection())
284      tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
285    if (src.hasCompareToSourceId())
286      tgt.setCompareToSourceIdElement(String14_30.convertString(src.getCompareToSourceIdElement()));
287    if (src.hasCompareToSourcePath())
288      tgt.setCompareToSourcePathElement(String14_30.convertString(src.getCompareToSourcePathElement()));
289    if (src.hasContentType())
290      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
291    if (src.hasHeaderField())
292      tgt.setHeaderFieldElement(String14_30.convertString(src.getHeaderFieldElement()));
293    if (src.hasMinimumId())
294      tgt.setMinimumIdElement(String14_30.convertString(src.getMinimumIdElement()));
295    if (src.hasNavigationLinks())
296      tgt.setNavigationLinksElement(Boolean14_30.convertBoolean(src.getNavigationLinksElement()));
297    if (src.hasOperator())
298      tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
299    if (src.hasPath())
300      tgt.setPathElement(String14_30.convertString(src.getPathElement()));
301    if (src.hasResource())
302      tgt.setResourceElement(Code14_30.convertCode(src.getResourceElement()));
303    if (src.hasResponse())
304      tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
305    if (src.hasResponseCode())
306      tgt.setResponseCodeElement(String14_30.convertString(src.getResponseCodeElement()));
307    if (src.hasRule())
308      tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule()));
309    if (src.hasRuleset())
310      tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset()));
311    if (src.hasSourceId())
312      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
313    if (src.hasValidateProfileId())
314      tgt.setValidateProfileIdElement(Id14_30.convertId(src.getValidateProfileIdElement()));
315    if (src.hasValue())
316      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
317    if (src.hasWarningOnly())
318      tgt.setWarningOnlyElement(Boolean14_30.convertBoolean(src.getWarningOnlyElement()));
319    return tgt;
320  }
321
322  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertComponent src) throws FHIRException {
323    if (src == null || src.isEmpty())
324      return null;
325    org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent();
326    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
327    if (src.hasLabel())
328      tgt.setLabelElement(String14_30.convertString(src.getLabelElement()));
329    if (src.hasDescription())
330      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
331    if (src.hasDirection())
332      tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
333    if (src.hasCompareToSourceId())
334      tgt.setCompareToSourceIdElement(String14_30.convertString(src.getCompareToSourceIdElement()));
335    if (src.hasCompareToSourcePath())
336      tgt.setCompareToSourcePathElement(String14_30.convertString(src.getCompareToSourcePathElement()));
337    if (src.hasContentType())
338      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
339    if (src.hasHeaderField())
340      tgt.setHeaderFieldElement(String14_30.convertString(src.getHeaderFieldElement()));
341    if (src.hasMinimumId())
342      tgt.setMinimumIdElement(String14_30.convertString(src.getMinimumIdElement()));
343    if (src.hasNavigationLinks())
344      tgt.setNavigationLinksElement(Boolean14_30.convertBoolean(src.getNavigationLinksElement()));
345    if (src.hasOperator())
346      tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
347    if (src.hasPath())
348      tgt.setPathElement(String14_30.convertString(src.getPathElement()));
349    if (src.hasResource())
350      tgt.setResourceElement(Code14_30.convertCode(src.getResourceElement()));
351    if (src.hasResponse())
352      tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
353    if (src.hasResponseCode())
354      tgt.setResponseCodeElement(String14_30.convertString(src.getResponseCodeElement()));
355    if (src.hasRule())
356      tgt.setRule(convertSetupActionAssertRuleComponent(src.getRule()));
357    if (src.hasRuleset())
358      tgt.setRuleset(convertSetupActionAssertRulesetComponent(src.getRuleset()));
359    if (src.hasSourceId())
360      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
361    if (src.hasValidateProfileId())
362      tgt.setValidateProfileIdElement(Id14_30.convertId(src.getValidateProfileIdElement()));
363    if (src.hasValue())
364      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
365    if (src.hasWarningOnly())
366      tgt.setWarningOnlyElement(Boolean14_30.convertBoolean(src.getWarningOnlyElement()));
367    return tgt;
368  }
369
370  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent convertSetupActionAssertRuleComponent(org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent src) throws FHIRException {
371    if (src == null || src.isEmpty())
372      return null;
373    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent();
374    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
375    for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent t : src.getParam())
376      tgt.addParam(convertSetupActionAssertRuleParamComponent(t));
377    return tgt;
378  }
379
380  public static org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent convertSetupActionAssertRuleComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleComponent src) throws FHIRException {
381    if (src == null || src.isEmpty())
382      return null;
383    org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleComponent();
384    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
385    for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent t : src.getParam())
386      tgt.addParam(convertSetupActionAssertRuleParamComponent(t));
387    return tgt;
388  }
389
390  public static org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent convertSetupActionAssertRuleParamComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent src) throws FHIRException {
391    if (src == null || src.isEmpty())
392      return null;
393    org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent();
394    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
395    if (src.hasNameElement())
396      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
397    if (src.hasValue())
398      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
399    return tgt;
400  }
401
402  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent convertSetupActionAssertRuleParamComponent(org.hl7.fhir.dstu3.model.TestScript.ActionAssertRuleParamComponent src) throws FHIRException {
403    if (src == null || src.isEmpty())
404      return null;
405    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRuleParamComponent();
406    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
407    if (src.hasNameElement())
408      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
409    if (src.hasValue())
410      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
411    return tgt;
412  }
413
414  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent convertSetupActionAssertRulesetComponent(org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent src) throws FHIRException {
415    if (src == null || src.isEmpty())
416      return null;
417    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent();
418    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
419    for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent t : src.getRule())
420      tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t));
421    return tgt;
422  }
423
424  public static org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent convertSetupActionAssertRulesetComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetComponent src) throws FHIRException {
425    if (src == null || src.isEmpty())
426      return null;
427    org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetComponent();
428    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
429    for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent t : src.getRule())
430      tgt.addRule(convertSetupActionAssertRulesetRuleComponent(t));
431    return tgt;
432  }
433
434  public static org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent convertSetupActionAssertRulesetRuleComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent src) throws FHIRException {
435    if (src == null || src.isEmpty())
436      return null;
437    org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent();
438    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
439    for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent t : src.getParam())
440      tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t));
441    return tgt;
442  }
443
444  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent convertSetupActionAssertRulesetRuleComponent(org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleComponent src) throws FHIRException {
445    if (src == null || src.isEmpty())
446      return null;
447    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleComponent();
448    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
449    for (org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent t : src.getParam())
450      tgt.addParam(convertSetupActionAssertRulesetRuleParamComponent(t));
451    return tgt;
452  }
453
454  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent convertSetupActionAssertRulesetRuleParamComponent(org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent src) throws FHIRException {
455    if (src == null || src.isEmpty())
456      return null;
457    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent();
458    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
459    if (src.hasNameElement())
460      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
461    if (src.hasValue())
462      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
463    return tgt;
464  }
465
466  public static org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent convertSetupActionAssertRulesetRuleParamComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionAssertRulesetRuleParamComponent src) throws FHIRException {
467    if (src == null || src.isEmpty())
468      return null;
469    org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.ActionAssertRulesetRuleParamComponent();
470    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
471    if (src.hasNameElement())
472      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
473    if (src.hasValue())
474      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
475    return tgt;
476  }
477
478  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent src) throws FHIRException {
479    if (src == null || src.isEmpty())
480      return null;
481    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent();
482    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
483    if (src.hasOperation())
484      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
485    if (src.hasAssert())
486      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
487    return tgt;
488  }
489
490  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent src) throws FHIRException {
491    if (src == null || src.isEmpty())
492      return null;
493    org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent();
494    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
495    if (src.hasOperation())
496      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
497    if (src.hasAssert())
498      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
499    return tgt;
500  }
501
502  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationComponent src) throws FHIRException {
503    if (src == null || src.isEmpty())
504      return null;
505    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent();
506    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
507    if (src.hasType())
508      tgt.setType(Code14_30.convertCoding(src.getType()));
509    if (src.hasResource())
510      tgt.setResourceElement(Code14_30.convertCode(src.getResourceElement()));
511    if (src.hasLabel())
512      tgt.setLabelElement(String14_30.convertString(src.getLabelElement()));
513    if (src.hasDescription())
514      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
515    if (src.hasAccept())
516      tgt.setAcceptElement(convertContentType(src.getAcceptElement()));
517    if (src.hasContentType())
518      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
519    if (src.hasDestination())
520      tgt.setDestinationElement(Integer14_30.convertInteger(src.getDestinationElement()));
521    if (src.hasEncodeRequestUrl())
522      tgt.setEncodeRequestUrlElement(Boolean14_30.convertBoolean(src.getEncodeRequestUrlElement()));
523    if (src.hasOrigin())
524      tgt.setOriginElement(Integer14_30.convertInteger(src.getOriginElement()));
525    if (src.hasParams())
526      tgt.setParamsElement(String14_30.convertString(src.getParamsElement()));
527    for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
528      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
529    if (src.hasResponseId())
530      tgt.setResponseIdElement(Id14_30.convertId(src.getResponseIdElement()));
531    if (src.hasSourceId())
532      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
533    if (src.hasTargetId())
534      tgt.setTargetId(src.getTargetId());
535    if (src.hasUrl())
536      tgt.setUrlElement(String14_30.convertString(src.getUrlElement()));
537    return tgt;
538  }
539
540  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent src) throws FHIRException {
541    if (src == null || src.isEmpty())
542      return null;
543    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationComponent();
544    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
545    if (src.hasResource())
546      tgt.setResourceElement(Code14_30.convertCode(src.getResourceElement()));
547    if (src.hasLabel())
548      tgt.setLabelElement(String14_30.convertString(src.getLabelElement()));
549    if (src.hasDescription())
550      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
551    if (src.hasAccept())
552      tgt.setAcceptElement(convertContentType(src.getAcceptElement()));
553    if (src.hasContentType())
554      tgt.setContentTypeElement(convertContentType(src.getContentTypeElement()));
555    if (src.hasDestination())
556      tgt.setDestinationElement(Integer14_30.convertInteger(src.getDestinationElement()));
557    if (src.hasEncodeRequestUrl())
558      tgt.setEncodeRequestUrlElement(Boolean14_30.convertBoolean(src.getEncodeRequestUrlElement()));
559    if (src.hasOrigin())
560      tgt.setOriginElement(Integer14_30.convertInteger(src.getOriginElement()));
561    if (src.hasParams())
562      tgt.setParamsElement(String14_30.convertString(src.getParamsElement()));
563    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
564      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
565    if (src.hasResponseId())
566      tgt.setResponseIdElement(Id14_30.convertId(src.getResponseIdElement()));
567    if (src.hasSourceId())
568      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
569    if (src.hasTargetId())
570      tgt.setTargetId(src.getTargetId());
571    if (src.hasUrl())
572      tgt.setUrlElement(String14_30.convertString(src.getUrlElement()));
573    return tgt;
574  }
575
576  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException {
577    if (src == null || src.isEmpty())
578      return null;
579    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent();
580    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
581    if (src.hasFieldElement())
582      tgt.setFieldElement(String14_30.convertString(src.getFieldElement()));
583    if (src.hasValueElement())
584      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
585    return tgt;
586  }
587
588  public static org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException {
589    if (src == null || src.isEmpty())
590      return null;
591    org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.SetupActionOperationRequestHeaderComponent();
592    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
593    if (src.hasFieldElement())
594      tgt.setFieldElement(String14_30.convertString(src.getFieldElement()));
595    if (src.hasValueElement())
596      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
597    return tgt;
598  }
599
600  public static org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent src) throws FHIRException {
601    if (src == null || src.isEmpty())
602      return null;
603    org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent();
604    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
605    if (src.hasOperation())
606      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
607    return tgt;
608  }
609
610  public static org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent src) throws FHIRException {
611    if (src == null || src.isEmpty())
612      return null;
613    org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent();
614    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
615    if (src.hasOperation())
616      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
617    return tgt;
618  }
619
620  public static org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestScript.TestActionComponent src) throws FHIRException {
621    if (src == null || src.isEmpty())
622      return null;
623    org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent();
624    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
625    if (src.hasOperation())
626      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
627    if (src.hasAssert())
628      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
629    return tgt;
630  }
631
632  public static org.hl7.fhir.dstu3.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent src) throws FHIRException {
633    if (src == null || src.isEmpty())
634      return null;
635    org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent();
636    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
637    if (src.hasOperation())
638      tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
639    if (src.hasAssert())
640      tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
641    return tgt;
642  }
643
644  public static org.hl7.fhir.dstu3.model.TestScript convertTestScript(org.hl7.fhir.dstu2016may.model.TestScript src) throws FHIRException {
645    if (src == null || src.isEmpty())
646      return null;
647    org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript();
648    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
649    if (src.hasUrlElement())
650      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
651    if (src.hasVersion())
652      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
653    if (src.hasNameElement())
654      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
655    if (src.hasStatus())
656      tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement()));
657    if (src.hasIdentifier())
658      tgt.setIdentifier(Identifier14_30.convertIdentifier(src.getIdentifier()));
659    if (src.hasExperimental())
660      tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement()));
661    if (src.hasPublisher())
662      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
663    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent t : src.getContact())
664      tgt.addContact(convertTestScriptContactComponent(t));
665    if (src.hasDate())
666      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
667    if (src.hasDescription())
668      tgt.setDescription(src.getDescription());
669    for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext())
670      if (VersionConvertor_14_30.isJurisdiction(t))
671        tgt.addJurisdiction(CodeableConcept14_30.convertCodeableConcept(t));
672      else
673        tgt.addUseContext(CodeableConcept14_30.convertCodeableConceptToUsageContext(t));
674    if (src.hasRequirements())
675      tgt.setPurpose(src.getRequirements());
676    if (src.hasCopyright())
677      tgt.setCopyright(src.getCopyright());
678    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent t : src.getOrigin())
679      tgt.addOrigin(convertTestScriptOriginComponent(t));
680    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent t : src.getDestination())
681      tgt.addDestination(convertTestScriptDestinationComponent(t));
682    if (src.hasMetadata())
683      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
684    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
685      tgt.addFixture(convertTestScriptFixtureComponent(t));
686    for (org.hl7.fhir.dstu2016may.model.Reference t : src.getProfile())
687      tgt.addProfile(Reference14_30.convertReference(t));
688    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent t : src.getVariable())
689      tgt.addVariable(convertTestScriptVariableComponent(t));
690    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent t : src.getRule())
691      tgt.addRule(convertTestScriptRuleComponent(t));
692    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent t : src.getRuleset())
693      tgt.addRuleset(convertTestScriptRulesetComponent(t));
694    if (src.hasSetup())
695      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
696    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent t : src.getTest())
697      tgt.addTest(convertTestScriptTestComponent(t));
698    if (src.hasTeardown())
699      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
700    return tgt;
701  }
702
703  public static org.hl7.fhir.dstu2016may.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException {
704    if (src == null || src.isEmpty())
705      return null;
706    org.hl7.fhir.dstu2016may.model.TestScript tgt = new org.hl7.fhir.dstu2016may.model.TestScript();
707    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt);
708    if (src.hasUrlElement())
709      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
710    if (src.hasVersion())
711      tgt.setVersionElement(String14_30.convertString(src.getVersionElement()));
712    if (src.hasNameElement())
713      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
714    if (src.hasStatus())
715      tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement()));
716    if (src.hasIdentifier())
717      tgt.setIdentifier(Identifier14_30.convertIdentifier(src.getIdentifier()));
718    if (src.hasExperimental())
719      tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement()));
720    if (src.hasPublisher())
721      tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement()));
722    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
723      tgt.addContact(convertTestScriptContactComponent(t));
724    if (src.hasDate())
725      tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement()));
726    if (src.hasDescription())
727      tgt.setDescription(src.getDescription());
728    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
729      if (t.hasValueCodeableConcept())
730        tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t.getValueCodeableConcept()));
731    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
732      tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t));
733    if (src.hasPurpose())
734      tgt.setRequirements(src.getPurpose());
735    if (src.hasCopyright())
736      tgt.setCopyright(src.getCopyright());
737    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin())
738      tgt.addOrigin(convertTestScriptOriginComponent(t));
739    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination())
740      tgt.addDestination(convertTestScriptDestinationComponent(t));
741    if (src.hasMetadata())
742      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
743    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
744      tgt.addFixture(convertTestScriptFixtureComponent(t));
745    for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.addProfile(Reference14_30.convertReference(t));
746    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable())
747      tgt.addVariable(convertTestScriptVariableComponent(t));
748    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent t : src.getRule())
749      tgt.addRule(convertTestScriptRuleComponent(t));
750    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent t : src.getRuleset())
751      tgt.addRuleset(convertTestScriptRulesetComponent(t));
752    if (src.hasSetup())
753      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
754    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest())
755      tgt.addTest(convertTestScriptTestComponent(t));
756    if (src.hasTeardown())
757      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
758    return tgt;
759  }
760
761  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent convertTestScriptContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
762    if (src == null || src.isEmpty())
763      return null;
764    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent();
765    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
766    if (src.hasName())
767      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
768    for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
769      tgt.addTelecom(ContactPoint14_30.convertContactPoint(t));
770    return tgt;
771  }
772
773  public static org.hl7.fhir.dstu3.model.ContactDetail convertTestScriptContactComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptContactComponent src) throws FHIRException {
774    if (src == null || src.isEmpty())
775      return null;
776    org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
777    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
778    if (src.hasName())
779      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
780    for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom())
781      tgt.addTelecom(ContactPoint14_30.convertContactPoint(t));
782    return tgt;
783  }
784
785  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent src) throws FHIRException {
786    if (src == null || src.isEmpty())
787      return null;
788    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent();
789    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
790    if (src.hasIndexElement())
791      tgt.setIndexElement(Integer14_30.convertInteger(src.getIndexElement()));
792    if (src.hasProfile())
793      tgt.setProfile(Code14_30.convertCoding(src.getProfile()));
794    return tgt;
795  }
796
797  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptDestinationComponent src) throws FHIRException {
798    if (src == null || src.isEmpty())
799      return null;
800    org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent();
801    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
802    if (src.hasIndexElement())
803      tgt.setIndexElement(Integer14_30.convertInteger(src.getIndexElement()));
804    if (src.hasProfile())
805      tgt.setProfile(Code14_30.convertCoding(src.getProfile()));
806    return tgt;
807  }
808
809  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
810    if (src == null || src.isEmpty())
811      return null;
812    org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent();
813    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
814    if (src.hasAutocreate())
815      tgt.setAutocreateElement(Boolean14_30.convertBoolean(src.getAutocreateElement()));
816    if (src.hasAutodelete())
817      tgt.setAutodeleteElement(Boolean14_30.convertBoolean(src.getAutodeleteElement()));
818    if (src.hasResource())
819      tgt.setResource(Reference14_30.convertReference(src.getResource()));
820    return tgt;
821  }
822
823  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
824    if (src == null || src.isEmpty())
825      return null;
826    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptFixtureComponent();
827    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
828    if (src.hasAutocreate())
829      tgt.setAutocreateElement(Boolean14_30.convertBoolean(src.getAutocreateElement()));
830    if (src.hasAutodelete())
831      tgt.setAutodeleteElement(Boolean14_30.convertBoolean(src.getAutodeleteElement()));
832    if (src.hasResource())
833      tgt.setResource(Reference14_30.convertReference(src.getResource()));
834    return tgt;
835  }
836
837  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
838    if (src == null || src.isEmpty())
839      return null;
840    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent();
841    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
842    if (src.hasRequired())
843      tgt.setRequiredElement(Boolean14_30.convertBoolean(src.getRequiredElement()));
844    if (src.hasValidated())
845      tgt.setValidatedElement(Boolean14_30.convertBoolean(src.getValidatedElement()));
846    if (src.hasDescription())
847      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
848    for (org.hl7.fhir.dstu2016may.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue());
849    if (src.hasDestination())
850      tgt.setDestinationElement(Integer14_30.convertInteger(src.getDestinationElement()));
851    for (org.hl7.fhir.dstu2016may.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
852    if (src.hasConformance())
853      tgt.setCapabilities(Reference14_30.convertReference(src.getConformance()));
854    return tgt;
855  }
856
857  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
858    if (src == null || src.isEmpty())
859      return null;
860    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent();
861    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
862    if (src.hasRequired())
863      tgt.setRequiredElement(Boolean14_30.convertBoolean(src.getRequiredElement()));
864    if (src.hasValidated())
865      tgt.setValidatedElement(Boolean14_30.convertBoolean(src.getValidatedElement()));
866    if (src.hasDescription())
867      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
868    for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue());
869    if (src.hasDestination())
870      tgt.setDestinationElement(Integer14_30.convertInteger(src.getDestinationElement()));
871    for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
872    if (src.hasCapabilities())
873      tgt.setConformance(Reference14_30.convertReference(src.getCapabilities()));
874    return tgt;
875  }
876
877  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
878    if (src == null || src.isEmpty())
879      return null;
880    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent();
881    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
882    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
883      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
884    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
885      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
886    return tgt;
887  }
888
889  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
890    if (src == null || src.isEmpty())
891      return null;
892    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataComponent();
893    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
894    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
895      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
896    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
897      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
898    return tgt;
899  }
900
901  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
902    if (src == null || src.isEmpty())
903      return null;
904    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent();
905    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
906    if (src.hasUrlElement())
907      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
908    if (src.hasDescription())
909      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
910    return tgt;
911  }
912
913  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
914    if (src == null || src.isEmpty())
915      return null;
916    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptMetadataLinkComponent();
917    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
918    if (src.hasUrlElement())
919      tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement()));
920    if (src.hasDescription())
921      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
922    return tgt;
923  }
924
925  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent src) throws FHIRException {
926    if (src == null || src.isEmpty())
927      return null;
928    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent();
929    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
930    if (src.hasIndexElement())
931      tgt.setIndexElement(Integer14_30.convertInteger(src.getIndexElement()));
932    if (src.hasProfile())
933      tgt.setProfile(Code14_30.convertCoding(src.getProfile()));
934    return tgt;
935  }
936
937  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptOriginComponent src) throws FHIRException {
938    if (src == null || src.isEmpty())
939      return null;
940    org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent();
941    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
942    if (src.hasIndexElement())
943      tgt.setIndexElement(Integer14_30.convertInteger(src.getIndexElement()));
944    if (src.hasProfile())
945      tgt.setProfile(Code14_30.convertCoding(src.getProfile()));
946    return tgt;
947  }
948
949  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent convertTestScriptRuleComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent src) throws FHIRException {
950    if (src == null || src.isEmpty())
951      return null;
952    org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent();
953    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
954    if (src.hasResource())
955      tgt.setResource(Reference14_30.convertReference(src.getResource()));
956    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent t : src.getParam())
957      tgt.addParam(convertTestScriptRuleParamComponent(t));
958    return tgt;
959  }
960
961  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent convertTestScriptRuleComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptRuleComponent src) throws FHIRException {
962    if (src == null || src.isEmpty())
963      return null;
964    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleComponent();
965    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
966    if (src.hasResource())
967      tgt.setResource(Reference14_30.convertReference(src.getResource()));
968    for (org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent t : src.getParam())
969      tgt.addParam(convertTestScriptRuleParamComponent(t));
970    return tgt;
971  }
972
973  public static org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent convertTestScriptRuleParamComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent src) throws FHIRException {
974    if (src == null || src.isEmpty())
975      return null;
976    org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent();
977    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
978    if (src.hasNameElement())
979      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
980    if (src.hasValue())
981      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
982    return tgt;
983  }
984
985  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent convertTestScriptRuleParamComponent(org.hl7.fhir.dstu3.model.TestScript.RuleParamComponent src) throws FHIRException {
986    if (src == null || src.isEmpty())
987      return null;
988    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRuleParamComponent();
989    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
990    if (src.hasNameElement())
991      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
992    if (src.hasValue())
993      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
994    return tgt;
995  }
996
997  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent convertTestScriptRulesetComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent src) throws FHIRException {
998    if (src == null || src.isEmpty())
999      return null;
1000    org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent();
1001    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1002    if (src.hasResource())
1003      tgt.setResource(Reference14_30.convertReference(src.getResource()));
1004    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent t : src.getRule())
1005      tgt.addRule(convertTestScriptRulesetRuleComponent(t));
1006    return tgt;
1007  }
1008
1009  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent convertTestScriptRulesetComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptRulesetComponent src) throws FHIRException {
1010    if (src == null || src.isEmpty())
1011      return null;
1012    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetComponent();
1013    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1014    if (src.hasResource())
1015      tgt.setResource(Reference14_30.convertReference(src.getResource()));
1016    for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent t : src.getRule())
1017      tgt.addRule(convertTestScriptRulesetRuleComponent(t));
1018    return tgt;
1019  }
1020
1021  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent convertTestScriptRulesetRuleComponent(org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent src) throws FHIRException {
1022    if (src == null || src.isEmpty())
1023      return null;
1024    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent();
1025    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1026    for (org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent t : src.getParam())
1027      tgt.addParam(convertTestScriptRulesetRuleParamComponent(t));
1028    return tgt;
1029  }
1030
1031  public static org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent convertTestScriptRulesetRuleComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleComponent src) throws FHIRException {
1032    if (src == null || src.isEmpty())
1033      return null;
1034    org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RulesetRuleComponent();
1035    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1036    for (org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent t : src.getParam())
1037      tgt.addParam(convertTestScriptRulesetRuleParamComponent(t));
1038    return tgt;
1039  }
1040
1041  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent convertTestScriptRulesetRuleParamComponent(org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent src) throws FHIRException {
1042    if (src == null || src.isEmpty())
1043      return null;
1044    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent();
1045    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1046    if (src.hasNameElement())
1047      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1048    if (src.hasValue())
1049      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
1050    return tgt;
1051  }
1052
1053  public static org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent convertTestScriptRulesetRuleParamComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptRulesetRuleParamComponent src) throws FHIRException {
1054    if (src == null || src.isEmpty())
1055      return null;
1056    org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.RulesetRuleParamComponent();
1057    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1058    if (src.hasNameElement())
1059      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1060    if (src.hasValue())
1061      tgt.setValueElement(String14_30.convertString(src.getValueElement()));
1062    return tgt;
1063  }
1064
1065  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
1066    if (src == null || src.isEmpty())
1067      return null;
1068    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent();
1069    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1070    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction())
1071      tgt.addAction(convertSetupActionComponent(t));
1072    return tgt;
1073  }
1074
1075  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
1076    if (src == null || src.isEmpty())
1077      return null;
1078    org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent();
1079    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1080    for (org.hl7.fhir.dstu2016may.model.TestScript.SetupActionComponent t : src.getAction())
1081      tgt.addAction(convertSetupActionComponent(t));
1082    return tgt;
1083  }
1084
1085  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
1086    if (src == null || src.isEmpty())
1087      return null;
1088    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent();
1089    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1090    for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction())
1091      tgt.addAction(convertTeardownActionComponent(t));
1092    return tgt;
1093  }
1094
1095  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
1096    if (src == null || src.isEmpty())
1097      return null;
1098    org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent();
1099    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1100    for (org.hl7.fhir.dstu2016may.model.TestScript.TeardownActionComponent t : src.getAction())
1101      tgt.addAction(convertTeardownActionComponent(t));
1102    return tgt;
1103  }
1104
1105  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent src) throws FHIRException {
1106    if (src == null || src.isEmpty())
1107      return null;
1108    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent();
1109    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1110    if (src.hasName())
1111      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1112    if (src.hasDescription())
1113      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
1114    for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction())
1115      tgt.addAction(convertTestActionComponent(t));
1116    return tgt;
1117  }
1118
1119  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptTestComponent src) throws FHIRException {
1120    if (src == null || src.isEmpty())
1121      return null;
1122    org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent();
1123    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1124    if (src.hasName())
1125      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1126    if (src.hasDescription())
1127      tgt.setDescriptionElement(String14_30.convertString(src.getDescriptionElement()));
1128    for (org.hl7.fhir.dstu2016may.model.TestScript.TestActionComponent t : src.getAction())
1129      tgt.addAction(convertTestActionComponent(t));
1130    return tgt;
1131  }
1132
1133  public static org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
1134    if (src == null || src.isEmpty())
1135      return null;
1136    org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent();
1137    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1138    if (src.hasNameElement())
1139      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1140    if (src.hasDefaultValue())
1141      tgt.setDefaultValueElement(String14_30.convertString(src.getDefaultValueElement()));
1142    if (src.hasHeaderField())
1143      tgt.setHeaderFieldElement(String14_30.convertString(src.getHeaderFieldElement()));
1144    if (src.hasPath())
1145      tgt.setPathElement(String14_30.convertString(src.getPathElement()));
1146    if (src.hasSourceId())
1147      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
1148    return tgt;
1149  }
1150
1151  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu2016may.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
1152    if (src == null || src.isEmpty())
1153      return null;
1154    org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent();
1155    ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
1156    if (src.hasNameElement())
1157      tgt.setNameElement(String14_30.convertString(src.getNameElement()));
1158    if (src.hasDefaultValue())
1159      tgt.setDefaultValueElement(String14_30.convertString(src.getDefaultValueElement()));
1160    if (src.hasHeaderField())
1161      tgt.setHeaderFieldElement(String14_30.convertString(src.getHeaderFieldElement()));
1162    if (src.hasPath())
1163      tgt.setPathElement(String14_30.convertString(src.getPathElement()));
1164    if (src.hasSourceId())
1165      tgt.setSourceIdElement(Id14_30.convertId(src.getSourceIdElement()));
1166    return tgt;
1167  }
1168}