diff --git a/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp b/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
index 65f3aa583b4c3b833cf276a65941267f545a140f..f6bcd32398ab272937790d4d874f681ea209347e 100644
--- a/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
+++ b/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
@@ -40,11 +40,10 @@
             request.getParameter("understand") != null && request.getParameter("understand").equals("I UNDERSTAND")) {
         try {
             action.activate();
+            long patientMID = action.getPatient().getMID();
             
             ActivateAndDeactivatePreRegi activate = new ActivateAndDeactivatePreRegi(prodDAO, loggedInMID.longValue(), pidString);
-
-            long patientMID = action.getPatient().getMID();
-
+            activate.activate();
             loggingAction.logEvent(TransactionType.PATIENT_ACTIVATE, loggedInMID.longValue(), 
                     Long.valueOf((String)session.getAttribute("pid")).longValue(), "");
 %>
@@ -57,7 +56,9 @@
     
     <div align=center>
         <span class="iTrustMessage">Patient Successfully Activated! You can </span>
-        <a href="editPHR.jsp">Edit Patient</a>
+         <a href="editPHR.jsp" style="text-decoration: none;">
+        <input type=button value="Edit Patient" onClick="location='editPHR.jsp';">
+    </a>
     </div>
     <br /><br /><br /><br /><br />
 <%
diff --git a/iTrust/WebRoot/auth/hcp-uap/viewPreRegisteredPatientList.jsp b/iTrust/WebRoot/auth/hcp-uap/viewPreRegisteredPatientList.jsp
index 3630fd440ab093e5575b496224e7a90f676453a8..82f420c2b084ce7311746150fb3dcd5bca8a7586 100644
--- a/iTrust/WebRoot/auth/hcp-uap/viewPreRegisteredPatientList.jsp
+++ b/iTrust/WebRoot/auth/hcp-uap/viewPreRegisteredPatientList.jsp
@@ -18,129 +18,119 @@ pageTitle = "iTrust - View All Pre-Registered Patients";
 
 <%
 ViewPreRegisteredPatientListAction action = new ViewPreRegisteredPatientListAction(prodDAO, loggedInMID.longValue());
-                            ///////////////////////              ViewPatientOfficeVisitHistoryAction(prodDAO, loggedInMID.longValue());
 
-//List<PatientBean> PreRegisteredPatientList = action.getPatients();   ////////   action   is    in     ViewPreRegisteredPatientListAction
-                             ////////////////       ????????????????  change   <PatientVisitBean> patientVisits  to   PreRegisteredPatientList
 List<PatientBean> PreRegisteredPatientList = action.getPreRegisteredPatients();
-                            		 
-loggingAction.logEvent(TransactionType.PATIENT_LIST_VIEW, loggedInMID, 0, "");  //////////   ?????????     TransactionType.PATIENT_LIST_VIEW
+                                     
+loggingAction.logEvent(TransactionType.PATIENT_LIST_VIEW, loggedInMID, 0, "");
 
 %>
-			<script src="/iTrust/DataTables/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
-			<script type="text/javascript">
-				jQuery.fn.dataTableExt.oSort['lname-asc']  = function(x,y) {
-					var a = x.split(" ");
-					var b = y.split(" ");
-					return ((a[1] < b[1]) ? -1 : ((a[1] > b[1]) ?  1 : 0));
-				};
-				
-				jQuery.fn.dataTableExt.oSort['lname-desc']  = function(x,y) {
-					var a = x.split(" ");
-					var b = y.split(" ");
-					return ((a[1] < b[1]) ? 1 : ((a[1] > b[1]) ?  -1 : 0));
-				};
-			</script>
-			
-			<script type="text/javascript">	
-   				$(document).ready(function() {
-       				$("#patientList").dataTable( {
-       					"aaColumns": [ [2,'dsc'] ],
-       					"aoColumns": [ { "sType": "lname" }, null, null],
-       					"bStateSave": true,
-       					"sPaginationType": "full_numbers"
-       				});
-   				});
-			</script>
-			<style type="text/css" title="currentStyle">
-				@import "/iTrust/DataTables/media/css/demo_table.css";		
-			</style>
+
+<script src="/iTrust/DataTables/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
+    <script type="text/javascript">
+    jQuery.fn.dataTableExt.oSort['lname-asc']  = function(x,y) {
+        var a = x.split(" ");
+        var b = y.split(" ");
+        return ((a[1] < b[1]) ? -1 : ((a[1] > b[1]) ?  1 : 0));
+    };
+                
+    jQuery.fn.dataTableExt.oSort['lname-desc']  = function(x,y) {
+        var a = x.split(" ");
+        var b = y.split(" ");
+        return ((a[1] < b[1]) ? 1 : ((a[1] > b[1]) ?  -1 : 0));
+    };
+</script>
+            
+<script type="text/javascript">    
+       $(document).ready(function() {
+                       $("#patientList").dataTable( {
+                           "aaColumns": [ [2,'dsc'] ],
+                           "aoColumns": [ { "sType": "lname" }, null, null],
+                           "bStateSave": true,
+                           "sPaginationType": "full_numbers"
+                       });
+                   });
+</script>
+
+
+<style type="text/css" title="currentStyle">
+@import "/iTrust/DataTables/media/css/demo_table.css";        
+</style>
 
 <br />
-	<h2>Pre-Registered Patients</h2>
+    <h2>Pre-Registered Patients</h2>
+    
 <form action="viewReport.jsp" method="post" name="myform">
 <table class="display fTable" id="patientList" align="center">
-	
-	
-	<script type="text/javascript">
+    
+    <script type="text/javascript">
         var editButtonId = "";
         
-        function showButton(){       /////////////////////////////////////        for  BUTTONS  DEACTIVE,   Should  HIDE  ROW.
-	        //document.getElementById("editButton").style.display="inline";
-	        
+        function showButton(){
             document.getElementById(editButtonId).style.display="none";
-	        return;
-        }
-        
+            return;
+        }  
     </script>
 
+    <thead>
+    <tr class="">
+        <th>Deactivate</th>
+        <th>Name</th>
+        <th>Address</th>
+        <th>Email</th>
 
-	<thead>
-
-
-	<tr class="">
-	    <th>Deactivate</th>
-		<th>Name</th>
-		<th>Address</th>
-		<th>Email</th>
-
-	</tr>
-	</thead>
-	<tbody>
-	<%
-		List<PatientBean> patientsList = new ArrayList<PatientBean>();         ///////////////////////////////////
-		int index = 0;
-		
-		for (PatientBean bean : PreRegisteredPatientList) {      //////////   ????????????????????   Change   PatientVisitBean to   PatientBean
-			patientsList.add(bean);
-		    String idName = "row" + index;
-		    String editButtonName = "button" + index;
-	%>
-	
-	<script type="text/javascript">
-		
-		row_id = "<%=idName%>";
+    </tr>
+    </thead>
+    <tbody>
+    <%
+        List<PatientBean> patientsList = new ArrayList<PatientBean>();
+        int index = 0;
+        
+        for (PatientBean bean : PreRegisteredPatientList) {
+            patientsList.add(bean);
+            String idName = "row" + index;
+            String editButtonName = "button" + index;
+    %>
+    
+    <script type="text/javascript">
         
-        function hideRow(rowId){       /////////////////////////////////////        for  BUTTONS  DEACTIVE,   Should  HIDE  ROW.
-	        //document.getElementById("editButton").style.display="inline";
-	        //rowId = "<%=idName%>";
+        row_id = "<%=idName%>";
+        
+        function hideRow(rowId){  
+            rowId = "<%=idName%>";
             document.getElementById(rowId).style.display="none";
-	        return;
+            return;
         }
         
         editButtonId = "<%=editButtonName%>";
         
     </script>
     
-	<tr id=<%=idName%>>
-	    <td>
-	        <a style="text-decoration: none;">
-		    	<input type=button value="DeActivate" onclick="javascript:hideRow(row_id);">
-		    </a>
-	    </td>
-	    
-		<td >
-			<a href="viewPreRegisteredPatientInfo.jsp?patient=<%= StringEscapeUtils.escapeHtml("" + (index)) %>" id=<%=editButtonName%>>
-		
-		
-			<%= StringEscapeUtils.escapeHtml("" + (bean.getFullName())) %>	
-		
-		
-			</a>
-		</td>
-		<td ><%= StringEscapeUtils.escapeHtml("" + (bean.getStreetAddress1() +" " +bean.getStreetAddress2() +" " +bean.getCity() +" " +bean.getState()) +" " +bean.getZip()) %></td>
-		<td >
-				<%= StringEscapeUtils.escapeHtml("" + (bean.getEmail())) %>
-		</td>
-	</tr>
-	<%
-			index ++;
-	
-		}
-		
-		session.setAttribute("patients", patientsList);                 ////////////////////        ??????????????????????????????????????????
-	%>
-	</tbody>
+    <tr id=<%=idName%>>
+        <td>
+            <a style="text-decoration: none;">
+                <input type=button value="DeActivate" onclick="javascript:hideRow(row_id);">
+            </a>
+        </td>
+        
+        <td >
+            <a href="viewPreRegisteredPatientInfo.jsp?patient=<%= StringEscapeUtils.escapeHtml("" + (index)) %>" id=<%=editButtonName%>>
+        
+            <%= StringEscapeUtils.escapeHtml("" + (bean.getFullName())) %>    
+        
+            </a>
+        </td>
+        <td ><%= StringEscapeUtils.escapeHtml("" + (bean.getStreetAddress1() +" " +bean.getStreetAddress2() +" " +bean.getCity() +" " +bean.getState()) +" " +bean.getZip()) %></td>
+        <td >
+                <%= StringEscapeUtils.escapeHtml("" + (bean.getEmail())) %>
+        </td>
+    </tr>
+    <%
+            index ++;
+        }
+        
+        session.setAttribute("patients", patientsList);
+    %>
+    </tbody>
 </table>
 </form>
 <br />
diff --git a/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java b/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java
index 135469b60b003d842137a314e88553fbba5ce5c4..d85c158f020b2672c057524b7990e12010ff22f6 100644
--- a/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java
+++ b/iTrust/src/edu/ncsu/csc/itrust/action/ViewPreRegisteredPatientListAction.java
@@ -4,7 +4,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Scanner;
 
-import edu.ncsu.csc.itrust.Messages;
 import edu.ncsu.csc.itrust.beans.OfficeVisitBean;
 import edu.ncsu.csc.itrust.beans.PatientBean;
 import edu.ncsu.csc.itrust.beans.PatientVisitBean;
@@ -22,38 +21,60 @@ import edu.ncsu.csc.itrust.exception.ITrustException;
  *
  */
 public class ViewPreRegisteredPatientListAction {
-	private long loggedInMID;
-	private PatientDAO patientDAO;
-	private List<PatientBean> PreRegisteredPatients;
+    private long loggedInMID;
+    private PatientDAO patientDAO;
+    private PersonnelDAO personnelDAO;
 
-	/**
-	 * Set up defaults
-	 * @param factory The DAOFactory used to create the DAOs used in this action.
-	 * @param loggedInMID The MID of the person viewing the office visits.
-	 */
-	public ViewPreRegisteredPatientListAction(DAOFactory factory) {
-	
-		this.patientDAO = factory.getPatientDAO();
-		
-	}
-	
-	/**
-	 * Identify all the PreRegistered Patients from Patients Table using  Users Table Role="PreRegistered", and add them to a list.
-	 * 
-	 * @throws ITrustException
-	 */
-	public List<PatientBean> getPreRegisteredPatients() throws ITrustException {
-		try {
+    private ArrayList<PatientBean> PreRegisteredPatients;
 
-			PreRegisteredPatients = patientDAO.getAllPreRegisteredPatients();
-			if (PreRegisteredPatients != null) {
-				return PreRegisteredPatients;
-			} else {
-				throw new ITrustException("getAllPreRegisteredPatients() has returned null");
-			}
+    /**
+     * Set up defaults
+     * @param factory The DAOFactory used to create the DAOs used in this action.
+     * @param loggedInMID The MID of the person viewing the office visits.
+     */
+    public ViewPreRegisteredPatientListAction(DAOFactory factory, long loggedInMID) {
+        this.loggedInMID = loggedInMID;
+        
+        this.personnelDAO = factory.getPersonnelDAO();
+        
+        this.patientDAO = factory.getPatientDAO(); 
+        
+        PreRegisteredPatients = new ArrayList<PatientBean>();
+    }
+    
+    /**
+     * Identify all the PreRegistered Patients from Patients Table using  Users Table Role="PreRegistered", and add them to a list.
+     * 
+     * @throws ITrustException
+     */
+    private void getPreRegisteredFromPatientsTable() throws ITrustException {
+        try {
+            
+            List<PatientBean> plist = patientDAO.getAllPreRegisteredPatients();
 
-		} catch (DBException dbe) {
-			throw new ITrustException(dbe.getMessage());
-		}
-	}
-}
+            for(PatientBean pb : plist) {
+                
+                PreRegisteredPatients.add(pb);
+            }
+        }
+        catch (DBException dbe) {
+            throw new ITrustException(dbe.getMessage());
+        }
+    }
+    
+/**
+ * Get the list of Pre-Registered patients 
+ * 
+ * @return the list of patients an HCP has had office visits with
+ * @throws DBException
+ */
+    public List<PatientBean> getPreRegisteredPatients() throws DBException {
+        
+        try {
+            getPreRegisteredFromPatientsTable();
+        }
+        catch (ITrustException ie) {
+        }
+        return PreRegisteredPatients;
+    }
+}
\ No newline at end of file