001package org.hl7.fhir.convertors.conv30_40.resources30_40; 002 003import org.hl7.fhir.convertors.context.ConversionContext30_40; 004import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40; 005import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.*; 006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; 007import org.hl7.fhir.exceptions.FHIRException; 008 009public class DocumentReference30_40 { 010 011 public static org.hl7.fhir.r4.model.InstantType convertDateTimeToInstant(org.hl7.fhir.dstu3.model.DateTimeType src) throws FHIRException { 012 org.hl7.fhir.r4.model.InstantType tgt = new org.hl7.fhir.r4.model.InstantType(src.getValueAsString()); 013 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 014 return tgt; 015 } 016 017 public static org.hl7.fhir.dstu3.model.DocumentReference convertDocumentReference(org.hl7.fhir.r4.model.DocumentReference src) throws FHIRException { 018 if (src == null) 019 return null; 020 org.hl7.fhir.dstu3.model.DocumentReference tgt = new org.hl7.fhir.dstu3.model.DocumentReference(); 021 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 022 if (src.hasMasterIdentifier()) 023 tgt.setMasterIdentifier(Identifier30_40.convertIdentifier(src.getMasterIdentifier())); 024 for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) 025 tgt.addIdentifier(Identifier30_40.convertIdentifier(t)); 026 if (src.hasStatus()) 027 tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement())); 028 if (src.hasDocStatus()) 029 tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement())); 030 if (src.hasType()) 031 tgt.setType(CodeableConcept30_40.convertCodeableConcept(src.getType())); 032 if (src.hasCategory()) 033 tgt.setClass_(CodeableConcept30_40.convertCodeableConcept(src.getCategoryFirstRep())); 034 if (src.hasSubject()) 035 tgt.setSubject(Reference30_40.convertReference(src.getSubject())); 036 if (src.hasDateElement()) 037 tgt.setCreatedElement(convertInstantToDateTime(src.getDateElement())); 038 if (src.hasAuthenticator()) 039 tgt.setAuthenticator(Reference30_40.convertReference(src.getAuthenticator())); 040 if (src.hasCustodian()) 041 tgt.setCustodian(Reference30_40.convertReference(src.getCustodian())); 042 for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) 043 tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); 044 if (src.hasDescription()) 045 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 046 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel()) 047 tgt.addSecurityLabel(CodeableConcept30_40.convertCodeableConcept(t)); 048 for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) 049 tgt.addContent(convertDocumentReferenceContentComponent(t)); 050 if (src.hasContext()) 051 tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); 052 return tgt; 053 } 054 055 public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(org.hl7.fhir.dstu3.model.DocumentReference src) throws FHIRException { 056 if (src == null) 057 return null; 058 org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference(); 059 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 060 if (src.hasMasterIdentifier()) 061 tgt.setMasterIdentifier(Identifier30_40.convertIdentifier(src.getMasterIdentifier())); 062 for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) 063 tgt.addIdentifier(Identifier30_40.convertIdentifier(t)); 064 if (src.hasStatus()) 065 tgt.setStatusElement(convertDocumentReferenceStatus(src.getStatusElement())); 066 if (src.hasDocStatus()) 067 tgt.setDocStatusElement(convertReferredDocumentStatus(src.getDocStatusElement())); 068 if (src.hasType()) 069 tgt.setType(CodeableConcept30_40.convertCodeableConcept(src.getType())); 070 if (src.hasClass_()) 071 tgt.addCategory(CodeableConcept30_40.convertCodeableConcept(src.getClass_())); 072 if (src.hasSubject()) 073 tgt.setSubject(Reference30_40.convertReference(src.getSubject())); 074 if (src.hasCreated()) 075 tgt.setDateElement(convertDateTimeToInstant(src.getCreatedElement())); 076 if (src.hasAuthenticator()) 077 tgt.setAuthenticator(Reference30_40.convertReference(src.getAuthenticator())); 078 if (src.hasCustodian()) 079 tgt.setCustodian(Reference30_40.convertReference(src.getCustodian())); 080 for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo()) 081 tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t)); 082 if (src.hasDescription()) 083 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 084 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSecurityLabel()) 085 tgt.addSecurityLabel(CodeableConcept30_40.convertCodeableConcept(t)); 086 for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent()) 087 tgt.addContent(convertDocumentReferenceContentComponent(t)); 088 if (src.hasContext()) 089 tgt.setContext(convertDocumentReferenceContextComponent(src.getContext())); 090 return tgt; 091 } 092 093 public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { 094 if (src == null) 095 return null; 096 org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent(); 097 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 098 if (src.hasAttachment()) 099 tgt.setAttachment(Attachment30_40.convertAttachment(src.getAttachment())); 100 if (src.hasFormat()) 101 tgt.setFormat(Coding30_40.convertCoding(src.getFormat())); 102 return tgt; 103 } 104 105 public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException { 106 if (src == null) 107 return null; 108 org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent(); 109 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 110 if (src.hasAttachment()) 111 tgt.setAttachment(Attachment30_40.convertAttachment(src.getAttachment())); 112 if (src.hasFormat()) 113 tgt.setFormat(Coding30_40.convertCoding(src.getFormat())); 114 return tgt; 115 } 116 117 public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { 118 if (src == null) 119 return null; 120 org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent(); 121 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 122 if (src.hasEncounter()) 123 tgt.setEncounter(Reference30_40.convertReference(src.getEncounterFirstRep())); 124 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent()) 125 tgt.addEvent(CodeableConcept30_40.convertCodeableConcept(t)); 126 if (src.hasPeriod()) 127 tgt.setPeriod(Period30_40.convertPeriod(src.getPeriod())); 128 if (src.hasFacilityType()) 129 tgt.setFacilityType(CodeableConcept30_40.convertCodeableConcept(src.getFacilityType())); 130 if (src.hasPracticeSetting()) 131 tgt.setPracticeSetting(CodeableConcept30_40.convertCodeableConcept(src.getPracticeSetting())); 132 if (src.hasSourcePatientInfo()) 133 tgt.setSourcePatientInfo(Reference30_40.convertReference(src.getSourcePatientInfo())); 134 for (org.hl7.fhir.r4.model.Reference t : src.getRelated()) 135 tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); 136 return tgt; 137 } 138 139 public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException { 140 if (src == null) 141 return null; 142 org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent(); 143 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 144 if (src.hasEncounter()) 145 tgt.addEncounter(Reference30_40.convertReference(src.getEncounter())); 146 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent()) 147 tgt.addEvent(CodeableConcept30_40.convertCodeableConcept(t)); 148 if (src.hasPeriod()) 149 tgt.setPeriod(Period30_40.convertPeriod(src.getPeriod())); 150 if (src.hasFacilityType()) 151 tgt.setFacilityType(CodeableConcept30_40.convertCodeableConcept(src.getFacilityType())); 152 if (src.hasPracticeSetting()) 153 tgt.setPracticeSetting(CodeableConcept30_40.convertCodeableConcept(src.getPracticeSetting())); 154 if (src.hasSourcePatientInfo()) 155 tgt.setSourcePatientInfo(Reference30_40.convertReference(src.getSourcePatientInfo())); 156 for (org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated()) 157 tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t)); 158 return tgt; 159 } 160 161 public static org.hl7.fhir.r4.model.Reference convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent src) throws FHIRException { 162 if (src == null) 163 return null; 164 org.hl7.fhir.r4.model.Reference tgt = Reference30_40.convertReference(src.getRef()); 165 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 166 if (src.hasIdentifier()) 167 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 168 return tgt; 169 } 170 171 public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent convertDocumentReferenceContextRelatedComponent(org.hl7.fhir.r4.model.Reference src) throws FHIRException { 172 if (src == null) 173 return null; 174 org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent(); 175 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 176 if (src.hasIdentifier()) 177 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 178 tgt.setRef(Reference30_40.convertReference(src)); 179 return tgt; 180 } 181 182 public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { 183 if (src == null) 184 return null; 185 org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent(); 186 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 187 if (src.hasCode()) 188 tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement())); 189 if (src.hasTarget()) 190 tgt.setTarget(Reference30_40.convertReference(src.getTarget())); 191 return tgt; 192 } 193 194 public static org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException { 195 if (src == null) 196 return null; 197 org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent(); 198 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 199 if (src.hasCode()) 200 tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement())); 201 if (src.hasTarget()) 202 tgt.setTarget(Reference30_40.convertReference(src.getTarget())); 203 return tgt; 204 } 205 206 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException { 207 if (src == null || src.isEmpty()) 208 return null; 209 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory()); 210 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 211 switch (src.getValue()) { 212 case CURRENT: 213 tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT); 214 break; 215 case SUPERSEDED: 216 tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); 217 break; 218 case ENTEREDINERROR: 219 tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); 220 break; 221 default: 222 tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL); 223 break; 224 } 225 return tgt; 226 } 227 228 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException { 229 if (src == null || src.isEmpty()) 230 return null; 231 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatusEnumFactory()); 232 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 233 switch (src.getValue()) { 234 case CURRENT: 235 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT); 236 break; 237 case SUPERSEDED: 238 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED); 239 break; 240 case ENTEREDINERROR: 241 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR); 242 break; 243 default: 244 tgt.setValue(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL); 245 break; 246 } 247 return tgt; 248 } 249 250 public static org.hl7.fhir.r4.model.DateTimeType convertInstantToDateTime(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException { 251 org.hl7.fhir.r4.model.DateTimeType tgt = new org.hl7.fhir.r4.model.DateTimeType(src.getValueAsString()); 252 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 253 return tgt; 254 } 255 256 public static org.hl7.fhir.dstu3.model.DateTimeType convertInstantToDateTime(org.hl7.fhir.r4.model.InstantType src) throws FHIRException { 257 org.hl7.fhir.dstu3.model.DateTimeType tgt = new org.hl7.fhir.dstu3.model.DateTimeType(src.getValueAsString()); 258 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 259 return tgt; 260 } 261 262 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus> convertReferredDocumentStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus> src) throws FHIRException { 263 if (src == null || src.isEmpty()) 264 return null; 265 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatusEnumFactory()); 266 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 267 switch (src.getValue()) { 268 case PRELIMINARY: 269 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); 270 break; 271 case FINAL: 272 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL); 273 break; 274 case AMENDED: 275 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED); 276 break; 277 case ENTEREDINERROR: 278 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); 279 break; 280 default: 281 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL); 282 break; 283 } 284 return tgt; 285 } 286 287 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus> convertReferredDocumentStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus> src) throws FHIRException { 288 if (src == null || src.isEmpty()) 289 return null; 290 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatusEnumFactory()); 291 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 292 switch (src.getValue()) { 293 case PRELIMINARY: 294 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY); 295 break; 296 case FINAL: 297 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL); 298 break; 299 case AMENDED: 300 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED); 301 break; 302 case ENTEREDINERROR: 303 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR); 304 break; 305 default: 306 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL); 307 break; 308 } 309 return tgt; 310 } 311 312 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException { 313 if (src == null || src.isEmpty()) return null; 314 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); 315 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 316 if (src.getValue() == null) { 317 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); 318 } else { 319 switch (src.getValue()) { 320 case REPLACES: 321 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES); 322 break; 323 case TRANSFORMS: 324 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); 325 break; 326 case SIGNS: 327 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS); 328 break; 329 case APPENDS: 330 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS); 331 break; 332 default: 333 tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL); 334 break; 335 } 336 } 337 return tgt; 338 } 339 340 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException { 341 if (src == null || src.isEmpty()) return null; 342 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory()); 343 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 344 if (src.getValue() == null) { 345 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); 346 } else { 347 switch (src.getValue()) { 348 case REPLACES: 349 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES); 350 break; 351 case TRANSFORMS: 352 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS); 353 break; 354 case SIGNS: 355 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS); 356 break; 357 case APPENDS: 358 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS); 359 break; 360 default: 361 tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL); 362 break; 363 } 364 } 365 return tgt; 366 } 367}