1498 lines
54 KiB
Plaintext
1498 lines
54 KiB
Plaintext
<%@ page import="com.tarisan.control.*" %>
|
|
<%@ page import="com.tarisan.data.*" %>
|
|
<%@ page import="com.tarisan.excepcion.*" %>
|
|
<%@ page import="com.tarisan.log.*" %>
|
|
<%@ page import="java.sql.*" %>
|
|
<%@ page import="java.util.Vector" %>
|
|
<%@ page import="com.tarisan.util.Utilidades" %>
|
|
<%
|
|
//LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + ": Inicio página de solicitud de analiticas con niveles (pac/solicitudAnaliticaNiveles.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
|
|
{
|
|
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Inicio página de solicitud de analiticas con niveles (pac/solicitudAnaliticaNiveles.jsp)");
|
|
|
|
try
|
|
{
|
|
|
|
// Definicion de variables
|
|
int vieneDeGrupo = 0;
|
|
boolean boolActosValidosCargados=false;
|
|
String strMensajeSinElementos="No ha seleccionado ningún acto médico.";
|
|
String strJustificacionPrescripcion="";
|
|
String strParametroMenu="";
|
|
String strCampoNombre="";
|
|
String strListaElementos="";
|
|
String strListaCodigoElementos="";
|
|
String strInforme="";
|
|
String strGrupo="";
|
|
String strModifiAut="";
|
|
String strJustificacionInforme="";
|
|
String strJustificacionPres="";
|
|
//String hiddenGrupo = "";
|
|
String strTextBox = "";
|
|
int intScroll = 0;
|
|
int intPagina = 0;
|
|
int prog = 0;
|
|
int paginacion = 0;
|
|
int i=0;
|
|
int intImpresion = 0;
|
|
String strAutorizacion = "";
|
|
StringBuffer strSql = new StringBuffer();
|
|
Object aCondiciones[]=null;
|
|
|
|
PersistenciaTagruana perTagruana = new PersistenciaTagruana();
|
|
Tagruana tagruana=null;
|
|
int intMedico = ((Usuario)sesion.getAttribute("USUARIO")).getMedico();
|
|
|
|
//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("nombre")!=null)
|
|
strCampoNombre = (String)request.getParameter("nombre");
|
|
|
|
//parametro scroll para saber si hay que hacer scroll o no
|
|
if (request.getParameter("scroll")!=null)
|
|
intScroll = Integer.parseInt(request.getParameter("scroll"));
|
|
|
|
//parametro pagina para realizar la paginacion
|
|
if (request.getParameter("pagina")!=null)
|
|
intPagina=Integer.parseInt(request.getParameter("pagina"));
|
|
|
|
//parametro listaPrescripciones para mostrar las prescripciones seleccionadas
|
|
if (request.getParameter("listaElementos")!=null)
|
|
strListaElementos=(String)request.getParameter("listaElementos");
|
|
|
|
//parametro listaPrescripciones para mostrar las prescripciones seleccionadas
|
|
if (request.getParameter("listaCodigoElementos")!=null)
|
|
strListaCodigoElementos=(String)request.getParameter("listaCodigoElementos");
|
|
|
|
//parametro informe para mostrar el informe introducido por el medico
|
|
if (request.getParameter("informe")!=null)
|
|
strInforme=(String)request.getParameter("informe");
|
|
|
|
//parametro impresion que nos indica que se ha de realizar una impresion
|
|
if (request.getParameter("imp")!=null) {
|
|
intImpresion=Integer.parseInt(request.getParameter("imp"));
|
|
}
|
|
|
|
//parametro autorizacion que se pasa cuando se ha pulsado en editar peticion
|
|
if (request.getParameter("modifiAuto")!=null)
|
|
strModifiAut=(String)request.getParameter("modifiAuto");
|
|
|
|
//parametro aut que nos indica la autorizacion que se va a imprimir
|
|
if (request.getParameter("aut")!=null)
|
|
strAutorizacion=(String)request.getParameter("aut");
|
|
|
|
//parametro justificacion que contiene la justificacion del medico para hacer un nuevo analisis.
|
|
//en caso de no ser necesaria una justificacion, este campo estará vacio
|
|
if (request.getParameter("justificacionPrescripcion")!=null)
|
|
{
|
|
strJustificacionPrescripcion=(String)request.getParameter("justificacionPrescripcion");
|
|
|
|
//quitamos las comillas simples para pasarlas a un input oculto del formulario
|
|
//en javascript.
|
|
//Si no le quitamos las comillas simples, fallaria. Antes de pasar el valor al input, restauramos las comillas simples.
|
|
strJustificacionPrescripcion = strJustificacionPrescripcion.replace('\'', '~');
|
|
}
|
|
/*if (request.getParameter("grp")!=null)
|
|
{
|
|
hiddenGrupo=(String)request.getParameter("grp");
|
|
}*/
|
|
|
|
//parametro nombreTextBox para saber a que caja de texto hay que ponerle el focus y hacerle parpadear cambiando su color
|
|
if (request.getParameter("nombreTextBox")!=null)
|
|
{
|
|
strTextBox=(String)request.getParameter("nombreTextBox");
|
|
}
|
|
|
|
PersistenciaTamedico perTamedico = new PersistenciaTamedico();
|
|
Tamedico tamedico = new Tamedico();
|
|
int maxDeterminaciones = 25;
|
|
maxDeterminaciones = perTamedico.obtenerNumeroDeterminaciones(intMedico);
|
|
|
|
//parametro grupo que indica que el usuario selecciona los actos medicos de un grupo de analisis
|
|
//tenemos que cargar los actos medicos de ese grupo
|
|
if ((request.getParameter("seleccionGrupo")!=null)&&(request.getParameter("grupo")!=null))
|
|
{
|
|
|
|
strGrupo=(String)request.getParameter("grupo");
|
|
if ( ((String)request.getParameter("seleccionGrupo")).equalsIgnoreCase("si") && strGrupo!="")
|
|
{
|
|
Vector vActosGrupo = perTagruana.obtenerActosMedicos(Integer.parseInt(strGrupo),intMedico);
|
|
|
|
if (vActosGrupo.size()>0)
|
|
{
|
|
tagruana=null;
|
|
if(strListaElementos.length() == 0)
|
|
strListaElementos="¬"+strListaElementos;
|
|
|
|
if(strListaCodigoElementos.length() == 0)
|
|
strListaCodigoElementos="¬"+strListaCodigoElementos;
|
|
//
|
|
|
|
int actosPorGrupo = Utilidades.contar_coincidencias(strListaCodigoElementos,"¬");
|
|
|
|
if (((actosPorGrupo-1) + vActosGrupo.size()) > maxDeterminaciones){
|
|
%>
|
|
<script language="JavaScript" type="text/javascript">
|
|
/*alert("AVISO: No puede haber más de " + <%= maxDeterminaciones %> + " elementos.\nDebe eliminar algún acto para seleccionar este grupo");*/
|
|
$('#textoPopUp').text("No puede haber más de " + <%= maxDeterminaciones %> + " elementos.\nDebe eliminar algún acto para seleccionar este grupo.");
|
|
$('#popup').fadeIn('fast');
|
|
</script>
|
|
<%
|
|
strGrupo="";
|
|
}else{
|
|
for (i=0;i<vActosGrupo.size();i++)
|
|
{
|
|
tagruana=(Tagruana)vActosGrupo.elementAt(i);
|
|
|
|
if(strListaElementos.indexOf(tagruana.getDescripcionActo()) == -1)
|
|
{
|
|
strListaElementos += tagruana.getDescripcionActo() + "¬";
|
|
strListaCodigoElementos += tagruana.getActo() + "¬";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Cargamos los actos de la petición que se ha decidido modificar
|
|
if (strModifiAut.compareTo("")!=0 ){
|
|
if ((request.getParameter("progress")!=null)&&(request.getParameter("progress").compareTo("")!=0)) {
|
|
prog=Integer.parseInt(request.getParameter("progress"));
|
|
}
|
|
if (prog==0){
|
|
if ((request.getParameter("paginacion")!=null)&&(request.getParameter("paginacion").compareTo("")!=0)) {
|
|
paginacion=Integer.parseInt(request.getParameter("paginacion"));
|
|
}
|
|
if (paginacion==0){
|
|
PersistenciaTtactmedGPC perTtactmedGPC = new PersistenciaTtactmedGPC();
|
|
Vector vAnaliticas = perTtactmedGPC.actosPorPeticion(Long.parseLong(strModifiAut));
|
|
strListaElementos = "¬";
|
|
strListaCodigoElementos = "¬";
|
|
for (i=0;i<vAnaliticas.size();i++)
|
|
{
|
|
TtactmedGPC ttactmed = new TtactmedGPC();
|
|
ttactmed=(TtactmedGPC)vAnaliticas.elementAt(i);
|
|
if(ttactmed.getJustifi_deter()!=null && ttactmed.getJustifi_deter().compareTo("")!=0){
|
|
strListaElementos += ttactmed.getDescripcion_gpc().trim()+ " « "+ttactmed.getJustifi_deter() + "¬";
|
|
}else{
|
|
strListaElementos += ttactmed.getDescripcion_gpc().trim() + "¬";
|
|
}
|
|
strListaCodigoElementos += ttactmed.getActo() + "¬";
|
|
|
|
//justificacion/informe de la analitica
|
|
if(ttactmed.getJustificacionInforme()!=null){
|
|
strJustificacionInforme = ttactmed.getJustificacionInforme();
|
|
}
|
|
|
|
//justificacion/prescipcion de la analitica
|
|
if(ttactmed.getJustificacionPrescripcion()!=null){
|
|
strJustificacionPres = ttactmed.getJustificacionPrescripcion();
|
|
}
|
|
}
|
|
}else{
|
|
paginacion=0;
|
|
}
|
|
}else{
|
|
prog=0;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
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 n = 0; n < vSeleccionNot.size(); n++)
|
|
{
|
|
tanoticia = (Tanoticias)vSeleccionNot.elementAt(n);
|
|
if (n!=0){
|
|
strNoticia = strNoticia + separador + tanoticia.getNoticia();
|
|
}else{
|
|
strNoticia = tanoticia.getNoticia();
|
|
}
|
|
strNoticia = strNoticia.replaceAll("<br/>", " ");
|
|
}
|
|
}
|
|
|
|
String path = request.getContextPath();
|
|
if (request.getContextPath().indexOf("tarisan")==-1){
|
|
path = path + "/tarisan";
|
|
}
|
|
|
|
%>
|
|
|
|
<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">
|
|
<link rel="STYLESHEET" type="text/css" href="<%=path %>/css/jquery.modal.css">
|
|
<link rel="STYLESHEET" type="text/css" href="<%=path %>/css/alertify.core.css">
|
|
<link rel="STYLESHEET" type="text/css" href="<%=path %>/css/alertify.default.css">
|
|
<script language="JavaScript" src="<%=path%>/js/funciones.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/jquery-1.11.3.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/jquery-ui.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/jquery.modal.min.js"></script>
|
|
<script language="JavaScript" src="<%=path%>/js/alertify.js"></script>
|
|
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
|
<script language="JavaScript" type="text/javascript">
|
|
<!--
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
//FUNCIONES UTILIZADAS PARA EL TRATAMIENTO DE LA SELECCION DE LOS CHECKBOXES DE LA GESTION DE PACIENTES
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
var mensajeSinElementos = "<%=strMensajeSinElementos%>";
|
|
var vElementos = new Array();
|
|
var vCodigoElementos = new Array();
|
|
var intNumeroCheckBoxes = 0;
|
|
var strParametroGrupoSeleccionado = '<%=strGrupo%>';
|
|
var stringActosValidos = "";
|
|
var stringActosValidosPerfiles ="";
|
|
var stringActosJustificacion = "";
|
|
|
|
function anular()
|
|
{
|
|
strParametroGrupoSeleccionado="";
|
|
|
|
vElementos = new Array();
|
|
escribirListaElementos();
|
|
|
|
vCodigoElementos = new Array();
|
|
|
|
//limpiamos la seleccion de las checkboxes
|
|
for (var i=0;i<intNumeroCheckBoxes;i++)
|
|
eval("document.frmAnalitica.checkbox" + i + ".checked=false");
|
|
|
|
document.frmPrescripcion.listaElementosPrescripcion.value="";
|
|
document.frmPrescripcion.listaCodigoElementosPrescripcion.value="";
|
|
document.frmPrescripcion.informePrescripcion.value="";
|
|
document.frmAnalitica.listaElementos.value="";
|
|
document.frmAnalitica.listaCodigoElementos.value="";
|
|
document.frmAnalitica.informe.value="";
|
|
document.frmAnalitica.grupo.value=""
|
|
document.frmAnalitica.seleccionGrupo.value=""
|
|
//document.frmAnalitica.grp.value=""
|
|
deshabilitarCombo("");
|
|
}
|
|
|
|
function imprimir()
|
|
{
|
|
prepararImpresionListaElementos(document.frmPrescripcion.listaElementosPrescripcion, document.frmPrescripcion.listaCodigoElementosPrescripcion);
|
|
prepararEnvioFormInformePrescripcion();
|
|
|
|
/*if (document.frmPrescripcion.listaElementosPrescripcion.value=="")
|
|
alert("Debe seleccionar algún elemento para realizar la prescripción.");*/
|
|
if (document.frmPrescripcion.informePrescripcion.value.length > 1000){
|
|
//alert("No puede introducir un informe de más de 1000 caracteres.");
|
|
modal({type:'error',title:'¡Atención!',text:'No puede introducir un informe de más de 1000 caracteres.',});
|
|
}
|
|
else
|
|
{
|
|
if (document.frmPrescripcion.listaElementosPrescripcion.value!=""){
|
|
//enviamos el formulario
|
|
document.frmPrescripcion.submit();
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!Array.prototype.indexOf) {
|
|
Array.prototype.indexOf = function (obj, fromIndex) {
|
|
if (fromIndex == null) {
|
|
fromIndex = 0;
|
|
} else if (fromIndex < 0) {
|
|
fromIndex = Math.max(0, this.length + fromIndex);
|
|
}
|
|
for (var i = fromIndex, j = this.length; i < j; i++) {
|
|
if (this[i] == obj && obj != 0)
|
|
return i;
|
|
}
|
|
return -1;
|
|
};
|
|
}
|
|
|
|
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");
|
|
}
|
|
}
|
|
|
|
function prepararImpresionListaElementos(campoElementos, campoCodigoElementos)
|
|
{
|
|
var textoElementos="";
|
|
var textoCodigoElementos="";
|
|
if(vCodigoElementos.length>0)
|
|
{
|
|
for (var i=0; i<vCodigoElementos.length; i++)
|
|
{
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i];
|
|
}
|
|
textoCodigoElementos+= "¬";
|
|
textoElementos+="¬";
|
|
campoElementos.value=textoElementos;
|
|
campoCodigoElementos.value=textoCodigoElementos;
|
|
}
|
|
else
|
|
{
|
|
//alert("Debe seleccionar algún elemento para realizar la prescripción.");
|
|
modal({type:'error',title:'¡Atención!',text:'Debe seleccionar algún elemento para realizar la prescripción.',});
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function DetectFirefox()
|
|
{
|
|
var resul = false;
|
|
var val = navigator.appName;
|
|
if(val.indexOf("Netscape") > -1)
|
|
{
|
|
resul = true;
|
|
}
|
|
return resul;
|
|
}
|
|
|
|
function buscar_array_firefox(obj, elemento)
|
|
{
|
|
var matriz = new Array();
|
|
matriz = obj;
|
|
for(var i=0; i<matriz.length; i++)
|
|
{
|
|
if(matriz[i] == elemento)
|
|
return i;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
//Se prepara la lista de elementos cuando se han seleccionadeo de un grupo de análisis
|
|
function prepararEnvioFormListaElementosGrupos(campoElementos, campoCodigoElementos)
|
|
{
|
|
var textoElementos="";
|
|
var textoCodigoElementos="";
|
|
var posiciones_eliminar="";
|
|
var temp3 = new Array();
|
|
var temp2 = new Array();
|
|
var j=0;
|
|
|
|
if (vCodigoElementos.length>0) //array con elementos
|
|
{
|
|
//preparamos la lista de codigos
|
|
//Convertimos el string en array y buscamos el elemento actual dentro del array:
|
|
for (var i=0; i<vCodigoElementos.length; i++)
|
|
{
|
|
//Buscar los análisis válidos y sacar un pop up para avisar de aquellos no cubiertos para el paciente.
|
|
var temp = new Array();
|
|
temp = stringActosValidos.split('¬');
|
|
var bueno = false;
|
|
//Buscar tambien los análisis que necesiten justificacion y sacar un pop up para avisar.
|
|
var tmp = new Array();
|
|
tmp = stringActosJustificacion.split('¬');
|
|
var justifi = false;
|
|
|
|
|
|
if(DetectFirefox())
|
|
{
|
|
if(buscar_array_firefox(temp, vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis está cubierto para el paciente
|
|
bueno = true;
|
|
}
|
|
if(buscar_array_firefox(tmp, vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis necesita justificación
|
|
justifi = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(temp.indexOf(vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis está cubierto para el paciente
|
|
bueno = true;
|
|
}
|
|
if(tmp.indexOf(vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis necesita justificación
|
|
justifi = true;
|
|
}
|
|
}
|
|
|
|
if(bueno && !justifi) //Controla que el análisis esté cubierto para el paciente y no necesite justificación
|
|
{
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i];
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i];
|
|
j=j+1;
|
|
}
|
|
else
|
|
{
|
|
if(!bueno){ //El análisis no está cubierto para el paciente
|
|
//alert("El acto: "+vElementos[i].replace(/^\s+|\s+$/g,'')+" no está cubierto para este paciente, no saldrá en la petición...");
|
|
modal({type:'error',title:'¡Atención!',text:'El acto: '+vElementos[i].replace(/^\s+|\s+$/g,'')+' no está cubierto para este paciente, no saldrá en la petición.',});
|
|
|
|
}else //El análisis necesita justificación
|
|
{
|
|
if(!(vElementos[i].indexOf(" « ") > 0)) //El análisis a tratar necesita justificación y todabía no la tiene
|
|
{
|
|
//POP UP que pide la justificacion de un análisis
|
|
do{
|
|
var jus = prompt("El acto: "+vElementos[i].replace(/^\s+|\s+$/g,'')+" necesita justificación.", "");
|
|
}while (jus == "");
|
|
|
|
if (jus != null){
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i]+ " « "+jus;
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i]+ " « "+jus;
|
|
j=j+1;
|
|
}
|
|
|
|
//var ju = "";
|
|
//do{
|
|
//var correcto = 1;
|
|
|
|
/*modal({
|
|
type : 'prompt',
|
|
title : '¡Atención!',
|
|
text : 'El acto: '+vElementos[i].replace(/^\s+|\s+$/g,'')+' necesita justificación',
|
|
callback: function(result){
|
|
ju=result;
|
|
}
|
|
});*/
|
|
//}while (ju == "");
|
|
|
|
/*if (ju != ""){
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i]+ " « "+ju;
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i]+ " « "+ju;
|
|
j=j+1;
|
|
}else{
|
|
alert("La justificacion esta vacia");
|
|
}*/
|
|
|
|
/*var miStr="";
|
|
do{
|
|
alertify.prompt("El acto: "+vElementos[i].replace(/^\s+|\s+$/g,'')+" necesita justificación", function (e, str) {
|
|
if (e){
|
|
//alertify.success("Has pulsado '" + alertify.labels.ok + "'' e introducido: " + str);
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i]+ " « "+str;
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i]+ " « "+str;
|
|
j=j+1;
|
|
miStr=str;
|
|
}else{
|
|
miStr="";
|
|
}
|
|
});
|
|
return false;
|
|
}while (miStr == ""); */
|
|
|
|
}else //El análisis ya tiene justificación y no se vuelva a preguntar por ella. Se inserta en la lista
|
|
{
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i];
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i];
|
|
j=j+1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
textoCodigoElementos+= "¬";
|
|
textoElementos+="¬";
|
|
}
|
|
campoElementos.value=textoElementos;
|
|
|
|
document.frmAnalitica.vienedegrupo.value=0;
|
|
campoCodigoElementos.value=textoCodigoElementos;
|
|
|
|
vCodigoElementos = temp3;
|
|
vElementos = temp2;
|
|
|
|
}
|
|
|
|
//Se prepara la lista de elementos cuando no se han seleccionadeo de un grupo de análisis
|
|
function prepararEnvioFormListaElementos(campoElementos, campoCodigoElementos)
|
|
{
|
|
var textoElementos="";
|
|
var textoCodigoElementos="";
|
|
var posiciones_eliminar="";
|
|
var temp3 = new Array();
|
|
var temp2 = new Array();
|
|
var j=0;
|
|
|
|
if (vCodigoElementos.length>0) //array con elementos
|
|
{
|
|
//preparamos la lista de codigos
|
|
//Convertimos el string en array y buscamos el elemento actual dentro del array:
|
|
for (var i=0; i<vCodigoElementos.length; i++)
|
|
{
|
|
//Buscar los análisis válidos y sacar un pop up para avisar de aquellos no cubiertos para el paciente.
|
|
var temp = new Array();
|
|
temp = stringActosValidos.split('¬');
|
|
var bueno = false;
|
|
|
|
if(DetectFirefox())
|
|
{
|
|
if(buscar_array_firefox(temp, vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis está cubierto para el paciente
|
|
bueno = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(temp.indexOf(vCodigoElementos[i]) > 0)
|
|
{
|
|
//El análisis está cubierto para el paciente
|
|
bueno = true;
|
|
}
|
|
|
|
}
|
|
if(bueno)
|
|
{
|
|
textoCodigoElementos+= "¬" + vCodigoElementos[i];
|
|
textoElementos+= "¬" + vElementos[i];
|
|
temp3[j] = vCodigoElementos[i];
|
|
temp2[j] = vElementos[i];
|
|
j=j+1;
|
|
}
|
|
else
|
|
{
|
|
//alert("El acto: "+vElementos[i].replace(/^\s+|\s+$/g,'')+" no está cubierto para este paciente, no saldrá en la petición...");
|
|
modal({type:'error',title:'¡Atención!',text:'El acto: '+vElementos[i].replace(/^\s+|\s+$/g,'')+' no está cubierto para este paciente, no saldrá en la petición.',});
|
|
|
|
}
|
|
|
|
}
|
|
textoCodigoElementos+= "¬";
|
|
textoElementos+="¬";
|
|
}
|
|
campoElementos.value=textoElementos;
|
|
|
|
campoCodigoElementos.value=textoCodigoElementos;
|
|
|
|
vCodigoElementos = temp3;
|
|
vElementos = temp2;
|
|
|
|
}
|
|
|
|
function prepararEnvioFormInformePrescripcion()
|
|
{
|
|
document.frmPrescripcion.informePrescripcion.value = document.frmAnalitica.informe.value;
|
|
|
|
}
|
|
|
|
function inicializarListaElementos()
|
|
{
|
|
//preparamos la lista de codigos
|
|
|
|
//cogemos los valores de la lista de codigos
|
|
var lstCodigoElementos = '<%=strListaCodigoElementos%>';
|
|
|
|
//inicializamos el array de elementos con sus valores
|
|
var i=0;
|
|
if (lstCodigoElementos!="") //la lista no esta vacia
|
|
{
|
|
//quitamos el primer caracter separador
|
|
lstCodigoElementos=lstCodigoElementos.substring(lstCodigoElementos.indexOf("¬") + 1);
|
|
while (lstCodigoElementos.indexOf("¬")!=-1)
|
|
{
|
|
var string = lstCodigoElementos.substring(0, lstCodigoElementos.indexOf("¬"));
|
|
if(string.length > 0)
|
|
vCodigoElementos[i] = string;
|
|
|
|
lstCodigoElementos=lstCodigoElementos.substring(lstCodigoElementos.indexOf("¬") + 1);
|
|
i++;
|
|
}
|
|
}
|
|
|
|
//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 strListaElementosAux=strListaElementos.replace('\'', '~');
|
|
%>
|
|
|
|
//cogemos los valores de la lista sin comillas simples
|
|
var lstElementos = '<%=strListaElementosAux%>';
|
|
|
|
//restauramos las comillas simples para ponerlos con su valor original en el array de elementos
|
|
while(lstElementos.indexOf("~")!=-1)
|
|
lstElementos = lstElementos.replace("~", "'");
|
|
|
|
//inicializamos el array de elementos con sus valores originales
|
|
var i=0;
|
|
if (lstElementos!="") //la lista no esta vacia
|
|
{
|
|
//quitamos el primer caracter separador
|
|
lstElementos=lstElementos.substring(lstElementos.indexOf("¬") + 1);
|
|
|
|
while (lstElementos.indexOf("¬")!=-1)
|
|
{
|
|
var string = lstElementos.substring(0, lstElementos.indexOf("¬"));
|
|
if(string.length > 0)
|
|
vElementos[i] = string;
|
|
|
|
//lstElementos.substring(0, lstElementos.indexOf("¬"));
|
|
|
|
lstElementos=lstElementos.substring(lstElementos.indexOf("¬") + 1);
|
|
i++;
|
|
}
|
|
}
|
|
var vieneDeG = document.frmAnalitica.vienedegrupo.value;
|
|
if(vieneDeG==1)
|
|
{
|
|
prepararEnvioFormListaElementosGrupos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
}else
|
|
{
|
|
prepararEnvioFormListaElementos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
}
|
|
|
|
escribirListaElementos();
|
|
|
|
}
|
|
|
|
function aniadirElemento(elemento, codigoElemento, justificacion)
|
|
{
|
|
var elementoConComillaSimple=elemento+ " « "+justificacion;
|
|
var nocargar=false;
|
|
|
|
if (justificacion==""){
|
|
elementoConComillaSimple=elemento;
|
|
}else{
|
|
elementoConComillaSimple=elemento+" « "+justificacion;
|
|
}
|
|
|
|
//En caso de que el elemento tenga el caracter (~), se sustituye por una comilla simple (')
|
|
//para mostrarlo correctamente. En el array se almacenan los valores reales, con comillas simples.
|
|
//El elemento viene con ese caracter especial que sustituye a la comilla simple, porque si no, a la hora de
|
|
//asignar el valor original a la propiedad value del checkbox, si el valor original contiene ', kaska. Pensara que es
|
|
//final de string. Para evitar eso, antes de asignar a la propiedad value remplazamos la comilla por ese valor especial.
|
|
while(elementoConComillaSimple.indexOf("~")!=-1)
|
|
{
|
|
elementoConComillaSimple = elementoConComillaSimple.replace("~", "'");
|
|
}
|
|
|
|
//añadimos descripcion elemento
|
|
vElementos[vElementos.length]=elementoConComillaSimple;
|
|
|
|
|
|
//añadimos codigo elemento
|
|
vCodigoElementos[vCodigoElementos.length]=codigoElemento;
|
|
|
|
}
|
|
|
|
function eliminarElemento(elemento, codigoElemento)
|
|
{
|
|
var vNuevosElementos=new Array();
|
|
var vNuevosCodigoElementos=new Array();
|
|
var j=0;
|
|
var pos=0;
|
|
|
|
//Buscamos la posicion del elemento seleccionado en el array de codigos de elementos(vCodigoElementos) y la guardamos en una variable(pos)
|
|
for (var i=0; i<vCodigoElementos.length; i++)
|
|
{
|
|
if(vCodigoElementos[i]==codigoElemento)
|
|
{
|
|
pos=i;
|
|
}
|
|
}
|
|
|
|
//eliminamos descripcion elemento
|
|
for (var i=0; i<vElementos.length; i++)
|
|
{
|
|
if(i!=pos)
|
|
{
|
|
vNuevosElementos[j]=vElementos[i];
|
|
j++;
|
|
}
|
|
}
|
|
vElementos = vNuevosElementos;
|
|
|
|
//eliminamos codigo elemento
|
|
j=0;
|
|
for (var i=0; i<vCodigoElementos.length; i++)
|
|
{
|
|
if(i!=pos)
|
|
{
|
|
vNuevosCodigoElementos[j]=vCodigoElementos[i];
|
|
j++;
|
|
}
|
|
}
|
|
vCodigoElementos = vNuevosCodigoElementos;
|
|
}
|
|
|
|
function escribirListaElementos()
|
|
{
|
|
// USAR EL STRING EN LUGAR DEL ARRAY O MODIFICAR EL ARRAY
|
|
var texto="<table border='0' cellpadding='0' cellspacing='0'>";
|
|
if (vElementos.length==0) //no hay ningun elemento
|
|
texto+= "<tr><td class='txt'>" + mensajeSinElementos + "</td></tr>";
|
|
else //hay algun elemento
|
|
{
|
|
for (var i=0; i<vElementos.length; i++)
|
|
{
|
|
texto+= "<tr><td class="+'"txtNegrita"'+" valign='top'><input type=\"checkbox\" onclick=\"javascript:tratarCheckBox(this, " + vCodigoElementos[i] + ", 'justificacion_" + vCodigoElementos[i] + "', false)\" checked=\"checked\" value='"+vElementos[i]+"'></td><td class='txt'>" + vElementos[i] + "</td></tr>";
|
|
}
|
|
}
|
|
|
|
texto = texto + "</table>";
|
|
//alert(texto);
|
|
|
|
//escribimos la lista de elementos dependiendo del navegador
|
|
if (document.all)
|
|
{
|
|
document.all['elementos'].innerHTML = texto;
|
|
}
|
|
else if (document.getElementById)
|
|
{
|
|
document.getElementById('elementos').innerHTML = texto;
|
|
}
|
|
else if (document.layers)
|
|
{
|
|
texto = "<layer top='0' left='0'>"+texto+"</layer>";
|
|
document.layers['elementos'].document.open();
|
|
document.layers['elementos'].document.write(texto);
|
|
document.layers['elementos'].document.close();
|
|
}
|
|
}
|
|
|
|
function tratarCheckBox(checkbox, codigoElemento, justificacion, need_justify)
|
|
{
|
|
if (vElementos.length>=<%=maxDeterminaciones%>) //Están seleccinoados el máximo de elementos permitidos. No puede seleccionar mas elementos.
|
|
{
|
|
if (checkbox.checked==true) //se selecciona una prescripcion
|
|
{
|
|
checkbox.checked=false;
|
|
//alert("No puede imputar más actos médicos");
|
|
modal({type:'error',title:'¡Atención!',text:'No puede imputar más actos médicos.',});
|
|
|
|
}
|
|
else //se quita la seleccion de una prescripcion
|
|
{
|
|
eliminarElemento(checkbox.value, codigoElemento);
|
|
prepararEnvioFormListaElementos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
escribirListaElementos();
|
|
}
|
|
}
|
|
else //tiene seleccionados menos que 25 elementos. Le dejamos que seleccione sin ningun problema.
|
|
{
|
|
if (checkbox.checked==true) //se selecciona una prescripcion
|
|
{
|
|
if(need_justify) //El elemento necesita justificación
|
|
{
|
|
var justi = document.getElementById(justificacion).value;
|
|
var nombreCaja = document.getElementById(justificacion).name;//Guardo el nombre de la caja de texto para ponerle el focus después de sacar el alert
|
|
if (justi == "")
|
|
{
|
|
alert("Debe justificar la solicitud de esta determinación.")
|
|
/*modal({type:'error',
|
|
title:'¡Atención!',
|
|
text:'Debe justificar la solicitud de esta determinación.',
|
|
|
|
callback: function(result){
|
|
checkbox.checked=false;
|
|
document.frmAnalitica.nombreTextBox.value=nombreCaja;
|
|
document.frmAnalitica.scroll.value=1;
|
|
}
|
|
});*/
|
|
checkbox.checked=false;
|
|
document.frmAnalitica.nombreTextBox.value=nombreCaja;
|
|
document.frmAnalitica.scroll.value=1;
|
|
}else
|
|
{
|
|
aniadirElemento(checkbox.value, codigoElemento, justi);
|
|
document.frmAnalitica.nombreTextBox.value=null;
|
|
}
|
|
}
|
|
else //No necesita justificación
|
|
{
|
|
aniadirElemento(checkbox.value, codigoElemento, '');
|
|
}
|
|
}
|
|
else //Se descheckea un elemento. Se elimina de la lista
|
|
{
|
|
checkbox.checked=false;
|
|
eliminarElemento(checkbox.value, codigoElemento);
|
|
|
|
}
|
|
<%vieneDeGrupo=0;%> // Se asigna el valor 0 para que el elemento no se trate como si fuera un análisis seleccionado del combo de grupos de análisis
|
|
prepararEnvioFormListaElementos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
escribirListaElementos();
|
|
document.frmAnalitica.progress.value=1;
|
|
document.frmAnalitica.submit();
|
|
|
|
}
|
|
}
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
//FUNCIONES UTILIZADAS PARA EL TRATAMIENTO DE LA SELECCION DE LOS CHECKBOXES DE LA GESTION DE PACIENTES
|
|
//********************************************************************************************************************
|
|
//********************************************************************************************************************
|
|
|
|
|
|
//el parametro justificacion proveniente de la jsp justificaccionDiagnostico, puede que tenga comillas simples.
|
|
//este valor hay que pasarlo como input oculto dentro del formulario.
|
|
//para evitar que kaske esta asignacion, hacemos tratamiento de las comillas.
|
|
//antes, en el codigo java, hemos sustituido las comillas simples por el caracter '~'.
|
|
//ahora sustituimos el valor '~' por las comillas simples.
|
|
function prepararCampoJustificacion()
|
|
{
|
|
var justificacionConComillas = document.frmPrescripcion.justificacionPrescripcion.value;
|
|
while (justificacionConComillas.indexOf("~")!=-1)
|
|
justificacionConComillas=justificacionConComillas.replace("~", "'");
|
|
|
|
document.frmAnalitica.justificacionPrescripcion.value = justificacionConComillas;
|
|
document.frmPrescripcion.justificacionPrescripcion.value = justificacionConComillas;
|
|
}
|
|
|
|
function informarParametroCampoBusqueda()
|
|
{
|
|
//Quitamos las comillas simples para que al asignar el valor del campo de busqueda
|
|
//no kaske, ya que en esa asignacion se utiliza comillas simples
|
|
<%
|
|
String strCampoNombreAux=strCampoNombre.replace('\'', '~');
|
|
%>
|
|
|
|
//cogemos el valor del campo de busqueda sin comillas simples
|
|
var lstCampoBusqueda = '<%=strCampoNombreAux%>';
|
|
//restauramos las comillas simples para ponerlos con su valor original en campo de busqueda
|
|
while(lstCampoBusqueda.indexOf("~")!=-1)
|
|
lstCampoBusqueda = lstCampoBusqueda.replace("~", "'");
|
|
|
|
document.frmAnalitica.nombre.value=lstCampoBusqueda;
|
|
}
|
|
|
|
function comprobarTamanio()
|
|
{
|
|
return (document.frmAnalitica.informe.value.length < 1000)
|
|
}
|
|
|
|
function inicializarListaGrupos()
|
|
{
|
|
document.frmAnalitica.grupo.value = strParametroGrupoSeleccionado;
|
|
}
|
|
|
|
function tratarGrupoAnalisis(grupo,tamañoGrupo)
|
|
{
|
|
if (grupo != "" && grupo!=strParametroGrupoSeleccionado)
|
|
{
|
|
|
|
/* if ((vElementos.length + tamañoGrupo)>25) //hay más de 25 elementos entre los que hay seleccionados y los que tiene el grupo.
|
|
{
|
|
alert("AVISO: No puede haber más de 25 elementos.\nDebe eliminar algún acto para seleccionar este grupo");
|
|
}else{*/
|
|
<%vieneDeGrupo=1;%>
|
|
document.frmAnalitica.seleccionGrupo.value = "si";
|
|
//document.frmAnalitica.grp.value = "deshabilitar"; //Valor que utilizaremos para deshabilitar el combo de los grupos de análisis
|
|
document.frmAnalitica.submit();
|
|
// }
|
|
}
|
|
}
|
|
|
|
function deshabilitarCombo(value)
|
|
{
|
|
if (value != "")
|
|
{
|
|
document.frmAnalitica.grupo.disabled = true;
|
|
document.frmAnalitica.grupo.style.backgroundColor = '#EBEBEB';
|
|
}else{
|
|
document.frmAnalitica.grupo.disabled = false;
|
|
document.frmAnalitica.grupo.style.backgroundColor = 'white';
|
|
}
|
|
}
|
|
|
|
function pasarAMayusculas(campo)
|
|
{
|
|
campo.value=campo.value.toUpperCase();
|
|
}
|
|
|
|
function buscar()
|
|
{
|
|
prepararEnvioFormListaElementos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
document.frmAnalitica.pagina.value=1;
|
|
pasarAMayusculas(document.frmAnalitica.nombre);
|
|
document.frmAnalitica.submit();
|
|
}
|
|
|
|
function paginacion(pagina)
|
|
{
|
|
prepararEnvioFormListaElementos(document.frmAnalitica.listaElementos, document.frmAnalitica.listaCodigoElementos);
|
|
document.frmAnalitica.pagina.value=pagina;
|
|
pasarAMayusculas(document.frmAnalitica.nombre);
|
|
document.frmAnalitica.paginacion.value=1;
|
|
document.frmAnalitica.submit();
|
|
}
|
|
//-->
|
|
</script>
|
|
|
|
</head>
|
|
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onload="javascript:inicializarListaElementos();prepararCampoJustificacion();inicializarListaGrupos();informarParametroCampoBusqueda();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="180">//-->
|
|
<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="<%=request.getContextPath()%>/img/sp.gif" width="180" height="12" border="0"></td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td><script language="JavaScript">escribirMenuGst();</script></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%">
|
|
<tr>
|
|
<td width="1px" bgcolor="#CCCCCC"></td>
|
|
<td class="txt" valign="top">
|
|
<table border="0" align="center" width="100%" cellpadding="0">
|
|
|
|
<!-- Presentacion de los resultados -->
|
|
<tr>
|
|
<!--<td colspan="2" align="right">//-->
|
|
<td colspan="2" align="right" width="100%">
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td><input type="button" name="aceptar" value="OK/Imprimir" onclick="javascript:imprimir()" class="menu"></td>
|
|
<td><img src="<%=request.getContextPath()%>/img/sp.gif" width="5" height="1" border="0"></td>
|
|
<td><input type="button" name="anular" value="Anular" onclick="javascript:anular()" class="menu"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<form name="frmPrescripcion" action="<%=request.getContextPath()%>/servlet/GestorPacientes?x=<%=strParametroMenu%>&imp=1" method="post">
|
|
<input type="hidden" name="listaElementosPrescripcion" value="">
|
|
<input type="hidden" name="listaCodigoElementosPrescripcion" value="">
|
|
<input type="hidden" name="informePrescripcion" value="">
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_PAC_PRESCRIPCION_ANALITICA%>">
|
|
<%
|
|
String justificacion = "";
|
|
if(strJustificacionPres.compareTo("")!=0){
|
|
justificacion = strJustificacionPres;
|
|
}else{
|
|
justificacion = strJustificacionPrescripcion;
|
|
}%>
|
|
<input type="hidden" name="justificacionPrescripcion" value='<%=justificacion%>'>
|
|
<input type="hidden" name="modifiAuto" value="<%=strModifiAut%>">
|
|
</form>
|
|
<form name="frmAnalitica" action="<%=request.getContextPath()%>/jsp/pac/solicitudAnaliticaNiveles.jsp?x=<%=strParametroMenu%>" method="post" onSubmit="javascript:pasarAMayusculas(this.nombre)">
|
|
<input type="hidden" name="scroll" value="0">
|
|
<input type="hidden" name="modifiAuto" value="<%=strModifiAut%>">
|
|
<input type="hidden" name="progress" value="">
|
|
<input type="hidden" name="paginacion" value="">
|
|
|
|
<%
|
|
if (request.getParameter("seleccionGrupo")!=null)//Controlar si viene de grupo o no
|
|
{
|
|
if ( ((String)request.getParameter("seleccionGrupo")).equalsIgnoreCase("si"))
|
|
{
|
|
vieneDeGrupo=1;
|
|
}else{
|
|
vieneDeGrupo=0;
|
|
}
|
|
}else{
|
|
vieneDeGrupo=0;
|
|
}
|
|
|
|
%>
|
|
<table border="0" align="left" width="60%">
|
|
<tr>
|
|
<td align="left" class="txtNegrita">Prescripción de diagnóstico:</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left">
|
|
<div id="elementos" style="position:relative;top:0px;left:0px;" class="txt"></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table border="0" align="right">
|
|
<tr>
|
|
<td align="left" class="txtNegrita">Grupos de análisis:</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<%
|
|
|
|
Vector vGrupos = perTagruana.obtenerGruposAnalisis(intMedico);
|
|
tagruana = null;
|
|
%>
|
|
<select name="grupo" class="txt" onChange="javascript:tratarGrupoAnalisis(this.value,<%=vGrupos.size() %>)">
|
|
<%
|
|
if (vGrupos.size() > 0) {
|
|
%>
|
|
<option <%=(strGrupo.compareTo("")==0)?"\"selected=\"selected\"":"" %> value="">Seleccione...</option>
|
|
<%
|
|
}
|
|
else{
|
|
%>
|
|
<option value="">Usuario sin grupos definidos</option>
|
|
<%
|
|
}
|
|
%>
|
|
<%
|
|
for(i = 0; i < vGrupos.size(); i++)
|
|
{
|
|
tagruana = (Tagruana)vGrupos.elementAt(i);
|
|
%>
|
|
<option <%=(strGrupo.compareTo(Integer.toString(tagruana.getGrupo()))==0)?"\"selected=\"selected\"":"" %> value="<%=tagruana.getGrupo()%>"><%=tagruana.getDescripcion()%></option>
|
|
<%
|
|
}
|
|
%>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" class="txtNegrita">Informe:</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left">
|
|
<%
|
|
String info = "";
|
|
if(strJustificacionInforme.compareTo("")!=0){
|
|
info = strJustificacionInforme;
|
|
}else{
|
|
info = strInforme;
|
|
}%>
|
|
<textarea name="informe" rows="4" cols="40" class="txt" onkeypress="javascript:return comprobarTamanio()"><%=info%></textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"><img src="<%=request.getContextPath()%>/img/sp.gif" width="1" height="2" border="0"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td><span class="txtnegrita">Nombre acto médico: </span></td>
|
|
<td><input type="text" size="50" name="nombre" class="txt"></td>
|
|
<td> </td>
|
|
<td><a href="javascript:buscar()" class="enlace" name="buscar"><%=pertamensaje.obtenerMensaje(24).getMensaje() %></a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<input type="hidden" name="pagina" value="<%=intPagina%>">
|
|
<input type="hidden" name="listaElementos" value="">
|
|
<input type="hidden" name="listaCodigoElementos" value="">
|
|
<input type="hidden" name="justificacionPrescripcion">
|
|
<input type="hidden" name="seleccionGrupo">
|
|
<input type="hidden" name="vienedegrupo" value="<%=vieneDeGrupo%>">
|
|
<input type="hidden" name="grp" value="">
|
|
<input type="hidden" name="nombreTextBox" value="<%=strTextBox%>">
|
|
</tr>
|
|
<%
|
|
Paciente pac = (Paciente)sesion.getAttribute("PACIENTE");
|
|
long intColectivonew = ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getColectivo();
|
|
double dblPolizanew = ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getPoliza();
|
|
int intContratonew = ((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getContrato();
|
|
int tarifa = ((Usuario)sesion.getAttribute("USUARIO")).getTarifa();
|
|
int medico = ((Usuario)sesion.getAttribute("USUARIO")).getMedico();
|
|
int perfil_med = Integer.parseInt((String)sesion.getAttribute("PERFIL"));
|
|
int visibilidad = 0;
|
|
/*
|
|
# Definición de pérfiles
|
|
PERFIL.ADMINISTRADOR = 0
|
|
PERFIL.ANALISTA1 = 4
|
|
PERFIL.ANALISTA2 = 17
|
|
PERFIL.CABECERA = 1
|
|
PERFIL.PODOLOGIA = 53
|
|
PERFIL.REHABILITACION = 37
|
|
PERFIL.ATS = 50
|
|
PERFIL.DENTISTA = 19
|
|
|
|
Esta visibilidad se asigna a una especialidad o perfil del médico. Es con la que se compara la visibilidad de los actos.
|
|
Si la visibilidad es 1, los actos saldrán o no saldrán y lo harán con sus justificaciones, según se indique en las tablas TANIVEL_ACTO Y TANIVEL ESPECIALIDAD
|
|
Si la visibilidad es 2, los actos saldrán o no saldrán pero lo harán siempre sin pedir justificación
|
|
*/
|
|
if(perfil_med == 0)
|
|
visibilidad = 4;
|
|
/*else if(perfil_med == 1)
|
|
visibilidad = 2;*/
|
|
else
|
|
visibilidad = 1;
|
|
|
|
PersistenciaTtactmed per = new PersistenciaTtactmed();
|
|
Vector vSeleccion_Validos = null;
|
|
Vector vSeleccion_Con_Justificacion = null;
|
|
if(pac.getDesplazado() == null)
|
|
pac.setDesplazado(((Paciente)sesion.getAttribute("PACIENTE")).getTarjeta().getEntidadChipcard());
|
|
|
|
if(pac.getDesplazado().compareTo(ParametrosConfiguracion.bin_chipcard_propios) == 0)
|
|
{
|
|
//vSeleccion_Validos= per.obtenerAnalisisNiveles(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico); //Apuntando a desa contra TTACTMED
|
|
//vSeleccion_Validos= per.obtenerAnalisisNivelesTTACTMED_NUEVO(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico); //Apuntando a real contra TTACTMED_NUEVO
|
|
vSeleccion_Validos= per.obtenerAnalisisNivelesTTACTMED_GPC(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico); //Apuntando a real contra TTACTMED y TTACTMED_GPC
|
|
if (vieneDeGrupo==1)
|
|
vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesJustificacionTTACTMED_GPC(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico);
|
|
//vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesJustificacion(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico);
|
|
//vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesJustificacionTTACTMED_NUEVO(0, intContratonew, intColectivonew, dblPolizanew, "%", tarifa, medico);
|
|
|
|
}
|
|
else
|
|
{
|
|
LogTarisan.logger.log(NivelLog.DEBUG, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Obtener todos los actos, es desplazado");
|
|
//vSeleccion_Validos= per.obtenerAnalisisNivelesDesplazados(0, "%", medico);
|
|
//vSeleccion_Validos= per.obtenerAnalisisNivelesDesplazadosTTACTMED_NUEVO(0, "%", medico);
|
|
vSeleccion_Validos= per.obtenerAnalisisNivelesDesplazadosTTACTMED_GPC(0, "%", medico);
|
|
if (vieneDeGrupo==1)
|
|
vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesDesplazadosJustificacionTTACTMED_GPC(0, "%", medico);
|
|
//vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesDesplazadosJustificacion(0, "%", medico);
|
|
//vSeleccion_Con_Justificacion= per.obtenerAnalisisNivelesDesplazadosJustificacionTTACTMED_NUEVO(0, "%", medico);
|
|
|
|
}
|
|
|
|
if(vSeleccion_Validos.size()>0 && !boolActosValidosCargados)
|
|
{
|
|
Ttactmed ttactmed2=null;
|
|
for(int j=0;j<vSeleccion_Validos.size(); j++)
|
|
{
|
|
ttactmed2 = (Ttactmed)vSeleccion_Validos.elementAt(j);
|
|
|
|
%>
|
|
<!-- Para cargar en un string todos los actos autorizados a este paciente -->
|
|
<script language="javascript" type="text/javascript">
|
|
<!--
|
|
|
|
stringActosValidos += "¬"+<%=ttactmed2.getActo() %>;
|
|
//-->
|
|
</script>
|
|
<%
|
|
}
|
|
}
|
|
if (vieneDeGrupo==1){
|
|
vieneDeGrupo=0;
|
|
if(vSeleccion_Con_Justificacion.size()>0)
|
|
{
|
|
Ttactmed ttactmed2=null;
|
|
for(int j=0;j<vSeleccion_Con_Justificacion.size(); j++)
|
|
{
|
|
ttactmed2 = (Ttactmed)vSeleccion_Con_Justificacion.elementAt(j);
|
|
|
|
%>
|
|
<!-- Para cargar en un string todos los actos que necesiten justificacino para este paciente -->
|
|
<script language="javascript" type="text/javascript">
|
|
<!--
|
|
|
|
stringActosJustificacion += "¬"+<%=ttactmed2.getActo() %>;
|
|
//-->
|
|
</script>
|
|
<%
|
|
}
|
|
}
|
|
}
|
|
Vector vSeleccion = null;
|
|
if(pac.getDesplazado().compareTo(ParametrosConfiguracion.bin_chipcard_propios) == 0)
|
|
{
|
|
//vSeleccion= per.obtenerAnalisisNiveles(intPagina, intContratonew, intColectivonew, dblPolizanew, strCampoNombre, tarifa, medico);
|
|
//vSeleccion= per.obtenerAnalisisNivelesTTACTMED_NUEVO(intPagina, intContratonew, intColectivonew, dblPolizanew, strCampoNombre, tarifa, medico);
|
|
vSeleccion= per.obtenerAnalisisNivelesTTACTMED_GPC(intPagina, intContratonew, intColectivonew, dblPolizanew, strCampoNombre, tarifa, medico);
|
|
}
|
|
else
|
|
{
|
|
LogTarisan.logger.log(NivelLog.DEBUG, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Obtener todos los actos, es desplazado");
|
|
//vSeleccion= per.obtenerAnalisisNivelesDesplazados(intPagina, strCampoNombre, medico);
|
|
//vSeleccion= per.obtenerAnalisisNivelesDesplazadosTTACTMED_NUEVO(intPagina, strCampoNombre, medico);
|
|
vSeleccion= per.obtenerAnalisisNivelesDesplazadosTTACTMED_GPC(intPagina, strCampoNombre, medico);
|
|
}
|
|
|
|
if (vSeleccion.size()==0) //No se han encontrado datos
|
|
{
|
|
%>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="center"><span class="txt"><% tamensaje = pertamensaje.obtenerMensaje(10); %><%=tamensaje.getMensaje() %></span></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
if (intPagina != 0){ //se tiene en cuenta la paginacion
|
|
%>
|
|
<tr>
|
|
<td colspan="2" align="right"><span class="txt">Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%></span></td>
|
|
</tr>
|
|
<%
|
|
}
|
|
%>
|
|
<!-- Para saber cuantas checkbox tenemos en la pagina y poder hacer la anulacion de las selecciones -->
|
|
<script language="javascript" type="text/javascript">
|
|
<!--
|
|
intNumeroCheckBoxes = <%=vSeleccion.size()%>
|
|
//-->
|
|
</script>
|
|
<tr>
|
|
<td width="1%"></td>
|
|
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Descripción - Justificación</td>
|
|
</tr>
|
|
|
|
<%
|
|
Ttactmed ttactmed = null;
|
|
tamensaje = pertamensaje.obtenerMensaje(1);
|
|
String estilo = "";
|
|
String strDescripcionSinComilla="";
|
|
for(i = 0; i < vSeleccion.size(); i++)
|
|
{
|
|
if (i % 2 == 0)
|
|
{
|
|
estilo = "filaA";
|
|
}
|
|
else
|
|
{
|
|
estilo = "filaB";
|
|
}
|
|
ttactmed = (Ttactmed)vSeleccion.elementAt(i);
|
|
//hacemos el tratamiento por si viene comilla simple en la descripcion
|
|
strDescripcionSinComilla = ttactmed.getDescripcion().replace('\'', '~');
|
|
%>
|
|
<tr class="trResultados">
|
|
<%
|
|
if (strListaCodigoElementos.indexOf("¬" + ttactmed.getActo() + "¬")!=-1)
|
|
{
|
|
%>
|
|
<td><input type="checkbox" name="checkbox<%=i%>" value='<%=strDescripcionSinComilla%>' checked="checked" onclick="javascript:tratarCheckBox(this, <%=ttactmed.getActo()%>, 'justificacion_<%=ttactmed.getActo()%>', <%=(ttactmed.getVisibilidad()<=visibilidad)?"false":"true" %>)"></td>
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
%>
|
|
<td><input type="checkbox" name="checkbox<%=i%>" value='<%=strDescripcionSinComilla%>' onclick="javascript:tratarCheckBox(this, <%=ttactmed.getActo()%>, 'justificacion_<%=ttactmed.getActo() %>', <%=(ttactmed.getVisibilidad()<=visibilidad)?"false":"true" %>)"></td>
|
|
<%
|
|
}
|
|
%>
|
|
<td class="<%=estilo%>" align="center">
|
|
<table style="margin:auto;width:100%">
|
|
<tr >
|
|
<td align="left" class="<%=estilo%>"><%=ttactmed.getDescripcion()%></td>
|
|
<td align="right"><input <%=(ttactmed.getVisibilidad()<=visibilidad)?"disabled=\"disabled\" value='"+tamensaje.getMensaje()+"' style='background-color:rgb(235, 235, 228);'":" value=''" %> type="text" id="justificacion_<%=ttactmed.getActo() %>" name="justificacion_<%=ttactmed.getActo() %>"/></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
}
|
|
if (strTextBox!="")//Controlar si hay que poner el focus en algun textbox
|
|
{
|
|
%>
|
|
<script language="javascript" type="text/javascript">
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "#FFAAAA"; }, 500);
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "white"; }, 1000);
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "#FFAAAA"; }, 1500);
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "white"; }, 2000);
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "#FFAAAA"; }, 2500);
|
|
setTimeout(function(){ document.frmAnalitica.<%=strTextBox%>.style.backgroundColor = "white"; }, 3000);
|
|
document.frmAnalitica.<%=strTextBox%>.focus();
|
|
document.frmAnalitica.nombreTextBox.value="";
|
|
</script>
|
|
<%
|
|
strTextBox="";
|
|
intScroll=1;
|
|
} %>
|
|
<%
|
|
if (intScroll==1){
|
|
%>
|
|
<script>
|
|
//document.location.href = "#hacer_scroll";
|
|
//window.location.hash = "#hacer_scroll";
|
|
window.location.href = "#hacer_scroll";
|
|
</script>
|
|
<%
|
|
intScroll=0;
|
|
}
|
|
%>
|
|
</form>
|
|
<% if (intPagina!=0){ //se tiene en cuenta la paginacion
|
|
%>
|
|
<tr><td colspan="2"></td></tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<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>
|
|
<a name="hacer_scroll"></a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="popup" style="display:none">
|
|
<div class="content-popup">
|
|
<div class="close"><a href="#" id="close"><img src="../../img/close4.png"></a></div>
|
|
<div>
|
|
<h2>¡Atención!</h2>
|
|
<p id="textoPopUp"></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="popupJustifi" style="display:none">
|
|
<div class="content-popup">
|
|
<div class="close"><a href="#" id="closeJustifiPopup"><img src="../../img/close4.png"></a></div>
|
|
<div>
|
|
<h2>¡Atención!</h2>
|
|
<p id="textoPopUpJustifi"></p>
|
|
<p id="cajaPopUpJustifi"><input type="text" value="" id="campoJustifiPopup" name="campoJustifiPopup"/></p>
|
|
<p id="btnAceptarJustifi"><a href="#" id="popupAceptar" name="popupAceptar" class="enlacePeticion">Aceptar</a></p>
|
|
<p id="btnAceptarJustifi2"><input type="button" id="popupAceptar2" name="popupAceptar2" value="Aceptar2"></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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(ExcepcionTarisan ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - ExcepcionTarisan: " + ex.getMensaje());
|
|
sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario.");
|
|
response.sendRedirect(request.getContextPath() + "/jsp/error.jsp");
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Exception: " + ex);
|
|
sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario.");
|
|
response.sendRedirect(request.getContextPath() + "/jsp/error.jsp");
|
|
}
|
|
LogTarisan.logger.log(NivelLog.INFO, ((Usuario)sesion.getAttribute("USUARIO")).getMedico() + " - Final página de solicitud de analiticas con niveles(pac/solicitudAnaliticaNiveles.jsp)");
|
|
}
|
|
%>
|