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.special40_50.Extension40_50; 005import org.hl7.fhir.exceptions.FHIRException; 006 007/* 008 Copyright (c) 2011+, HL7, Inc. 009 All rights reserved. 010 011 Redistribution and use in source and binary forms, with or without modification, 012 are permitted provided that the following conditions are met: 013 014 * Redistributions of source code must retain the above copyright notice, this 015 list of conditions and the following disclaimer. 016 * Redistributions in binary form must reproduce the above copyright notice, 017 this list of conditions and the following disclaimer in the documentation 018 and/or other materials provided with the distribution. 019 * Neither the name of HL7 nor the names of its contributors may be used to 020 endorse or promote products derived from this software without specific 021 prior written permission. 022 023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 024 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 025 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 026 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 027 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 028 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 029 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 030 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 031 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 032 POSSIBILITY OF SUCH DAMAGE. 033 034*/ 035// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 036public class Enumerations40_50 { 037 038 public static void copyEnumeration(org.hl7.fhir.r4.model.Enumeration<?> src, org.hl7.fhir.r5.model.Enumeration<?> tgt) throws FHIRException { 039 if (src.hasId()) tgt.setId(src.getId()); 040 for (org.hl7.fhir.r4.model.Extension e : src.getExtension()) { 041 tgt.addExtension(Extension40_50.convertExtension(e)); 042 } 043 } 044 045 public static void copyEnumeration(org.hl7.fhir.r5.model.Enumeration<?> src, org.hl7.fhir.r4.model.Enumeration<?> tgt) throws FHIRException { 046 if (src.hasId()) tgt.setId(src.getId()); 047 for (org.hl7.fhir.r5.model.Extension e : src.getExtension()) { 048 tgt.addExtension(Extension40_50.convertExtension(e)); 049 } 050 } 051 052 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> src) throws FHIRException { 053 if (src == null || src.isEmpty()) 054 return null; 055 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory()); 056 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 057 switch (src.getValue()) { 058 case REQUIRED: 059 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED); 060 break; 061 case EXTENSIBLE: 062 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE); 063 break; 064 case PREFERRED: 065 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED); 066 break; 067 case EXAMPLE: 068 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE); 069 break; 070 default: 071 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL); 072 break; 073 } 074 return tgt; 075 } 076 077 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> src) throws FHIRException { 078 if (src == null || src.isEmpty()) 079 return null; 080 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory()); 081 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 082 switch (src.getValue()) { 083 case REQUIRED: 084 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED); 085 break; 086 case EXTENSIBLE: 087 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE); 088 break; 089 case PREFERRED: 090 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED); 091 break; 092 case EXAMPLE: 093 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE); 094 break; 095 default: 096 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL); 097 break; 098 } 099 return tgt; 100 } 101 102 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> src) throws FHIRException { 103 if (src == null || src.isEmpty()) 104 return null; 105 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.PublicationStatusEnumFactory()); 106 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 107 switch (src.getValue()) { 108 case DRAFT: 109 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT); 110 break; 111 case ACTIVE: 112 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE); 113 break; 114 case RETIRED: 115 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED); 116 break; 117 case UNKNOWN: 118 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN); 119 break; 120 default: 121 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL); 122 break; 123 } 124 return tgt; 125 } 126 127 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> src) throws FHIRException { 128 if (src == null || src.isEmpty()) 129 return null; 130 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory()); 131 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 132 switch (src.getValue()) { 133 case DRAFT: 134 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT); 135 break; 136 case ACTIVE: 137 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE); 138 break; 139 case RETIRED: 140 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED); 141 break; 142 case UNKNOWN: 143 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN); 144 break; 145 default: 146 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL); 147 break; 148 } 149 return tgt; 150 } 151 152 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> convertFHIRVersion(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.FHIRVersion> src) throws FHIRException { 153 if (src == null || src.isEmpty()) 154 return null; 155 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FHIRVersionEnumFactory()); 156 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 157 switch (src.getValue()) { 158 case _0_01: 159 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01); 160 break; 161 case _0_05: 162 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05); 163 break; 164 case _0_06: 165 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06); 166 break; 167 case _0_11: 168 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11); 169 break; 170 case _0_0_80: 171 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80); 172 break; 173 case _0_0_81: 174 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81); 175 break; 176 case _0_0_82: 177 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82); 178 break; 179 case _0_4_0: 180 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0); 181 break; 182 case _0_5_0: 183 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0); 184 break; 185 case _1_0_0: 186 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0); 187 break; 188 case _1_0_1: 189 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1); 190 break; 191 case _1_0_2: 192 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2); 193 break; 194 case _1_1_0: 195 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0); 196 break; 197 case _1_4_0: 198 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0); 199 break; 200 case _1_6_0: 201 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0); 202 break; 203 case _1_8_0: 204 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0); 205 break; 206 case _3_0_0: 207 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0); 208 break; 209 case _3_0_1: 210 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1); 211 break; 212 case _3_0_2: 213 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_2); 214 break; 215 case _3_3_0: 216 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0); 217 break; 218 case _3_5_0: 219 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0); 220 break; 221 case _4_0_0: 222 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0); 223 break; 224 case _4_0_1: 225 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_1); 226 break; 227 case _4_1_0: 228 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0); 229 break; 230 default: 231 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL); 232 break; 233 } 234 return tgt; 235 } 236 237 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.FHIRVersion> convertFHIRVersion(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> src) throws FHIRException { 238 if (src == null || src.isEmpty()) 239 return null; 240 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.FHIRVersion> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.FHIRVersionEnumFactory()); 241 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 242 switch (src.getValue()) { 243 case _0_01: 244 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01); 245 break; 246 case _0_05: 247 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05); 248 break; 249 case _0_06: 250 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06); 251 break; 252 case _0_11: 253 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11); 254 break; 255 case _0_0_80: 256 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80); 257 break; 258 case _0_0_81: 259 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81); 260 break; 261 case _0_0_82: 262 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82); 263 break; 264 case _0_4_0: 265 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0); 266 break; 267 case _0_5_0: 268 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0); 269 break; 270 case _1_0_0: 271 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0); 272 break; 273 case _1_0_1: 274 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1); 275 break; 276 case _1_0_2: 277 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2); 278 break; 279 case _1_1_0: 280 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0); 281 break; 282 case _1_4_0: 283 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0); 284 break; 285 case _1_6_0: 286 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0); 287 break; 288 case _1_8_0: 289 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0); 290 break; 291 case _3_0_0: 292 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0); 293 break; 294 case _3_0_1: 295 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1); 296 break; 297 case _3_0_2: 298 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_2); 299 break; 300 case _3_3_0: 301 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0); 302 break; 303 case _3_5_0: 304 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0); 305 break; 306 case _4_0_0: 307 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0); 308 break; 309 case _4_0_1: 310 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_1); 311 break; 312 case _4_1_0: 313 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0); 314 break; 315 default: 316 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL); 317 break; 318 } 319 return tgt; 320 } 321 322 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> src) throws FHIRException { 323 if (src == null || src.isEmpty()) 324 return null; 325 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.SearchParamTypeEnumFactory()); 326 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 327 switch (src.getValue()) { 328 case NUMBER: 329 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER); 330 break; 331 case DATE: 332 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE); 333 break; 334 case STRING: 335 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING); 336 break; 337 case TOKEN: 338 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN); 339 break; 340 case REFERENCE: 341 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE); 342 break; 343 case COMPOSITE: 344 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE); 345 break; 346 case QUANTITY: 347 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY); 348 break; 349 case URI: 350 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI); 351 break; 352 case SPECIAL: 353 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL); 354 break; 355 default: 356 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL); 357 break; 358 } 359 return tgt; 360 } 361 362 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> src) throws FHIRException { 363 if (src == null || src.isEmpty()) 364 return null; 365 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory()); 366 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 367 switch (src.getValue()) { 368 case NUMBER: 369 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER); 370 break; 371 case DATE: 372 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE); 373 break; 374 case STRING: 375 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING); 376 break; 377 case TOKEN: 378 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN); 379 break; 380 case REFERENCE: 381 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE); 382 break; 383 case COMPOSITE: 384 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE); 385 break; 386 case QUANTITY: 387 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY); 388 break; 389 case URI: 390 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI); 391 break; 392 case SPECIAL: 393 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL); 394 break; 395 default: 396 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL); 397 break; 398 } 399 return tgt; 400 } 401 402 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.NoteType> convertNoteType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.NoteType> src) throws FHIRException { 403 if (src == null || src.isEmpty()) 404 return null; 405 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.NoteType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.NoteTypeEnumFactory()); 406 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 407 switch (src.getValue()) { 408 case DISPLAY: 409 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.DISPLAY); 410 break; 411 case PRINT: 412 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.PRINT); 413 break; 414 case PRINTOPER: 415 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.PRINTOPER); 416 break; 417 default: 418 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.NoteType.NULL); 419 break; 420 } 421 return tgt; 422 } 423 424 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.NoteType> convertNoteType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.NoteType> src) throws FHIRException { 425 if (src == null || src.isEmpty()) 426 return null; 427 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.NoteType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.NoteTypeEnumFactory()); 428 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 429 switch (src.getValue()) { 430 case DISPLAY: 431 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY); 432 break; 433 case PRINT: 434 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT); 435 break; 436 case PRINTOPER: 437 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER); 438 break; 439 default: 440 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.NoteType.NULL); 441 break; 442 } 443 return tgt; 444 } 445 446 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship> convertConceptMapRelationship(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException { 447 if (src == null || src.isEmpty()) 448 return null; 449 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationshipEnumFactory()); 450 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 451 switch (src.getValue()) { 452 case RELATEDTO: 453 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); 454 break; 455 case EQUIVALENT: 456 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); 457 break; 458 case EQUAL: 459 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT); 460 break; 461 case WIDER: 462 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); 463 break; 464 case SUBSUMES: 465 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET); 466 break; 467 case NARROWER: 468 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); 469 break; 470 case SPECIALIZES: 471 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET); 472 break; 473 case INEXACT: 474 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO); 475 break; 476 case UNMATCHED: 477 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); 478 break; 479 case DISJOINT: 480 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO); 481 break; 482 default: 483 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL); 484 break; 485 } 486 return tgt; 487 } 488 489 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship> src) throws FHIRException { 490 if (src == null || src.isEmpty()) 491 return null; 492 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalenceEnumFactory()); 493 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 494 switch (src.getValue()) { 495 case RELATEDTO: 496 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO); 497 break; 498 case EQUIVALENT: 499 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT); 500 break; 501 case SOURCEISNARROWERTHANTARGET: 502 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER); 503 break; 504 case SOURCEISBROADERTHANTARGET: 505 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER); 506 break; 507 case NOTRELATEDTO: 508 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT); 509 break; 510 default: 511 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL); 512 break; 513 } 514 return tgt; 515 } 516 517 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException { 518 if (src == null || src.isEmpty()) 519 return null; 520 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatusEnumFactory()); 521 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 522 switch (src.getValue()) { 523 case CURRENT: 524 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT); 525 break; 526 case SUPERSEDED: 527 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); 528 break; 529 case ENTEREDINERROR: 530 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); 531 break; 532 default: 533 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL); 534 break; 535 } 536 return tgt; 537 } 538 539 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException { 540 if (src == null || src.isEmpty()) 541 return null; 542 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); 543 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 544 switch (src.getValue()) { 545 case CURRENT: 546 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); 547 break; 548 case SUPERSEDED: 549 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); 550 break; 551 case ENTEREDINERROR: 552 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); 553 break; 554 default: 555 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); 556 break; 557 } 558 return tgt; 559 } 560 561 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> src) throws FHIRException { 562 if (src == null || src.isEmpty()) 563 return null; 564 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.AdministrativeGenderEnumFactory()); 565 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 566 switch (src.getValue()) { 567 case MALE: 568 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE); 569 break; 570 case FEMALE: 571 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE); 572 break; 573 case OTHER: 574 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER); 575 break; 576 case UNKNOWN: 577 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN); 578 break; 579 default: 580 tgt.setValue(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL); 581 break; 582 } 583 return tgt; 584 } 585 586 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> src) throws FHIRException { 587 if (src == null || src.isEmpty()) 588 return null; 589 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory()); 590 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 591 switch (src.getValue()) { 592 case MALE: 593 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE); 594 break; 595 case FEMALE: 596 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE); 597 break; 598 case OTHER: 599 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER); 600 break; 601 case UNKNOWN: 602 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN); 603 break; 604 default: 605 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL); 606 break; 607 } 608 return tgt; 609 } 610 611}