001package org.hl7.fhir.convertors.conv40_50.resources40_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext40_50;
004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50;
005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Signature40_50;
006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*;
007import org.hl7.fhir.exceptions.FHIRException;
008
009/*
010  Copyright (c) 2011+, HL7, Inc.
011  All rights reserved.
012  
013  Redistribution and use in source and binary forms, with or without modification, 
014  are permitted provided that the following conditions are met:
015  
016   * Redistributions of source code must retain the above copyright notice, this 
017     list of conditions and the following disclaimer.
018   * Redistributions in binary form must reproduce the above copyright notice, 
019     this list of conditions and the following disclaimer in the documentation 
020     and/or other materials provided with the distribution.
021   * Neither the name of HL7 nor the names of its contributors may be used to 
022     endorse or promote products derived from this software without specific 
023     prior written permission.
024  
025  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
026  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
027  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
028  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
029  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
030  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
031  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
032  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
033  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
034  POSSIBILITY OF SUCH DAMAGE.
035  
036*/
037// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
038public class Bundle40_50 {
039
040  public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src) throws FHIRException {
041    if (src == null)
042      return null;
043    org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle();
044    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyResource(src, tgt);
045    if (src.hasIdentifier())
046      tgt.setIdentifier(Identifier40_50.convertIdentifier(src.getIdentifier()));
047    if (src.hasType())
048      tgt.setTypeElement(convertBundleType(src.getTypeElement()));
049    if (src.hasTimestamp())
050      tgt.setTimestampElement(Instant40_50.convertInstant(src.getTimestampElement()));
051    if (src.hasTotal())
052      tgt.setTotalElement(UnsignedInt40_50.convertUnsignedInt(src.getTotalElement()));
053    for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
054    for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry())
055      tgt.addEntry(convertBundleEntryComponent(t));
056    if (src.hasSignature())
057      tgt.setSignature(Signature40_50.convertSignature(src.getSignature()));
058    return tgt;
059  }
060
061  public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException {
062    if (src == null)
063      return null;
064    org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle();
065    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyResource(src, tgt);
066    if (src.hasIdentifier())
067      tgt.setIdentifier(Identifier40_50.convertIdentifier(src.getIdentifier()));
068    if (src.hasType())
069      tgt.setTypeElement(convertBundleType(src.getTypeElement()));
070    if (src.hasTimestamp())
071      tgt.setTimestampElement(Instant40_50.convertInstant(src.getTimestampElement()));
072    if (src.hasTotal())
073      tgt.setTotalElement(UnsignedInt40_50.convertUnsignedInt(src.getTotalElement()));
074    for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
075    for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry())
076      tgt.addEntry(convertBundleEntryComponent(t));
077    if (src.hasSignature())
078      tgt.setSignature(Signature40_50.convertSignature(src.getSignature()));
079    return tgt;
080  }
081
082  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.BundleType> src) throws FHIRException {
083    if (src == null || src.isEmpty())
084      return null;
085    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory());
086    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
087    switch (src.getValue()) {
088      case DOCUMENT:
089        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT);
090        break;
091      case MESSAGE:
092        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE);
093        break;
094      case TRANSACTION:
095        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION);
096        break;
097      case TRANSACTIONRESPONSE:
098        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE);
099        break;
100      case BATCH:
101        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH);
102        break;
103      case BATCHRESPONSE:
104        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE);
105        break;
106      case HISTORY:
107        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY);
108        break;
109      case SEARCHSET:
110        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET);
111        break;
112      case COLLECTION:
113        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION);
114        break;
115      default:
116        tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL);
117        break;
118    }
119    return tgt;
120  }
121
122  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> src) throws FHIRException {
123    if (src == null || src.isEmpty())
124      return null;
125    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.BundleType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.BundleTypeEnumFactory());
126    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
127    switch (src.getValue()) {
128      case DOCUMENT:
129        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT);
130        break;
131      case MESSAGE:
132        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE);
133        break;
134      case TRANSACTION:
135        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION);
136        break;
137      case TRANSACTIONRESPONSE:
138        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE);
139        break;
140      case BATCH:
141        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH);
142        break;
143      case BATCHRESPONSE:
144        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE);
145        break;
146      case HISTORY:
147        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY);
148        break;
149      case SEARCHSET:
150        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET);
151        break;
152      case COLLECTION:
153        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION);
154        break;
155      default:
156        tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL);
157        break;
158    }
159    return tgt;
160  }
161
162  public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.model.Bundle.BundleLinkComponent src) throws FHIRException {
163    if (src == null)
164      return null;
165    org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent();
166    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
167    if (src.hasRelation())
168      tgt.setRelationElement(String40_50.convertString(src.getRelationElement()));
169    if (src.hasUrl())
170      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
171    return tgt;
172  }
173
174  public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException {
175    if (src == null)
176      return null;
177    org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent();
178    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
179    if (src.hasRelation())
180      tgt.setRelationElement(String40_50.convertString(src.getRelationElement()));
181    if (src.hasUrl())
182      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
183    return tgt;
184  }
185
186  public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent src) throws FHIRException {
187    if (src == null)
188      return null;
189    org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent();
190    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
191    for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
192    if (src.hasFullUrl())
193      tgt.setFullUrlElement(Uri40_50.convertUri(src.getFullUrlElement()));
194    if (src.hasResource())
195      tgt.setResource(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertResource(src.getResource()));
196    if (src.hasSearch())
197      tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
198    if (src.hasRequest())
199      tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
200    if (src.hasResponse())
201      tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
202    return tgt;
203  }
204
205  public static org.hl7.fhir.r4.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException {
206    if (src == null)
207      return null;
208    org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent();
209    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
210    for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
211    if (src.hasFullUrl())
212      tgt.setFullUrlElement(Uri40_50.convertUri(src.getFullUrlElement()));
213    if (src.hasResource())
214      tgt.setResource(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertResource(src.getResource()));
215    if (src.hasSearch())
216      tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
217    if (src.hasRequest())
218      tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
219    if (src.hasResponse())
220      tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
221    return tgt;
222  }
223
224  public static org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
225    if (src == null)
226      return null;
227    org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent();
228    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
229    if (src.hasMode())
230      tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
231    if (src.hasScore())
232      tgt.setScoreElement(Decimal40_50.convertDecimal(src.getScoreElement()));
233    return tgt;
234  }
235
236  public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
237    if (src == null)
238      return null;
239    org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent();
240    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
241    if (src.hasMode())
242      tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
243    if (src.hasScore())
244      tgt.setScoreElement(Decimal40_50.convertDecimal(src.getScoreElement()));
245    return tgt;
246  }
247
248  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.SearchEntryMode> src) throws FHIRException {
249    if (src == null || src.isEmpty())
250      return null;
251    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory());
252    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
253    switch (src.getValue()) {
254      case MATCH:
255        tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH);
256        break;
257      case INCLUDE:
258        tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE);
259        break;
260      case OUTCOME:
261        tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME);
262        break;
263      default:
264        tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL);
265        break;
266    }
267    return tgt;
268  }
269
270  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> src) throws FHIRException {
271    if (src == null || src.isEmpty())
272      return null;
273    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.SearchEntryModeEnumFactory());
274    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
275    switch (src.getValue()) {
276      case MATCH:
277        tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH);
278        break;
279      case INCLUDE:
280        tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE);
281        break;
282      case OUTCOME:
283        tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME);
284        break;
285      default:
286        tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL);
287        break;
288    }
289    return tgt;
290  }
291
292  public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
293    if (src == null)
294      return null;
295    org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent();
296    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
297    if (src.hasMethod())
298      tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
299    if (src.hasUrl())
300      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
301    if (src.hasIfNoneMatch())
302      tgt.setIfNoneMatchElement(String40_50.convertString(src.getIfNoneMatchElement()));
303    if (src.hasIfModifiedSince())
304      tgt.setIfModifiedSinceElement(Instant40_50.convertInstant(src.getIfModifiedSinceElement()));
305    if (src.hasIfMatch())
306      tgt.setIfMatchElement(String40_50.convertString(src.getIfMatchElement()));
307    if (src.hasIfNoneExist())
308      tgt.setIfNoneExistElement(String40_50.convertString(src.getIfNoneExistElement()));
309    return tgt;
310  }
311
312  public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
313    if (src == null)
314      return null;
315    org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent();
316    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
317    if (src.hasMethod())
318      tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
319    if (src.hasUrl())
320      tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement()));
321    if (src.hasIfNoneMatch())
322      tgt.setIfNoneMatchElement(String40_50.convertString(src.getIfNoneMatchElement()));
323    if (src.hasIfModifiedSince())
324      tgt.setIfModifiedSinceElement(Instant40_50.convertInstant(src.getIfModifiedSinceElement()));
325    if (src.hasIfMatch())
326      tgt.setIfMatchElement(String40_50.convertString(src.getIfMatchElement()));
327    if (src.hasIfNoneExist())
328      tgt.setIfNoneExistElement(String40_50.convertString(src.getIfNoneExistElement()));
329    return tgt;
330  }
331
332  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.HTTPVerb> src) throws FHIRException {
333    if (src == null || src.isEmpty())
334      return null;
335    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory());
336    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
337    switch (src.getValue()) {
338      case GET:
339        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET);
340        break;
341      case HEAD:
342        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD);
343        break;
344      case POST:
345        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST);
346        break;
347      case PUT:
348        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT);
349        break;
350      case DELETE:
351        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE);
352        break;
353      case PATCH:
354        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH);
355        break;
356      default:
357        tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL);
358        break;
359    }
360    return tgt;
361  }
362
363  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> src) throws FHIRException {
364    if (src == null || src.isEmpty())
365      return null;
366    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Bundle.HTTPVerbEnumFactory());
367    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
368    switch (src.getValue()) {
369      case GET:
370        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET);
371        break;
372      case HEAD:
373        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD);
374        break;
375      case POST:
376        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST);
377        break;
378      case PUT:
379        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT);
380        break;
381      case DELETE:
382        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE);
383        break;
384      case PATCH:
385        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH);
386        break;
387      default:
388        tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL);
389        break;
390    }
391    return tgt;
392  }
393
394  public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
395    if (src == null)
396      return null;
397    org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent();
398    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
399    if (src.hasStatus())
400      tgt.setStatusElement(String40_50.convertString(src.getStatusElement()));
401    if (src.hasLocation())
402      tgt.setLocationElement(Uri40_50.convertUri(src.getLocationElement()));
403    if (src.hasEtag())
404      tgt.setEtagElement(String40_50.convertString(src.getEtagElement()));
405    if (src.hasLastModified())
406      tgt.setLastModifiedElement(Instant40_50.convertInstant(src.getLastModifiedElement()));
407    if (src.hasOutcome())
408      tgt.setOutcome(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertResource(src.getOutcome()));
409    return tgt;
410  }
411
412  public static org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
413    if (src == null)
414      return null;
415    org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent();
416    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
417    if (src.hasStatus())
418      tgt.setStatusElement(String40_50.convertString(src.getStatusElement()));
419    if (src.hasLocation())
420      tgt.setLocationElement(Uri40_50.convertUri(src.getLocationElement()));
421    if (src.hasEtag())
422      tgt.setEtagElement(String40_50.convertString(src.getEtagElement()));
423    if (src.hasLastModified())
424      tgt.setLastModifiedElement(Instant40_50.convertInstant(src.getLastModifiedElement()));
425    if (src.hasOutcome())
426      tgt.setOutcome(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertResource(src.getOutcome()));
427    return tgt;
428  }
429}