Skip to content
Snippets Groups Projects
Commit 25741949 authored by adityab3's avatar adityab3
Browse files

removed dead code in preregisterpatient.jsp

parent 28871c87
No related branches found
No related tags found
1 merge request!3Uc91.1
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<%@page import="edu.ncsu.csc.itrust.beans.PatientBean"%> <%@page import="edu.ncsu.csc.itrust.beans.PatientBean"%>
<%@page import="edu.ncsu.csc.itrust.beans.HealthRecord"%> <%@page import="edu.ncsu.csc.itrust.beans.HealthRecord"%>
<%@page import="edu.ncsu.csc.itrust.exception.FormValidationException"%> <%@page import="edu.ncsu.csc.itrust.exception.FormValidationException"%>
<%@include file="/global.jsp" %> <%@include file="/global.jsp" %>
<% <%
...@@ -19,76 +18,17 @@ pageTitle = "iTrust - Add Patient"; ...@@ -19,76 +18,17 @@ pageTitle = "iTrust - Add Patient";
boolean formIsFilled = request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true"); boolean formIsFilled = request.getParameter("formIsFilled") != null && request.getParameter("formIsFilled").equals("true");
if (formIsFilled) { if (formIsFilled) {
//PatientBean p = new BeanBuilder<PatientBean>().build(request.getParameterMap(), new PatientBean()); PatientBean p = new BeanBuilder<PatientBean>().build(request.getParameterMap(), new PatientBean());
//HealthRecord h = new BeanBuilder<HealthRecord>().build(request.getParameterMap(), new HealthRecord()); HealthRecord h = new BeanBuilder<HealthRecord>().build(request.getParameterMap(), new HealthRecord());
//This page is not actually a "page", it just adds a user and forwards. String s = "bla";
PatientBean p = new BeanBuilder<PatientBean>().build(request.getParameterMap(), new PatientBean()); if (p != null) {
////////////// ???????????????????????? s = p.getFullName();
}
try{
boolean isDependent = false;
long representativeId = -1L;
if(request.getParameter("isDependent") != null && request.getParameter("isDependent").equals("on")){
isDependent = true;
}
if(request.getParameter("repId") != "" && isDependent){
representativeId = Long.valueOf(request.getParameter("repId"));
}else if(isDependent && request.getParameter("repId") == ""){
throw new FormValidationException("Representative MID must be filled if the patient is marked as a dependent.");
}
long newMID = 1L;
if(isDependent){
newMID = new AddPatientAction(prodDAO, loggedInMID.longValue()).addDependentPatient(p, representativeId);
}else{
newMID = new AddPatientAction(prodDAO, loggedInMID.longValue()).addPatient(p);
}
session.setAttribute("pid", Long.toString(newMID));
String fullname;
String password;
password = p.getPassword();
fullname = p.getFullName();
if (isDependent) {
loggingAction.logEvent(TransactionType.HCP_CREATED_DEPENDENT_PATIENT, loggedInMID.longValue(), newMID, "");
} else {
loggingAction.logEvent(TransactionType.PATIENT_CREATE, loggedInMID.longValue(), newMID, "");
}
%>
<div align=center>
<span class="iTrustMessage">New patient <%= StringEscapeUtils.escapeHtml("" + (fullname)) %> successfully added!</span>
<br />
<table class="fTable">
<tr>
<th colspan=2>New Patient Information</th>
</tr>
<tr>
<td class="subHeaderVertical">MID:</td>
<td><%= StringEscapeUtils.escapeHtml("" + (newMID)) %></td>
</tr>
<tr>
<td class="subHeaderVertical">Temporary Password:</td>
<td><%= StringEscapeUtils.escapeHtml("" + (password)) %></td>
</tr>
</table>
<br />Please get this information to <b><%= StringEscapeUtils.escapeHtml("" + (fullname)) %></b>!
<p>
<a href = "/iTrust/auth/hcp-uap/editPatient.jsp">Continue to patient information.</a>
</p>
</div>
<%
} catch(FormValidationException e){
%> %>
<div align=center> <div><%=s%></div>
<span class="iTrustError"><%=StringEscapeUtils.escapeHtml(e.getMessage()) %></span>
</div>
<% <%
}
} }
%> %>
...@@ -149,11 +89,11 @@ to recover the password.</div> ...@@ -149,11 +89,11 @@ to recover the password.</div>
</tr> </tr>
<tr> <tr>
<td class="subHeaderVertical">Height:</td> <td class="subHeaderVertical">Height:</td>
<td><input type="number" name="height"></td> <td><input type="text" name="height" value="0"></td>
</tr> </tr>
<tr> <tr>
<td class="subHeaderVertical">Weight:</td> <td class="subHeaderVertical">Weight:</td>
<td><input type="number" name="weight"></td> <td><input type="text" name="weight" value="0"></td>
</tr> </tr>
<tr> <tr>
<td class="subHeaderVertical">Smoker:</td> <td class="subHeaderVertical">Smoker:</td>
......
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