001package org.hl7.fhir.convertors.conv30_40.resources30_40; 002 003import java.util.Collections; 004 005import org.hl7.fhir.convertors.context.ConversionContext30_40; 006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Narrative30_40; 007import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Reference30_40; 008import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.CodeableConcept30_40; 009import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Identifier30_40; 010import org.hl7.fhir.convertors.conv30_40.datatypes30_40.complextypes30_40.Period30_40; 011import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.DateTime30_40; 012import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.String30_40; 013import org.hl7.fhir.exceptions.FHIRException; 014 015public class Composition30_40 { 016 017 public static org.hl7.fhir.dstu3.model.Composition convertComposition(org.hl7.fhir.r4.model.Composition src) throws FHIRException { 018 if (src == null) 019 return null; 020 org.hl7.fhir.dstu3.model.Composition tgt = new org.hl7.fhir.dstu3.model.Composition(); 021 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 022 if (src.hasIdentifier()) 023 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 024 if (src.hasStatus()) 025 tgt.setStatusElement(convertCompositionStatus(src.getStatusElement())); 026 if (src.hasType()) 027 tgt.setType(CodeableConcept30_40.convertCodeableConcept(src.getType())); 028 if (src.hasCategory()) 029 tgt.setClass_(CodeableConcept30_40.convertCodeableConcept(src.getCategoryFirstRep())); 030 if (src.hasSubject()) 031 tgt.setSubject(Reference30_40.convertReference(src.getSubject())); 032 if (src.hasEncounter()) 033 tgt.setEncounter(Reference30_40.convertReference(src.getEncounter())); 034 if (src.hasDateElement()) 035 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 036 for (org.hl7.fhir.r4.model.Reference t : src.getAuthor()) 037 tgt.addAuthor(Reference30_40.convertReference(t)); 038 if (src.hasTitle()) 039 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 040 if (src.hasConfidentiality()) 041 tgt.setConfidentialityElement(convertDocumentConfidentiality(src.getConfidentialityElement())); 042 for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester()) 043 tgt.addAttester(convertCompositionAttesterComponent(t)); 044 if (src.hasCustodian()) 045 tgt.setCustodian(Reference30_40.convertReference(src.getCustodian())); 046 for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) 047 tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); 048 for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent()) 049 tgt.addEvent(convertCompositionEventComponent(t)); 050 for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) 051 tgt.addSection(convertSectionComponent(t)); 052 return tgt; 053 } 054 055 public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir.dstu3.model.Composition src) throws FHIRException { 056 if (src == null) 057 return null; 058 org.hl7.fhir.r4.model.Composition tgt = new org.hl7.fhir.r4.model.Composition(); 059 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 060 if (src.hasIdentifier()) 061 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 062 if (src.hasStatus()) 063 tgt.setStatusElement(convertCompositionStatus(src.getStatusElement())); 064 if (src.hasType()) 065 tgt.setType(CodeableConcept30_40.convertCodeableConcept(src.getType())); 066 if (src.hasClass_()) 067 tgt.addCategory(CodeableConcept30_40.convertCodeableConcept(src.getClass_())); 068 if (src.hasSubject()) 069 tgt.setSubject(Reference30_40.convertReference(src.getSubject())); 070 if (src.hasEncounter()) 071 tgt.setEncounter(Reference30_40.convertReference(src.getEncounter())); 072 if (src.hasDateElement()) 073 tgt.setDateElement(DateTime30_40.convertDateTime(src.getDateElement())); 074 for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) 075 tgt.addAuthor(Reference30_40.convertReference(t)); 076 if (src.hasTitle()) 077 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 078 if (src.hasConfidentiality()) 079 tgt.setConfidentialityElement(convertDocumentConfidentiality(src.getConfidentialityElement())); 080 for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) 081 tgt.addAttester(convertCompositionAttesterComponent(t)); 082 if (src.hasCustodian()) 083 tgt.setCustodian(Reference30_40.convertReference(src.getCustodian())); 084 for (org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo()) 085 tgt.addRelatesTo(convertCompositionRelatesToComponent(t)); 086 for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) 087 tgt.addEvent(convertCompositionEventComponent(t)); 088 for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) 089 tgt.addSection(convertSectionComponent(t)); 090 return tgt; 091 } 092 093 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> src) throws FHIRException { 094 if (src == null || src.isEmpty()) 095 return null; 096 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionAttestationModeEnumFactory()); 097 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 098 switch (src.getValue()) { 099 case PERSONAL: 100 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL); 101 break; 102 case PROFESSIONAL: 103 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL); 104 break; 105 case LEGAL: 106 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL); 107 break; 108 case OFFICIAL: 109 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL); 110 break; 111 default: 112 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.NULL); 113 break; 114 } 115 return tgt; 116 } 117 118 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> src) throws FHIRException { 119 if (src == null || src.isEmpty()) 120 return null; 121 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionAttestationModeEnumFactory()); 122 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 123 switch (src.getValue()) { 124 case PERSONAL: 125 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL); 126 break; 127 case PROFESSIONAL: 128 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL); 129 break; 130 case LEGAL: 131 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL); 132 break; 133 case OFFICIAL: 134 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL); 135 break; 136 default: 137 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL); 138 break; 139 } 140 return tgt; 141 } 142 143 public static org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent src) throws FHIRException { 144 if (src == null) 145 return null; 146 org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent(); 147 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 148 if (src.hasMode()) 149 tgt.setMode(Collections.singletonList(convertCompositionAttestationMode(src.getModeElement()))); 150 if (src.hasTime()) 151 tgt.setTimeElement(DateTime30_40.convertDateTime(src.getTimeElement())); 152 if (src.hasParty()) 153 tgt.setParty(Reference30_40.convertReference(src.getParty())); 154 return tgt; 155 } 156 157 public static org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent src) throws FHIRException { 158 if (src == null) 159 return null; 160 org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent(); 161 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 162 if (src.hasMode()) 163 tgt.setModeElement(convertCompositionAttestationMode(src.getMode().get(0))); 164 if (src.hasTime()) 165 tgt.setTimeElement(DateTime30_40.convertDateTime(src.getTimeElement())); 166 if (src.hasParty()) 167 tgt.setParty(Reference30_40.convertReference(src.getParty())); 168 return tgt; 169 } 170 171 public static org.hl7.fhir.r4.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent src) throws FHIRException { 172 if (src == null) 173 return null; 174 org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent(); 175 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 176 for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) 177 tgt.addCode(CodeableConcept30_40.convertCodeableConcept(t)); 178 if (src.hasPeriod()) 179 tgt.setPeriod(Period30_40.convertPeriod(src.getPeriod())); 180 for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) 181 tgt.addDetail(Reference30_40.convertReference(t)); 182 return tgt; 183 } 184 185 public static org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4.model.Composition.CompositionEventComponent src) throws FHIRException { 186 if (src == null) 187 return null; 188 org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent(); 189 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 190 for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode()) 191 tgt.addCode(CodeableConcept30_40.convertCodeableConcept(t)); 192 if (src.hasPeriod()) 193 tgt.setPeriod(Period30_40.convertPeriod(src.getPeriod())); 194 for (org.hl7.fhir.r4.model.Reference t : src.getDetail()) 195 tgt.addDetail(Reference30_40.convertReference(t)); 196 return tgt; 197 } 198 199 public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent src) throws FHIRException { 200 if (src == null) 201 return null; 202 org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent(); 203 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 204 if (src.hasCode()) 205 tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement())); 206 if (src.hasTarget()) 207 tgt.setTarget(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getTarget())); 208 return tgt; 209 } 210 211 public static org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException { 212 if (src == null) 213 return null; 214 org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent(); 215 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 216 if (src.hasCode()) 217 tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement())); 218 if (src.hasTarget()) 219 tgt.setTarget(ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().convertType(src.getTarget())); 220 return tgt; 221 } 222 223 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> src) throws FHIRException { 224 if (src == null || src.isEmpty()) 225 return null; 226 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionStatusEnumFactory()); 227 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 228 switch (src.getValue()) { 229 case PRELIMINARY: 230 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY); 231 break; 232 case FINAL: 233 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL); 234 break; 235 case AMENDED: 236 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED); 237 break; 238 case ENTEREDINERROR: 239 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR); 240 break; 241 default: 242 tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL); 243 break; 244 } 245 return tgt; 246 } 247 248 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionStatus> src) throws FHIRException { 249 if (src == null || src.isEmpty()) 250 return null; 251 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory()); 252 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 253 switch (src.getValue()) { 254 case PRELIMINARY: 255 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY); 256 break; 257 case FINAL: 258 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL); 259 break; 260 case AMENDED: 261 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED); 262 break; 263 case ENTEREDINERROR: 264 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR); 265 break; 266 default: 267 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL); 268 break; 269 } 270 return tgt; 271 } 272 273 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentConfidentiality> convertDocumentConfidentiality(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality> src) throws FHIRException { 274 if (src == null || src.isEmpty()) 275 return null; 276 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentConfidentiality> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentConfidentialityEnumFactory()); 277 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 278 switch (src.getValue()) { 279 case U: 280 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U); 281 break; 282 case L: 283 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L); 284 break; 285 case M: 286 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M); 287 break; 288 case N: 289 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N); 290 break; 291 case R: 292 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R); 293 break; 294 case V: 295 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V); 296 break; 297 default: 298 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL); 299 break; 300 } 301 return tgt; 302 } 303 304 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality> convertDocumentConfidentiality(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentConfidentiality> src) throws FHIRException { 305 if (src == null || src.isEmpty()) 306 return null; 307 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentConfidentialityEnumFactory()); 308 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 309 switch (src.getValue()) { 310 case U: 311 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.U); 312 break; 313 case L: 314 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.L); 315 break; 316 case M: 317 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.M); 318 break; 319 case N: 320 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.N); 321 break; 322 case R: 323 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.R); 324 break; 325 case V: 326 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.V); 327 break; 328 default: 329 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.NULL); 330 break; 331 } 332 return tgt; 333 } 334 335 public static org.hl7.fhir.dstu3.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4.model.Composition.SectionComponent src) throws FHIRException { 336 if (src == null) 337 return null; 338 org.hl7.fhir.dstu3.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu3.model.Composition.SectionComponent(); 339 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 340 if (src.hasTitle()) 341 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 342 if (src.hasCode()) 343 tgt.setCode(CodeableConcept30_40.convertCodeableConcept(src.getCode())); 344 if (src.hasText()) 345 tgt.setText(Narrative30_40.convertNarrative(src.getText())); 346 if (src.hasMode()) 347 tgt.setModeElement(convertSectionMode(src.getModeElement())); 348 if (src.hasOrderedBy()) 349 tgt.setOrderedBy(CodeableConcept30_40.convertCodeableConcept(src.getOrderedBy())); 350 for (org.hl7.fhir.r4.model.Reference t : src.getEntry()) 351 tgt.addEntry(Reference30_40.convertReference(t)); 352 if (src.hasEmptyReason()) 353 tgt.setEmptyReason(CodeableConcept30_40.convertCodeableConcept(src.getEmptyReason())); 354 for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection()) 355 tgt.addSection(convertSectionComponent(t)); 356 return tgt; 357 } 358 359 public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu3.model.Composition.SectionComponent src) throws FHIRException { 360 if (src == null) 361 return null; 362 org.hl7.fhir.r4.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4.model.Composition.SectionComponent(); 363 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyBackboneElement(src,tgt); 364 if (src.hasTitle()) 365 tgt.setTitleElement(String30_40.convertString(src.getTitleElement())); 366 if (src.hasCode()) 367 tgt.setCode(CodeableConcept30_40.convertCodeableConcept(src.getCode())); 368 if (src.hasText()) 369 tgt.setText(Narrative30_40.convertNarrative(src.getText())); 370 if (src.hasMode()) 371 tgt.setModeElement(convertSectionMode(src.getModeElement())); 372 if (src.hasOrderedBy()) 373 tgt.setOrderedBy(CodeableConcept30_40.convertCodeableConcept(src.getOrderedBy())); 374 for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) 375 tgt.addEntry(Reference30_40.convertReference(t)); 376 if (src.hasEmptyReason()) 377 tgt.setEmptyReason(CodeableConcept30_40.convertCodeableConcept(src.getEmptyReason())); 378 for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) 379 tgt.addSection(convertSectionComponent(t)); 380 return tgt; 381 } 382 383 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.SectionMode> convertSectionMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.SectionMode> src) throws FHIRException { 384 if (src == null || src.isEmpty()) 385 return null; 386 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.SectionMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.SectionModeEnumFactory()); 387 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 388 switch (src.getValue()) { 389 case WORKING: 390 tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.WORKING); 391 break; 392 case SNAPSHOT: 393 tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT); 394 break; 395 case CHANGES: 396 tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES); 397 break; 398 default: 399 tgt.setValue(org.hl7.fhir.r4.model.Composition.SectionMode.NULL); 400 break; 401 } 402 return tgt; 403 } 404 405 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.SectionMode> convertSectionMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.SectionMode> src) throws FHIRException { 406 if (src == null || src.isEmpty()) 407 return null; 408 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.SectionMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.SectionModeEnumFactory()); 409 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 410 switch (src.getValue()) { 411 case WORKING: 412 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.WORKING); 413 break; 414 case SNAPSHOT: 415 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.SNAPSHOT); 416 break; 417 case CHANGES: 418 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.CHANGES); 419 break; 420 default: 421 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.SectionMode.NULL); 422 break; 423 } 424 return tgt; 425 } 426 427 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> src) throws FHIRException { 428 if (src == null || src.isEmpty()) 429 return null; 430 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentRelationshipTypeEnumFactory()); 431 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 432 switch (src.getValue()) { 433 case REPLACES: 434 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES); 435 break; 436 case TRANSFORMS: 437 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS); 438 break; 439 case SIGNS: 440 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS); 441 break; 442 case APPENDS: 443 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS); 444 break; 445 default: 446 tgt.setValue(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL); 447 break; 448 } 449 return tgt; 450 } 451 452 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> src) throws FHIRException { 453 if (src == null || src.isEmpty()) 454 return null; 455 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipTypeEnumFactory()); 456 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 457 switch (src.getValue()) { 458 case REPLACES: 459 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.REPLACES); 460 break; 461 case TRANSFORMS: 462 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.TRANSFORMS); 463 break; 464 case SIGNS: 465 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.SIGNS); 466 break; 467 case APPENDS: 468 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.APPENDS); 469 break; 470 default: 471 tgt.setValue(org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType.NULL); 472 break; 473 } 474 return tgt; 475 } 476 477}