
001package org.hl7.fhir.convertors.conv10_30.resources10_30; 002 003import org.hl7.fhir.convertors.context.ConversionContext10_30; 004import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30; 005import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30; 006import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30; 007import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30; 008import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30; 009import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30; 010import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30; 011import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30; 012import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30; 013import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30; 014import org.hl7.fhir.dstu3.model.Enumeration; 015import org.hl7.fhir.dstu3.model.ImplementationGuide; 016import org.hl7.fhir.exceptions.FHIRException; 017 018public class ImplementationGuide10_30 { 019 020 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType> convertGuideDependencyType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> src) throws FHIRException { 021 if (src == null || src.isEmpty()) 022 return null; 023 Enumeration<ImplementationGuide.GuideDependencyType> tgt = new Enumeration<>(new ImplementationGuide.GuideDependencyTypeEnumFactory()); 024 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 025 if (src.getValue() == null) { 026 tgt.setValue(null); 027 } else { 028 switch (src.getValue()) { 029 case REFERENCE: 030 tgt.setValue(ImplementationGuide.GuideDependencyType.REFERENCE); 031 break; 032 case INCLUSION: 033 tgt.setValue(ImplementationGuide.GuideDependencyType.INCLUSION); 034 break; 035 default: 036 tgt.setValue(ImplementationGuide.GuideDependencyType.NULL); 037 break; 038 } 039 } 040 return tgt; 041 } 042 043 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> convertGuideDependencyType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuideDependencyType> src) throws FHIRException { 044 if (src == null || src.isEmpty()) 045 return null; 046 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyTypeEnumFactory()); 047 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 048 if (src.getValue() == null) { 049 tgt.setValue(null); 050 } else { 051 switch (src.getValue()) { 052 case REFERENCE: 053 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.REFERENCE); 054 break; 055 case INCLUSION: 056 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.INCLUSION); 057 break; 058 default: 059 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideDependencyType.NULL); 060 break; 061 } 062 } 063 return tgt; 064 } 065 066 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind> convertGuidePageKind(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> src) throws FHIRException { 067 if (src == null || src.isEmpty()) 068 return null; 069 Enumeration<ImplementationGuide.GuidePageKind> tgt = new Enumeration<>(new ImplementationGuide.GuidePageKindEnumFactory()); 070 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 071 if (src.getValue() == null) { 072 tgt.setValue(null); 073 } else { 074 switch (src.getValue()) { 075 case PAGE: 076 tgt.setValue(ImplementationGuide.GuidePageKind.PAGE); 077 break; 078 case EXAMPLE: 079 tgt.setValue(ImplementationGuide.GuidePageKind.EXAMPLE); 080 break; 081 case LIST: 082 tgt.setValue(ImplementationGuide.GuidePageKind.LIST); 083 break; 084 case INCLUDE: 085 tgt.setValue(ImplementationGuide.GuidePageKind.INCLUDE); 086 break; 087 case DIRECTORY: 088 tgt.setValue(ImplementationGuide.GuidePageKind.DIRECTORY); 089 break; 090 case DICTIONARY: 091 tgt.setValue(ImplementationGuide.GuidePageKind.DICTIONARY); 092 break; 093 case TOC: 094 tgt.setValue(ImplementationGuide.GuidePageKind.TOC); 095 break; 096 case RESOURCE: 097 tgt.setValue(ImplementationGuide.GuidePageKind.RESOURCE); 098 break; 099 default: 100 tgt.setValue(ImplementationGuide.GuidePageKind.NULL); 101 break; 102 } 103 } 104 return tgt; 105 } 106 107 static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> convertGuidePageKind(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ImplementationGuide.GuidePageKind> src) throws FHIRException { 108 if (src == null || src.isEmpty()) 109 return null; 110 org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKindEnumFactory()); 111 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 112 if (src.getValue() == null) { 113 tgt.setValue(null); 114 } else { 115 switch (src.getValue()) { 116 case PAGE: 117 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.PAGE); 118 break; 119 case EXAMPLE: 120 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.EXAMPLE); 121 break; 122 case LIST: 123 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.LIST); 124 break; 125 case INCLUDE: 126 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.INCLUDE); 127 break; 128 case DIRECTORY: 129 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DIRECTORY); 130 break; 131 case DICTIONARY: 132 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.DICTIONARY); 133 break; 134 case TOC: 135 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.TOC); 136 break; 137 case RESOURCE: 138 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.RESOURCE); 139 break; 140 default: 141 tgt.setValue(org.hl7.fhir.dstu2.model.ImplementationGuide.GuidePageKind.NULL); 142 break; 143 } 144 } 145 return tgt; 146 } 147 148 public static org.hl7.fhir.dstu3.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu2.model.ImplementationGuide src) throws FHIRException { 149 if (src == null || src.isEmpty()) 150 return null; 151 org.hl7.fhir.dstu3.model.ImplementationGuide tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide(); 152 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt); 153 if (src.hasUrlElement()) 154 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 155 if (src.hasVersionElement()) 156 tgt.setVersionElement(String10_30.convertString(src.getVersionElement())); 157 if (src.hasNameElement()) 158 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 159 if (src.hasStatus()) 160 tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement())); 161 if (src.hasExperimental()) 162 tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement())); 163 if (src.hasPublisherElement()) 164 tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement())); 165 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent t : src.getContact()) 166 tgt.addContact(convertImplementationGuideContactComponent(t)); 167 if (src.hasDate()) 168 tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement())); 169 if (src.hasDescription()) 170 tgt.setDescription(src.getDescription()); 171 for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) 172 if (VersionConvertor_10_30.isJurisdiction(t)) 173 tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t)); 174 else 175 tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t)); 176 if (src.hasCopyright()) 177 tgt.setCopyright(src.getCopyright()); 178 if (src.hasFhirVersionElement()) 179 tgt.setFhirVersionElement(Id10_30.convertId(src.getFhirVersionElement())); 180 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) 181 tgt.addDependency(convertImplementationGuideDependencyComponent(t)); 182 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) 183 tgt.addPackage(convertImplementationGuidePackageComponent(t)); 184 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) 185 tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); 186 for (org.hl7.fhir.dstu2.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); 187 if (src.hasPage()) 188 tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); 189 return tgt; 190 } 191 192 public static org.hl7.fhir.dstu2.model.ImplementationGuide convertImplementationGuide(org.hl7.fhir.dstu3.model.ImplementationGuide src) throws FHIRException { 193 if (src == null || src.isEmpty()) 194 return null; 195 org.hl7.fhir.dstu2.model.ImplementationGuide tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide(); 196 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt); 197 if (src.hasUrlElement()) 198 tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement())); 199 if (src.hasVersionElement()) 200 tgt.setVersionElement(String10_30.convertString(src.getVersionElement())); 201 if (src.hasNameElement()) 202 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 203 if (src.hasStatus()) 204 tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement())); 205 if (src.hasExperimental()) 206 tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement())); 207 if (src.hasPublisherElement()) 208 tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement())); 209 for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) 210 tgt.addContact(convertImplementationGuideContactComponent(t)); 211 if (src.hasDate()) 212 tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement())); 213 if (src.hasDescription()) 214 tgt.setDescription(src.getDescription()); 215 for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) 216 if (t.hasValueCodeableConcept()) 217 tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept())); 218 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) 219 tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t)); 220 if (src.hasCopyright()) 221 tgt.setCopyright(src.getCopyright()); 222 if (src.hasFhirVersionElement()) 223 tgt.setFhirVersionElement(Id10_30.convertId(src.getFhirVersionElement())); 224 for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent t : src.getDependency()) 225 tgt.addDependency(convertImplementationGuideDependencyComponent(t)); 226 for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent t : src.getPackage()) 227 tgt.addPackage(convertImplementationGuidePackageComponent(t)); 228 for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent t : src.getGlobal()) 229 tgt.addGlobal(convertImplementationGuideGlobalComponent(t)); 230 for (org.hl7.fhir.dstu3.model.UriType t : src.getBinary()) tgt.addBinary(t.getValue()); 231 if (src.hasPage()) 232 tgt.setPage(convertImplementationGuidePageComponent(src.getPage())); 233 return tgt; 234 } 235 236 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent convertImplementationGuideContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException { 237 if (src == null || src.isEmpty()) 238 return null; 239 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent(); 240 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 241 if (src.hasNameElement()) 242 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 243 for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) 244 tgt.addTelecom(ContactPoint10_30.convertContactPoint(t)); 245 return tgt; 246 } 247 248 public static org.hl7.fhir.dstu3.model.ContactDetail convertImplementationGuideContactComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideContactComponent src) throws FHIRException { 249 if (src == null || src.isEmpty()) 250 return null; 251 org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail(); 252 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); 253 if (src.hasNameElement()) 254 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 255 for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) 256 tgt.addTelecom(ContactPoint10_30.convertContactPoint(t)); 257 return tgt; 258 } 259 260 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException { 261 if (src == null || src.isEmpty()) 262 return null; 263 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent(); 264 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 265 if (src.hasType()) 266 tgt.setTypeElement(convertGuideDependencyType(src.getTypeElement())); 267 if (src.hasUriElement()) 268 tgt.setUriElement(Uri10_30.convertUri(src.getUriElement())); 269 return tgt; 270 } 271 272 public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException { 273 if (src == null || src.isEmpty()) 274 return null; 275 org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent(); 276 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 277 if (src.hasType()) 278 tgt.setTypeElement(convertGuideDependencyType(src.getTypeElement())); 279 if (src.hasUriElement()) 280 tgt.setUriElement(Uri10_30.convertUri(src.getUriElement())); 281 return tgt; 282 } 283 284 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { 285 if (src == null || src.isEmpty()) 286 return null; 287 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent(); 288 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 289 if (src.hasTypeElement()) 290 tgt.setTypeElement(Code10_30.convertCode(src.getTypeElement())); 291 if (src.hasProfile()) 292 tgt.setProfile(Reference10_30.convertReference(src.getProfile())); 293 return tgt; 294 } 295 296 public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent convertImplementationGuideGlobalComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideGlobalComponent src) throws FHIRException { 297 if (src == null || src.isEmpty()) 298 return null; 299 org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideGlobalComponent(); 300 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 301 if (src.hasTypeElement()) 302 tgt.setTypeElement(Code10_30.convertCode(src.getTypeElement())); 303 if (src.hasProfile()) 304 tgt.setProfile(Reference10_30.convertReference(src.getProfile())); 305 return tgt; 306 } 307 308 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent convertImplementationGuidePackageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent src) throws FHIRException { 309 if (src == null || src.isEmpty()) 310 return null; 311 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent(); 312 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 313 if (src.hasNameElement()) 314 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 315 if (src.hasDescriptionElement()) 316 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 317 for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) 318 tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); 319 return tgt; 320 } 321 322 public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent convertImplementationGuidePackageComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageComponent src) throws FHIRException { 323 if (src == null || src.isEmpty()) 324 return null; 325 org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageComponent(); 326 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 327 if (src.hasNameElement()) 328 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 329 if (src.hasDescriptionElement()) 330 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 331 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent t : src.getResource()) 332 tgt.addResource(convertImplementationGuidePackageResourceComponent(t)); 333 return tgt; 334 } 335 336 public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException { 337 if (src == null || src.isEmpty()) 338 return null; 339 org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); 340 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 341 tgt.setExample(src.getPurpose() == org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE); 342 if (src.hasNameElement()) 343 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 344 if (src.hasDescriptionElement()) 345 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 346 if (src.hasAcronymElement()) 347 tgt.setAcronymElement(String10_30.convertString(src.getAcronymElement())); 348 if (src.hasSource()) 349 tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource())); 350 if (src.hasExampleFor()) 351 tgt.setExampleFor(Reference10_30.convertReference(src.getExampleFor())); 352 return tgt; 353 } 354 355 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException { 356 if (src == null || src.isEmpty()) 357 return null; 358 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent(); 359 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 360 if (src.getExample()) 361 tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE); 362 else 363 tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.PROFILE); 364 if (src.hasNameElement()) 365 tgt.setNameElement(String10_30.convertString(src.getNameElement())); 366 if (src.hasDescriptionElement()) 367 tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement())); 368 if (src.hasAcronymElement()) 369 tgt.setAcronymElement(String10_30.convertString(src.getAcronymElement())); 370 if (src.hasSource()) 371 tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource())); 372 if (src.hasExampleFor()) 373 tgt.setExampleFor(Reference10_30.convertReference(src.getExampleFor())); 374 return tgt; 375 } 376 377 public static org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException { 378 if (src == null || src.isEmpty()) 379 return null; 380 org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent(); 381 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 382 if (src.hasSourceElement()) 383 tgt.setSourceElement(Uri10_30.convertUri(src.getSourceElement())); 384 if (src.hasTitleElement()) 385 tgt.setNameElement(String10_30.convertString(src.getTitleElement())); 386 if (src.hasKind()) 387 tgt.setKindElement(convertGuidePageKind(src.getKindElement())); 388 for (org.hl7.fhir.dstu3.model.CodeType t : src.getType()) tgt.addType(t.getValue()); 389 for (org.hl7.fhir.dstu3.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); 390 if (src.hasFormatElement()) 391 tgt.setFormatElement(Code10_30.convertCode(src.getFormatElement())); 392 for (org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) 393 tgt.addPage(convertImplementationGuidePageComponent(t)); 394 return tgt; 395 } 396 397 public static org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException { 398 if (src == null || src.isEmpty()) 399 return null; 400 org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent tgt = new org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent(); 401 ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyBackboneElement(src,tgt); 402 if (src.hasSourceElement()) 403 tgt.setSourceElement(Uri10_30.convertUri(src.getSourceElement())); 404 if (src.hasNameElement()) 405 tgt.setTitleElement(String10_30.convertString(src.getNameElement())); 406 if (src.hasKind()) 407 tgt.setKindElement(convertGuidePageKind(src.getKindElement())); 408 for (org.hl7.fhir.dstu2.model.CodeType t : src.getType()) tgt.addType(t.getValue()); 409 for (org.hl7.fhir.dstu2.model.StringType t : src.getPackage()) tgt.addPackage(t.getValue()); 410 if (src.hasFormatElement()) 411 tgt.setFormatElement(Code10_30.convertCode(src.getFormatElement())); 412 for (org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage()) 413 tgt.addPage(convertImplementationGuidePageComponent(t)); 414 return tgt; 415 } 416}