From d64c16dbb851cced673e504573204bc79b1d3f01 Mon Sep 17 00:00:00 2001
From: xuechen5 <xuechen5@illinois.edu>
Date: Sat, 21 Nov 2020 06:33:15 -0600
Subject: [PATCH] GUI: Refine interface Format: delete commented code, change
 tabs to blank space

---
 .../WebRoot/auth/hcp-uap/activatePatient.jsp  | 203 +++++++-----------
 1 file changed, 79 insertions(+), 124 deletions(-)

diff --git a/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp b/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
index 91fadb0..65f3aa5 100644
--- a/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
+++ b/iTrust/WebRoot/auth/hcp-uap/activatePatient.jsp
@@ -10,159 +10,114 @@
 <%@page import="edu.ncsu.csc.itrust.exception.FormValidationException"%>
 <%@page import="edu.ncsu.csc.itrust.enums.Gender"%>
 <%@page import="edu.ncsu.csc.itrust.beans.DiagnosisBean"%>
-
 <%@page import="edu.ncsu.csc.itrust.action.ActivateAndDeactivatePreRegi"%>
 
 <%@include file="/global.jsp"%>
 
 <%
-	pageTitle = "iTrust - Activate a Pre-Registered Patient";
+    pageTitle = "iTrust - Activate a Pre-Registered Patient";
 %>
 
 <%@include file="/header.jsp"%>
 <itrust:patientNav thisTitle="Deactivate" />
 <%
