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