Skip to content
Snippets Groups Projects
Commit 96930835 authored by Bennett's avatar Bennett
Browse files

Added the cancelAppt.jsp and cancelModMyAppts.jsp files and linked them.

parent 6f67579e
No related branches found
No related tags found
1 merge request!10UC100 (UC New)
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="test">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="test">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -45,4 +45,15 @@
<nature>net.sourceforge.metrics.nature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
</natures>
<filteredResources>
<filter>
<id>1605131018689</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
......@@ -8,6 +8,10 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust/test/edu/ncsu/csc/itrust/unit/DBBuilder.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.ncsu.csc.itrust.unit.DBBuilder"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust/test/edu/ncsu/csc/itrust/unit/DBBuilder.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.ncsu.csc.itrust.unit.DBBuilder"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust/test/edu/ncsu/csc/itrust/unit/datagenerators/TestDataGenerator.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.ncsu.csc.itrust.unit.datagenerators.TestDataGenerator"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust/test/edu/ncsu/csc/itrust/unit/datagenerators/TestDataGenerator.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.ncsu.csc.itrust.unit.datagenerators.TestDataGenerator"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
<%@page errorPage="/auth/exceptionHandler.jsp"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="edu.ncsu.csc.itrust.action.EditApptAction"%>
<%@page import="edu.ncsu.csc.itrust.action.EditApptTypeAction"%>
<%@page import="edu.ncsu.csc.itrust.action.ViewMyApptsAction"%>
<%@page import="edu.ncsu.csc.itrust.action.EditRepresentativesAction"%>
<%@page import="edu.ncsu.csc.itrust.action.ViewPersonnelAction"%>
<%@page import="edu.ncsu.csc.itrust.beans.ApptBean"%>
<%@page import="edu.ncsu.csc.itrust.dao.mysql.ApptTypeDAO"%>
<%@page import="edu.ncsu.csc.itrust.beans.PatientBean"%>
<%@page import="edu.ncsu.csc.itrust.beans.PersonnelBean"%>
<%@page import="java.util.List"%>
<%@include file="/global.jsp" %>
<%
pageTitle = "iTrust - Cancel This Appointment";
%>
<%@include file="/header.jsp" %>
<%
long mid = loggedInMID.longValue();
ViewMyApptsAction apptAction = new ViewMyApptsAction(prodDAO, loggedInMID.longValue());
ApptTypeDAO apptTypeDAO = prodDAO.getApptTypeDAO();
if (request.getParameter("patient") != null) {
String patientParameter = request.getParameter("patient");
try {
mid = Long.parseLong(patientParameter);
} catch (NumberFormatException nfe) {
response.sendRedirect("viewMyAppts.jsp");
}
EditRepresentativesAction representativeAction = new EditRepresentativesAction(prodDAO, loggedInMID.longValue(), String.valueOf(loggedInMID.longValue()));
List<PatientBean> representees = representativeAction.getRepresented(loggedInMID.longValue());
boolean isRepresented = (loggedInMID == mid);
if (!isRepresented) {
for(PatientBean patientDataBean: representees) {
if(patientDataBean.getMID() == mid) {
isRepresented = true;
break;
}
}
}
if(!isRepresented) {
response.sendRedirect("viewMyAppts.jsp");
}
session.setAttribute("appts", apptAction.getAppointments(mid));
}
ViewMyApptsAction action = new ViewMyApptsAction(prodDAO, mid);
ApptBean original = null;
if (request.getParameter("apt") != null) {
EditApptAction editAction = new EditApptAction(prodDAO, loggedInMID.longValue());
String aptParameter = request.getParameter("apt");
try {
int apptID = Integer.parseInt(aptParameter);
original = editAction.getAppt(apptID);
if (original == null){
response.sendRedirect("viewMyAppts.jsp");
}
} catch (NullPointerException npe) {
response.sendRedirect("viewMyAppts.jsp");
} catch (NumberFormatException e) {
response.sendRedirect("viewMyAppts.jsp");
}
}
else {
response.sendRedirect("viewMyAppts.jsp");
}
if (original != null) {
EditRepresentativesAction repAction = new EditRepresentativesAction(prodDAO, loggedInMID, ""+loggedInMID);
List<PatientBean> representees = repAction.getRepresented(loggedInMID.longValue());
boolean authorized = false;
for (PatientBean pBean : representees) {
if (pBean.getMID() == original.getPatient()) {
authorized = true;
break;
}
}
if (loggedInMID == original.getPatient())
authorized = true;
if (authorized) {
Date d = new Date(original.getDate().getTime());
DateFormat format = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
loggingAction.logEvent(TransactionType.APPOINTMENT_VIEW, loggedInMID, original.getPatient(), "");
%>
<div align="center">
<h2>You are about to Cancel the Following Appointment. Do you wish to proceed?</h2>
<div>
<ul>
<li><a href="/iTrust/auth/patient/cancelModMyAppts.jsp">Yes</a>
<li><a href="/iTrust/auth/patient/cancelModMyAppts.jsp">No</a>
</ul>
<table>
<tr>
<th>Appointment Info</th>
</tr>
<tr>
<td><b>Patient:</b> <%= StringEscapeUtils.escapeHtml("" + ( action.getName(original.getPatient()) )) %></td>
</tr>
<tr>
<td><b>HCP:</b> <%= StringEscapeUtils.escapeHtml("" + ( action.getName(original.getHcp()) )) %></td>
</tr>
<tr>
<td><b>Type:</b> <%= StringEscapeUtils.escapeHtml("" + ( original.getApptType() )) %></td>
</tr>
<tr>
<td><b>Date/Time:</b> <%= StringEscapeUtils.escapeHtml("" + ( format.format(d) )) %></td>
</tr>
<tr>
<td><b>Duration:</b> <%= StringEscapeUtils.escapeHtml("" + ( apptTypeDAO.getApptType(original.getApptType()).getDuration()+" minutes" )) %></td>
</tr>
</table>
</div>
<table>
<tr>
<td colspan="2"><b>Comments:</b></td>
</tr>
<tr>
<td colspan="2"><%= StringEscapeUtils.escapeHtml("" + ( (original.getComment()== null)?"No Comment":original.getComment() )) %></td>
</tr>
</table>
</div>
<%
} else {
%>
<div align=center>
<span class="iTrustError">You are not authorized to view details of this appointment</span>
</div>
<%
}
}
%>
<%@include file="/footer.jsp" %>
<%@page errorPage="/auth/exceptionHandler.jsp"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.sql.Timestamp"%>
<%@page import="edu.ncsu.csc.itrust.action.EditApptTypeAction"%>
<%@page import="edu.ncsu.csc.itrust.action.ViewMyApptsAction"%>
<%@page import="edu.ncsu.csc.itrust.beans.ApptBean"%>
<%@page import="edu.ncsu.csc.itrust.dao.mysql.ApptTypeDAO"%>
<%@page import="edu.ncsu.csc.itrust.dao.DAOFactory"%>
<%@include file="/global.jsp" %>
<%
pageTitle = "iTrust - Cancel or Modify My Appointments";
%>
<%@include file="/header.jsp" %>
<div align=center>
<h2>My Appointments</h2>
<%
loggingAction.logEvent(TransactionType.APPOINTMENT_ALL_VIEW, loggedInMID.longValue(), 0, "");
ViewMyApptsAction action = new ViewMyApptsAction(prodDAO, loggedInMID.longValue());
EditApptTypeAction types = new EditApptTypeAction(prodDAO, loggedInMID.longValue());
ApptTypeDAO apptTypeDAO = prodDAO.getApptTypeDAO();
List<ApptBean> appts = action.getMyAppointments();
session.setAttribute("appts", appts);
if (appts.size() > 0) {
%>
<table class="fancyTable">
<tr>
<th>Provider</th>
<th>Appointment Type</th>
<th>Appointment Date/Time</th>
<th>Duration</th>
<th>Comment</th>
<th>Action</th>
</tr>
<%
List<ApptBean>conflicts = action.getAllConflicts(loggedInMID.longValue());
int index = 0;
for(ApptBean a : appts) {
String comment = "";
String cancelMod = "";
cancelMod = "<a href='cancelAppt.jsp?apt=" + a.getApptID() + "'>Cancel Appointment</a>";
if(a.getComment() == null)
comment = "No Comment";
else
comment = "<a href='viewAppt.jsp?apt=" + a.getApptID() + "'>Read Comment</a>";
Date d = new Date(a.getDate().getTime());
DateFormat format = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
String row = "";
if(conflicts.contains(a))
row = "<tr style='font-weight: bold;'";
else
row = "<tr";
%>
<%=row+" "+((index%2 == 1)?"class=\"alt\"":"")+">"%>
<td><%= StringEscapeUtils.escapeHtml("" + ( action.getName(a.getHcp()) )) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + ( a.getApptType() )) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + ( format.format(d) )) %></td>
<td><%= StringEscapeUtils.escapeHtml("" + ( apptTypeDAO.getApptType(a.getApptType()).getDuration()+" minutes" )) %></td>
<td><%= comment %></td>
<td><%= cancelMod %></td>
</tr>
<% index ++; %>
<% } %>
</table>
<% } else { %>
<div>
<i>You have no Appointments</i>
</div>
<% } %>
<br />
</div>
<%@include file="/footer.jsp" %>
......@@ -66,7 +66,7 @@
<div class="panel-body" id="appt-menu">
<ul class="nav nav-sidebar">
<li><a href="/iTrust/auth/patient/appointmentRequests.jsp">Appointment Requests</a>
<li><a href="/iTrust/auth/patient/viewMyAppts.jsp">Cancel or Modify My Appointments</a>
<li><a href="/iTrust/auth/patient/cancelModMyAppts.jsp">Cancel/Modify My Appointments</a>
<li><a href="/iTrust/auth/patient/viewMyAppts.jsp">View My Appointments</a>
</ul>
</div>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=iTrust/test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/iTrust"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=iTrust/test"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="iTrust"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
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