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.general40_50.Coding40_50; 006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50; 007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.ContactDetail40_50; 008import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageContext40_50; 009import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*; 010import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.ElementDefinition40_50; 011import org.hl7.fhir.exceptions.FHIRException; 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 StructureDefinition40_50 { 043 044 public static org.hl7.fhir.r5.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r4.model.StructureDefinition src) throws FHIRException { 045 if (src == null) 046 return null; 047 org.hl7.fhir.r5.model.StructureDefinition tgt = new org.hl7.fhir.r5.model.StructureDefinition(); 048 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 049 if (src.hasUrl()) 050 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 051 for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) 052 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 053 if (src.hasVersion()) 054 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 055 if (src.hasName()) 056 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 057 if (src.hasTitle()) 058 tgt.setTitleElement(String40_50.convertString(src.getTitleElement())); 059 if (src.hasStatus()) 060 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 061 if (src.hasExperimental()) 062 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 063 if (src.hasDate()) 064 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 065 if (src.hasPublisher()) 066 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 067 for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact()) 068 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 069 if (src.hasDescription()) 070 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 071 for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext()) 072 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 073 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction()) 074 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 075 if (src.hasPurpose()) 076 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 077 if (src.hasCopyright()) 078 tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement())); 079 for (org.hl7.fhir.r4.model.Coding t : src.getKeyword()) tgt.addKeyword(Coding40_50.convertCoding(t)); 080 if (src.hasFhirVersion()) 081 tgt.setFhirVersionElement(Enumerations40_50.convertFHIRVersion(src.getFhirVersionElement())); 082 for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) 083 tgt.addMapping(convertStructureDefinitionMappingComponent(t)); 084 if (src.hasKind()) 085 tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); 086 if (src.hasAbstract()) 087 tgt.setAbstractElement(Boolean40_50.convertBoolean(src.getAbstractElement())); 088 for (org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) 089 tgt.addContext(convertStructureDefinitionContextComponent(t)); 090 for (org.hl7.fhir.r4.model.StringType t : src.getContextInvariant()) 091 tgt.getContextInvariant().add(String40_50.convertString(t)); 092 if (src.hasType()) 093 tgt.setTypeElement(Uri40_50.convertUri(src.getTypeElement())); 094 if (src.hasBaseDefinition()) 095 tgt.setBaseDefinitionElement(Canonical40_50.convertCanonical(src.getBaseDefinitionElement())); 096 if (src.hasDerivation()) 097 tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); 098 if (src.hasSnapshot()) 099 tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); 100 if (src.hasDifferential()) 101 tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); 102 return tgt; 103 } 104 105 public static org.hl7.fhir.r4.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.r5.model.StructureDefinition src) throws FHIRException { 106 if (src == null) 107 return null; 108 org.hl7.fhir.r4.model.StructureDefinition tgt = new org.hl7.fhir.r4.model.StructureDefinition(); 109 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); 110 if (src.hasUrl()) 111 tgt.setUrlElement(Uri40_50.convertUri(src.getUrlElement())); 112 for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) 113 tgt.addIdentifier(Identifier40_50.convertIdentifier(t)); 114 if (src.hasVersion()) 115 tgt.setVersionElement(String40_50.convertString(src.getVersionElement())); 116 if (src.hasName()) 117 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 118 if (src.hasTitle()) 119 tgt.setTitleElement(String40_50.convertString(src.getTitleElement())); 120 if (src.hasStatus()) 121 tgt.setStatusElement(Enumerations40_50.convertPublicationStatus(src.getStatusElement())); 122 if (src.hasExperimental()) 123 tgt.setExperimentalElement(Boolean40_50.convertBoolean(src.getExperimentalElement())); 124 if (src.hasDate()) 125 tgt.setDateElement(DateTime40_50.convertDateTime(src.getDateElement())); 126 if (src.hasPublisher()) 127 tgt.setPublisherElement(String40_50.convertString(src.getPublisherElement())); 128 for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact()) 129 tgt.addContact(ContactDetail40_50.convertContactDetail(t)); 130 if (src.hasDescription()) 131 tgt.setDescriptionElement(MarkDown40_50.convertMarkdown(src.getDescriptionElement())); 132 for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext()) 133 tgt.addUseContext(UsageContext40_50.convertUsageContext(t)); 134 for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction()) 135 tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept(t)); 136 if (src.hasPurpose()) 137 tgt.setPurposeElement(MarkDown40_50.convertMarkdown(src.getPurposeElement())); 138 if (src.hasCopyright()) 139 tgt.setCopyrightElement(MarkDown40_50.convertMarkdown(src.getCopyrightElement())); 140 for (org.hl7.fhir.r5.model.Coding t : src.getKeyword()) tgt.addKeyword(Coding40_50.convertCoding(t)); 141 if (src.hasFhirVersion()) 142 tgt.setFhirVersionElement(Enumerations40_50.convertFHIRVersion(src.getFhirVersionElement())); 143 for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) 144 tgt.addMapping(convertStructureDefinitionMappingComponent(t)); 145 if (src.hasKind()) 146 tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); 147 if (src.hasAbstract()) 148 tgt.setAbstractElement(Boolean40_50.convertBoolean(src.getAbstractElement())); 149 for (org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent t : src.getContext()) 150 tgt.addContext(convertStructureDefinitionContextComponent(t)); 151 for (org.hl7.fhir.r5.model.StringType t : src.getContextInvariant()) 152 tgt.getContextInvariant().add(String40_50.convertString(t)); 153 if (src.hasType()) 154 tgt.setTypeElement(Uri40_50.convertUri(src.getTypeElement())); 155 if (src.hasBaseDefinition()) 156 tgt.setBaseDefinitionElement(Canonical40_50.convertCanonical(src.getBaseDefinitionElement())); 157 if (src.hasDerivation()) 158 tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); 159 if (src.hasSnapshot()) 160 tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); 161 if (src.hasDifferential()) 162 tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); 163 return tgt; 164 } 165 166 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind> convertStructureDefinitionKind(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind> src) throws FHIRException { 167 if (src == null || src.isEmpty()) 168 return null; 169 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKindEnumFactory()); 170 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 171 switch (src.getValue()) { 172 case PRIMITIVETYPE: 173 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); 174 break; 175 case COMPLEXTYPE: 176 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); 177 break; 178 case RESOURCE: 179 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.RESOURCE); 180 break; 181 case LOGICAL: 182 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.LOGICAL); 183 break; 184 default: 185 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind.NULL); 186 break; 187 } 188 return tgt; 189 } 190 191 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind> convertStructureDefinitionKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind> src) throws FHIRException { 192 if (src == null || src.isEmpty()) 193 return null; 194 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKindEnumFactory()); 195 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 196 switch (src.getValue()) { 197 case PRIMITIVETYPE: 198 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.PRIMITIVETYPE); 199 break; 200 case COMPLEXTYPE: 201 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); 202 break; 203 case RESOURCE: 204 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.RESOURCE); 205 break; 206 case LOGICAL: 207 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.LOGICAL); 208 break; 209 default: 210 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind.NULL); 211 break; 212 } 213 return tgt; 214 } 215 216 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule> convertTypeDerivationRule(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule> src) throws FHIRException { 217 if (src == null || src.isEmpty()) 218 return null; 219 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRuleEnumFactory()); 220 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 221 switch (src.getValue()) { 222 case SPECIALIZATION: 223 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); 224 break; 225 case CONSTRAINT: 226 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); 227 break; 228 default: 229 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule.NULL); 230 break; 231 } 232 return tgt; 233 } 234 235 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule> convertTypeDerivationRule(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule> src) throws FHIRException { 236 if (src == null || src.isEmpty()) 237 return null; 238 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRuleEnumFactory()); 239 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 240 switch (src.getValue()) { 241 case SPECIALIZATION: 242 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); 243 break; 244 case CONSTRAINT: 245 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); 246 break; 247 default: 248 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule.NULL); 249 break; 250 } 251 return tgt; 252 } 253 254 public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { 255 if (src == null) 256 return null; 257 org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent(); 258 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 259 if (src.hasIdentity()) 260 tgt.setIdentityElement(Id40_50.convertId(src.getIdentityElement())); 261 if (src.hasUri()) 262 tgt.setUriElement(Uri40_50.convertUri(src.getUriElement())); 263 if (src.hasName()) 264 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 265 if (src.hasComment()) 266 tgt.setCommentElement(String40_50.convertString(src.getCommentElement())); 267 return tgt; 268 } 269 270 public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { 271 if (src == null) 272 return null; 273 org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionMappingComponent(); 274 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 275 if (src.hasIdentity()) 276 tgt.setIdentityElement(Id40_50.convertId(src.getIdentityElement())); 277 if (src.hasUri()) 278 tgt.setUriElement(Uri40_50.convertUri(src.getUriElement())); 279 if (src.hasName()) 280 tgt.setNameElement(String40_50.convertString(src.getNameElement())); 281 if (src.hasComment()) 282 tgt.setCommentElement(String40_50.convertString(src.getCommentElement())); 283 return tgt; 284 } 285 286 public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { 287 if (src == null) 288 return null; 289 org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent(); 290 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 291 if (src.hasType()) 292 tgt.setTypeElement(convertExtensionContextType(src.getTypeElement())); 293 if (src.hasExpression()) 294 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 295 return tgt; 296 } 297 298 public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent convertStructureDefinitionContextComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionContextComponent src) throws FHIRException { 299 if (src == null) 300 return null; 301 org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionContextComponent(); 302 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 303 if (src.hasType()) 304 tgt.setTypeElement(convertExtensionContextType(src.getTypeElement())); 305 if (src.hasExpression()) 306 tgt.setExpressionElement(String40_50.convertString(src.getExpressionElement())); 307 return tgt; 308 } 309 310 static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType> convertExtensionContextType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType> src) throws FHIRException { 311 if (src == null || src.isEmpty()) 312 return null; 313 org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextTypeEnumFactory()); 314 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 315 switch (src.getValue()) { 316 case FHIRPATH: 317 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.FHIRPATH); 318 break; 319 case ELEMENT: 320 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.ELEMENT); 321 break; 322 case EXTENSION: 323 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.EXTENSION); 324 break; 325 default: 326 tgt.setValue(org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType.NULL); 327 break; 328 } 329 return tgt; 330 } 331 332 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType> convertExtensionContextType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.StructureDefinition.ExtensionContextType> src) throws FHIRException { 333 if (src == null || src.isEmpty()) 334 return null; 335 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextTypeEnumFactory()); 336 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 337 switch (src.getValue()) { 338 case FHIRPATH: 339 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.FHIRPATH); 340 break; 341 case ELEMENT: 342 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.ELEMENT); 343 break; 344 case EXTENSION: 345 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.EXTENSION); 346 break; 347 default: 348 tgt.setValue(org.hl7.fhir.r4.model.StructureDefinition.ExtensionContextType.NULL); 349 break; 350 } 351 return tgt; 352 } 353 354 public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { 355 if (src == null) 356 return null; 357 org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent(); 358 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 359 for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) 360 tgt.addElement(ElementDefinition40_50.convertElementDefinition(t)); 361 return tgt; 362 } 363 364 public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { 365 if (src == null) 366 return null; 367 org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionSnapshotComponent(); 368 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 369 for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) 370 tgt.addElement(ElementDefinition40_50.convertElementDefinition(t)); 371 return tgt; 372 } 373 374 public static org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { 375 if (src == null) 376 return null; 377 org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent(); 378 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 379 for (org.hl7.fhir.r4.model.ElementDefinition t : src.getElement()) 380 tgt.addElement(ElementDefinition40_50.convertElementDefinition(t)); 381 return tgt; 382 } 383 384 public static org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { 385 if (src == null) 386 return null; 387 org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionDifferentialComponent(); 388 ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); 389 for (org.hl7.fhir.r5.model.ElementDefinition t : src.getElement()) 390 tgt.addElement(ElementDefinition40_50.convertElementDefinition(t)); 391 return tgt; 392 } 393}