001package org.hl7.fhir.convertors.conv10_40.resources10_40; 002 003import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40; 004import org.hl7.fhir.convertors.context.ConversionContext10_40; 005import org.hl7.fhir.convertors.conv10_40.datatypes10_40.complextypes10_40.Signature10_40; 006import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Decimal10_40; 007import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Instant10_40; 008import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.String10_40; 009import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.UnsignedInt10_40; 010import org.hl7.fhir.convertors.conv10_40.datatypes10_40.primitivetypes10_40.Uri10_40; 011import org.hl7.fhir.exceptions.FHIRException; 012import org.hl7.fhir.utilities.FhirPublication; 013 014public class Bundle10_40 { 015 016 public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.dstu2.model.Bundle src) throws FHIRException { 017 if (src == null || src.isEmpty()) 018 return null; 019 org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); 020 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyResource(src, tgt); 021 if (src.hasType()) 022 tgt.setTypeElement(convertBundleType(src.getTypeElement())); 023 if (src.hasTotal()) 024 tgt.setTotalElement(UnsignedInt10_40.convertUnsignedInt(src.getTotalElement())); 025 for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) 026 tgt.addLink(convertBundleLinkComponent(t)); 027 for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) 028 tgt.addEntry(convertBundleEntryComponent(t)); 029 if (src.hasSignature()) 030 tgt.setSignature(Signature10_40.convertSignature(src.getSignature())); 031 return tgt; 032 } 033 034 public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src, BaseAdvisor_10_40 advisor) throws FHIRException { 035 if (src == null || src.isEmpty()) 036 return null; 037 org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle(); 038 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyResource(src, tgt); 039 if (src.hasType()) 040 tgt.setTypeElement(convertBundleType(src.getTypeElement())); 041 if (src.hasTotal()) 042 tgt.setTotalElement(UnsignedInt10_40.convertUnsignedInt(src.getTotalElement())); 043 for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); 044 for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry()) 045 tgt.addEntry(convertBundleEntryComponent(t, advisor)); 046 if (src.hasSignature()) 047 tgt.setSignature(Signature10_40.convertSignature(src.getSignature())); 048 return tgt; 049 } 050 051 public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src) throws FHIRException { 052 return convertBundle(src, null); 053 } 054 055 public static org.hl7.fhir.r4.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent src) throws FHIRException { 056 if (src == null || src.isEmpty()) 057 return null; 058 org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent(); 059 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 060 for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) 061 tgt.addLink(convertBundleLinkComponent(t)); 062 if (src.hasFullUrlElement()) 063 tgt.setFullUrlElement(Uri10_40.convertUri(src.getFullUrlElement())); 064 if (src.hasResource()) 065 tgt.setResource(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource())); 066 if (src.hasSearch()) 067 tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); 068 if (src.hasRequest()) 069 tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); 070 if (src.hasResponse()) 071 tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); 072 return tgt; 073 } 074 075 public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent src, BaseAdvisor_10_40 advisor) throws FHIRException { 076 if (src == null || src.isEmpty()) 077 return null; 078 if (advisor.ignoreEntry(src, FhirPublication.DSTU2)) 079 return null; 080 org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent(); 081 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 082 for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); 083 if (src.hasFullUrlElement()) 084 tgt.setFullUrlElement(Uri10_40.convertUri(src.getFullUrlElement())); 085 if (src.hasResource()) 086 tgt.setResource(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource())); 087 if (src.hasSearch()) 088 tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); 089 if (src.hasRequest()) 090 tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); 091 if (src.hasResponse()) 092 tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); 093 return tgt; 094 } 095 096 public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryComponent src) throws FHIRException { 097 return convertBundleEntryComponent(src, null); 098 } 099 100 public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { 101 if (src == null || src.isEmpty()) 102 return null; 103 org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent(); 104 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 105 if (src.hasMethod()) 106 tgt.setMethodElement(convertHTTPVerb(src.getMethodElement())); 107 if (src.hasUrlElement()) 108 tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement())); 109 if (src.hasIfNoneMatchElement()) 110 tgt.setIfNoneMatchElement(String10_40.convertString(src.getIfNoneMatchElement())); 111 if (src.hasIfModifiedSinceElement()) 112 tgt.setIfModifiedSinceElement(Instant10_40.convertInstant(src.getIfModifiedSinceElement())); 113 if (src.hasIfMatchElement()) 114 tgt.setIfMatchElement(String10_40.convertString(src.getIfMatchElement())); 115 if (src.hasIfNoneExistElement()) 116 tgt.setIfNoneExistElement(String10_40.convertString(src.getIfNoneExistElement())); 117 return tgt; 118 } 119 120 public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent src) throws FHIRException { 121 if (src == null || src.isEmpty()) 122 return null; 123 org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent(); 124 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 125 if (src.hasMethod()) 126 tgt.setMethodElement(convertHTTPVerb(src.getMethodElement())); 127 if (src.hasUrlElement()) 128 tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement())); 129 if (src.hasIfNoneMatchElement()) 130 tgt.setIfNoneMatchElement(String10_40.convertString(src.getIfNoneMatchElement())); 131 if (src.hasIfModifiedSinceElement()) 132 tgt.setIfModifiedSinceElement(Instant10_40.convertInstant(src.getIfModifiedSinceElement())); 133 if (src.hasIfMatchElement()) 134 tgt.setIfMatchElement(String10_40.convertString(src.getIfMatchElement())); 135 if (src.hasIfNoneExistElement()) 136 tgt.setIfNoneExistElement(String10_40.convertString(src.getIfNoneExistElement())); 137 return tgt; 138 } 139 140 public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { 141 if (src == null || src.isEmpty()) 142 return null; 143 org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent(); 144 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 145 if (src.hasStatusElement()) 146 tgt.setStatusElement(String10_40.convertString(src.getStatusElement())); 147 if (src.hasLocationElement()) 148 tgt.setLocationElement(Uri10_40.convertUri(src.getLocationElement())); 149 if (src.hasEtagElement()) 150 tgt.setEtagElement(String10_40.convertString(src.getEtagElement())); 151 if (src.hasLastModifiedElement()) 152 tgt.setLastModifiedElement(Instant10_40.convertInstant(src.getLastModifiedElement())); 153 return tgt; 154 } 155 156 public static org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent src) throws FHIRException { 157 if (src == null || src.isEmpty()) 158 return null; 159 org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent(); 160 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 161 if (src.hasStatusElement()) 162 tgt.setStatusElement(String10_40.convertString(src.getStatusElement())); 163 if (src.hasLocationElement()) 164 tgt.setLocationElement(Uri10_40.convertUri(src.getLocationElement())); 165 if (src.hasEtagElement()) 166 tgt.setEtagElement(String10_40.convertString(src.getEtagElement())); 167 if (src.hasLastModifiedElement()) 168 tgt.setLastModifiedElement(Instant10_40.convertInstant(src.getLastModifiedElement())); 169 return tgt; 170 } 171 172 public static org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { 173 if (src == null || src.isEmpty()) 174 return null; 175 org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent(); 176 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 177 if (src.hasMode()) 178 tgt.setModeElement(convertSearchEntryMode(src.getModeElement())); 179 if (src.hasScoreElement()) 180 tgt.setScoreElement(Decimal10_40.convertDecimal(src.getScoreElement())); 181 return tgt; 182 } 183 184 public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent src) throws FHIRException { 185 if (src == null || src.isEmpty()) 186 return null; 187 org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent(); 188 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 189 if (src.hasMode()) 190 tgt.setModeElement(convertSearchEntryMode(src.getModeElement())); 191 if (src.hasScoreElement()) 192 tgt.setScoreElement(Decimal10_40.convertDecimal(src.getScoreElement())); 193 return tgt; 194 } 195 196 public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent src) throws FHIRException { 197 if (src == null || src.isEmpty()) 198 return null; 199 org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent(); 200 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 201 if (src.hasRelationElement()) 202 tgt.setRelationElement(String10_40.convertString(src.getRelationElement())); 203 if (src.hasUrlElement()) 204 tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement())); 205 return tgt; 206 } 207 208 public static org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.model.Bundle.BundleLinkComponent src) throws FHIRException { 209 if (src == null || src.isEmpty()) 210 return null; 211 org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent(); 212 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyBackboneElement(src,tgt); 213 if (src.hasRelationElement()) 214 tgt.setRelationElement(String10_40.convertString(src.getRelationElement())); 215 if (src.hasUrlElement()) 216 tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement())); 217 return tgt; 218 } 219 220 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.BundleType> src) throws FHIRException { 221 if (src == null || src.isEmpty()) 222 return null; 223 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory()); 224 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 225 switch (src.getValue()) { 226 case DOCUMENT: 227 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT); 228 break; 229 case MESSAGE: 230 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE); 231 break; 232 case TRANSACTION: 233 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION); 234 break; 235 case TRANSACTIONRESPONSE: 236 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE); 237 break; 238 case BATCH: 239 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH); 240 break; 241 case BATCHRESPONSE: 242 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE); 243 break; 244 case HISTORY: 245 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY); 246 break; 247 case SEARCHSET: 248 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET); 249 break; 250 case COLLECTION: 251 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION); 252 break; 253 default: 254 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL); 255 break; 256 } 257 return tgt; 258 } 259 260 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> src) throws FHIRException { 261 if (src == null || src.isEmpty()) 262 return null; 263 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()); 264 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 265 switch (src.getValue()) { 266 case DOCUMENT: 267 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT); 268 break; 269 case MESSAGE: 270 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE); 271 break; 272 case TRANSACTION: 273 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION); 274 break; 275 case TRANSACTIONRESPONSE: 276 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE); 277 break; 278 case BATCH: 279 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCH); 280 break; 281 case BATCHRESPONSE: 282 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE); 283 break; 284 case HISTORY: 285 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY); 286 break; 287 case SEARCHSET: 288 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET); 289 break; 290 case COLLECTION: 291 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION); 292 break; 293 default: 294 tgt.setValue(org.hl7.fhir.r4.model.Bundle.BundleType.NULL); 295 break; 296 } 297 return tgt; 298 } 299 300 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.HTTPVerb> src) throws FHIRException { 301 if (src == null || src.isEmpty()) 302 return null; 303 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory()); 304 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 305 switch (src.getValue()) { 306 case GET: 307 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET); 308 break; 309 case POST: 310 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST); 311 break; 312 case PUT: 313 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT); 314 break; 315 case DELETE: 316 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE); 317 break; 318 default: 319 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL); 320 break; 321 } 322 return tgt; 323 } 324 325 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> src) throws FHIRException { 326 if (src == null || src.isEmpty()) 327 return null; 328 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()); 329 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 330 switch (src.getValue()) { 331 case GET: 332 tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET); 333 break; 334 case POST: 335 tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); 336 break; 337 case PUT: 338 tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); 339 break; 340 case DELETE: 341 tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE); 342 break; 343 default: 344 tgt.setValue(org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL); 345 break; 346 } 347 return tgt; 348 } 349 350 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.SearchEntryMode> src) throws FHIRException { 351 if (src == null || src.isEmpty()) 352 return null; 353 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory()); 354 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 355 switch (src.getValue()) { 356 case MATCH: 357 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH); 358 break; 359 case INCLUDE: 360 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE); 361 break; 362 case OUTCOME: 363 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME); 364 break; 365 default: 366 tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL); 367 break; 368 } 369 return tgt; 370 } 371 372 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> src) throws FHIRException { 373 if (src == null || src.isEmpty()) 374 return null; 375 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()); 376 ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); 377 switch (src.getValue()) { 378 case MATCH: 379 tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH); 380 break; 381 case INCLUDE: 382 tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE); 383 break; 384 case OUTCOME: 385 tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME); 386 break; 387 default: 388 tgt.setValue(org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL); 389 break; 390 } 391 return tgt; 392 } 393}