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