package gov.nih.nci.cabig.caaers.service.migrator;

import gov.nih.nci.cabig.caaers.domain.Study;
import gov.nih.nci.cabig.caaers.domain.StudyDisease;
import gov.nih.nci.cabig.caaers.service.DomainObjectImportOutcome;
import gov.nih.nci.cabig.caaers.service.DomainObjectImportOutcome.Severity;

public class StudyDiseaseTerminologyMigrator implements Migrator<Study> {
	
	/**
	 * Will copy the {@link StudyDisease} terminology
	 */
	public void migrate(Study src, Study dest,
			DomainObjectImportOutcome<Study> outcome) {
		
        // AeTerminology and Version
        dest.setDiseaseTerminology(src.getDiseaseTerminology());
        outcome.ifNullObject(dest.getDiseaseTerminology(), DomainObjectImportOutcome.Severity.ERROR, 
        		"Disease AeTerminology is either Empty or Not Valid");
        if (dest.getDiseaseTerminology() != null) {
            dest.getDiseaseTerminology().setStudy(dest);
            outcome.ifNullObject(dest.getDiseaseTerminology().getDiseaseCodeTerm(), DomainObjectImportOutcome.Severity.ERROR, "Disease Code Term is either Empty or Not Valid");
        }
		
	}
}

@@ -383,60 +383,8 @@
 **%0D%0A
-%09 * Will copy the %7B@link StudyDisease%7D terminology%0D%0A
 %09 */

comment modified