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.complextypes30_50.Identifier30_50;
005import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50;
006import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Decimal30_50;
007import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.MarkDown30_50;
008import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
009import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
010import org.hl7.fhir.dstu3.model.Reference;
011import org.hl7.fhir.exceptions.FHIRException;
012
013public class TestReport30_50 {
014
015  public static org.hl7.fhir.dstu3.model.TestReport convertTestReport(org.hl7.fhir.r5.model.TestReport src) throws FHIRException {
016    if (src == null)
017      return null;
018    org.hl7.fhir.dstu3.model.TestReport tgt = new org.hl7.fhir.dstu3.model.TestReport();
019    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
020    if (src.hasIdentifier())
021      tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
022    if (src.hasName())
023      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
024    if (src.hasStatus())
025      tgt.setStatusElement(convertTestReportStatus(src.getStatusElement()));
026    if (src.hasTestScript())
027      tgt.setTestScript(new Reference().setReference(src.getTestScript()));
028    if (src.hasResult())
029      tgt.setResultElement(convertTestReportResult(src.getResultElement()));
030    if (src.hasScore())
031      tgt.setScoreElement(Decimal30_50.convertDecimal(src.getScoreElement()));
032    if (src.hasTester())
033      tgt.setTesterElement(String30_50.convertString(src.getTesterElement()));
034    if (src.hasIssued())
035      tgt.setIssuedElement(DateTime30_50.convertDateTime(src.getIssuedElement()));
036    for (org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent t : src.getParticipant())
037      tgt.addParticipant(convertTestReportParticipantComponent(t));
038    if (src.hasSetup())
039      tgt.setSetup(convertTestReportSetupComponent(src.getSetup()));
040    for (org.hl7.fhir.r5.model.TestReport.TestReportTestComponent t : src.getTest())
041      tgt.addTest(convertTestReportTestComponent(t));
042    if (src.hasTeardown())
043      tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown()));
044    return tgt;
045  }
046
047  public static org.hl7.fhir.r5.model.TestReport convertTestReport(org.hl7.fhir.dstu3.model.TestReport src) throws FHIRException {
048    if (src == null)
049      return null;
050    org.hl7.fhir.r5.model.TestReport tgt = new org.hl7.fhir.r5.model.TestReport();
051    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
052    if (src.hasIdentifier())
053      tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
054    if (src.hasName())
055      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
056    if (src.hasStatus())
057      tgt.setStatusElement(convertTestReportStatus(src.getStatusElement()));
058    if (src.hasTestScript())
059      tgt.setTestScript(src.getTestScript().getReference());
060    if (src.hasResult())
061      tgt.setResultElement(convertTestReportResult(src.getResultElement()));
062    if (src.hasScore())
063      tgt.setScoreElement(Decimal30_50.convertDecimal(src.getScoreElement()));
064    if (src.hasTester())
065      tgt.setTesterElement(String30_50.convertString(src.getTesterElement()));
066    if (src.hasIssued())
067      tgt.setIssuedElement(DateTime30_50.convertDateTime(src.getIssuedElement()));
068    for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant())
069      tgt.addParticipant(convertTestReportParticipantComponent(t));
070    if (src.hasSetup())
071      tgt.setSetup(convertTestReportSetupComponent(src.getSetup()));
072    for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest())
073      tgt.addTest(convertTestReportTestComponent(t));
074    if (src.hasTeardown())
075      tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown()));
076    return tgt;
077  }
078
079  public static org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent src) throws FHIRException {
080    if (src == null)
081      return null;
082    org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent();
083    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
084    if (src.hasType())
085      tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement()));
086    if (src.hasUri())
087      tgt.setUriElement(Uri30_50.convertUri(src.getUriElement()));
088    if (src.hasDisplay())
089      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
090    return tgt;
091  }
092
093  public static org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent src) throws FHIRException {
094    if (src == null)
095      return null;
096    org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportParticipantComponent();
097    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
098    if (src.hasType())
099      tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement()));
100    if (src.hasUri())
101      tgt.setUriElement(Uri30_50.convertUri(src.getUriElement()));
102    if (src.hasDisplay())
103      tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
104    return tgt;
105  }
106
107  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportParticipantType> convertTestReportParticipantType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> src) throws FHIRException {
108    if (src == null || src.isEmpty())
109      return null;
110    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportParticipantType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportParticipantTypeEnumFactory());
111    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
112    switch (src.getValue()) {
113      case TESTENGINE:
114        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.TESTENGINE);
115        break;
116      case CLIENT:
117        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.CLIENT);
118        break;
119      case SERVER:
120        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.SERVER);
121        break;
122      default:
123        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportParticipantType.NULL);
124        break;
125    }
126    return tgt;
127  }
128
129  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> convertTestReportParticipantType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportParticipantType> src) throws FHIRException {
130    if (src == null || src.isEmpty())
131      return null;
132    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantTypeEnumFactory());
133    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
134    switch (src.getValue()) {
135      case TESTENGINE:
136        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.TESTENGINE);
137        break;
138      case CLIENT:
139        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.CLIENT);
140        break;
141      case SERVER:
142        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.SERVER);
143        break;
144      default:
145        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.NULL);
146        break;
147    }
148    return tgt;
149  }
150
151  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportResult> convertTestReportResult(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> src) throws FHIRException {
152    if (src == null || src.isEmpty())
153      return null;
154    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportResult> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportResultEnumFactory());
155    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
156    switch (src.getValue()) {
157      case PASS:
158        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PASS);
159        break;
160      case FAIL:
161        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.FAIL);
162        break;
163      case PENDING:
164        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.PENDING);
165        break;
166      default:
167        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportResult.NULL);
168        break;
169    }
170    return tgt;
171  }
172
173  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> convertTestReportResult(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportResult> src) throws FHIRException {
174    if (src == null || src.isEmpty())
175      return null;
176    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportResultEnumFactory());
177    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
178    switch (src.getValue()) {
179      case PASS:
180        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PASS);
181        break;
182      case FAIL:
183        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.FAIL);
184        break;
185      case PENDING:
186        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PENDING);
187        break;
188      default:
189        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.NULL);
190        break;
191    }
192    return tgt;
193  }
194
195  public static org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent src) throws FHIRException {
196    if (src == null)
197      return null;
198    org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent();
199    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
200    for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction())
201      tgt.addAction(convertSetupActionComponent(t));
202    return tgt;
203  }
204
205  public static org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r5.model.TestReport.TestReportSetupComponent src) throws FHIRException {
206    if (src == null)
207      return null;
208    org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent();
209    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
210    for (org.hl7.fhir.r5.model.TestReport.SetupActionComponent t : src.getAction())
211      tgt.addAction(convertSetupActionComponent(t));
212    return tgt;
213  }
214
215  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportStatus> convertTestReportStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> src) throws FHIRException {
216    if (src == null || src.isEmpty())
217      return null;
218    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportStatusEnumFactory());
219    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
220    switch (src.getValue()) {
221      case COMPLETED:
222        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.COMPLETED);
223        break;
224      case INPROGRESS:
225        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.INPROGRESS);
226        break;
227      case WAITING:
228        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.WAITING);
229        break;
230      case STOPPED:
231        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.STOPPED);
232        break;
233      case ENTEREDINERROR:
234        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.ENTEREDINERROR);
235        break;
236      default:
237        tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportStatus.NULL);
238        break;
239    }
240    return tgt;
241  }
242
243  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> convertTestReportStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportStatus> src) throws FHIRException {
244    if (src == null || src.isEmpty())
245      return null;
246    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportStatusEnumFactory());
247    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
248    switch (src.getValue()) {
249      case COMPLETED:
250        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.COMPLETED);
251        break;
252      case INPROGRESS:
253        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.INPROGRESS);
254        break;
255      case WAITING:
256        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.WAITING);
257        break;
258      case STOPPED:
259        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.STOPPED);
260        break;
261      case ENTEREDINERROR:
262        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.ENTEREDINERROR);
263        break;
264      default:
265        tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.NULL);
266        break;
267    }
268    return tgt;
269  }
270
271  public static org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent src) throws FHIRException {
272    if (src == null)
273      return null;
274    org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent();
275    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
276    for (org.hl7.fhir.r5.model.TestReport.TeardownActionComponent t : src.getAction())
277      tgt.addAction(convertTeardownActionComponent(t));
278    return tgt;
279  }
280
281  public static org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent src) throws FHIRException {
282    if (src == null)
283      return null;
284    org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTeardownComponent();
285    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
286    for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction())
287      tgt.addAction(convertTeardownActionComponent(t));
288    return tgt;
289  }
290
291  public static org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r5.model.TestReport.TestReportTestComponent src) throws FHIRException {
292    if (src == null)
293      return null;
294    org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent();
295    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
296    if (src.hasName())
297      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
298    if (src.hasDescription())
299      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
300    for (org.hl7.fhir.r5.model.TestReport.TestActionComponent t : src.getAction())
301      tgt.addAction(convertTestActionComponent(t));
302    return tgt;
303  }
304
305  public static org.hl7.fhir.r5.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent src) throws FHIRException {
306    if (src == null)
307      return null;
308    org.hl7.fhir.r5.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestReportTestComponent();
309    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
310    if (src.hasName())
311      tgt.setNameElement(String30_50.convertString(src.getNameElement()));
312    if (src.hasDescription())
313      tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
314    for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction())
315      tgt.addAction(convertTestActionComponent(t));
316    return tgt;
317  }
318
319  public static org.hl7.fhir.r5.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent src) throws FHIRException {
320    if (src == null) return null;
321    org.hl7.fhir.r5.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionComponent();
322    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
323    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
324    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
325    return tgt;
326  }
327
328  public static org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r5.model.TestReport.SetupActionComponent src) throws FHIRException {
329    if (src == null) return null;
330    org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent();
331    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
332    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
333    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
334    return tgt;
335  }
336
337  public static org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent src) throws FHIRException {
338    if (src == null) return null;
339    org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent();
340    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
341    if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement()));
342    if (src.hasMessage()) tgt.setMessageElement(MarkDown30_50.convertMarkdown(src.getMessageElement()));
343    if (src.hasDetail()) tgt.setDetailElement(Uri30_50.convertUri(src.getDetailElement()));
344    return tgt;
345  }
346
347  public static org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r5.model.TestReport.SetupActionOperationComponent src) throws FHIRException {
348    if (src == null) return null;
349    org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent();
350    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
351    if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement()));
352    if (src.hasMessage()) tgt.setMessageElement(MarkDown30_50.convertMarkdown(src.getMessageElement()));
353    if (src.hasDetail()) tgt.setDetailElement(Uri30_50.convertUri(src.getDetailElement()));
354    return tgt;
355  }
356
357  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportActionResult> convertTestReportActionResult(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> src) throws FHIRException {
358    if (src == null || src.isEmpty()) return null;
359    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportActionResult> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TestReport.TestReportActionResultEnumFactory());
360    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
361    if (src.getValue() == null) {
362      tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL);
363    } else {
364      switch (src.getValue()) {
365        case PASS:
366          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.PASS);
367          break;
368        case SKIP:
369          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.SKIP);
370          break;
371        case FAIL:
372          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.FAIL);
373          break;
374        case WARNING:
375          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.WARNING);
376          break;
377        case ERROR:
378          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.ERROR);
379          break;
380        default:
381          tgt.setValue(org.hl7.fhir.r5.model.TestReport.TestReportActionResult.NULL);
382          break;
383      }
384    }
385    return tgt;
386  }
387
388  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> convertTestReportActionResult(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TestReport.TestReportActionResult> src) throws FHIRException {
389    if (src == null || src.isEmpty()) return null;
390    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportActionResultEnumFactory());
391    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
392    if (src.getValue() == null) {
393      tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL);
394    } else {
395      switch (src.getValue()) {
396        case PASS:
397          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.PASS);
398          break;
399        case SKIP:
400          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.SKIP);
401          break;
402        case FAIL:
403          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.FAIL);
404          break;
405        case WARNING:
406          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.WARNING);
407          break;
408        case ERROR:
409          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.ERROR);
410          break;
411        default:
412          tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL);
413          break;
414      }
415    }
416    return tgt;
417  }
418
419  public static org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent src) throws FHIRException {
420    if (src == null) return null;
421    org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent();
422    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
423    if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement()));
424    if (src.hasMessage()) tgt.setMessageElement(MarkDown30_50.convertMarkdown(src.getMessageElement()));
425    if (src.hasDetail()) tgt.setDetailElement(String30_50.convertString(src.getDetailElement()));
426    return tgt;
427  }
428
429  public static org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r5.model.TestReport.SetupActionAssertComponent src) throws FHIRException {
430    if (src == null) return null;
431    org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent();
432    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
433    if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement()));
434    if (src.hasMessage()) tgt.setMessageElement(MarkDown30_50.convertMarkdown(src.getMessageElement()));
435    if (src.hasDetail()) tgt.setDetailElement(String30_50.convertString(src.getDetailElement()));
436    return tgt;
437  }
438
439  public static org.hl7.fhir.r5.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestReport.TestActionComponent src) throws FHIRException {
440    if (src == null) return null;
441    org.hl7.fhir.r5.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TestActionComponent();
442    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
443    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
444    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
445    return tgt;
446  }
447
448  public static org.hl7.fhir.dstu3.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r5.model.TestReport.TestActionComponent src) throws FHIRException {
449    if (src == null) return null;
450    org.hl7.fhir.dstu3.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestActionComponent();
451    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
452    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
453    if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert()));
454    return tgt;
455  }
456
457  public static org.hl7.fhir.r5.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent src) throws FHIRException {
458    if (src == null) return null;
459    org.hl7.fhir.r5.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r5.model.TestReport.TeardownActionComponent();
460    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
461    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
462    return tgt;
463  }
464
465  public static org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r5.model.TestReport.TeardownActionComponent src) throws FHIRException {
466    if (src == null) return null;
467    org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent();
468    ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyBackboneElement(src,tgt);
469    if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation()));
470    return tgt;
471  }
472}