001package org.hl7.fhir.convertors.conv14_30.resources14_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext14_30; 004import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30; 005import org.hl7.fhir.convertors.conv14_30.datatypes14_30.ElementDefinition14_30; 006import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.CodeableConcept14_30; 007import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.ContactPoint14_30; 008import org.hl7.fhir.convertors.conv14_30.datatypes14_30.complextypes14_30.Identifier14_30; 009import org.hl7.fhir.convertors.conv14_30.datatypes14_30.primitivetypes14_30.*; 010import org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule; 011import org.hl7.fhir.exceptions.FHIRException; 012 013public class StructureDefinition14_30 { 014 015 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext> convertExtensionContext(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext> src) throws FHIRException { 016 if (src == null || src.isEmpty()) 017 return null; 018 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContextEnumFactory()); 019 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 020 switch (src.getValue()) { 021 case RESOURCE: 022 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.RESOURCE); 023 break; 024 case DATATYPE: 025 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.DATATYPE); 026 break; 027 case EXTENSION: 028 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.EXTENSION); 029 break; 030 default: 031 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext.NULL); 032 break; 033 } 034 return tgt; 035 } 036 037 static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext> convertExtensionContext(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.ExtensionContext> src) throws FHIRException { 038 if (src == null || src.isEmpty()) 039 return null; 040 org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContextEnumFactory()); 041 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 042 switch (src.getValue()) { 043 case RESOURCE: 044 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.RESOURCE); 045 break; 046 case DATATYPE: 047 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.DATATYPE); 048 break; 049 case EXTENSION: 050 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.EXTENSION); 051 break; 052 default: 053 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.ExtensionContext.NULL); 054 break; 055 } 056 return tgt; 057 } 058 059 public static org.hl7.fhir.dstu2016may.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu3.model.StructureDefinition src) throws FHIRException { 060 if (src == null || src.isEmpty()) 061 return null; 062 org.hl7.fhir.dstu2016may.model.StructureDefinition tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition(); 063 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt); 064 if (src.hasUrl()) 065 tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement())); 066 for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) 067 tgt.addIdentifier(Identifier14_30.convertIdentifier(t)); 068 if (src.hasVersion()) 069 tgt.setVersionElement(String14_30.convertString(src.getVersionElement())); 070 if (src.hasNameElement()) 071 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 072 if (src.hasTitle()) 073 tgt.setDisplayElement(String14_30.convertString(src.getTitleElement())); 074 if (src.hasStatus()) 075 tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement())); 076 if (src.hasExperimental()) 077 tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement())); 078 if (src.hasPublisher()) 079 tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement())); 080 for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) 081 tgt.addContact(convertStructureDefinitionContactComponent(t)); 082 if (src.hasDate()) 083 tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement())); 084 if (src.hasDescription()) 085 tgt.setDescription(src.getDescription()); 086 for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) 087 if (t.hasValueCodeableConcept()) 088 tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t.getValueCodeableConcept())); 089 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) 090 tgt.addUseContext(CodeableConcept14_30.convertCodeableConcept(t)); 091 if (src.hasPurpose()) 092 tgt.setRequirements(src.getPurpose()); 093 if (src.hasCopyright()) 094 tgt.setCopyright(src.getCopyright()); 095 for (org.hl7.fhir.dstu3.model.Coding t : src.getKeyword()) tgt.addCode(Code14_30.convertCoding(t)); 096 if (src.hasFhirVersion()) 097 tgt.setFhirVersionElement(Id14_30.convertId(src.getFhirVersionElement())); 098 for (org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) 099 tgt.addMapping(convertStructureDefinitionMappingComponent(t)); 100 if (src.hasKind()) 101 tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); 102 if (src.hasAbstractElement()) 103 tgt.setAbstractElement(Boolean14_30.convertBoolean(src.getAbstractElement())); 104 if (src.hasContextType()) 105 tgt.setContextTypeElement(convertExtensionContext(src.getContextTypeElement())); 106 for (org.hl7.fhir.dstu3.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); 107 if (src.hasBaseDefinition()) 108 tgt.setBaseDefinitionElement(Uri14_30.convertUri(src.getBaseDefinitionElement())); 109 if (src.hasType() && src.getDerivation() == org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT) 110 tgt.setBaseTypeElement(Code14_30.convertCode(src.getTypeElement())); 111 if (src.hasDerivation()) 112 tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); 113 if (src.hasSnapshot()) 114 tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); 115 if (src.hasDifferential()) 116 tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); 117 return tgt; 118 } 119 120 public static org.hl7.fhir.dstu3.model.StructureDefinition convertStructureDefinition(org.hl7.fhir.dstu2016may.model.StructureDefinition src) throws FHIRException { 121 if (src == null || src.isEmpty()) 122 return null; 123 org.hl7.fhir.dstu3.model.StructureDefinition tgt = new org.hl7.fhir.dstu3.model.StructureDefinition(); 124 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyDomainResource(src, tgt); 125 if (src.hasUrl()) 126 tgt.setUrlElement(Uri14_30.convertUri(src.getUrlElement())); 127 for (org.hl7.fhir.dstu2016may.model.Identifier t : src.getIdentifier()) 128 tgt.addIdentifier(Identifier14_30.convertIdentifier(t)); 129 if (src.hasVersion()) 130 tgt.setVersionElement(String14_30.convertString(src.getVersionElement())); 131 if (src.hasNameElement()) 132 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 133 if (src.hasDisplay()) 134 tgt.setTitleElement(String14_30.convertString(src.getDisplayElement())); 135 if (src.hasStatus()) 136 tgt.setStatusElement(Enumerations14_30.convertConformanceResourceStatus(src.getStatusElement())); 137 if (src.hasExperimental()) 138 tgt.setExperimentalElement(Boolean14_30.convertBoolean(src.getExperimentalElement())); 139 if (src.hasPublisher()) 140 tgt.setPublisherElement(String14_30.convertString(src.getPublisherElement())); 141 for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent t : src.getContact()) 142 tgt.addContact(convertStructureDefinitionContactComponent(t)); 143 if (src.hasDate()) 144 tgt.setDateElement(DateTime14_30.convertDateTime(src.getDateElement())); 145 if (src.hasDescription()) 146 tgt.setDescription(src.getDescription()); 147 for (org.hl7.fhir.dstu2016may.model.CodeableConcept t : src.getUseContext()) 148 if (VersionConvertor_14_30.isJurisdiction(t)) 149 tgt.addJurisdiction(CodeableConcept14_30.convertCodeableConcept(t)); 150 else 151 tgt.addUseContext(CodeableConcept14_30.convertCodeableConceptToUsageContext(t)); 152 if (src.hasRequirements()) 153 tgt.setPurpose(src.getRequirements()); 154 if (src.hasCopyright()) 155 tgt.setCopyright(src.getCopyright()); 156 for (org.hl7.fhir.dstu2016may.model.Coding t : src.getCode()) tgt.addKeyword(Code14_30.convertCoding(t)); 157 if (src.hasFhirVersion()) 158 tgt.setFhirVersionElement(Id14_30.convertId(src.getFhirVersionElement())); 159 for (org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent t : src.getMapping()) 160 tgt.addMapping(convertStructureDefinitionMappingComponent(t)); 161 if (src.hasKind()) 162 tgt.setKindElement(convertStructureDefinitionKind(src.getKindElement())); 163 if (src.hasAbstractElement()) 164 tgt.setAbstractElement(Boolean14_30.convertBoolean(src.getAbstractElement())); 165 if (src.hasContextType()) 166 tgt.setContextTypeElement(convertExtensionContext(src.getContextTypeElement())); 167 for (org.hl7.fhir.dstu2016may.model.StringType t : src.getContext()) tgt.addContext(t.getValue()); 168 if (src.getDerivation() == TypeDerivationRule.CONSTRAINT) 169 tgt.setTypeElement(Code14_30.convertCode(src.getBaseTypeElement())); 170 else 171 tgt.setType(src.getId()); 172 if (src.hasBaseDefinition()) 173 tgt.setBaseDefinitionElement(Uri14_30.convertUri(src.getBaseDefinitionElement())); 174 if (src.hasDerivation()) 175 tgt.setDerivationElement(convertTypeDerivationRule(src.getDerivationElement())); 176 if (src.hasSnapshot()) { 177 if (src.hasSnapshot()) 178 tgt.setSnapshot(convertStructureDefinitionSnapshotComponent(src.getSnapshot())); 179 tgt.getSnapshot().getElementFirstRep().getType().clear(); 180 } 181 if (src.hasDifferential()) { 182 if (src.hasDifferential()) 183 tgt.setDifferential(convertStructureDefinitionDifferentialComponent(src.getDifferential())); 184 tgt.getDifferential().getElementFirstRep().getType().clear(); 185 } 186 return tgt; 187 } 188 189 public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent convertStructureDefinitionContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException { 190 if (src == null || src.isEmpty()) 191 return null; 192 org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent(); 193 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 194 if (src.hasName()) 195 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 196 for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) 197 tgt.addTelecom(ContactPoint14_30.convertContactPoint(t)); 198 return tgt; 199 } 200 201 public static org.hl7.fhir.dstu3.model.ContactDetail convertStructureDefinitionContactComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionContactComponent src) throws FHIRException { 202 if (src == null || src.isEmpty()) 203 return null; 204 org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); 205 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 206 if (src.hasName()) 207 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 208 for (org.hl7.fhir.dstu2016may.model.ContactPoint t : src.getTelecom()) 209 tgt.addTelecom(ContactPoint14_30.convertContactPoint(t)); 210 return tgt; 211 } 212 213 public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { 214 if (src == null || src.isEmpty()) 215 return null; 216 org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent(); 217 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 218 for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) 219 tgt.addElement(ElementDefinition14_30.convertElementDefinition(t)); 220 return tgt; 221 } 222 223 public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent convertStructureDefinitionDifferentialComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionDifferentialComponent src) throws FHIRException { 224 if (src == null || src.isEmpty()) 225 return null; 226 org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionDifferentialComponent(); 227 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 228 for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) 229 tgt.addElement(ElementDefinition14_30.convertElementDefinition(t)); 230 return tgt; 231 } 232 233 static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind> convertStructureDefinitionKind(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind> src) throws FHIRException { 234 if (src == null || src.isEmpty()) 235 return null; 236 org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKindEnumFactory()); 237 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 238 switch (src.getValue()) { 239 case PRIMITIVETYPE: 240 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); 241 break; 242 case COMPLEXTYPE: 243 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.DATATYPE); 244 break; 245 case RESOURCE: 246 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.RESOURCE); 247 break; 248 case LOGICAL: 249 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.LOGICAL); 250 break; 251 default: 252 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind.NULL); 253 break; 254 } 255 return tgt; 256 } 257 258 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind> convertStructureDefinitionKind(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind> src) throws FHIRException { 259 if (src == null || src.isEmpty()) 260 return null; 261 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKindEnumFactory()); 262 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 263 switch (src.getValue()) { 264 case DATATYPE: 265 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.COMPLEXTYPE); 266 break; 267 case RESOURCE: 268 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.RESOURCE); 269 break; 270 case LOGICAL: 271 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.LOGICAL); 272 break; 273 default: 274 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind.NULL); 275 break; 276 } 277 return tgt; 278 } 279 280 public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { 281 if (src == null || src.isEmpty()) 282 return null; 283 org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent(); 284 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 285 if (src.hasIdentityElement()) 286 tgt.setIdentityElement(Id14_30.convertId(src.getIdentityElement())); 287 if (src.hasUri()) 288 tgt.setUriElement(Uri14_30.convertUri(src.getUriElement())); 289 if (src.hasName()) 290 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 291 if (src.hasComments()) 292 tgt.setCommentElement(String14_30.convertString(src.getCommentsElement())); 293 return tgt; 294 } 295 296 public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException { 297 if (src == null || src.isEmpty()) 298 return null; 299 org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionMappingComponent(); 300 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 301 if (src.hasIdentityElement()) 302 tgt.setIdentityElement(Id14_30.convertId(src.getIdentityElement())); 303 if (src.hasUri()) 304 tgt.setUriElement(Uri14_30.convertUri(src.getUriElement())); 305 if (src.hasName()) 306 tgt.setNameElement(String14_30.convertString(src.getNameElement())); 307 if (src.hasComment()) 308 tgt.setCommentsElement(String14_30.convertString(src.getCommentElement())); 309 return tgt; 310 } 311 312 public static org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { 313 if (src == null || src.isEmpty()) 314 return null; 315 org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent(); 316 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 317 for (org.hl7.fhir.dstu2016may.model.ElementDefinition t : src.getElement()) 318 tgt.addElement(ElementDefinition14_30.convertElementDefinition(t)); 319 return tgt; 320 } 321 322 public static org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent convertStructureDefinitionSnapshotComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionSnapshotComponent src) throws FHIRException { 323 if (src == null || src.isEmpty()) 324 return null; 325 org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent tgt = new org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionSnapshotComponent(); 326 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 327 for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) 328 tgt.addElement(ElementDefinition14_30.convertElementDefinition(t)); 329 return tgt; 330 } 331 332 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule> convertTypeDerivationRule(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule> src) throws FHIRException { 333 if (src == null || src.isEmpty()) 334 return null; 335 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRuleEnumFactory()); 336 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 337 switch (src.getValue()) { 338 case SPECIALIZATION: 339 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); 340 break; 341 case CONSTRAINT: 342 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); 343 break; 344 default: 345 tgt.setValue(org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule.NULL); 346 break; 347 } 348 return tgt; 349 } 350 351 static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule> convertTypeDerivationRule(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.StructureDefinition.TypeDerivationRule> src) throws FHIRException { 352 if (src == null || src.isEmpty()) 353 return null; 354 org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRuleEnumFactory()); 355 ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); 356 switch (src.getValue()) { 357 case SPECIALIZATION: 358 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.SPECIALIZATION); 359 break; 360 case CONSTRAINT: 361 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.CONSTRAINT); 362 break; 363 default: 364 tgt.setValue(org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule.NULL); 365 break; 366 } 367 return tgt; 368 } 369}