001package org.hl7.fhir.convertors.conv30_50.resources30_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_50;
004import org.hl7.fhir.convertors.conv30_50.datatypes30_50.ContactDetail30_50;
005import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
006import org.hl7.fhir.convertors.conv30_50.datatypes30_50.UsageContext30_50;
007import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50;
008import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Coding30_50;
009import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50;
010import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50;
011import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50;
012import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Id30_50;
013import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Integer30_50;
014import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50;
015import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
016import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
017import org.hl7.fhir.exceptions.FHIRException;
018import org.hl7.fhir.r5.model.CanonicalType;
019
020public class TestScript30_50 {
021
022  public static org.hl7.fhir.r5.model.TestScript convertTestScript(org.hl7.fhir.dstu3.model.TestScript src) throws FHIRException {
023    if (src == null)
024      return null;
025    org.hl7.fhir.r5.model.TestScript tgt = new org.hl7.fhir.r5.model.TestScript();
026    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
027    if (src.hasUrl())
028      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
029    if (src.hasIdentifier())
030      tgt.addIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
031    if (src.hasVersion())
032      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
033    if (src.hasName())
034      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
035    if (src.hasTitle())
036      tgt.setTitleElement(String30_50.convertString(src.getTitleElement()));
037    if (src.hasStatus())
038      tgt.setStatusElement(Enumerations30_50.convertPublicationStatus(src.getStatusElement()));
039    if (src.hasExperimental())
040      tgt.setExperimentalElement(Boolean30_50.convertBoolean(src.getExperimentalElement()));
041    if (src.hasDate())
042      tgt.setDateElement(DateTime30_50.convertDateTime(src.getDateElement()));
043    if (src.hasPublisher())
044      tgt.setPublisherElement(String30_50.convertString(src.getPublisherElement()));
045    for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
046      tgt.addContact(ContactDetail30_50.convertContactDetail(t));
047    if (src.hasDescription())
048      tgt.setDescriptionElement(MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
049    for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
050      tgt.addUseContext(UsageContext30_50.convertUsageContext(t));
051    for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
052      tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept(t));
053    if (src.hasPurpose())
054      tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement()));
055    if (src.hasCopyright())
056      tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
057    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent t : src.getOrigin())
058      tgt.addOrigin(convertTestScriptOriginComponent(t));
059    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent t : src.getDestination())
060      tgt.addDestination(convertTestScriptDestinationComponent(t));
061    if (src.hasMetadata())
062      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
063    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
064      tgt.addFixture(convertTestScriptFixtureComponent(t));
065    for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile()) tgt.getProfile().add(Reference30_50.convertReferenceToCanonical(t));
066    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent t : src.getVariable())
067      tgt.addVariable(convertTestScriptVariableComponent(t));
068    if (src.hasSetup())
069      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
070    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent t : src.getTest())
071      tgt.addTest(convertTestScriptTestComponent(t));
072    if (src.hasTeardown())
073      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
074    return tgt;
075  }
076
077  public static org.hl7.fhir.dstu3.model.TestScript convertTestScript(org.hl7.fhir.r5.model.TestScript src) throws FHIRException {
078    if (src == null)
079      return null;
080    org.hl7.fhir.dstu3.model.TestScript tgt = new org.hl7.fhir.dstu3.model.TestScript();
081    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
082    if (src.hasUrl())
083      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
084    if (src.hasIdentifier())
085      tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifierFirstRep()));
086    if (src.hasVersion())
087      tgt.setVersionElement(String30_50.convertString(src.getVersionElement()));
088    if (src.hasName())
089      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
090    if (src.hasTitle())
091      tgt.setTitleElement(String30_50.convertString(src.getTitleElement()));
092    if (src.hasStatus())
093      tgt.setStatusElement(Enumerations30_50.convertPublicationStatus(src.getStatusElement()));
094    if (src.hasExperimental())
095      tgt.setExperimentalElement(Boolean30_50.convertBoolean(src.getExperimentalElement()));
096    if (src.hasDate())
097      tgt.setDateElement(DateTime30_50.convertDateTime(src.getDateElement()));
098    if (src.hasPublisher())
099      tgt.setPublisherElement(String30_50.convertString(src.getPublisherElement()));
100    for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
101      tgt.addContact(ContactDetail30_50.convertContactDetail(t));
102    if (src.hasDescription())
103      tgt.setDescriptionElement(MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
104    for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
105      tgt.addUseContext(UsageContext30_50.convertUsageContext(t));
106    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
107      tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept(t));
108    if (src.hasPurpose())
109      tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement()));
110    if (src.hasCopyright())
111      tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
112    for (org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent t : src.getOrigin())
113      tgt.addOrigin(convertTestScriptOriginComponent(t));
114    for (org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent t : src.getDestination())
115      tgt.addDestination(convertTestScriptDestinationComponent(t));
116    if (src.hasMetadata())
117      tgt.setMetadata(convertTestScriptMetadataComponent(src.getMetadata()));
118    for (org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent t : src.getFixture())
119      tgt.addFixture(convertTestScriptFixtureComponent(t));
120    for (CanonicalType t : src.getProfile()) tgt.addProfile(Reference30_50.convertCanonicalToReference(t));
121    for (org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent t : src.getVariable())
122      tgt.addVariable(convertTestScriptVariableComponent(t));
123    if (src.hasSetup())
124      tgt.setSetup(convertTestScriptSetupComponent(src.getSetup()));
125    for (org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent t : src.getTest())
126      tgt.addTest(convertTestScriptTestComponent(t));
127    if (src.hasTeardown())
128      tgt.setTeardown(convertTestScriptTeardownComponent(src.getTeardown()));
129    return tgt;
130  }
131
132  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent src) throws FHIRException {
133    if (src == null)
134      return null;
135    org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent();
136    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
137    if (src.hasIndex())
138      tgt.setIndexElement(Integer30_50.convertInteger(src.getIndexElement()));
139    if (src.hasProfile())
140      tgt.setProfile(Coding30_50.convertCoding(src.getProfile()));
141    return tgt;
142  }
143
144  public static org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent convertTestScriptDestinationComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptDestinationComponent src) throws FHIRException {
145    if (src == null)
146      return null;
147    org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptDestinationComponent();
148    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
149    if (src.hasIndex())
150      tgt.setIndexElement(Integer30_50.convertInteger(src.getIndexElement()));
151    if (src.hasProfile())
152      tgt.setProfile(Coding30_50.convertCoding(src.getProfile()));
153    return tgt;
154  }
155
156  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
157    if (src == null)
158      return null;
159    org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent();
160    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
161    if (src.hasAutocreate())
162      tgt.setAutocreateElement(Boolean30_50.convertBoolean(src.getAutocreateElement()));
163    if (src.hasAutodelete())
164      tgt.setAutodeleteElement(Boolean30_50.convertBoolean(src.getAutodeleteElement()));
165    if (src.hasResource())
166      tgt.setResource(Reference30_50.convertReference(src.getResource()));
167    return tgt;
168  }
169
170  public static org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
171    if (src == null)
172      return null;
173    org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptFixtureComponent();
174    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
175    if (src.hasAutocreate())
176      tgt.setAutocreateElement(Boolean30_50.convertBoolean(src.getAutocreateElement()));
177    if (src.hasAutodelete())
178      tgt.setAutodeleteElement(Boolean30_50.convertBoolean(src.getAutodeleteElement()));
179    if (src.hasResource())
180      tgt.setResource(Reference30_50.convertReference(src.getResource()));
181    return tgt;
182  }
183
184  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
185    if (src == null)
186      return null;
187    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent();
188    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
189    if (src.hasRequired())
190      tgt.setRequiredElement(Boolean30_50.convertBoolean(src.getRequiredElement()));
191    if (src.hasValidated())
192      tgt.setValidatedElement(Boolean30_50.convertBoolean(src.getValidatedElement()));
193    if (src.hasDescription())
194      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
195    for (org.hl7.fhir.r5.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue());
196    if (src.hasDestination())
197      tgt.setDestinationElement(Integer30_50.convertInteger(src.getDestinationElement()));
198    for (org.hl7.fhir.r5.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
199    if (src.hasCapabilities())
200      tgt.setCapabilities(Reference30_50.convertCanonicalToReference(src.getCapabilitiesElement()));
201    return tgt;
202  }
203
204  public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
205    if (src == null)
206      return null;
207    org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent();
208    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
209    if (src.hasRequired())
210      tgt.setRequiredElement(Boolean30_50.convertBoolean(src.getRequiredElement()));
211    if (src.hasValidated())
212      tgt.setValidatedElement(Boolean30_50.convertBoolean(src.getValidatedElement()));
213    if (src.hasDescription())
214      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
215    for (org.hl7.fhir.dstu3.model.IntegerType t : src.getOrigin()) tgt.addOrigin(t.getValue());
216    if (src.hasDestination())
217      tgt.setDestinationElement(Integer30_50.convertInteger(src.getDestinationElement()));
218    for (org.hl7.fhir.dstu3.model.UriType t : src.getLink()) tgt.addLink(t.getValue());
219    if (src.hasCapabilities())
220      tgt.setCapabilitiesElement(Reference30_50.convertReferenceToCanonical(src.getCapabilities()));
221    return tgt;
222  }
223
224  public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
225    if (src == null)
226      return null;
227    org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent();
228    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
229    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
230      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
231    for (org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
232      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
233    return tgt;
234  }
235
236  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
237    if (src == null)
238      return null;
239    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent();
240    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
241    for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())
242      tgt.addLink(convertTestScriptMetadataLinkComponent(t));
243    for (org.hl7.fhir.r5.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())
244      tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
245    return tgt;
246  }
247
248  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
249    if (src == null)
250      return null;
251    org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent();
252    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
253    if (src.hasUrl())
254      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
255    if (src.hasDescription())
256      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
257    return tgt;
258  }
259
260  public static org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent convertTestScriptMetadataLinkComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent src) throws FHIRException {
261    if (src == null)
262      return null;
263    org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptMetadataLinkComponent();
264    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
265    if (src.hasUrl())
266      tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
267    if (src.hasDescription())
268      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
269    return tgt;
270  }
271
272  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent src) throws FHIRException {
273    if (src == null)
274      return null;
275    org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent();
276    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
277    if (src.hasIndex())
278      tgt.setIndexElement(Integer30_50.convertInteger(src.getIndexElement()));
279    if (src.hasProfile())
280      tgt.setProfile(Coding30_50.convertCoding(src.getProfile()));
281    return tgt;
282  }
283
284  public static org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent convertTestScriptOriginComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptOriginComponent src) throws FHIRException {
285    if (src == null)
286      return null;
287    org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptOriginComponent();
288    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
289    if (src.hasIndex())
290      tgt.setIndexElement(Integer30_50.convertInteger(src.getIndexElement()));
291    if (src.hasProfile())
292      tgt.setProfile(Coding30_50.convertCoding(src.getProfile()));
293    return tgt;
294  }
295
296  public static org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
297    if (src == null)
298      return null;
299    org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent();
300    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
301    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction())
302      tgt.addAction(convertSetupActionComponent(t));
303    return tgt;
304  }
305
306  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.r5.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
307    if (src == null)
308      return null;
309    org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent();
310    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
311    for (org.hl7.fhir.r5.model.TestScript.SetupActionComponent t : src.getAction())
312      tgt.addAction(convertSetupActionComponent(t));
313    return tgt;
314  }
315
316  public static org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
317    if (src == null)
318      return null;
319    org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent();
320    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
321    for (org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent t : src.getAction())
322      tgt.addAction(convertTeardownActionComponent(t));
323    return tgt;
324  }
325
326  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent convertTestScriptTeardownComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTeardownComponent src) throws FHIRException {
327    if (src == null)
328      return null;
329    org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTeardownComponent();
330    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
331    for (org.hl7.fhir.r5.model.TestScript.TeardownActionComponent t : src.getAction())
332      tgt.addAction(convertTeardownActionComponent(t));
333    return tgt;
334  }
335
336  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent src) throws FHIRException {
337    if (src == null)
338      return null;
339    org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent();
340    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
341    if (src.hasName())
342      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
343    if (src.hasDescription())
344      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
345    for (org.hl7.fhir.r5.model.TestScript.TestActionComponent t : src.getAction())
346      tgt.addAction(convertTestActionComponent(t));
347    return tgt;
348  }
349
350  public static org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent convertTestScriptTestComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptTestComponent src) throws FHIRException {
351    if (src == null)
352      return null;
353    org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptTestComponent();
354    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
355    if (src.hasName())
356      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
357    if (src.hasDescription())
358      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
359    for (org.hl7.fhir.dstu3.model.TestScript.TestActionComponent t : src.getAction())
360      tgt.addAction(convertTestActionComponent(t));
361    return tgt;
362  }
363
364  public static org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
365    if (src == null)
366      return null;
367    org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent();
368    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
369    if (src.hasName())
370      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
371    if (src.hasDefaultValue())
372      tgt.setDefaultValueElement(String30_50.convertString(src.getDefaultValueElement()));
373    if (src.hasDescription())
374      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
375    if (src.hasExpression())
376      tgt.setExpressionElement(String30_50.convertString(src.getExpressionElement()));
377    if (src.hasHeaderField())
378      tgt.setHeaderFieldElement(String30_50.convertString(src.getHeaderFieldElement()));
379    if (src.hasHint())
380      tgt.setHintElement(String30_50.convertString(src.getHintElement()));
381    if (src.hasPath())
382      tgt.setPathElement(String30_50.convertString(src.getPathElement()));
383    if (src.hasSourceId())
384      tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
385    return tgt;
386  }
387
388  public static org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent convertTestScriptVariableComponent(org.hl7.fhir.r5.model.TestScript.TestScriptVariableComponent src) throws FHIRException {
389    if (src == null)
390      return null;
391    org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestScriptVariableComponent();
392    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
393    if (src.hasName())
394      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
395    if (src.hasDefaultValue())
396      tgt.setDefaultValueElement(String30_50.convertString(src.getDefaultValueElement()));
397    if (src.hasDescription())
398      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
399    if (src.hasExpression())
400      tgt.setExpressionElement(String30_50.convertString(src.getExpressionElement()));
401    if (src.hasHeaderField())
402      tgt.setHeaderFieldElement(String30_50.convertString(src.getHeaderFieldElement()));
403    if (src.hasHint())
404      tgt.setHintElement(String30_50.convertString(src.getHintElement()));
405    if (src.hasPath())
406      tgt.setPathElement(String30_50.convertString(src.getPathElement()));
407    if (src.hasSourceId())
408      tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
409    return tgt;
410  }
411
412  public static org.hl7.fhir.r5.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent src) throws FHIRException {
413    if (src == null) return null;
414    org.hl7.fhir.r5.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionComponent();
415    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
416    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
417    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
418    return tgt;
419  }
420
421  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestScript.SetupActionComponent src) throws FHIRException {
422    if (src == null) return null;
423    org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent();
424    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
425    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
426    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
427    return tgt;
428  }
429
430  public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent src) throws FHIRException {
431    if (src == null) return null;
432    org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent();
433    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
434    if (src.hasType()) tgt.setType(Coding30_50.convertCoding(src.getType()));
435    if (src.hasResource())
436      tgt.setResource(src.getResource());
437    if (src.hasLabel()) tgt.setLabelElement(String30_50.convertString(src.getLabelElement()));
438    if (src.hasDescription()) tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
439    if (src.hasAccept()) tgt.setAccept(convertContentType(src.getAccept()));
440    if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType()));
441    if (src.hasDestination()) tgt.setDestinationElement(Integer30_50.convertInteger(src.getDestinationElement()));
442    if (src.hasEncodeRequestUrl())
443      tgt.setEncodeRequestUrlElement(Boolean30_50.convertBoolean(src.getEncodeRequestUrlElement()));
444    if (src.hasOrigin()) tgt.setOriginElement(Integer30_50.convertInteger(src.getOriginElement()));
445    if (src.hasParams()) tgt.setParamsElement(String30_50.convertString(src.getParamsElement()));
446    for (org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
447      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
448    if (src.hasRequestId()) tgt.setRequestIdElement(Id30_50.convertId(src.getRequestIdElement()));
449    if (src.hasResponseId()) tgt.setResponseIdElement(Id30_50.convertId(src.getResponseIdElement()));
450    if (src.hasSourceId()) tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
451    if (src.hasTargetId()) tgt.setTargetId(src.getTargetId());
452    if (src.hasUrl()) tgt.setUrlElement(String30_50.convertString(src.getUrlElement()));
453    return tgt;
454  }
455
456  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationComponent src) throws FHIRException {
457    if (src == null) return null;
458    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationComponent();
459    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
460    if (src.hasType()) tgt.setType(Coding30_50.convertCoding(src.getType()));
461    if (src.hasResource()) tgt.setResource(src.getResource());
462    if (src.hasLabel()) tgt.setLabelElement(String30_50.convertString(src.getLabelElement()));
463    if (src.hasDescription()) tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
464    if (src.hasAccept()) tgt.setAccept(convertContentType(src.getAccept()));
465    if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType()));
466    if (src.hasDestination()) tgt.setDestinationElement(Integer30_50.convertInteger(src.getDestinationElement()));
467    if (src.hasEncodeRequestUrl())
468      tgt.setEncodeRequestUrlElement(Boolean30_50.convertBoolean(src.getEncodeRequestUrlElement()));
469    if (src.hasOrigin()) tgt.setOriginElement(Integer30_50.convertInteger(src.getOriginElement()));
470    if (src.hasParams()) tgt.setParamsElement(String30_50.convertString(src.getParamsElement()));
471    for (org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent t : src.getRequestHeader())
472      tgt.addRequestHeader(convertSetupActionOperationRequestHeaderComponent(t));
473    if (src.hasRequestId()) tgt.setRequestIdElement(Id30_50.convertId(src.getRequestIdElement()));
474    if (src.hasResponseId()) tgt.setResponseIdElement(Id30_50.convertId(src.getResponseIdElement()));
475    if (src.hasSourceId()) tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
476    if (src.hasTargetId()) tgt.setTargetId(src.getTargetId());
477    if (src.hasUrl()) tgt.setUrlElement(String30_50.convertString(src.getUrlElement()));
478    return tgt;
479  }
480
481  static public String convertContentType(org.hl7.fhir.dstu3.model.TestScript.ContentType src) throws FHIRException {
482    if (src == null) return null;
483    switch (src) {
484      case XML:
485        return "application/fhir+xml";
486      case JSON:
487        return "application/fhir+json";
488      case TTL:
489        return "text/turtle";
490      case NONE:
491        return null;
492      default:
493        return null;
494    }
495  }
496
497  static public org.hl7.fhir.dstu3.model.TestScript.ContentType convertContentType(String src) throws FHIRException {
498    if (src == null) return null;
499    if (src.contains("xml")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.XML;
500    if (src.contains("json")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.JSON;
501    if (src.contains("tu")) return org.hl7.fhir.dstu3.model.TestScript.ContentType.TTL;
502    return org.hl7.fhir.dstu3.model.TestScript.ContentType.NONE;
503  }
504
505  public static org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException {
506    if (src == null) return null;
507    org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent();
508    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
509    if (src.hasField()) tgt.setFieldElement(String30_50.convertString(src.getFieldElement()));
510    if (src.hasValue()) tgt.setValueElement(String30_50.convertString(src.getValueElement()));
511    return tgt;
512  }
513
514  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent convertSetupActionOperationRequestHeaderComponent(org.hl7.fhir.r5.model.TestScript.SetupActionOperationRequestHeaderComponent src) throws FHIRException {
515    if (src == null) return null;
516    org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionOperationRequestHeaderComponent();
517    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
518    if (src.hasField()) tgt.setFieldElement(String30_50.convertString(src.getFieldElement()));
519    if (src.hasValue()) tgt.setValueElement(String30_50.convertString(src.getValueElement()));
520    return tgt;
521  }
522
523  public static org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent src) throws FHIRException {
524    if (src == null) return null;
525    org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent();
526    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
527    if (src.hasLabel()) tgt.setLabelElement(String30_50.convertString(src.getLabelElement()));
528    if (src.hasDescription()) tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
529    if (src.hasDirection()) tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
530    if (src.hasCompareToSourceId())
531      tgt.setCompareToSourceIdElement(String30_50.convertString(src.getCompareToSourceIdElement()));
532    if (src.hasCompareToSourceExpression())
533      tgt.setCompareToSourceExpressionElement(String30_50.convertString(src.getCompareToSourceExpressionElement()));
534    if (src.hasCompareToSourcePath())
535      tgt.setCompareToSourcePathElement(String30_50.convertString(src.getCompareToSourcePathElement()));
536    if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType()));
537    if (src.hasExpression()) tgt.setExpressionElement(String30_50.convertString(src.getExpressionElement()));
538    if (src.hasHeaderField()) tgt.setHeaderFieldElement(String30_50.convertString(src.getHeaderFieldElement()));
539    if (src.hasMinimumId()) tgt.setMinimumIdElement(String30_50.convertString(src.getMinimumIdElement()));
540    if (src.hasNavigationLinks())
541      tgt.setNavigationLinksElement(Boolean30_50.convertBoolean(src.getNavigationLinksElement()));
542    if (src.hasOperator()) tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
543    if (src.hasPath()) tgt.setPathElement(String30_50.convertString(src.getPathElement()));
544    if (src.hasRequestMethod())
545      tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement()));
546    if (src.hasRequestURL()) tgt.setRequestURLElement(String30_50.convertString(src.getRequestURLElement()));
547    if (src.hasResource())
548      tgt.setResource(src.getResource());
549    if (src.hasResponse()) tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
550    if (src.hasResponseCode()) tgt.setResponseCodeElement(String30_50.convertString(src.getResponseCodeElement()));
551    if (src.hasSourceId()) tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
552    if (src.hasValidateProfileId())
553      tgt.setValidateProfileIdElement(Id30_50.convertId(src.getValidateProfileIdElement()));
554    if (src.hasValue()) tgt.setValueElement(String30_50.convertString(src.getValueElement()));
555    if (src.hasWarningOnly()) tgt.setWarningOnlyElement(Boolean30_50.convertBoolean(src.getWarningOnlyElement()));
556    return tgt;
557  }
558
559  public static org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestScript.SetupActionAssertComponent src) throws FHIRException {
560    if (src == null) return null;
561    org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.SetupActionAssertComponent();
562    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
563    if (src.hasLabel()) tgt.setLabelElement(String30_50.convertString(src.getLabelElement()));
564    if (src.hasDescription()) tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
565    if (src.hasDirection()) tgt.setDirectionElement(convertAssertionDirectionType(src.getDirectionElement()));
566    if (src.hasCompareToSourceId())
567      tgt.setCompareToSourceIdElement(String30_50.convertString(src.getCompareToSourceIdElement()));
568    if (src.hasCompareToSourceExpression())
569      tgt.setCompareToSourceExpressionElement(String30_50.convertString(src.getCompareToSourceExpressionElement()));
570    if (src.hasCompareToSourcePath())
571      tgt.setCompareToSourcePathElement(String30_50.convertString(src.getCompareToSourcePathElement()));
572    if (src.hasContentType()) tgt.setContentType(convertContentType(src.getContentType()));
573    if (src.hasExpression()) tgt.setExpressionElement(String30_50.convertString(src.getExpressionElement()));
574    if (src.hasHeaderField()) tgt.setHeaderFieldElement(String30_50.convertString(src.getHeaderFieldElement()));
575    if (src.hasMinimumId()) tgt.setMinimumIdElement(String30_50.convertString(src.getMinimumIdElement()));
576    if (src.hasNavigationLinks())
577      tgt.setNavigationLinksElement(Boolean30_50.convertBoolean(src.getNavigationLinksElement()));
578    if (src.hasOperator()) tgt.setOperatorElement(convertAssertionOperatorType(src.getOperatorElement()));
579    if (src.hasPath()) tgt.setPathElement(String30_50.convertString(src.getPathElement()));
580    if (src.hasRequestMethod())
581      tgt.setRequestMethodElement(convertTestScriptRequestMethodCode(src.getRequestMethodElement()));
582    if (src.hasRequestURL()) tgt.setRequestURLElement(String30_50.convertString(src.getRequestURLElement()));
583    if (src.hasResource()) tgt.setResource(src.getResource());
584    if (src.hasResponse()) tgt.setResponseElement(convertAssertionResponseTypes(src.getResponseElement()));
585    if (src.hasResponseCode()) tgt.setResponseCodeElement(String30_50.convertString(src.getResponseCodeElement()));
586    if (src.hasSourceId()) tgt.setSourceIdElement(Id30_50.convertId(src.getSourceIdElement()));
587    if (src.hasValidateProfileId())
588      tgt.setValidateProfileIdElement(Id30_50.convertId(src.getValidateProfileIdElement()));
589    if (src.hasValue()) tgt.setValueElement(String30_50.convertString(src.getValueElement()));
590    if (src.hasWarningOnly()) tgt.setWarningOnlyElement(Boolean30_50.convertBoolean(src.getWarningOnlyElement()));
591    return tgt;
592  }
593
594  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> src) throws FHIRException {
595    if (src == null || src.isEmpty()) return null;
596    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionDirectionType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionDirectionTypeEnumFactory());
597    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
598    if (src.getValue() == null) {
599      tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL);
600    } else {
601      switch (src.getValue()) {
602        case RESPONSE:
603          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.RESPONSE);
604          break;
605        case REQUEST:
606          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.REQUEST);
607          break;
608        default:
609          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionDirectionType.NULL);
610          break;
611      }
612    }
613    return tgt;
614  }
615
616  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType> convertAssertionDirectionType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionDirectionType> src) throws FHIRException {
617    if (src == null || src.isEmpty()) return null;
618    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());
619    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
620    if (src.getValue() == null) {
621      tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL);
622    } else {
623      switch (src.getValue()) {
624        case RESPONSE:
625          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.RESPONSE);
626          break;
627        case REQUEST:
628          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.REQUEST);
629          break;
630        default:
631          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionDirectionType.NULL);
632          break;
633      }
634    }
635    return tgt;
636  }
637
638  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> src) throws FHIRException {
639    if (src == null || src.isEmpty()) return null;
640    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionOperatorType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionOperatorTypeEnumFactory());
641    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
642    if (src.getValue() == null) {
643      tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL);
644    } else {
645      switch (src.getValue()) {
646        case EQUALS:
647          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EQUALS);
648          break;
649        case NOTEQUALS:
650          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEQUALS);
651          break;
652        case IN:
653          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.IN);
654          break;
655        case NOTIN:
656          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTIN);
657          break;
658        case GREATERTHAN:
659          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.GREATERTHAN);
660          break;
661        case LESSTHAN:
662          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.LESSTHAN);
663          break;
664        case EMPTY:
665          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EMPTY);
666          break;
667        case NOTEMPTY:
668          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTEMPTY);
669          break;
670        case CONTAINS:
671          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.CONTAINS);
672          break;
673        case NOTCONTAINS:
674          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NOTCONTAINS);
675          break;
676        case EVAL:
677          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.EVAL);
678          break;
679        default:
680          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionOperatorType.NULL);
681          break;
682      }
683    }
684    return tgt;
685  }
686
687  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType> convertAssertionOperatorType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionOperatorType> src) throws FHIRException {
688    if (src == null || src.isEmpty()) return null;
689    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());
690    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
691    if (src.getValue() == null) {
692      tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL);
693    } else {
694      switch (src.getValue()) {
695        case EQUALS:
696          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EQUALS);
697          break;
698        case NOTEQUALS:
699          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEQUALS);
700          break;
701        case IN:
702          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.IN);
703          break;
704        case NOTIN:
705          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTIN);
706          break;
707        case GREATERTHAN:
708          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.GREATERTHAN);
709          break;
710        case LESSTHAN:
711          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.LESSTHAN);
712          break;
713        case EMPTY:
714          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EMPTY);
715          break;
716        case NOTEMPTY:
717          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTEMPTY);
718          break;
719        case CONTAINS:
720          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.CONTAINS);
721          break;
722        case NOTCONTAINS:
723          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NOTCONTAINS);
724          break;
725        case EVAL:
726          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.EVAL);
727          break;
728        default:
729          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionOperatorType.NULL);
730          break;
731      }
732    }
733    return tgt;
734  }
735
736  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode> convertTestScriptRequestMethodCode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> src) throws FHIRException {
737    if (src == null || src.isEmpty()) return null;
738    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCodeEnumFactory());
739    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
740    if (src.getValue() == null) {
741      tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL);
742    } else {
743      switch (src.getValue()) {
744        case DELETE:
745          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.DELETE);
746          break;
747        case GET:
748          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.GET);
749          break;
750        case OPTIONS:
751          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.OPTIONS);
752          break;
753        case PATCH:
754          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PATCH);
755          break;
756        case POST:
757          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.POST);
758          break;
759        case PUT:
760          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.PUT);
761          break;
762        default:
763          tgt.setValue(org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode.NULL);
764          break;
765      }
766    }
767    return tgt;
768  }
769
770  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> convertTestScriptRequestMethodCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.TestScriptRequestMethodCode> src) throws FHIRException {
771    if (src == null || src.isEmpty()) return null;
772    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCodeEnumFactory());
773    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
774    if (src.getValue() == null) {
775      tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL);
776    } else {
777      switch (src.getValue()) {
778        case DELETE:
779          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.DELETE);
780          break;
781        case GET:
782          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.GET);
783          break;
784        case OPTIONS:
785          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.OPTIONS);
786          break;
787        case PATCH:
788          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PATCH);
789          break;
790        case POST:
791          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.POST);
792          break;
793        case PUT:
794          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.PUT);
795          break;
796        default:
797          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.TestScriptRequestMethodCode.NULL);
798          break;
799      }
800    }
801    return tgt;
802  }
803
804  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
805    if (src == null || src.isEmpty()) return null;
806    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestScript.AssertionResponseTypesEnumFactory());
807    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
808    if (src.getValue() == null) {
809      tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL);
810    } else {
811      switch (src.getValue()) {
812        case OKAY:
813          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.OKAY);
814          break;
815        case CREATED:
816          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CREATED);
817          break;
818        case NOCONTENT:
819          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOCONTENT);
820          break;
821        case NOTMODIFIED:
822          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
823          break;
824        case BAD:
825          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.BADREQUEST);
826          break;
827        case FORBIDDEN:
828          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.FORBIDDEN);
829          break;
830        case NOTFOUND:
831          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NOTFOUND);
832          break;
833        case METHODNOTALLOWED:
834          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
835          break;
836        case CONFLICT:
837          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.CONFLICT);
838          break;
839        case GONE:
840          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.GONE);
841          break;
842        case PRECONDITIONFAILED:
843          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
844          break;
845        case UNPROCESSABLE:
846          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.UNPROCESSABLECONTENT);
847          break;
848        default:
849          tgt.setValue(org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes.NULL);
850          break;
851      }
852    }
853    return tgt;
854  }
855
856  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes> convertAssertionResponseTypes(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestScript.AssertionResponseTypes> src) throws FHIRException {
857    if (src == null || src.isEmpty()) return null;
858    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());
859    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
860    if (src.getValue() == null) {
861      tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL);
862    } else {
863      switch (src.getValue()) {
864        case OKAY:
865          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.OKAY);
866          break;
867        case CREATED:
868          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CREATED);
869          break;
870        case NOCONTENT:
871          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOCONTENT);
872          break;
873        case NOTMODIFIED:
874          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTMODIFIED);
875          break;
876        case BADREQUEST:
877          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.BAD);
878          break;
879        case FORBIDDEN:
880          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.FORBIDDEN);
881          break;
882        case NOTFOUND:
883          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NOTFOUND);
884          break;
885        case METHODNOTALLOWED:
886          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.METHODNOTALLOWED);
887          break;
888        case CONFLICT:
889          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.CONFLICT);
890          break;
891        case GONE:
892          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.GONE);
893          break;
894        case PRECONDITIONFAILED:
895          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.PRECONDITIONFAILED);
896          break;
897        case UNPROCESSABLECONTENT:
898          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.UNPROCESSABLE);
899          break;
900        default:
901          tgt.setValue(org.hl7.fhir.dstu3.model.TestScript.AssertionResponseTypes.NULL);
902          break;
903      }
904    }
905    return tgt;
906  }
907
908  public static org.hl7.fhir.r5.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestScript.TestActionComponent src) throws FHIRException {
909    if (src == null) return null;
910    org.hl7.fhir.r5.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TestActionComponent();
911    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
912    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
913    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
914    return tgt;
915  }
916
917  public static org.hl7.fhir.dstu3.model.TestScript.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestScript.TestActionComponent src) throws FHIRException {
918    if (src == null) return null;
919    org.hl7.fhir.dstu3.model.TestScript.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TestActionComponent();
920    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
921    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
922    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
923    return tgt;
924  }
925
926  public static org.hl7.fhir.r5.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent src) throws FHIRException {
927    if (src == null) return null;
928    org.hl7.fhir.r5.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestScript.TeardownActionComponent();
929    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
930    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
931    return tgt;
932  }
933
934  public static org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestScript.TeardownActionComponent src) throws FHIRException {
935    if (src == null) return null;
936    org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestScript.TeardownActionComponent();
937    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
938    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
939    return tgt;
940  }
941}