%@ 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" %>
<%
//LogTarisan.logger.log(NivelLog.INFO, "Inicio página de peticiones capturadas (med/peticiones_capturadas.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
{
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Inicio página de buscar pacientes (med/buscar_paciente.jsp)");
try
{
// Definicion de variables
String strParametroMenu="";
String strCampoFecha="";
StringBuffer strSql = new StringBuffer();
int intPagina=0;
int intBuscarPaciente=0;
String intIdentificador="";
String troquelado = "";
String mensajeNoEncontrado = "";
Object aCondiciones[]=null;
int intTarifa = ((Usuario)sesion.getAttribute("USUARIO")).getTarifa();
int intEspecialidad = ((Usuario)sesion.getAttribute("USUARIO")).getEspecialidad();
//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 descripcion para las busquedas
if (request.getParameter("fecha")!=null)
strCampoFecha = (String)request.getParameter("fecha");
//parametro pagina para realizar la paginacion
if (request.getParameter("pagina")!=null)
intPagina=Integer.parseInt(request.getParameter("pagina"));
//parametro pagina para realizar la paginacion
if (request.getParameter("buscarPaciente")!=null)
intBuscarPaciente=Integer.parseInt(request.getParameter("buscarPaciente"));
troquelado = (String)request.getParameter("troque");
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
int medico = ((Usuario)sesion.getAttribute("USUARIO")).getMedico();
String ape = "";
String nom = "";
String dir = "";
String fec = "";
String tel = "";
String nif = "";
String ent = "";
String tar = "";
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(" ", " ");
}
}
%>
Peticiones capturadas
<%= sesion.getAttribute("USUARIO") %>
<%=strNoticia %>
<%
//Se ha pulsado en Buscar Paciente
PersistenciaTapecap per = new PersistenciaTapecap();
Tapecap tapecap = null;
Vector vSeleccion = per.buscarPaciente(troquelado, intPagina);
if (vSeleccion==null || vSeleccion.size()==0) //No se han encontrado datos
{%>
No se ha encontrado el paciente
<%
}
else //no existe un analisis previo. Se muestran los datos de la prescripcion.
{
if (intPagina != 0){ //se tiene en cuenta la paginacion
%>
Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%>
<%
}
%>
Nombre
Direccion
Fecha Nacimiento
Telefono
Dni
Compañia
Tarjeta
Seleccionar
<%
String estilo = "";
for(int i = 0; i < vSeleccion.size(); i++)
{
if (i % 2 == 0)
{
estilo = "filaA";
}
else
{
estilo = "filaB";
}
tapecap = (Tapecap)vSeleccion.elementAt(i);
if (tapecap.getApellidos()!=null){
ape = tapecap.getApellidos();
}
if (tapecap.getNombre()!=null){
nom = tapecap.getNombre().trim();
}
if (tapecap.getDireccion()!=null){
dir = tapecap.getDireccion();
}
if (tapecap.getFecha_nac()!=null){
fec = tapecap.getFecha_nac().toString();
/*fec = fec.replace('/','-');*/
String[] arrFecha = fec.split("-");
fec = arrFecha[2] + "-" + arrFecha[1] + "-" + arrFecha[0];
}
if (tapecap.getTelefono()!=null){
tel = tapecap.getTelefono().trim();
}
if (tapecap.getNif()!=null){
nif = tapecap.getNif().trim();
}
if (tapecap.getCompañia()!=null){
ent = tapecap.getCompañia();
}
if (tapecap.getIdentificador()!=null){
tar = tapecap.getIdentificador();
}
%>