<%@ page info="ReProcessVeteransIn8eAnd8g" %>
<%@ page import="gov.va.med.esr.common.batchprocess.ReProcessVeteransIn8eAnd8gProcess" %>
<%@ page import="gov.va.med.esr.common.batchprocess.VeteranUpdaterProcess" %>
<%@ page import="java.lang.Integer" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>


<html>
<head><title>ReProcessVeteransIn8eAnd8g</title></head>
<body bgcolor="#ffffff">
<b>DO NOT CLOSE THIS BROWSER WINDOW UNTIL CONVERSION COMPLETES</b><br/>
<%=new Date()%>: Starting ReProcessVeteransIn8eAnd8g
<%
/**
	Finds veterans that meet certain criteria, reapply determine enrollment rules, log those whose resulting state is unexpected, and send letters for those whose state is expected. 
	To include ONLY certain person ids from the selection criteria, supply a comma separated list of person ids for the query argument personExclusionList. 
	Ex. ../admin/reProcessVeteransIn8eAnd8g.jsp?personInclusionList=100129632,100129719,100129740
	To adjust the frequency, in milliseconds, of status messages to the browser window, supply a numeric value to the query argument statusMessageFrequency.  Default is 30000 ms
	Ex. ../admin/reProcessVeteransIn8eAnd8g.jsp?statusMessageFrequency=30000
*/

	ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
    ReProcessVeteransIn8eAnd8gProcess reProcessVeteransIn8eAnd8gProcess = (ReProcessVeteransIn8eAnd8gProcess) appContext.getBean("reProcessVeteransIn8eAnd8gProcess");
    reProcessVeteransIn8eAnd8gProcess.setJspWriter(out);
    reProcessVeteransIn8eAnd8gProcess.setResponse(response);
	reProcessVeteransIn8eAnd8gProcess.setPersonInclusionList(request.getParameter("personInclusionList"));
	VeteranUpdaterProcess veteranUpdaterProcess = (VeteranUpdaterProcess) appContext.getBean("veteranUpdaterProcess");
    veteranUpdaterProcess.setJspWriter(out);
    veteranUpdaterProcess.setResponse(response);
	if(request.getParameter("statusMessageFrequency") != null){
		reProcessVeteransIn8eAnd8gProcess.setDelay(Integer.valueOf(request.getParameter("statusMessageFrequency")).intValue());
		veteranUpdaterProcess.setDelay(Integer.valueOf(request.getParameter("statusMessageFrequency")).intValue());
	}
	reProcessVeteransIn8eAnd8gProcess.execute();
%>
<br/><%=new Date()%>: Complete<br/>
</body>
</html>

