Skip to content
Snippets Groups Projects
Commit d64c16db authored by xuechen5's avatar xuechen5
Browse files

GUI: Refine interface

Format: delete commented code, change tabs to blank space 
parent 9ba1b2ac
No related branches found
No related tags found
2 merge requests!22Merge UC92 into Master,!15Merge 5-uc-92-activate-pre-registered-patient-2 into UC92v2
......@@ -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>
<% } %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment