346 lines
12 KiB
Plaintext
346 lines
12 KiB
Plaintext
<%@ page import="com.tarisan.control.*" %>
|
|
<%@ page import="com.tarisan.data.*" %>
|
|
<%@ page import="com.tarisan.excepcion.*" %>
|
|
<%@ page import="com.tarisan.log.*" %>
|
|
<%@ page import="com.tarisan.util.Utilidades" %>
|
|
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
|
|
<%@ page import="java.sql.*" %>
|
|
<%@ page import="java.util.Vector" %>
|
|
<%@ page import="java.text.SimpleDateFormat" %>
|
|
|
|
<%
|
|
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de pacientes (med/detallePacientes.jsp)");
|
|
|
|
response.setHeader("Expires", "0");
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
HttpSession sesion = request.getSession(true);
|
|
|
|
if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null))
|
|
{
|
|
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
|
|
response.sendRedirect("../../html/login.html");
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
|
|
// Definicion de variables
|
|
String strParametroMenu="";
|
|
String strFecha = "";
|
|
StringBuffer strSql = new StringBuffer();
|
|
int intPagina = 0;
|
|
SimpleDateFormat sdfFormateadorFecha=new SimpleDateFormat(PersistenciaParametros.formatoFechas);
|
|
Object aCondiciones[]=null;
|
|
|
|
//Obtención del perfil del usuario conectado
|
|
StringBuffer perfil = new StringBuffer();
|
|
perfil.append("|");
|
|
perfil.append(sesion.getAttribute("PERFIL"));
|
|
perfil.append("|");
|
|
|
|
//Obtenemos los valores de los parametros que se pasan a la pagina
|
|
//En caso de que no se le pasen parametros, quedaram inicializados
|
|
//a sus valores por defecto
|
|
|
|
//parametro x para marcar la opcion del menu en la que se encuentra el usuario
|
|
if (request.getParameter("x")!=null)
|
|
strParametroMenu=(String)request.getParameter("x");
|
|
|
|
//parametro fecha que indica el año para el que desea realizar la impresion
|
|
if (request.getParameter("fecha")!=null)
|
|
strFecha=(String)request.getParameter("fecha");
|
|
|
|
//parametro pagina para realizar la paginacion
|
|
if (request.getParameter("pagina")!=null)
|
|
intPagina=Integer.parseInt(request.getParameter("pagina"));
|
|
|
|
//parametro impresion que nos indica que se ha de realizar una impresion
|
|
int intImpresion = 0;
|
|
if (request.getParameter("imp")!=null) {
|
|
intImpresion = Integer.parseInt(request.getParameter("imp"));
|
|
}
|
|
%>
|
|
|
|
<html>
|
|
<head>
|
|
<title>Pacientes</title>
|
|
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
|
|
|
|
<script language="JavaScript" src="../../js/imprimir.js"></script>
|
|
<script language="JavaScript" src="../../js/funciones.js"></script>
|
|
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
|
|
<script language="JavaScript" src="../../js/menu_med.js"></script>
|
|
<script language="JavaScript" src="../../js/bloques_tarisan.js"></script>
|
|
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
|
<script language="JavaScript" type="text/javascript">
|
|
<!--
|
|
function paginacion(pagina)
|
|
{
|
|
document.frmDetallePacientes.pagina.value=pagina;
|
|
document.frmDetallePacientes.submit();
|
|
}
|
|
|
|
function comprobarFecha()
|
|
{
|
|
if (document.frmDetallePacientes.fecha.value!="")
|
|
{
|
|
return valorFecha(document.frmDetallePacientes.fecha);
|
|
}
|
|
else
|
|
{
|
|
alert("Introduzca la fecha.");
|
|
document.frmDetallePacientes.fecha.focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function realizarImpresion()
|
|
{
|
|
if (comprobarImpresion()==true)
|
|
{
|
|
VentanaImpresion('<%=request.getContextPath()%>','<%=request.getContextPath()%>/jsp/imp/impDetallePacientes.jsp?fecha='+document.frmDetallePacientes.fecha.value);
|
|
return true;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function imprimir()
|
|
{
|
|
if (comprobarFecha()==true) {
|
|
//VentanaImpresion('<%=request.getContextPath()%>','<%=request.getContextPath()%>/jsp/imp/impDetallePacientes.jsp?fecha='+document.frmDetallePacientes.fecha.value);
|
|
document.frmDetallePacientes.action = "<%=request.getContextPath()%>/servlet/GestorPacientes?x=4&pagina=1&imp=1";
|
|
document.frmDetallePacientes.submit();
|
|
}
|
|
}
|
|
|
|
function comprobarImpresion(impresion)
|
|
{
|
|
if (impresion==1) { //se efectua la impresion
|
|
var ventana1 = window.open('<%=request.getContextPath()%>/peticiones/DetallePaciente_<%=((Usuario)sesion.getAttribute("USUARIO")).getMedico()%>.pdf',"Detalle","dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
|
|
}
|
|
}
|
|
|
|
//-->
|
|
</script>
|
|
|
|
</head>
|
|
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onload="javascript:comprobarImpresion(<%=intImpresion%>);">
|
|
|
|
<!-- Logotipo de IMQ de Navarra //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
<tr valign="bottom">
|
|
<td align="center"><img src="../../img/Logo_rosca.jpg" border="0"></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<!-- Datos del usuario conectado //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
|
<tr>
|
|
<td class="tituloTabla" align="center"><%= sesion.getAttribute("USUARIO") %></td>
|
|
</tr>
|
|
<tr>
|
|
<td bgcolor="#C02331"><img src="img/sp.gif" width="746" height="1" border="0"></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<!-- Cabecera de Navegación superior //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
|
<tr>
|
|
<td><script language="JavaScript">bloques();</script></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<!-- Cuerpo de la página //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center">
|
|
<tr valign="top">
|
|
<td width="180">
|
|
<!-- Menú de navegación del módulo (zona izquierda) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr valign="top">
|
|
<td colspan="2"><img src="../../img/sp.gif" width="180" height="12" border="0"></td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td><script language="JavaScript">escribirMenuGst();</script></td>
|
|
<td><img src="../../img/sp.gif" width="14" height="261" border="0"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td bgcolor="#CCCCCC"><img src="../../img/sp.gif" width="1" height="12" border="0"></td>
|
|
<td width="565">
|
|
<!-- Tabla con el contenido de la página (zona central-derecha) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td><img src="../../img/sp.gif" width="4" height="261" border="0"></td>
|
|
<td class="txt" valign="top">
|
|
<img src="../../img/sp.gif" width="1" height="11" border="0"><br>
|
|
<table border="0" align="center" width="100%">
|
|
|
|
<!-- Presentacion de los resultados -->
|
|
<tr>
|
|
<td colspan="4"> </td>
|
|
</tr>
|
|
<form name="frmDetallePacientes" action="detallePacientes.jsp?x=<%=strParametroMenu%>" method="post">
|
|
<input type="hidden" name="listaElementosPrescripcion" value="">
|
|
<input type="hidden" name="informePrescripcion" value="">
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_MED_DETALLE_PACIENTE%>">
|
|
|
|
<td colspan="4">
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td><span class="txtnegrita">Fecha (dd-mm-aaaa): </span></td>
|
|
<td><input type="text" size="12" name="fecha" class="txt" value="<%=strFecha%>" maxlength="10"></td>
|
|
<td> </td>
|
|
<td><a href="javascript:imprimir()" class="enlace">Imprimir</a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<input type="hidden" name="pagina" value="1">
|
|
</form>
|
|
<tr><td colspan="4"> </td></tr>
|
|
<%
|
|
//Creación de la tabla presentación de resultados
|
|
|
|
strSql.append("SELECT tamovext.fecha, tamovext.precio as precioActoMedico, ttactmed.descripcion as descripcionActoMedico, ttclient.nombre, ttclient.apellidos");
|
|
strSql.append(" FROM tamovext, ttactmed, ttbenefi, ttclient");
|
|
strSql.append(" WHERE tamovext.acto=ttactmed.acto");
|
|
strSql.append(" and tamovext.especialidad=ttactmed.especialidad");
|
|
strSql.append(" and tamovext.medico=?");
|
|
strSql.append(" and tamovext.especialidad=?");
|
|
strSql.append(" and tamovext.colectivo=ttbenefi.colectivo");
|
|
strSql.append(" and tamovext.poliza=ttbenefi.poliza");
|
|
strSql.append(" and tamovext.orden=ttbenefi.orden");
|
|
strSql.append(" and tamovext.entidad=ttbenefi.entidad");
|
|
strSql.append(" and ttbenefi.cliente=ttclient.cliente");
|
|
strSql.append(" ORDER BY tamovext.fecha");
|
|
|
|
aCondiciones = new Object[2];
|
|
aCondiciones[0] = Integer.valueOf( ((Usuario)sesion.getAttribute("USUARIO")).getMedico() );
|
|
aCondiciones[1] = Integer.valueOf( ((Usuario)sesion.getAttribute("USUARIO")).getEspecialidad() );
|
|
|
|
PersistenciaVTamovextTaclient per = new PersistenciaVTamovextTaclient();
|
|
Vector vSeleccion = per.seleccionar(strSql.toString(), intPagina, aCondiciones);
|
|
|
|
if (vSeleccion.size()==0) //No se han encontrado datos
|
|
{
|
|
%>
|
|
<tr>
|
|
<td colspan="4"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4" align="center"><span class="txt">No se ha encontrado ningún dato.</span></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
if (intPagina != 0){ //se tiene en cuenta la paginacion
|
|
%>
|
|
<tr>
|
|
<td colspan="4" align="right"><span class="txt">Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%></span></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
%>
|
|
<tr>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Fecha</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Nombre</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Descripción</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Precio</td>
|
|
</tr>
|
|
|
|
<%
|
|
VTamovextTaclient vTamovextTaclient = null;
|
|
String estilo = "";
|
|
for(int i = 0; i < vSeleccion.size(); i++)
|
|
{
|
|
if (i % 2 == 0)
|
|
{
|
|
estilo = "filaA";
|
|
}
|
|
else
|
|
{
|
|
estilo = "filaB";
|
|
}
|
|
vTamovextTaclient = (VTamovextTaclient)vSeleccion.elementAt(i);
|
|
%>
|
|
<tr>
|
|
<td class="<%=estilo%>" align="center"><%=sdfFormateadorFecha.format(vTamovextTaclient.getFecha())%></td>
|
|
<td class="<%=estilo%>" align="left"><%=vTamovextTaclient.getNombre() + " " + vTamovextTaclient.getApellidos()%></td>
|
|
<td class="<%=estilo%>" align="left"><%=vTamovextTaclient.getDescripcionActoMedico()%></td>
|
|
<td class="<%=estilo%>" align="right"><%=Utilidades.formatearDouble(vTamovextTaclient.getPrecioActoMedico(),PersistenciaParametros.decimales)%></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
|
|
if (intPagina!=0){ //se tiene en cuenta la paginacion %>
|
|
<tr><td colspan="4"></td></tr>
|
|
<tr>
|
|
<td colspan="4">
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<%if (per.getPaginacion().esPrimeraPagina()){%>
|
|
<td width="70" align="right"><span class="pagDesactivo">primero</span></td>
|
|
<td></td>
|
|
<td width="70" align="left"><span class="pagDesactivo">anterior</span></td>
|
|
<%}else{%>
|
|
<td width="70" align="right"><a href="javascript:paginacion(1)" class="enlace">primero</a></td>
|
|
<td></td>
|
|
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() - 1%>)" class="enlace">anterior</a></td>
|
|
<%}%>
|
|
|
|
<%if (per.getPaginacion().esUltimaPagina()){%>
|
|
<td width="70" align="right"><span class="pagDesactivo">siguiente</span></td>
|
|
<td></td>
|
|
<td width="70" align="left"><span class="pagDesactivo">último</span></td>
|
|
<%}else{%>
|
|
<td width="70" align="right"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() + 1%>)" class="enlace">siguiente</a></td>
|
|
<td></td>
|
|
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPaginasTotales()%>)" class="enlace">último</a></td>
|
|
<%}%>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
} //fin if(pagina!=0)
|
|
|
|
} //fin else (vSeleccion.size()!=0)
|
|
%>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
<%
|
|
}
|
|
catch(ExcepcionTarisan ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, "ExcepcionTarisan: " + ex.getMensaje());
|
|
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex.getMensaje());
|
|
response.sendRedirect("../error.jsp");
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex);
|
|
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex);
|
|
response.sendRedirect("../error.jsp");
|
|
}
|
|
}
|
|
LogTarisan.logger.log(NivelLog.INFO, "Final página de pacientes (med/detallePacientes.jsp)");
|
|
%>
|