902 lines
41 KiB
Plaintext
902 lines
41 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="java.util.Vector" %>
|
|
<%@ page import="java.io.*" %>
|
|
<%@ page import="java.util.Calendar" %>
|
|
<%@ page import="java.math.BigDecimal"%>
|
|
<%@ page import="java.text.SimpleDateFormat" %>
|
|
<%@ page import="com.tarisan.util.DES" %>
|
|
|
|
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
|
|
|
|
<%
|
|
//LogTarisan.logger.log(NivelLog.INFO, "Inicio página de analitica (pac/analitica.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(request.getContextPath() + "/html/login.html");
|
|
}
|
|
/*else if ( ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getEntidadChipcard().compareTo(ParametrosConfiguracion.bin_chipcard_propios)!=0)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
|
|
response.sendRedirect(request.getContextPath() + "/jsp/pac/solicitudAnaliticaNiveles.jsp?x=4&pagina=1");
|
|
}*/
|
|
else
|
|
{
|
|
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Inicio página de analitica (pac/analitica.jsp)");
|
|
|
|
try
|
|
{
|
|
// Definicion de variables param2
|
|
boolean desplazado = false;
|
|
String strParametroMenu="";
|
|
Calendar calFechaAnalisis = Calendar.getInstance();
|
|
calFechaAnalisis.add(Calendar.MONTH, -ParametrosConfiguracion.periodoAnalisis);
|
|
java.sql.Date dtFechaAnalisis = new java.sql.Date(calFechaAnalisis.getTime().getTime());
|
|
int intPagina = 0;
|
|
int pteExtraccion = 0; /* Indica si la analítica esta pte de extraccion para indicarlo en el apartado de regenerar pdf */
|
|
StringBuffer strSql = new StringBuffer();
|
|
StringBuffer strSql2 = new StringBuffer();
|
|
StringBuffer strSql_requestid = new StringBuffer();
|
|
Object aCondiciones[]=null;
|
|
Object bCondiciones[]=null;
|
|
Object Condiciones[]=null;
|
|
Object aCondiciones_requestid[]=null;
|
|
SimpleDateFormat sdfFormateadorFecha=new SimpleDateFormat(PersistenciaParametros.formatoFechas);
|
|
int intImpresion = 0;
|
|
java.util.Date hoy = Calendar.getInstance().getTime();
|
|
|
|
String strListaElementosPrescripcion = "";
|
|
String strInformePrescripcion = "";
|
|
String strAutorizacion="";
|
|
|
|
//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 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
|
|
if (request.getParameter("imp")!=null) {
|
|
intImpresion=Integer.parseInt(request.getParameter("imp"));
|
|
}
|
|
|
|
//parametro listaElementosPrescripciones utilizado para realizar la impresion
|
|
if (request.getParameter("listaElementosPrescripcion")!=null)
|
|
strListaElementosPrescripcion=(String)request.getParameter("listaElementosPrescripcion");
|
|
|
|
//parametro informePrescripcion utilizado para realizar la impresion
|
|
if (request.getParameter("informePrescripcion")!=null)
|
|
strInformePrescripcion=(String)request.getParameter("informePrescripcion");
|
|
|
|
//atributo autorizacion utilizado para realizar la impresion
|
|
if (request.getAttribute("autorizacion")!=null) {
|
|
strAutorizacion=(String)request.getAttribute("autorizacion");
|
|
}
|
|
|
|
if ( ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getEntidadChipcard().compareTo(ParametrosConfiguracion.bin_chipcard_propios)!=0)
|
|
{
|
|
desplazado = true;
|
|
}
|
|
|
|
Tamensaje tamensaje = new Tamensaje();
|
|
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
|
|
|
|
boolean mostrarNoticia = true;
|
|
PersistenciaTanoticias perTaNo = new PersistenciaTanoticias();
|
|
Vector vSeleccionNot = perTaNo.obtener_noticias_cabecera();
|
|
Vector vNoticias = new Vector();
|
|
String strNoticia = "";
|
|
String noticias ="";
|
|
String separador = " ---//--- ";
|
|
if(vSeleccionNot.size()==0){
|
|
mostrarNoticia = false;
|
|
}else{
|
|
mostrarNoticia = true;
|
|
Tanoticias tanoticia = null;
|
|
for(int i = 0; i < vSeleccionNot.size(); i++)
|
|
{
|
|
tanoticia = (Tanoticias)vSeleccionNot.elementAt(i);
|
|
if (i!=0){
|
|
strNoticia = strNoticia + separador + tanoticia.getNoticia();
|
|
}else{
|
|
strNoticia = tanoticia.getNoticia();
|
|
}
|
|
strNoticia = strNoticia.replaceAll("<br/>", " ");
|
|
}
|
|
}
|
|
|
|
String path = request.getContextPath();
|
|
String pathSpgif = request.getContextPath();
|
|
if (request.getContextPath().indexOf("tarisan")==-1){
|
|
path = path + "/tarisan";
|
|
pathSpgif = path + "/..";
|
|
}
|
|
%>
|
|
|
|
<html>
|
|
<head>
|
|
<title>Analítica </title>
|
|
<link rel="shortcut icon" href="<%=path%>/img/logo.ico" />
|
|
<link rel="STYLESHEET" type="text/css" href="<%=path%>/css/estilos.css">
|
|
|
|
<script language="JavaScript" src="<%=path%>/js/imprimir.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/inicio_tarisan.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/menu_pac.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/bloques_tarisan.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/funciones.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/jquery-1.11.3.js"></script>
|
|
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
|
<script language="JavaScript" type="text/javascript">
|
|
<!--
|
|
var despla = <%= desplazado %>;
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
//FUNCION UTILIZADA DESE LA PANTALLA DE IMPRESION PARA OBTENER LA LISTA DE ELEMENTOS
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
function obtenerArrayListaElementosPrescripcion()
|
|
{
|
|
|
|
//preparamos la lista de descripciones
|
|
|
|
//Quitamos las comillas simples para que al asignar el valor de la lista de elementos
|
|
//no kaske, ya que en esa asignacion se utiliza comillas simples
|
|
<%
|
|
String strListaElementosPrescripcionAux=strListaElementosPrescripcion.replace('\'', '~');
|
|
%>
|
|
|
|
//cogemos los valores de la lista sin comillas simples
|
|
var lstElementosPrescripcion = '<%=strListaElementosPrescripcionAux%>';
|
|
//restauramos las comillas simples para ponerlos con su valor original en el array de elementos
|
|
while(lstElementosPrescripcion.indexOf("~")!=-1)
|
|
lstElementosPrescripcion = lstElementosPrescripcion.replace("~", "'");
|
|
|
|
//inicializamos el array de elementos con sus valores originales
|
|
var i=0;
|
|
var vElementosPrescripcion = new Array();
|
|
if (lstElementosPrescripcion!="") //la lista no esta vacia
|
|
{
|
|
//quitamos el primer caracter separador
|
|
lstElementosPrescripcion=lstElementosPrescripcion.substring(lstElementosPrescripcion.indexOf("¬") + 1);
|
|
while (lstElementosPrescripcion.indexOf("¬")!=-1)
|
|
{
|
|
vElementosPrescripcion[i] = lstElementosPrescripcion.substring(0, lstElementosPrescripcion.indexOf("¬"));
|
|
lstElementosPrescripcion=lstElementosPrescripcion.substring(lstElementosPrescripcion.indexOf("¬") + 1);
|
|
i++;
|
|
}
|
|
}
|
|
|
|
return vElementosPrescripcion;
|
|
}
|
|
|
|
function obtenerInformePrescripcion()
|
|
{
|
|
//preparamos el informe de prescripcion
|
|
|
|
//Quitamos las comillas simples para que al asignar el valor del informe
|
|
//no kaske, ya que en esa asignacion se utiliza comillas simples
|
|
//quitamos los saltos de linea en caso de que los haya y los sustituimos por la etiqueta <br>
|
|
//dependiendo del navegador el salto de linea es diferente.
|
|
//explorer => \r\n
|
|
//netscape 6 => \n
|
|
<%
|
|
String strInformePrescripcionAux=strInformePrescripcion.replace('\'', '~');
|
|
if (strInformePrescripcionAux.indexOf("\r\n")!=-1)
|
|
strInformePrescripcionAux=strInformePrescripcionAux.replaceAll("\r\n", "<br>");
|
|
else if (strInformePrescripcionAux.indexOf("\n")!=-1)
|
|
strInformePrescripcionAux=strInformePrescripcionAux.replaceAll("\n", "<br>");
|
|
%>
|
|
|
|
//cogemos los valores del informe sin comillas simples
|
|
var informePrescripcion = '<%=strInformePrescripcionAux%>';
|
|
//restauramos las comillas simples para ponerlos con su valor original
|
|
while(informePrescripcion.indexOf("~")!=-1)
|
|
informePrescripcion = informePrescripcion.replace("~", "'");
|
|
|
|
return informePrescripcion;
|
|
}
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
//FUNCION UTILIZADA DESE LA PANTALLA DE IMPRESION PARA OBTENER LA LISTA DE ELEMENTOS
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
|
|
|
|
function mostrarAnalisis(autorizacion, path)
|
|
{
|
|
//var url = path + "/servlet/GestorPacientes?OPCION=<%=Constantes.OPC_PAC_REGISTRAR_LOG_ANALISIS%>&autorizacion=" + autorizacion;
|
|
//var ventana = window.open(url,"analisis" + autorizacion,"dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
|
|
//var ventanaAnalisis = window.open('<%=request.getContextPath()%>'+ '/peticiones/' + autorizacion + '.pdf',autorizacion,"dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
|
|
|
|
document.frmImprimirPeticion.nombrePDF.value = "<%=strAutorizacion%>.pdf";
|
|
document.frmImprimirPeticion.submit();
|
|
|
|
}
|
|
|
|
function mostrarPDFIzasa(path)
|
|
{
|
|
var ventanaAnalisis = window.open("",analisis,"");
|
|
}
|
|
|
|
function mostrarResultadoAnalisis(autorizacion, path)
|
|
{
|
|
var ventanaAnalisis = window.open('<%=request.getContextPath()%>'+ '/jsp/resultado_analitica.jsp?peticion='+ autorizacion,autorizacion,"dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
|
|
|
|
}
|
|
function comprobarImpresion(impresion)
|
|
{
|
|
if (impresion==1) {//se efectua la impresion
|
|
//VentanaImpresion('<%=request.getContextPath()%>','<%=request.getContextPath()%>/jsp/imp/impAnalitica.jsp?autorizacion=<%=strAutorizacion%>');
|
|
//var ventanaAnalisis2 = window.open('<%=request.getContextPath()%>/peticiones/<%=strAutorizacion%>.pdf',"<%=strAutorizacion%>","dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
|
|
|
|
document.frmImprimirPeticion.nombrePDF.value = "<%=strAutorizacion%>";
|
|
document.frmImprimirPeticion.submit();
|
|
}
|
|
}
|
|
|
|
function nuevaPrescripcion(tieneAnalisis)
|
|
{
|
|
if ((tieneAnalisis=="no") || (despla==true))
|
|
{
|
|
<!-- Para la nueva pagina de solicitud de analiticas con niveles hemos cambiado este destino -->
|
|
<!-- document.frmSolicitudPrescripcion.action = " %=request.getContextPath()%>/jsp/pac/solicitudAnalitica.jsp?x= %=strParametroMenu%>"; -->
|
|
<!-- por este otro: solicitudAnaliticaNiveles.jsp -->
|
|
document.frmSolicitudPrescripcion.action = "<%=request.getContextPath()%>/jsp/pac/solicitudAnaliticaNiveles.jsp?x=<%=strParametroMenu%>";
|
|
}
|
|
else
|
|
{
|
|
document.frmSolicitudPrescripcion.action = "<%=request.getContextPath()%>/jsp/pac/justificacionAnalitica.jsp?x=<%=strParametroMenu%>";
|
|
}
|
|
|
|
document.frmSolicitudPrescripcion.submit();
|
|
}
|
|
|
|
function paginacion(pagina)
|
|
{
|
|
document.frmPrescripcion.pagina.value=pagina;
|
|
document.frmPrescripcion.submit();
|
|
}
|
|
|
|
function submitform()
|
|
{
|
|
document.frmAnalitica.submit();
|
|
}
|
|
|
|
|
|
//-->
|
|
</script>
|
|
|
|
</head>
|
|
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onLoad="javascript:comprobarImpresion(<%=intImpresion%>)">
|
|
<div class="marco">
|
|
<!-- Datos del usuario conectado //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr>
|
|
<td class="tdLogoCabecera"><img src="<%=request.getContextPath()%>/img/logo.png" class="logoCabecera"></td>
|
|
<td>
|
|
<table width="100%">
|
|
<tr><td class="tituloTablaMedico" align="center"><%= sesion.getAttribute("USUARIO") %></td></tr>
|
|
<tr>
|
|
<td>
|
|
<div id="contenedorNoticia">
|
|
<br>
|
|
<div class="tituloNoticia">
|
|
<p class="marquee"><%=strNoticia %></p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Cabecera de Navegación superior //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr>
|
|
<td><script language="JavaScript">bloques();</script></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<!-- Datos del paciente introducido mediante la lectura de la tarjeta //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr>
|
|
<td class="tituloTabla" align="center"><%= sesion.getAttribute("PACIENTE") %></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<!-- Cuerpo de la página //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr valign="top">
|
|
<td width="5%">
|
|
<!-- Menú de navegación del módulo (zona izquierda) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr valign="top">
|
|
<td colspan="2"><img src="<%=pathSpgif%>/img/sp.gif" width="180" height="12" border="0"></td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td><script language="JavaScript">escribirMenuGst();</script></td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td width="565">
|
|
<!-- Tabla con el contenido de la página (zona central-derecha) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
<%
|
|
//tarjeta.getEntidadChipcard().compareTo(ParametrosConfiguracion.bin_chipcard_propios)==0
|
|
Tarjeta tarjeta = ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta();
|
|
if(!((Paciente)sesion.getAttribute("PACIENTE")).get_noesiguala_inactivar() && tarjeta.getEntidadChipcard().compareTo(ParametrosConfiguracion.bin_chipcard_propios)==0)
|
|
{
|
|
|
|
%>
|
|
<tr><td> </td></tr>
|
|
<tr><td> </td></tr>
|
|
<tr><td> </td></tr>
|
|
<tr>
|
|
<td align="center" class="txtNegrita"><% tamensaje = pertamensaje.obtenerMensaje(11); %><%=tamensaje.getMensaje() %></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
%>
|
|
|
|
<tr>
|
|
<td width="1px" bgcolor="#CCCCCC"></td>
|
|
<td class="txt" valign="top">
|
|
<img src="<%=request.getContextPath()%>/img/sp.gif" width="1" height="11" border="0"><br>
|
|
<table border="0" align="center" width="100%">
|
|
|
|
<!-- Presentacion de los resultados -->
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<!-- formulario para realizar la paginacion en caso necesario -->
|
|
<form name="frmPrescripcion" action="analitica.jsp?x=<%=strParametroMenu%>" method="post">
|
|
<input type="hidden" name="pagina" value="1">
|
|
</form>
|
|
<!-- formulario para enviar la peticion a la pagina de solicitud de analitica -->
|
|
<form name="frmSolicitudPrescripcion" action="" method="post">
|
|
<input type="hidden" name="pagina" value="1">
|
|
</form>
|
|
<%
|
|
|
|
//Creación de la tabla presentación de resultados
|
|
PersistenciaVTaprescaTamedico per = new PersistenciaVTaprescaTamedico();
|
|
String cole = (Long.valueOf( ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getColectivo() )).toString();
|
|
String poli = new BigDecimal(((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getPoliza()).toString();
|
|
String orde = (Integer.valueOf( ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getBeneficiario() )).toString();
|
|
/*Vector vSeleccion = per.listado_analiticas_paciente(cole, poli, orde, dtFechaAnalisis, intPagina);*/
|
|
|
|
Paciente pac = (Paciente)sesion.getAttribute("PACIENTE");
|
|
/*Vector vSeleccion2 = per.listado_analiticas_por_tarjeta(pac, intPagina);
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Nueva select resultados analitica tapresca_tarisan. Tenemos resultados: " + vSeleccion2.size());*/
|
|
|
|
String vael = null;
|
|
|
|
/*for(int i = 0; i < vSeleccion2.size(); i++)
|
|
{
|
|
vSeleccion.addElement(vSeleccion2.elementAt(i));
|
|
}*/
|
|
|
|
int medico = ((Usuario)sesion.getAttribute("USUARIO")).getMedico();
|
|
Vector vSeleccion = per.listado_analiticas_por_paciente(cole, poli, orde, dtFechaAnalisis, pac, medico, intPagina);
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Resultados analitica tapresca_tarisan. Tenemos resultados: " + vSeleccion.size());
|
|
/*int prueba = per.prueba_conexion();*/
|
|
|
|
/*Vector vPagiancion = new Vector();
|
|
vPagiancion = Utilidades.ObtenerPaginacionDeUnVector(vSeleccion, intPagina);*/
|
|
if (vSeleccion.size()==0) //No se han encontrado datos
|
|
{
|
|
|
|
%>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="6" align="center"><span class="txt"><%=pertamensaje.obtenerMensaje(67).getMensaje() %></span></td>
|
|
</tr>
|
|
<tr><td colspan="2"> </td></tr>
|
|
<tr>
|
|
<td colspan="6" align="center"><a href="javascript:nuevaPrescripcion('no')" class="enlace"><%=pertamensaje.obtenerMensaje(68).getMensaje() %></a></td>
|
|
</tr>
|
|
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
|
|
if (intPagina != 0){ //se tiene en cuenta la paginacion
|
|
|
|
%>
|
|
<tr>
|
|
<td colspan="6" 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 Solicitud</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Prescriptor</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Peticion</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Ver Resultados</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Regenerar Resultados</td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Modificar</td>
|
|
</tr>
|
|
<%
|
|
|
|
VTaresanaTamedico vTaresanaTamedico = null;
|
|
String estilo = "";
|
|
for(int i = 0; i < vSeleccion.size(); i++)
|
|
{
|
|
if (i % 2 == 0)
|
|
{
|
|
estilo = "filaA";
|
|
}
|
|
else
|
|
{
|
|
estilo = "filaB";
|
|
}
|
|
vTaresanaTamedico = (VTaresanaTamedico)vSeleccion.elementAt(i);
|
|
|
|
%>
|
|
<tr class="trResultados">
|
|
<%
|
|
if (vTaresanaTamedico.getAutorizacion() == 0) //campo autorizacion nulo o inicializado a 0. Valor no valido.
|
|
{
|
|
%>
|
|
<td class="<%=estilo%>" align="center"><%=sdfFormateadorFecha.format(vTaresanaTamedico.getFecha())%></td>
|
|
<td class="<%=estilo%>" align="left"><%=vTaresanaTamedico.getNombre() + " " + vTaresanaTamedico.getApellidos()%></td>
|
|
<td class="<%=estilo%>" align="left"><%=vTaresanaTamedico.getAutorizacion()%></td>
|
|
<%
|
|
}
|
|
else //campo autorizacion tiene un valor valido
|
|
{
|
|
|
|
%>
|
|
<td class="<%=estilo%>" align="center"><%=sdfFormateadorFecha.format(vTaresanaTamedico.getFecha())%></td>
|
|
<td class="<%=estilo%>" align="left"><%=vTaresanaTamedico.getNombre() + " " + vTaresanaTamedico.getApellidos()%></td>
|
|
<td class="<%=estilo%>" align="center">
|
|
<%
|
|
String peticion = ""+vTaresanaTamedico.getAutorizacion();
|
|
/*peticion = (peticion.length()<8)?"0"+peticion:peticion;*/
|
|
String peticionE = ""+vTaresanaTamedico.getAutorizacionEncriptada();
|
|
String ruta = ParametrosConfiguracion.ruta_pdf_peticiones_analiticas;
|
|
File ficheroPeticion = new File(ruta+peticion+".pdf");
|
|
if(ficheroPeticion.exists()) //Busco en la nueva ubicación
|
|
{
|
|
%>
|
|
<form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="4"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*ficheroPeticion.getName()*/peticionE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="<%=peticion%>" class="enlacePeticion"></input>
|
|
</form>
|
|
<%
|
|
}else{
|
|
ruta = ParametrosConfiguracion.ruta_pdf_peticiones;
|
|
ficheroPeticion = new File(ruta+peticion+".pdf");
|
|
if(ficheroPeticion.exists()) //Busco en la ubicación vieja
|
|
{
|
|
%>
|
|
<form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="15"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*ficheroPeticion.getName()*/peticionE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="<%=peticion%>" class="enlacePeticion"></input>
|
|
</form>
|
|
<%
|
|
}else{
|
|
%>
|
|
<span align="center"><%=peticion%></span>
|
|
<%
|
|
}
|
|
}
|
|
%>
|
|
</td>
|
|
<td class="<%=estilo%>" align="center">
|
|
<%
|
|
|
|
PersistenciaPaciente perPac = new PersistenciaPaciente();
|
|
Paciente pacient = (Paciente)sesion.getAttribute("PACIENTE");
|
|
Usuario usu = (Usuario)sesion.getAttribute("USUARIO");
|
|
|
|
String autorizado = pacient.getAutorizado();
|
|
if(autorizado == null)
|
|
autorizado = "N";
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Autorizado: "+pacient.getAutorizado());
|
|
String igua = vTaresanaTamedico.getIgualada();
|
|
if(igua == null)
|
|
igua = "0";
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Igua: "+igua);
|
|
LogTarisan.logger.log(NivelLog.DEBUG, vTaresanaTamedico.getAutorizacion());
|
|
|
|
String resultado = ""+vTaresanaTamedico.getAutorizacion();
|
|
String resultadoE = ""+vTaresanaTamedico.getAutorizacionEncriptada();
|
|
String igualadaE = ""+vTaresanaTamedico.getIgualadaEncriptada();
|
|
|
|
//Buscar los PDF con ceros
|
|
String resultadoConCeros=resultado;
|
|
do{
|
|
resultadoConCeros = (resultado.length()<8)?"0"+resultadoConCeros:resultadoConCeros;
|
|
}while (resultadoConCeros.length() < 8);
|
|
|
|
if((autorizado.toUpperCase().compareTo("S") == 0) || usu.getMedico() == vTaresanaTamedico.getPrescriptor())
|
|
{
|
|
|
|
// 16/06/2018 Nuvea comprobación para mostrar los pdfs que subimos a mano(ej: los desplazados que se hacen la extracción en CSM)
|
|
String direccion = ParametrosConfiguracion.ruta_pdf_resultados_analiticas;
|
|
File fichero = new File(direccion+resultado+".pdf");
|
|
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="1"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
|
|
if (vTaresanaTamedico.getExtraccion()!=0 && vTaresanaTamedico.getExtraccion()!=3){ // Mirar si la analítica está pendiente de extracción
|
|
|
|
if(igua.compareTo("0") != 0){ //Comprobar si se trata de una autorización que está en Tarisan y GPC
|
|
%>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/servlet/resultados_analisis" method="post" target="_blank" style="margin-bottom: 0px;">
|
|
<input type="hidden" name="requestID" value="<%=/*igua*/igualadaE%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form>
|
|
<%
|
|
}else{
|
|
if(vTaresanaTamedico.isPeticionConGuion())
|
|
{
|
|
%>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/servlet/resultados_analisis" method="post" target="_blank" style="margin-bottom: 0px;">
|
|
<input type="hidden" name="requestID" value="<%=/*vTaresanaTamedico.getAutorizacion()*/resultadoE%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form>
|
|
<%
|
|
}
|
|
else if(vTaresanaTamedico.getAutorizacion() < 999999 && !(vTaresanaTamedico.getAutorizacion()>700000 && vTaresanaTamedico.getAutorizacion()<799999))
|
|
{
|
|
%>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/servlet/resultados_analisis" method="post" target="_blank" style="margin-bottom: 0px;">
|
|
<input type="hidden" name="requestID" value="<%=/*vTaresanaTamedico.getAutorizacion()*/resultadoE%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form>
|
|
<%
|
|
}
|
|
else{
|
|
//PAC.ruta_pdf
|
|
/*String resultado = ""+vTaresanaTamedico.getAutorizacion();
|
|
resultado = (resultado.length()<8)?"0"+resultado:resultado;*/
|
|
/*String*/ direccion = ParametrosConfiguracion.ruta_pdf_resultados_analiticas;
|
|
/*File*/ fichero = new File(direccion+resultado+".pdf");
|
|
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="1"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
fichero = new File(direccion+resultado+".PDF");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="1"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
direccion = ParametrosConfiguracion.ruta_pdf_resultados;
|
|
fichero = new File(direccion+resultado+".pdf");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="16"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
fichero = new File(direccion+resultado+".PDF");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="16"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
//Buscamos en los mismos sitios pero con los ceros en el nombre del PDF
|
|
DES encrypter = new DES(""+medico);
|
|
String resultadoConCerosE = encrypter.encrypt(resultadoConCeros);
|
|
|
|
|
|
direccion = ParametrosConfiguracion.ruta_pdf_resultados_analiticas;
|
|
fichero = new File(direccion+resultadoConCeros+".pdf");
|
|
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="1"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoConCerosE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
fichero = new File(direccion+resultadoConCeros+".PDF");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="1"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoConCerosE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
direccion = ParametrosConfiguracion.ruta_pdf_resultados;
|
|
fichero = new File(direccion+resultadoConCeros+".pdf");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="16"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoConCerosE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
fichero = new File(direccion+resultadoConCeros+".PDF");
|
|
if(fichero.exists())
|
|
{
|
|
%><form name="resultados" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="16"/>
|
|
<input type="hidden" name="nombrePDF" value="<%=/*fichero.getName()*/resultadoConCerosE%>" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
<input type="submit" value="Ver Resultado" class="enlace"></input>
|
|
</form><%
|
|
}
|
|
else
|
|
{
|
|
%><p><%=pertamensaje.obtenerMensaje(6).getMensaje() %></p><% //Resultados Pendientes
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(vTaresanaTamedico.getExtraccion()==3){
|
|
/* Controlamos las peticiones anuladas desde GPC */
|
|
pteExtraccion = 3;
|
|
%><p>Petición anulada en GPC</p><%
|
|
}
|
|
else{
|
|
pteExtraccion = 1;
|
|
%><p>Pendiente de Extracción</p><%
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
%><p><%=pertamensaje.obtenerMensaje(66).getMensaje() %></p><% //Pendiente de Autorización del paciente
|
|
}
|
|
%>
|
|
<td class="<%=estilo%>" align="center">
|
|
<%
|
|
/*PersistenciaPaciente perPac = new PersistenciaPaciente();
|
|
Paciente pacient = (Paciente)sesion.getAttribute("PACIENTE");
|
|
Usuario usu = (Usuario)sesion.getAttribute("USUARIO");
|
|
|
|
String autorizado = pacient.getAutorizado();
|
|
if(autorizado == null)
|
|
autorizado = "N";
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Autorizado: "+pacient.getAutorizado());
|
|
String igua = vTaresanaTamedico.getIgualada();
|
|
if(igua == null)
|
|
igua = "0";
|
|
LogTarisan.logger.log(NivelLog.DEBUG, "Igua: "+igua);
|
|
LogTarisan.logger.log(NivelLog.DEBUG, vTaresanaTamedico.getAutorizacion());
|
|
autorizado="S";*/
|
|
if(((autorizado.toUpperCase().compareTo("S") == 0) || usu.getMedico() == vTaresanaTamedico.getPrescriptor()) && pteExtraccion==0)
|
|
{
|
|
if(igua.compareTo("0") != 0){ //Comprobar si se trata de una autorización que está en Tarisan y GPC
|
|
//File fichero = new File(ParametrosConfiguracion.ruta_pdf_resultados_analiticas+Long.valueOf(igua.toString())+".pdf");
|
|
%>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/servlet/resultados_analisis" method="post" target="_blank" style="margin-bottom: 0px;">
|
|
<input type="hidden" name="requestID" value="<%=/*igua*/igualadaE%>">
|
|
<input type="hidden" name="borrarPDF" value="1">
|
|
<input type="submit" value="Regenerar" class="enlace"></input>
|
|
</form>
|
|
<%
|
|
}else{
|
|
if(vTaresanaTamedico.getAutorizacion() < 999999 && !(vTaresanaTamedico.getAutorizacion()>700000 && vTaresanaTamedico.getAutorizacion()<799999)) //Comprobar si es de izasa
|
|
{
|
|
//File fichero = new File(ParametrosConfiguracion.ruta_pdf_resultados_analiticas+Long.valueOf(vTaresanaTamedico.getAutorizacion()).toString()+".pdf");
|
|
%>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/servlet/resultados_analisis" method="post" target="_blank" style="margin-bottom: 0px;">
|
|
<input type="hidden" name="requestID" value="<%=/*vTaresanaTamedico.getAutorizacion()*/resultadoE%>">
|
|
<input type="hidden" name="borrarPDF" value="1">
|
|
<input type="submit" value="Regenerar" class="enlace"></input>
|
|
</form>
|
|
<%
|
|
}else{
|
|
%><p>PDF no regenerable</p><%
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
pteExtraccion = 0;
|
|
%><p>PDF no regenerable</p><%//Pendiente de Autorización del paciente
|
|
}
|
|
%>
|
|
</td>
|
|
</td>
|
|
<%
|
|
int diaHoy = hoy.getDate();
|
|
int mesHoy = hoy.getMonth();
|
|
int anoHoy = hoy.getYear();
|
|
|
|
int diaAnalisis = vTaresanaTamedico.getFecha().getDate();
|
|
int mesAnalisis = vTaresanaTamedico.getFecha().getMonth();
|
|
int anoAnalisis = vTaresanaTamedico.getFecha().getYear();
|
|
|
|
if ((diaHoy==diaAnalisis)&&(mesHoy==mesAnalisis)&&(anoHoy==anoAnalisis)){ %>
|
|
<td class="<%=estilo%>" align="center"><a href="<%=request.getContextPath()%>/jsp/pac/solicitudAnaliticaNiveles.jsp?x=<%=strParametroMenu%>&modifiAuto=<%=vTaresanaTamedico.getAutorizacion()%>&pagina=1" class="enlaceAnalisis">Editar</a></td>
|
|
<%}else{ %>
|
|
<td class="<%=estilo%>" align="center">-</td>
|
|
<%}%>
|
|
|
|
</tr>
|
|
<%
|
|
/*strSql_requestid.delete(0,strSql_requestid.length());*/
|
|
}
|
|
%>
|
|
<%
|
|
}
|
|
%>
|
|
<tr><td colspan="2"> </td></tr>
|
|
<tr>
|
|
<td colspan="6" align="center"><a href="javascript:nuevaPrescripcion('si')" class="enlace"><%=pertamensaje.obtenerMensaje(68).getMensaje() %></a></td>
|
|
</tr>
|
|
|
|
<%
|
|
if (intPagina!=0){ //se tiene en cuenta la paginacion %>
|
|
<tr><td colspan="2"></td></tr>
|
|
<tr>
|
|
<td colspan="6">
|
|
<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 width="70" align="right"><a href="<%=request.getContextPath()%>/jsp/pac/analitica.jsp?x=4&pagina=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>-->
|
|
<td width="70" align="left"><a href="<%=request.getContextPath()%>/jsp/pac/analitica.jsp?x=4&pagina=<%=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 width="70" align="right"><a href="<%=request.getContextPath()%>/jsp/pac/analitica.jsp?x=4&pagina=<%=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>-->
|
|
<td width="70" align="left"><a href="<%=request.getContextPath()%>/jsp/pac/analitica.jsp?x=4&pagina=<%=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>
|
|
</div>
|
|
<form name="frmImprimirPeticion" action="<%=request.getContextPath()%>/servlet/GestorPacientes" target="blank" method="post" style="width:50%;margin-bottom: 0px">
|
|
<input type="hidden" name="tipo" value="4"/>
|
|
<input type="hidden" name="nombrePDF" value="" />
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_VER_PDF%>">
|
|
</form>
|
|
</body>
|
|
</html>
|
|
<script>
|
|
var jsMostrarNoticia = <%=mostrarNoticia %>;
|
|
if (!jsMostrarNoticia){
|
|
document.getElementById('contenedorNoticia').style.display="none";
|
|
}else{
|
|
<% strNoticia = strNoticia.replaceAll("\"", "'"); %>
|
|
var not = "<%=strNoticia %>";
|
|
tamanioNoticia(not);
|
|
marquee($('.tituloNoticia'), $('.marquee'),not);
|
|
}
|
|
</script>
|
|
<%
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Exception: " + ex);
|
|
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex);
|
|
response.sendRedirect("../error.jsp");
|
|
}
|
|
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Final página de analitica (pac/analitica.jsp)");
|
|
}
|
|
|
|
%>
|