package gov.va.med.esr.common.batchprocess;

import org.apache.commons.collections.OrderedMap;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.infomata.data.DataRow;

import gov.va.med.fw.io.AbstractRawFileDataContainer;
import gov.va.med.fw.io.ClassMapping;
import gov.va.med.fw.io.RawFileDataContainerUtils;
import gov.va.med.fw.model.AbstractEntity;

/**
 * The DateOfDeathImportData class is called once for each line in the Date Of Death (DOD) file.
 * The file contains DOD records with a single DOD record on each line.
 * Each DOD record is a VPID ^ Date
 *
 * The mapping of this class is defined in the files batch_processes.xml and file_formats.xml.  Look for
 * 'common.batchprocess.dateOfDeath.inputFileBuilder' to trace the mapping.
 *
 * @author DNS   NELSOR
 *
 */
public class DateOfDeathImportData extends AbstractEntity{

	//private static Class[] AUTO_REGISTER_CLASSES = new Class[] {DateOfDeath.class};
	//static {
		//RawFileDataContainerUtils.autoRegisterConvertersForClasses(AUTO_REGISTER_CLASSES);
	//}

	private static final long serialVersionUID = -4428932123399533763L;

	//private DateOfDeath dodData;
	private String vpid;
	private String dateOfDeath;


	/*public DateOfDeath getDodData() {
		return dodData;
	}*/

	public String getVpid() {
		return vpid;
	}

	public void setVpid(String vpid) {
		this.vpid = vpid;
	}

	public String getDateOfDeath() {
		return dateOfDeath;
	}

	public void setDateOfDeath(String dateOfDeath) {
		this.dateOfDeath = dateOfDeath;
	}

	protected void buildToString(ToStringBuilder builder) {
		builder.append("vpid", vpid).
				append("dateofdeath", dateOfDeath);
	}

	/*public void setDodData(DateOfDeath dodData) {
		this.dodData = dodData;
	}

	public OrderedMap getRawFileData() throws Exception {
		return null;
	}*/

	/**
	 * Get the DOD information from the parsedRow parameter.  The two fields are retrieved by
	 * the parsedRow.getString(int) method.  Store the values into this object.  This object is
	 * passed to the DateOfDeathFileData.processDataRecord method.
	 *
	 */
	/*public void setRawFileData(String rawFileData, DataRow parsedRow, ClassMapping classMapping) throws Exception {

		DateOfDeath dod = new DateOfDeath();

		int i=0;

		dod.setVpid(parsedRow.getString(i++));
		RawFileDataContainerUtils.setConvertedField(dod,"dateOfDeath", parsedRow.getString(i++));
		setDodData(dod);

	}

	public Class[] getClassesForAutoRegisterConverters() {
		return AUTO_REGISTER_CLASSES;
	}*/



}
