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.Identifier30_40; 006import org.hl7.fhir.convertors.conv30_40.datatypes30_40.primitivetypes30_40.*; 007import org.hl7.fhir.exceptions.FHIRException; 008 009public class TestReport30_40 { 010 011 public static org.hl7.fhir.r4.model.TestReport convertTestReport(org.hl7.fhir.dstu3.model.TestReport src) throws FHIRException { 012 if (src == null) 013 return null; 014 org.hl7.fhir.r4.model.TestReport tgt = new org.hl7.fhir.r4.model.TestReport(); 015 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 016 if (src.hasIdentifier()) 017 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 018 if (src.hasName()) 019 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 020 if (src.hasStatus()) 021 tgt.setStatusElement(convertTestReportStatus(src.getStatusElement())); 022 if (src.hasTestScript()) 023 tgt.setTestScript(Reference30_40.convertReference(src.getTestScript())); 024 if (src.hasResult()) 025 tgt.setResultElement(convertTestReportResult(src.getResultElement())); 026 if (src.hasScore()) 027 tgt.setScoreElement(Decimal30_40.convertDecimal(src.getScoreElement())); 028 if (src.hasTester()) 029 tgt.setTesterElement(String30_40.convertString(src.getTesterElement())); 030 if (src.hasIssued()) 031 tgt.setIssuedElement(DateTime30_40.convertDateTime(src.getIssuedElement())); 032 for (org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) 033 tgt.addParticipant(convertTestReportParticipantComponent(t)); 034 if (src.hasSetup()) 035 tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); 036 for (org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent t : src.getTest()) 037 tgt.addTest(convertTestReportTestComponent(t)); 038 if (src.hasTeardown()) 039 tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); 040 return tgt; 041 } 042 043 public static org.hl7.fhir.dstu3.model.TestReport convertTestReport(org.hl7.fhir.r4.model.TestReport src) throws FHIRException { 044 if (src == null) 045 return null; 046 org.hl7.fhir.dstu3.model.TestReport tgt = new org.hl7.fhir.dstu3.model.TestReport(); 047 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt); 048 if (src.hasIdentifier()) 049 tgt.setIdentifier(Identifier30_40.convertIdentifier(src.getIdentifier())); 050 if (src.hasName()) 051 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 052 if (src.hasStatus()) 053 tgt.setStatusElement(convertTestReportStatus(src.getStatusElement())); 054 if (src.hasTestScript()) 055 tgt.setTestScript(Reference30_40.convertReference(src.getTestScript())); 056 if (src.hasResult()) 057 tgt.setResultElement(convertTestReportResult(src.getResultElement())); 058 if (src.hasScore()) 059 tgt.setScoreElement(Decimal30_40.convertDecimal(src.getScoreElement())); 060 if (src.hasTester()) 061 tgt.setTesterElement(String30_40.convertString(src.getTesterElement())); 062 if (src.hasIssued()) 063 tgt.setIssuedElement(DateTime30_40.convertDateTime(src.getIssuedElement())); 064 for (org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent t : src.getParticipant()) 065 tgt.addParticipant(convertTestReportParticipantComponent(t)); 066 if (src.hasSetup()) 067 tgt.setSetup(convertTestReportSetupComponent(src.getSetup())); 068 for (org.hl7.fhir.r4.model.TestReport.TestReportTestComponent t : src.getTest()) 069 tgt.addTest(convertTestReportTestComponent(t)); 070 if (src.hasTeardown()) 071 tgt.setTeardown(convertTestReportTeardownComponent(src.getTeardown())); 072 return tgt; 073 } 074 075 public static org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent src) throws FHIRException { 076 if (src == null) 077 return null; 078 org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent(); 079 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 080 if (src.hasType()) 081 tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement())); 082 if (src.hasUri()) 083 tgt.setUriElement(Uri30_40.convertUri(src.getUriElement())); 084 if (src.hasDisplay()) 085 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 086 return tgt; 087 } 088 089 public static org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent convertTestReportParticipantComponent(org.hl7.fhir.r4.model.TestReport.TestReportParticipantComponent src) throws FHIRException { 090 if (src == null) 091 return null; 092 org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantComponent(); 093 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 094 if (src.hasType()) 095 tgt.setTypeElement(convertTestReportParticipantType(src.getTypeElement())); 096 if (src.hasUri()) 097 tgt.setUriElement(Uri30_40.convertUri(src.getUriElement())); 098 if (src.hasDisplay()) 099 tgt.setDisplayElement(String30_40.convertString(src.getDisplayElement())); 100 return tgt; 101 } 102 103 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> convertTestReportParticipantType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportParticipantType> src) throws FHIRException { 104 if (src == null || src.isEmpty()) 105 return null; 106 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantTypeEnumFactory()); 107 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 108 switch (src.getValue()) { 109 case TESTENGINE: 110 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.TESTENGINE); 111 break; 112 case CLIENT: 113 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.CLIENT); 114 break; 115 case SERVER: 116 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.SERVER); 117 break; 118 default: 119 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType.NULL); 120 break; 121 } 122 return tgt; 123 } 124 125 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportParticipantType> convertTestReportParticipantType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportParticipantType> src) throws FHIRException { 126 if (src == null || src.isEmpty()) 127 return null; 128 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportParticipantType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportParticipantTypeEnumFactory()); 129 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 130 switch (src.getValue()) { 131 case TESTENGINE: 132 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.TESTENGINE); 133 break; 134 case CLIENT: 135 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.CLIENT); 136 break; 137 case SERVER: 138 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.SERVER); 139 break; 140 default: 141 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportParticipantType.NULL); 142 break; 143 } 144 return tgt; 145 } 146 147 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportResult> convertTestReportResult(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> src) throws FHIRException { 148 if (src == null || src.isEmpty()) 149 return null; 150 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportResult> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportResultEnumFactory()); 151 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 152 switch (src.getValue()) { 153 case PASS: 154 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PASS); 155 break; 156 case FAIL: 157 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.FAIL); 158 break; 159 case PENDING: 160 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.PENDING); 161 break; 162 default: 163 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportResult.NULL); 164 break; 165 } 166 return tgt; 167 } 168 169 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> convertTestReportResult(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportResult> src) throws FHIRException { 170 if (src == null || src.isEmpty()) 171 return null; 172 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportResult> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportResultEnumFactory()); 173 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 174 switch (src.getValue()) { 175 case PASS: 176 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PASS); 177 break; 178 case FAIL: 179 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.FAIL); 180 break; 181 case PENDING: 182 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.PENDING); 183 break; 184 default: 185 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportResult.NULL); 186 break; 187 } 188 return tgt; 189 } 190 191 public static org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent src) throws FHIRException { 192 if (src == null) 193 return null; 194 org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent(); 195 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 196 for (org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent t : src.getAction()) 197 tgt.addAction(convertSetupActionComponent(t)); 198 return tgt; 199 } 200 201 public static org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent convertTestReportSetupComponent(org.hl7.fhir.r4.model.TestReport.TestReportSetupComponent src) throws FHIRException { 202 if (src == null) 203 return null; 204 org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportSetupComponent(); 205 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 206 for (org.hl7.fhir.r4.model.TestReport.SetupActionComponent t : src.getAction()) 207 tgt.addAction(convertSetupActionComponent(t)); 208 return tgt; 209 } 210 211 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportStatus> convertTestReportStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> src) throws FHIRException { 212 if (src == null || src.isEmpty()) 213 return null; 214 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportStatusEnumFactory()); 215 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 216 switch (src.getValue()) { 217 case COMPLETED: 218 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.COMPLETED); 219 break; 220 case INPROGRESS: 221 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.INPROGRESS); 222 break; 223 case WAITING: 224 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.WAITING); 225 break; 226 case STOPPED: 227 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.STOPPED); 228 break; 229 case ENTEREDINERROR: 230 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.ENTEREDINERROR); 231 break; 232 default: 233 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportStatus.NULL); 234 break; 235 } 236 return tgt; 237 } 238 239 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> convertTestReportStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportStatus> src) throws FHIRException { 240 if (src == null || src.isEmpty()) 241 return null; 242 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportStatusEnumFactory()); 243 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 244 switch (src.getValue()) { 245 case COMPLETED: 246 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.COMPLETED); 247 break; 248 case INPROGRESS: 249 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.INPROGRESS); 250 break; 251 case WAITING: 252 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.WAITING); 253 break; 254 case STOPPED: 255 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.STOPPED); 256 break; 257 case ENTEREDINERROR: 258 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.ENTEREDINERROR); 259 break; 260 default: 261 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportStatus.NULL); 262 break; 263 } 264 return tgt; 265 } 266 267 public static org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent src) throws FHIRException { 268 if (src == null) 269 return null; 270 org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent(); 271 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 272 for (org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent t : src.getAction()) 273 tgt.addAction(convertTeardownActionComponent(t)); 274 return tgt; 275 } 276 277 public static org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent convertTestReportTeardownComponent(org.hl7.fhir.r4.model.TestReport.TestReportTeardownComponent src) throws FHIRException { 278 if (src == null) 279 return null; 280 org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTeardownComponent(); 281 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 282 for (org.hl7.fhir.r4.model.TestReport.TeardownActionComponent t : src.getAction()) 283 tgt.addAction(convertTeardownActionComponent(t)); 284 return tgt; 285 } 286 287 public static org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.r4.model.TestReport.TestReportTestComponent src) throws FHIRException { 288 if (src == null) 289 return null; 290 org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent(); 291 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 292 if (src.hasName()) 293 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 294 if (src.hasDescription()) 295 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 296 for (org.hl7.fhir.r4.model.TestReport.TestActionComponent t : src.getAction()) 297 tgt.addAction(convertTestActionComponent(t)); 298 return tgt; 299 } 300 301 public static org.hl7.fhir.r4.model.TestReport.TestReportTestComponent convertTestReportTestComponent(org.hl7.fhir.dstu3.model.TestReport.TestReportTestComponent src) throws FHIRException { 302 if (src == null) 303 return null; 304 org.hl7.fhir.r4.model.TestReport.TestReportTestComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestReportTestComponent(); 305 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 306 if (src.hasName()) 307 tgt.setNameElement(String30_40.convertString(src.getNameElement())); 308 if (src.hasDescription()) 309 tgt.setDescriptionElement(String30_40.convertString(src.getDescriptionElement())); 310 for (org.hl7.fhir.dstu3.model.TestReport.TestActionComponent t : src.getAction()) 311 tgt.addAction(convertTestActionComponent(t)); 312 return tgt; 313 } 314 315 public static org.hl7.fhir.r4.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent src) throws FHIRException { 316 if (src == null) return null; 317 org.hl7.fhir.r4.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionComponent(); 318 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 319 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 320 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 321 return tgt; 322 } 323 324 public static org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent convertSetupActionComponent(org.hl7.fhir.r4.model.TestReport.SetupActionComponent src) throws FHIRException { 325 if (src == null) return null; 326 org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionComponent(); 327 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 328 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 329 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 330 return tgt; 331 } 332 333 public static org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent src) throws FHIRException { 334 if (src == null) return null; 335 org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent(); 336 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 337 if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); 338 if (src.hasMessage()) tgt.setMessageElement(MarkDown30_40.convertMarkdown(src.getMessageElement())); 339 if (src.hasDetail()) tgt.setDetailElement(Uri30_40.convertUri(src.getDetailElement())); 340 return tgt; 341 } 342 343 public static org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent convertSetupActionOperationComponent(org.hl7.fhir.r4.model.TestReport.SetupActionOperationComponent src) throws FHIRException { 344 if (src == null) return null; 345 org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionOperationComponent(); 346 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 347 if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); 348 if (src.hasMessage()) tgt.setMessageElement(MarkDown30_40.convertMarkdown(src.getMessageElement())); 349 if (src.hasDetail()) tgt.setDetailElement(Uri30_40.convertUri(src.getDetailElement())); 350 return tgt; 351 } 352 353 static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportActionResult> convertTestReportActionResult(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> src) throws FHIRException { 354 if (src == null || src.isEmpty()) return null; 355 org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportActionResult> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.TestReport.TestReportActionResultEnumFactory()); 356 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 357 if (src.getValue() == null) { 358 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); 359 } else { 360 switch (src.getValue()) { 361 case PASS: 362 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.PASS); 363 break; 364 case SKIP: 365 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.SKIP); 366 break; 367 case FAIL: 368 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.FAIL); 369 break; 370 case WARNING: 371 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.WARNING); 372 break; 373 case ERROR: 374 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.ERROR); 375 break; 376 default: 377 tgt.setValue(org.hl7.fhir.r4.model.TestReport.TestReportActionResult.NULL); 378 break; 379 } 380 } 381 return tgt; 382 } 383 384 static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> convertTestReportActionResult(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.TestReport.TestReportActionResult> src) throws FHIRException { 385 if (src == null || src.isEmpty()) return null; 386 org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.TestReport.TestReportActionResultEnumFactory()); 387 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 388 if (src.getValue() == null) { 389 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); 390 } else { 391 switch (src.getValue()) { 392 case PASS: 393 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.PASS); 394 break; 395 case SKIP: 396 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.SKIP); 397 break; 398 case FAIL: 399 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.FAIL); 400 break; 401 case WARNING: 402 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.WARNING); 403 break; 404 case ERROR: 405 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.ERROR); 406 break; 407 default: 408 tgt.setValue(org.hl7.fhir.dstu3.model.TestReport.TestReportActionResult.NULL); 409 break; 410 } 411 } 412 return tgt; 413 } 414 415 public static org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent src) throws FHIRException { 416 if (src == null) return null; 417 org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent(); 418 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 419 if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); 420 if (src.hasMessage()) tgt.setMessageElement(MarkDown30_40.convertMarkdown(src.getMessageElement())); 421 if (src.hasDetail()) tgt.setDetailElement(String30_40.convertString(src.getDetailElement())); 422 return tgt; 423 } 424 425 public static org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent convertSetupActionAssertComponent(org.hl7.fhir.r4.model.TestReport.SetupActionAssertComponent src) throws FHIRException { 426 if (src == null) return null; 427 org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.SetupActionAssertComponent(); 428 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 429 if (src.hasResult()) tgt.setResultElement(convertTestReportActionResult(src.getResultElement())); 430 if (src.hasMessage()) tgt.setMessageElement(MarkDown30_40.convertMarkdown(src.getMessageElement())); 431 if (src.hasDetail()) tgt.setDetailElement(String30_40.convertString(src.getDetailElement())); 432 return tgt; 433 } 434 435 public static org.hl7.fhir.r4.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.dstu3.model.TestReport.TestActionComponent src) throws FHIRException { 436 if (src == null) return null; 437 org.hl7.fhir.r4.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TestActionComponent(); 438 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 439 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 440 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 441 return tgt; 442 } 443 444 public static org.hl7.fhir.dstu3.model.TestReport.TestActionComponent convertTestActionComponent(org.hl7.fhir.r4.model.TestReport.TestActionComponent src) throws FHIRException { 445 if (src == null) return null; 446 org.hl7.fhir.dstu3.model.TestReport.TestActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TestActionComponent(); 447 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 448 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 449 if (src.hasAssert()) tgt.setAssert(convertSetupActionAssertComponent(src.getAssert())); 450 return tgt; 451 } 452 453 public static org.hl7.fhir.r4.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent src) throws FHIRException { 454 if (src == null) return null; 455 org.hl7.fhir.r4.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.r4.model.TestReport.TeardownActionComponent(); 456 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 457 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 458 return tgt; 459 } 460 461 public static org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent convertTeardownActionComponent(org.hl7.fhir.r4.model.TestReport.TeardownActionComponent src) throws FHIRException { 462 if (src == null) return null; 463 org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent tgt = new org.hl7.fhir.dstu3.model.TestReport.TeardownActionComponent(); 464 ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); 465 if (src.hasOperation()) tgt.setOperation(convertSetupActionOperationComponent(src.getOperation())); 466 return tgt; 467 } 468}