-	/* Require a Patient ID first */
-	String pidString = (String) session.getAttribute("pid");
-    //String pidString = (String) request.getParameter("myparam")
-
-	if (pidString == null || pidString.equals("") || 1 > pidString.length()) {
-		out.println("pidstring is null");
-		response.sendRedirect("/iTrust/auth/getPatientID.jsp?forward=hcp-uap/deactivatePatient.jsp");
-		return;
-	}
-	
-	/* If the patient id doesn't check out, then kick 'em out to the exception handler */
-	EditPatientAction action = new EditPatientAction(prodDAO, loggedInMID.longValue(), pidString);
-
-	/* Now take care of updating information */
-	
-	PatientBean p;                         //////////////////////////////
-	
-	if (request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true") &&
-			request.getParameter("understand") != null && request.getParameter("understand").equals("I UNDERSTAND")) {
-		try {
-			action.activate();
-			
-			
-			ActivateAndDeactivatePreRegi activate = new ActivateAndDeactivatePreRegi(prodDAO, loggedInMID.longValue(), pidString);
-
-			
-/*			
-			//DAOFactory = new DAOFactory();
-					
-			///////  public PatientDAO(DAOFactory factory) {
-			
-			PatientDAO patientDAO = prodDAO.getPatientDAO();               ////////////////////////   prodDAO
-		//	PatientDAO patientDAO = PatientDAO(prodDAO);               ////////////////////////   prodDAO
-*/			
-			long patientMID = action.getPatient().getMID();
-		
-
-			
-/*			patientDAO.ConvertPreRegisteredPatientsToPatient(patientMID);		
-	*/
-	        
-	
-	        //long pidFromActivate =  
-			
-			activate.activate();  //patientMID);
-
-
-			%>	
-			
-			<%=patientMID %>
-			<%=prodDAO %>
-			<%=pidString %>		
+    /* Require a Patient ID first */
+    String pidString = (String) session.getAttribute("pid");
+
+    if (pidString == null || pidString.equals("") || 1 > pidString.length()) {
+        out.println("pidstring is null");
+        response.sendRedirect("/iTrust/auth/getPatientID.jsp?forward=hcp-uap/deactivatePatient.jsp");
+        return;
+    }
+    
+    /* If the patient id doesn't check out, then kick 'em out to the exception handler */
+    EditPatientAction action = new EditPatientAction(prodDAO, loggedInMID.longValue(), pidString);
+
+    /* Now take care of updating information */
+    PatientBean p;
+    
+    if (request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true") &&
+            request.getParameter("understand") != null && request.getParameter("understand").equals("I UNDERSTAND")) {
+        try {
+            action.activate();
+            
+            ActivateAndDeactivatePreRegi activate = new ActivateAndDeactivatePreRegi(prodDAO, loggedInMID.longValue(), pidString);
+
+            long patientMID = action.getPatient().getMID();
+
+            loggingAction.logEvent(TransactionType.PATIENT_ACTIVATE, loggedInMID.longValue(), 
+                    Long.valueOf((String)session.getAttribute("pid")).longValue(), "");
+%>
 
 
-			
-			<%
-			loggingAction.logEvent(TransactionType.PATIENT_ACTIVATE, loggedInMID.longValue(), Long.valueOf((String)session.getAttribute("pid")).longValue(), "");
-			
-			
-			
-			//session.removeAttribute("pid");
-	
-%>
     <a href="/iTrust/auth/hcp-uap/viewPreRegisteredPatientList.jsp" style="text-decoration: none;">
         <input type=button value="Go Back to Pre-Registered Patient List" onClick="location='/iTrust/auth/hcp-uap/viewPreRegisteredPatientList.jsp';">
     </a>
-    <br /><br /><br /><br />
-
-
-	<br />
-	<div align=center>
-		<span class="iTrustMessage">Patient Successfully Activated! You can </span>
-		<a href="editPHR.jsp">Edit Patient</a>
-	</div>
-	<br /><br /><br /><br />
-		
-	<div>
-		<td >
-			<a href="editPHR.jsp">Edit Patient </a>
-		</td>
-	</div>
-	
-	<br />
+    <br /><br /><br /><br /><br />
+    
+    <div align=center>
+        <span class="iTrustMessage">Patient Successfully Activated! You can </span>
+        <a href="editPHR.jsp">Edit Patient</a>
+    </div>
+    <br /><br /><br /><br /><br />
 <%
-		} catch (Exception e) {
+        } catch (Exception e) {
 %>
-	<br />
-	<div align=center>
-		<span class="iTrustError"><%=StringEscapeUtils.escapeHtml(e.getMessage()) %></span>
-	</div>
-	<br />
+    <br />
+    <div align=center>
+        <span class="iTrustError"><%=StringEscapeUtils.escapeHtml(e.getMessage()) %></span>
+    </div>
+    <br />
 <%
-		}
-	} else {
-		p = action.getPatient();                    //////////////////////////////
+        }
+    } else {
+        p = action.getPatient();
 
-	if (request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true") &&
-			(request.getParameter("understand") == null || !request.getParameter("understand").equals("I UNDERSTAND"))) {
+        if (request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true") &&
+            (request.getParameter("understand") == null || !request.getParameter("understand").equals("I UNDERSTAND"))) {
 %>
-		<br />
-		<div align=center>
-			<span class="iTrustError">You must type "I UNDERSTAND" in the textbox.</span>
-		</div>
-		<br />
+    <br />
+    <div align=center>
+        <span class="iTrustError">You must type "I UNDERSTAND" in the textbox.</span>
+    </div>
+    <br />
 <%
-	}
-	
+    }
+    
 %>
 
 <form id="activateForm" action="activatePatient.jsp" method="post">
 <input type="hidden" name="formIsFilled" value="true"><br />
 <table cellspacing=0 align=center cellpadding=0>
-	<tr>
-		<td valign=top>
-		<table class="fTable" align=center style="width: 350px;">
-			<tr>
-				<th colspan="4">Activate Patient</th>
-			</tr>		
-			<tr>
-			
-				<td class="subHeaderVertical">First Name:</td>
-				<td><%= StringEscapeUtils.escapeHtml("" + (p.getFirstName())) %></td>
-				<td class="subHeaderVertical">Last Name:</td>
-				<td><%= StringEscapeUtils.escapeHtml("" + (p.getLastName())) %></td>
-			</tr>
-			<tr>
-				<td colspan="4">Are you absolutely sure you want to ACTIVATE this
-				patient?  If you are sure, type "I UNDERSTAND" into the box below 
-				and click the button</td>
-			</tr>
-			<tr>
-				<td colspan="4"><div align="center"><input name="understand" type="text"></div></td>
-			</tr>
-		</table>
-		</td>
-	</tr>
+    <tr>
+        <td valign=top>
+        <table class="fTable" align=center style="width: 350px;">
+            <tr>
+                <th colspan="4">Activate Patient</th>
+            </tr>        
+            <tr>
+            
+                <td class="subHeaderVertical">First Name:</td>
+                <td><%= StringEscapeUtils.escapeHtml("" + (p.getFirstName())) %></td>
+                <td class="subHeaderVertical">Last Name:</td>
+                <td><%= StringEscapeUtils.escapeHtml("" + (p.getLastName())) %></td>
+            </tr>
+            <tr>
+                <td colspan="4">Are you absolutely sure you want to ACTIVATE this
+                patient?  If you are sure, type "I UNDERSTAND" into the box below 
+                and click the button</td>
+            </tr>
+            <tr>
+                <td colspan="4"><div align="center"><input name="understand" type="text"></div></td>
+            </tr>
+        </table>
+        </td>
+    </tr>
 </table>
 <br />
 <div align=center>
-	<input type="submit" name="action"
-		style="font-size: 16pt; font-weight: bold;" value="Activate Patient"><br /><br />
+    <input type="submit" name="action"
+        style="font-size: 16pt; font-weight: bold;" value="Activate Patient"><br /><br />
 </div>
 </form>
 <% } %>
-- 
GitLab