public void migrate( ExpeditedAdverseEventReport aeReportSrc, ExpeditedAdverseEventReport aeReportDest, DomainObjectImportOutcome<ExpeditedAdverseEventReport> outcome) { List<SAEReportPriorTherapy> srcSAEReportPriorTherapys = aeReportSrc.getSaeReportPriorTherapies(); if (srcSAEReportPriorTherapys == null || srcSAEReportPriorTherapys.isEmpty()) { outcome.addWarning("WR-SPT-1", "Input doesn't contain any SAEReportPriorTherapy Values."); return; } // Copy the SAEReportPriorTherapys Information from Source to Destination. for (SAEReportPriorTherapy spt : srcSAEReportPriorTherapys) { PriorTherapy pt = findPriorTherapy(spt.getPriorTherapy(), outcome); if (outcome.hasErrors()) { return; } validateSAEREportPriorTherapyDates(spt, outcome); SAEReportPriorTherapy destSAEReportPriorTherapy = new SAEReportPriorTherapy(); destSAEReportPriorTherapy.setPriorTherapy(pt); destSAEReportPriorTherapy.setReport(aeReportDest); copyProperties(spt, destSAEReportPriorTherapy); for (PriorTherapyAgent pta : spt.getPriorTherapyAgents()) { PriorTherapyAgent priorTherapyAgent = migratePriorTherapyAgent(pta, destSAEReportPriorTherapy); destSAEReportPriorTherapy.addPriorTherapyAgent(priorTherapyAgent); } aeReportDest.addSaeReportPriorTherapies(destSAEReportPriorTherapy); } }