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