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.CodeableConcept40_50; 005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50; 006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50; 007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*; 008import org.hl7.fhir.exceptions.FHIRException; 009import org.hl7.fhir.r5.model.CodeType; 010 011import java.util.stream.Collectors; 012 013/* 014 Copyright (c) 2011+, HL7, Inc. 015 All rights reserved. 016 017 Redistribution and use in source and binary forms, with or without modification, 018 are permitted provided that the following conditions are met: 019 020 * Redistributions of source code must retain the above copyright notice, this 021 list of conditions and the following disclaimer. 022 * Redistributions in binary form must reproduce the above copyright notice, 023 this list of conditions and the following disclaimer in the documentation 024 and/or other materials provided with the distribution. 025 * Neither the name of HL7 nor the names of its contributors may be used to 026 endorse or promote products derived from this software without specific 027 prior written permission. 028 029 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 030 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 031 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 032 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 033 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 034 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 035 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 036 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 037 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 038 POSSIBILITY OF SUCH DAMAGE. 039 040*/ 041// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 042public class SearchParameter40_50 { 043 044 public static org.hl7.fhir.r5.model.SearchParameter convertSearchParameter(org.hl7.fhir.r4.model.SearchParameter src) throws FHIRException { 045 if (src == null) 046 return null; 047 org.hl7.fhir.r5.model.SearchParameter tgt = new org.hl7.fhir.r5.model.SearchParameter(); 048 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 049 if (src.hasUrl()) 050 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 051 if (src.hasVersion()) 052 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 053 if (src.hasName()) 054 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 055 if (src.hasDerivedFrom()) 056 tgt.setDerivedFromElement(Canonical40_50.convertCanonical(src.getDerivedFromElement())); 057 if (src.hasStatus()) 058 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 059 if (src.hasExperimental()) 060 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 061 if (src.hasDate()) 062 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 063 if (src.hasPublisher()) 064 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 065 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 066 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 067 if (src.hasDescription()) 068 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 069 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 070 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 071 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 072 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 073 if (src.hasPurpose()) 074 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 075 if (src.hasCode()) 076 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 077 for (org.hl7.fhir.r4.model.CodeType t : src.getBase()) tgt.getBase().add(Code40_50.convertResourceEnum(t)); 078 if (src.hasType()) 079 tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement())); 080 if (src.hasExpression()) 081 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 082 if (src.hasXpath()) 083 tgt.setXpathElement(String40_50.convertString(src.getXpathElement())); 084 if (src.hasXpathUsage()) 085 tgt.setXpathUsageElement(convertXPathUsageType(src.getXpathUsageElement())); 086 for (org.hl7.fhir.r4.model.CodeType t : src.getTarget()) tgt.getTarget().add(Code40_50.convertResourceEnum(t)); 087 if (src.hasMultipleOr()) 088 tgt.setMultipleOrElement(Boolean40_50.convertBoolean(src.getMultipleOrElement())); 089 if (src.hasMultipleAnd()) 090 tgt.setMultipleAndElement(Boolean40_50.convertBoolean(src.getMultipleAndElement())); 091 tgt.setComparator(src.getComparator().stream() 092 .map(SearchParameter40_50::convertSearchComparator) 093 .collect(Collectors.toList())); 094 tgt.setModifier(src.getModifier().stream() 095 .map(SearchParameter40_50::convertSearchModifierCode) 096 .collect(Collectors.toList())); 097 for (org.hl7.fhir.r4.model.StringType t : src.getChain()) tgt.getChain().add(String40_50.convertString(t)); 098 for (org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) 099 tgt.addComponent(convertSearchParameterComponentComponent(t)); 100 return tgt; 101 } 102 103 public static org.hl7.fhir.r4.model.SearchParameter convertSearchParameter(org.hl7.fhir.r5.model.SearchParameter src) throws FHIRException { 104 if (src == null) 105 return null; 106 org.hl7.fhir.r4.model.SearchParameter tgt = new org.hl7.fhir.r4.model.SearchParameter(); 107 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 108 if (src.hasUrl()) 109 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 110 if (src.hasVersion()) 111 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 112 if (src.hasName()) 113 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 114 if (src.hasDerivedFrom()) 115 tgt.setDerivedFromElement(Canonical40_50.convertCanonical(src.getDerivedFromElement())); 116 if (src.hasStatus()) 117 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 118 if (src.hasExperimental()) 119 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 120 if (src.hasDate()) 121 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 122 if (src.hasPublisher()) 123 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 124 for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) 125 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 126 if (src.hasDescription()) 127 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 128 for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) 129 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 130 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) 131 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 132 if (src.hasPurpose()) 133 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 134 if (src.hasCode()) 135 tgt.setCodeElement(Code40_50.convertCode(src.getCodeElement())); 136 for (CodeType t : src.getBase()) tgt.getBase().add(Code40_50.convertResourceEnum(t)); 137 if (src.hasType()) 138 tgt.setTypeElement(Enumerations40_50.convertSearchParamType(src.getTypeElement())); 139 if (src.hasExpression()) 140 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 141 if (src.hasXpath()) 142 tgt.setXpathElement(String40_50.convertString(src.getXpathElement())); 143 if (src.hasXpathUsage()) 144 tgt.setXpathUsageElement(convertXPathUsageType(src.getXpathUsageElement())); 145 for (CodeType t : src.getTarget()) tgt.getTarget().add(Code40_50.convertResourceEnum(t)); 146 if (src.hasMultipleOr()) 147 tgt.setMultipleOrElement(Boolean40_50.convertBoolean(src.getMultipleOrElement())); 148 if (src.hasMultipleAnd()) 149 tgt.setMultipleAndElement(Boolean40_50.convertBoolean(src.getMultipleAndElement())); 150 tgt.setComparator(src.getComparator().stream() 151 .map(SearchParameter40_50::convertSearchComparator) 152 .collect(Collectors.toList())); 153 tgt.setModifier(src.getModifier().stream() 154 .map(SearchParameter40_50::convertSearchModifierCode) 155 .collect(Collectors.toList())); 156 for (org.hl7.fhir.r5.model.StringType t : src.getChain()) tgt.getChain().add(String40_50.convertString(t)); 157 for (org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent t : src.getComponent()) 158 tgt.addComponent(convertSearchParameterComponentComponent(t)); 159 return tgt; 160 } 161 162 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.XPathUsageType> convertXPathUsageType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> src) throws FHIRException { 163 if (src == null || src.isEmpty()) 164 return null; 165 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.XPathUsageType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.XPathUsageTypeEnumFactory()); 166 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 167 switch (src.getValue()) { 168 case NORMAL: 169 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NORMAL); 170 break; 171 case PHONETIC: 172 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.PHONETIC); 173 break; 174 case NEARBY: 175 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NEARBY); 176 break; 177 case DISTANCE: 178 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.DISTANCE); 179 break; 180 case OTHER: 181 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.OTHER); 182 break; 183 default: 184 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.XPathUsageType.NULL); 185 break; 186 } 187 return tgt; 188 } 189 190 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> convertXPathUsageType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.XPathUsageType> src) throws FHIRException { 191 if (src == null || src.isEmpty()) 192 return null; 193 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.XPathUsageType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.XPathUsageTypeEnumFactory()); 194 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 195 switch (src.getValue()) { 196 case NORMAL: 197 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NORMAL); 198 break; 199 case PHONETIC: 200 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.PHONETIC); 201 break; 202 case NEARBY: 203 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NEARBY); 204 break; 205 case DISTANCE: 206 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.DISTANCE); 207 break; 208 case OTHER: 209 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.OTHER); 210 break; 211 default: 212 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.XPathUsageType.NULL); 213 break; 214 } 215 return tgt; 216 } 217 218 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchComparator> convertSearchComparator(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> src) throws FHIRException { 219 if (src == null || src.isEmpty()) 220 return null; 221 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchComparator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchComparatorEnumFactory()); 222 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 223 switch (src.getValue()) { 224 case EQ: 225 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EQ); 226 break; 227 case NE: 228 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NE); 229 break; 230 case GT: 231 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GT); 232 break; 233 case LT: 234 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LT); 235 break; 236 case GE: 237 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.GE); 238 break; 239 case LE: 240 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.LE); 241 break; 242 case SA: 243 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.SA); 244 break; 245 case EB: 246 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.EB); 247 break; 248 case AP: 249 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.AP); 250 break; 251 default: 252 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchComparator.NULL); 253 break; 254 } 255 return tgt; 256 } 257 258 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> convertSearchComparator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchComparator> src) throws FHIRException { 259 if (src == null || src.isEmpty()) 260 return null; 261 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchComparator> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchComparatorEnumFactory()); 262 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 263 switch (src.getValue()) { 264 case EQ: 265 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EQ); 266 break; 267 case NE: 268 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NE); 269 break; 270 case GT: 271 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GT); 272 break; 273 case LT: 274 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LT); 275 break; 276 case GE: 277 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.GE); 278 break; 279 case LE: 280 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.LE); 281 break; 282 case SA: 283 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.SA); 284 break; 285 case EB: 286 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.EB); 287 break; 288 case AP: 289 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.AP); 290 break; 291 default: 292 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchComparator.NULL); 293 break; 294 } 295 return tgt; 296 } 297 298 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> src) throws FHIRException { 299 if (src == null || src.isEmpty()) 300 return null; 301 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.SearchParameter.SearchModifierCodeEnumFactory()); 302 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 303 switch (src.getValue()) { 304 case MISSING: 305 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.MISSING); 306 break; 307 case EXACT: 308 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.EXACT); 309 break; 310 case CONTAINS: 311 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.CONTAINS); 312 break; 313 case NOT: 314 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOT); 315 break; 316 case TEXT: 317 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TEXT); 318 break; 319 case IN: 320 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IN); 321 break; 322 case NOTIN: 323 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NOTIN); 324 break; 325 case BELOW: 326 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.BELOW); 327 break; 328 case ABOVE: 329 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.ABOVE); 330 break; 331 case TYPE: 332 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.TYPE); 333 break; 334 case IDENTIFIER: 335 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.IDENTIFIER); 336 break; 337 case OFTYPE: 338 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.OFTYPE); 339 break; 340 default: 341 tgt.setValue(org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode.NULL); 342 break; 343 } 344 return tgt; 345 } 346 347 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> convertSearchModifierCode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.SearchParameter.SearchModifierCode> src) throws FHIRException { 348 if (src == null || src.isEmpty()) 349 return null; 350 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.SearchParameter.SearchModifierCodeEnumFactory()); 351 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 352 switch (src.getValue()) { 353 case MISSING: 354 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.MISSING); 355 break; 356 case EXACT: 357 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.EXACT); 358 break; 359 case CONTAINS: 360 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.CONTAINS); 361 break; 362 case NOT: 363 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOT); 364 break; 365 case TEXT: 366 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TEXT); 367 break; 368 case IN: 369 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IN); 370 break; 371 case NOTIN: 372 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NOTIN); 373 break; 374 case BELOW: 375 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.BELOW); 376 break; 377 case ABOVE: 378 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.ABOVE); 379 break; 380 case TYPE: 381 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.TYPE); 382 break; 383 case IDENTIFIER: 384 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.IDENTIFIER); 385 break; 386 case OFTYPE: 387 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.OFTYPE); 388 break; 389 default: 390 tgt.setValue(org.hl7.fhir.r4.model.SearchParameter.SearchModifierCode.NULL); 391 break; 392 } 393 return tgt; 394 } 395 396 public static org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { 397 if (src == null) 398 return null; 399 org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent(); 400 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 401 if (src.hasDefinition()) 402 tgt.setDefinitionElement(Canonical40_50.convertCanonical(src.getDefinitionElement())); 403 if (src.hasExpression()) 404 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 405 return tgt; 406 } 407 408 public static org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent convertSearchParameterComponentComponent(org.hl7.fhir.r5.model.SearchParameter.SearchParameterComponentComponent src) throws FHIRException { 409 if (src == null) 410 return null; 411 org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent tgt = new org.hl7.fhir.r4.model.SearchParameter.SearchParameterComponentComponent(); 412 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 413 if (src.hasDefinition()) 414 tgt.setDefinitionElement(Canonical40_50.convertCanonical(src.getDefinitionElement())); 415 if (src.hasExpression()) 416 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 417 return tgt; 418 } 419}