|
- Nro. Ident. Adicional/Parentesco: |
+ Nro. Ident. Adicional:
-
+
<%----%>
diff --git a/WebLab/Protocolos/Default2.aspx.cs b/WebLab/Protocolos/Default2.aspx.cs
index eaa84152..5eef41f4 100644
--- a/WebLab/Protocolos/Default2.aspx.cs
+++ b/WebLab/Protocolos/Default2.aspx.cs
@@ -363,14 +363,14 @@ private void CargarGrillaAmpliada()
}
private void CargarGrilla ()
{
- string m_sexo = "F";
- if (ddlSexo.SelectedValue == "2")
- m_sexo = "F";
+ string m_sexo = ""; lblMensajeSexo.Visible = false; lblMensaje.Visible = false;
+ //if (ddlSexo.SelectedValue == "2")
+ // m_sexo = "F";
- if (ddlSexo.SelectedValue == "3")
- m_sexo = "M";
- if (ddlSexo.SelectedValue == "4")
- m_sexo = "X";
+ //if (ddlSexo.SelectedValue == "3")
+ // m_sexo = "M";
+ //if (ddlSexo.SelectedValue == "4")
+ // m_sexo = "X";
@@ -382,11 +382,22 @@ private void CargarGrilla ()
if (gvLista.Rows.Count == 0)
{
- lblMensaje.Visible = false;
-
-
- Response.Redirect("ProcesaRenaper.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
+ if (ddlSexo.SelectedValue != "0") // se debe seleccionar el sexo para generar un paciente nuevo
+ {
+ m_sexo = obtenerSexo();
+ lblMensaje.Visible = false;
+ if (Request["Operacion"] != "Modifica")
+ Response.Redirect("ProcesaRenaper.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
+ else
+ Response.Redirect("ProcesaRenaper.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString() + "&Operacion=" + Request["Operacion"].ToString() + "&idProtocolo=" + Request["idProtocolo"].ToString() + "&Desde=" + Request["Desde"].ToString());
+ }
+ else
+ {
+ lblMensajeSexo.Text = "Debe ingresar un sexo para generar un paciente nuevo";
+ lblMensajeSexo.Visible = true;
+ lblMensaje.Visible = false;
+ }
}
else
@@ -396,31 +407,53 @@ private void CargarGrilla ()
if ((ddlTipo.SelectedValue == "T"))
{ //temporal
+
+
if ((txtDni.Value != "") || (txtNumeroAdicional.Text != ""))
{
gvLista.DataSource = LeerDatos();
gvLista.DataBind();
-
-
if (gvLista.Rows.Count == 0)
{
- lblMensaje.Visible = false;
-
-
- Response.Redirect("ProcesaRenaperT.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
-
+ if (ddlSexo.SelectedValue != "0") // se debe seleccionar el sexo para generar un paciente nuevo
+ {
+ m_sexo = obtenerSexo();
+ lblMensaje.Visible = false;
+ if (Request["Operacion"] != "Modifica")
+ Response.Redirect("ProcesaRenaperT.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
+ else
+ Response.Redirect("ProcesaRenaperT.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString() + "&Operacion=" + Request["Operacion"].ToString() + "&idProtocolo=" + Request["idProtocolo"].ToString() + "&Desde=" + Request["Desde"].ToString());
+ }
+ else
+ {
+ lblMensajeSexo.Text = "Debe ingresar un sexo para generar un paciente nuevo";
+ lblMensajeSexo.Visible = true;
+ lblMensaje.Visible = false;
+ }
}
else
lblMensaje.Visible = true;
}
else
+ {
+ if (ddlSexo.SelectedValue != "0") // se debe seleccionar el sexo para generar un paciente nuevo
+ {
+ m_sexo = obtenerSexo();
- Response.Redirect("ProcesaRenaperT.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
- }
+
+ Response.Redirect("ProcesaRenaperT.aspx?Tipo=" + ddlTipo.SelectedValue + "&dni=" + txtDni.Value + "&sexo=" + m_sexo + "&llamada=LaboProtocolo&idServicio=" + Request["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString());
+ }
+ else
+ {
+ lblMensajeSexo.Text = "Debe ingresar un sexo para generar un paciente nuevo";
+ lblMensajeSexo.Visible = true;
+ }
+ }
+ }
@@ -437,6 +470,17 @@ private void CargarGrilla ()
}
+ private string obtenerSexo()
+ {
+ string m_sexo="";
+ if (ddlSexo.SelectedValue == "2")
+ m_sexo = "F";
+ if (ddlSexo.SelectedValue == "3")
+ m_sexo = "M";
+ if (ddlSexo.SelectedValue == "4")
+ m_sexo = "X";
+ return m_sexo;
+ }
private object LeerDatos()
{
@@ -457,8 +501,8 @@ private object LeerDatos()
{
str_condicion += " and Pa.idEstado in (2)"; // temporal
if (txtDni.Value != "") str_condicion += " AND (Pa.numeroDocumento = '" + txtDni.Value.Trim() + "')";
- if (txtNumeroAdicional.Text != "") str_condicion +=" and (Pa.numeroAdic like '%" + txtNumeroAdicional.Text.Trim() + @"%'
- or Pa.idPaciente in (select idPaciente from sys_parentesco with (nolock) where numeroDocumento=" + txtNumeroAdicional.Text.Trim()+"))";
+ if (txtNumeroAdicional.Text != "") str_condicion += " and (Pa.numeroAdic like '%" + txtNumeroAdicional.Text.Trim() + @"%')";
+ ///or Pa.idPaciente in (select idPaciente from sys_parentesco with (nolock) where numeroDocumento=" + txtNumeroAdicional.Text.Trim()+"))"; // es incorrecto porque el campo numerodocumento es int y no graba txtNumeroAdicional en sys_parentesco
}
m_strSQL = " SELECT top 10 Pa.idPaciente, case when Pa.idestado=2 then convert(varchar,Pa.numeroAdic) + '-T' else convert(varchar,Pa.numeroDocumento) end as dni,Pa.apellido+ ' ' + Pa.nombre as paciente, convert(varchar(10),Pa.fechaNacimiento,103) as fechaNacimiento, " +
diff --git a/WebLab/Protocolos/Default2.aspx.designer.cs b/WebLab/Protocolos/Default2.aspx.designer.cs
index e435235d..fcd53793 100644
--- a/WebLab/Protocolos/Default2.aspx.designer.cs
+++ b/WebLab/Protocolos/Default2.aspx.designer.cs
@@ -121,22 +121,22 @@ public partial class Default2 {
protected global::System.Web.UI.WebControls.CompareValidator cvDni;
///
- /// rvSexo control.
+ /// ddlSexo control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.RangeValidator rvSexo;
+ protected global::System.Web.UI.WebControls.DropDownList ddlSexo;
///
- /// ddlSexo control.
+ /// lblMensajeSexo control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.DropDownList ddlSexo;
+ protected global::System.Web.UI.WebControls.Label lblMensajeSexo;
///
/// txtNumeroAdicional control.
diff --git a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx
index d7bfeb93..c3bf7499 100644
--- a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx
+++ b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx
@@ -11,12 +11,12 @@
var txtNumeroLote = document.getElementById('<%= txtNumeroLote.ClientID %>');
//console.log(txtNumeroLote);
var num = txtNumeroLote.value;
- //console.log(num);
+ //console.log(num);
num = num.replace(/\D/g, '');
//console.log(num);
$("#<%=txtNumeroLote.ClientID%>").val(num);
}
-
+
@@ -50,9 +50,10 @@
|
@@ -93,20 +94,14 @@
|
diff --git a/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs b/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs
index 31b87abd..b2d09505 100644
--- a/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs
+++ b/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs
@@ -38,7 +38,7 @@ protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
- VerificaPermisos("Derivacion");
+ VerificaPermisos("Derivacion por Lotes");
CargarEncabezado();
}
}
@@ -70,15 +70,12 @@ private void CargarEncabezado()
private void CargarFechaHoraActual()
{
DateTime miFecha = DateTime.UtcNow.AddHours(-3); //Hora estándar de Argentina (UTC-03:00)
- //txt_Fecha.Value = miFecha.Date.ToString("yyyy-MM-dd");
txtHora.Value = miFecha.ToString("HH:mm");
txtFecha.Text = miFecha.Date.ToString("yyyy-MM-dd");
-
//LAB-74 Control de fecha: La fecha de ingreso del lote no puede ser anterior a la fecha de envio del lote
- rvFecha.MinimumValue = hidFechaEnvio.Value;
- rvFecha.MaximumValue = txtFecha.Text; //Fecha Date today
- rvFecha.Text = "La fecha de recepcion no puede ser menor a la fecha de envio " + hidFechaEnvio.Value;
-
+ //rvFecha.MinimumValue = hidFechaEnvio.Value;
+ //rvFecha.MaximumValue = txtFecha.Text; //Fecha Date today
+ //rvFecha.Text = "La fecha de recepcion no puede ser menor a la fecha de envio " + hidFechaEnvio.Value;
}
private void VerificaPermisos(string sObjeto)
@@ -112,16 +109,20 @@ private void VerificaPermisos(string sObjeto)
protected void btn_recibirLote_Click(object sender, EventArgs e)
{
- //Cambiar estado al lote
- LoteDerivacion lote = new LoteDerivacion();
- lote = (LoteDerivacion)lote.Get(typeof(LoteDerivacion), Convert.ToInt32(Request["idLote"]));
- lote.Estado = 4;
- lote.IdUsuarioRecepcion = oUser.IdUsuario;
- lote.Save();
-
- //Generar Auditorias
- GenerarAuditorias(lote);
- btn_volver_Click(null, null);
+ if (Page.IsValid)
+ {
+ //Cambiar estado al lote
+ LoteDerivacion lote = new LoteDerivacion();
+ lote = (LoteDerivacion)lote.Get(typeof(LoteDerivacion), Convert.ToInt32(Request["idLote"]));
+ lote.Estado = 4;
+ lote.IdUsuarioRecepcion = oUser.IdUsuario;
+ lote.Save();
+
+ //Generar Auditorias
+ GenerarAuditorias(lote);
+ btn_volver_Click(null, null);
+ }
+
}
private void GenerarAuditorias(LoteDerivacion lote)
@@ -157,5 +158,34 @@ protected void btn_volver_Click(object sender, EventArgs e)
{
Response.Redirect("DerivacionMultiEfectorLote.aspx?idServicio=" + Request["idServicio"] + "&idLote=" + Request["idLote"], false);
}
+
+ protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args)
+ {
+
+ string error = "";
+
+ if (string.IsNullOrEmpty(txtFecha.Text ))
+ {
+ args.IsValid = false;
+ error = "*Error en Fecha";
+ }
+
+ if (string.IsNullOrEmpty(txtHora.Value))
+ {
+ args.IsValid = false;
+ error = "*Error en Hora";
+ }
+
+ /* Por ahora no restringimos la fecha porque ellos si se equivocan no pueden editar la derivacion enviada*/
+ //if (DateTime.Parse(txtFecha.Text) < DateTime.Parse(hidFechaEnvio.Value))
+ //{
+ // error = "La fecha de recepcion no puede ser menor a la fecha de envio " + DateTime.Parse(hidFechaEnvio.Value).ToString("dd/MM/yyyy");
+ // args.IsValid = false;
+ //}
+
+
+
+ this.cvValidacionInput.ErrorMessage = error ;
+ }
}
}
\ No newline at end of file
diff --git a/WebLab/Protocolos/DerivacionRecibirLote.aspx.designer.cs b/WebLab/Protocolos/DerivacionRecibirLote.aspx.designer.cs
index 0705dca8..15e2ad4f 100644
--- a/WebLab/Protocolos/DerivacionRecibirLote.aspx.designer.cs
+++ b/WebLab/Protocolos/DerivacionRecibirLote.aspx.designer.cs
@@ -105,40 +105,22 @@ public partial class DerivacionRecibirLote
protected global::System.Web.UI.HtmlControls.HtmlInputGenericControl txtHora;
///
- /// rfvFecha control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvFecha;
-
- ///
- /// rfvHora control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvHora;
-
- ///
- /// rvFecha control.
+ /// txtObs control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.RangeValidator rvFecha;
+ protected global::System.Web.UI.HtmlControls.HtmlTextArea txtObs;
///
- /// txtObs control.
+ /// cvValidacionInput control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.HtmlControls.HtmlTextArea txtObs;
+ protected global::System.Web.UI.WebControls.CustomValidator cvValidacionInput;
///
/// btnRecibirLote control.
diff --git a/WebLab/Protocolos/MedicoSel.aspx b/WebLab/Protocolos/MedicoSel.aspx
index 5d059d71..006ec74b 100644
--- a/WebLab/Protocolos/MedicoSel.aspx
+++ b/WebLab/Protocolos/MedicoSel.aspx
@@ -37,19 +37,21 @@
-
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/WebLab/Protocolos/MedicoSel.aspx.cs b/WebLab/Protocolos/MedicoSel.aspx.cs
index 606e18c4..ddaeb4d6 100644
--- a/WebLab/Protocolos/MedicoSel.aspx.cs
+++ b/WebLab/Protocolos/MedicoSel.aspx.cs
@@ -1,5 +1,6 @@
using Business.Data;
using Business.Data.Laboratorio;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
@@ -19,19 +20,20 @@ public partial class MedicoSel : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
- if (!Page.IsPostBack)
- {
-
+ if (!Page.IsPostBack)
+ {
+ Session["matricula"] = null;
+ Session["apellidoNombre"] = null;
}
-
}
-
+
protected void btnBuscar_Click(object sender, EventArgs e)
{
try
{
+ lblErrorAPI.Text = "";
Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);
///Buscar especilista
@@ -39,32 +41,29 @@ protected void btnBuscar_Click(object sender, EventArgs e)
string nombre = txtNombre.Text;
string s_urlWFC = oCon.UrlMatriculacion;
string s_url = s_urlWFC + "nombre=" + nombre + "&apellido=" + apellido;// + "&codigoProfesion=1Â ";
+ System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(s_url);
HttpWebResponse ws1 = (HttpWebResponse)request.GetResponse();
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
-
+
Stream st = ws1.GetResponseStream();
StreamReader sr = new StreamReader(st);
string s = sr.ReadToEnd();
if (s != "0")
{
-
- //List pro = jsonSerializer.Deserialize>(s);
-
- DataTable t = GetJSONToDataTableUsingMethod(s);
+ DataTable t = GetDataTableMatriculaciones(s); //GetJSONToDataTableUsingMethod(s);
gvMedico.DataSource = t;
gvMedico.DataBind();
-
-
}
}
catch (Exception ex)
{
-
+ lblErrorAPI.Visible = true;
+ lblErrorAPI.Text = "Ha ocurrido un error: " + ex.Message.ToString() + ". Comuniquese con el administrador.";
}
-
+
}
public static DataTable GetJSONToDataTableUsingMethod(string JSONData)
@@ -119,13 +118,41 @@ public static DataTable GetJSONToDataTableUsingMethod(string JSONData)
}
return dtUsingMethodReturn;
}
+
+ private static DataTable GetDataTableMatriculaciones(string json)
+ {
+ //Pasa de JSON al tipo de objeto ProfesionalMatriculado
+ List personas = JsonConvert.DeserializeObject>(json);
+ DataTable dt = new DataTable();
+
+ if (personas.Count > 0)
+ {
+ //Guardo solo en la tabla aquellos datos que necesito
+ dt.Columns.Add("nombre");
+ dt.Columns.Add("apellido");
+ dt.Columns.Add("titulo");
+ dt.Columns.Add("matriculaNumero");
+
+ foreach (Protocolos.ProtocoloEdit2.ProfesionalMatriculado persona in personas)
+ {
+ foreach (Protocolos.ProtocoloEdit2.Profesiones prof in persona.profesiones)
+ {
+ foreach (Protocolos.ProtocoloEdit2.Matricula mat in prof.matriculacion)
+ {
+ if (DateTime.Compare(mat.fin, DateTime.Now) > 0) //Solo agrega las matriculas no vencidas
+ {
+ dt.Rows.Add(persona.nombre, persona.apellido, prof.titulo, mat.matriculaNumero);
+ }
+ }
+ }
+ }
+ }
+ return dt;
+ }
protected void gvMedico_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.Cells.Count > 1)
{
-
-
-
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton CmdModificar = (LinkButton)e.Row.Cells[3].Controls[1];
@@ -133,23 +160,27 @@ protected void gvMedico_RowDataBound(object sender, GridViewRowEventArgs e)
CmdModificar.CommandName = "Seleccionar";
CmdModificar.ToolTip = "Seleccionar";
+ // Valor adicional (Nombre y apellido)
+ DataRow rowData = ((DataRowView)e.Row.DataItem).Row;
+ CmdModificar.Attributes["nombre"] = rowData.ItemArray[0].ToString();
+ CmdModificar.Attributes["apellido"] = rowData.ItemArray[1].ToString();
}
-
-
}
}
protected void gvMedico_RowCommand(object sender, GridViewCommandEventArgs e)
{
- if (e.CommandName== "Seleccionar")
+ if (e.CommandName == "Seleccionar")
{
-
- Session["matricula"] = e.CommandArgument.ToString();
-
-
-
+ Session["matricula"] = e.CommandArgument.ToString();
+ LinkButton boton = (LinkButton)e.CommandSource;
+ Session["apellidoNombre"] = boton.Attributes["apellido"] + " " + boton.Attributes["nombre"];
}
+
}
+
+
+
}
}
\ No newline at end of file
diff --git a/WebLab/Protocolos/MedicoSel.aspx.designer.cs b/WebLab/Protocolos/MedicoSel.aspx.designer.cs
index a48b0927..a609d583 100644
--- a/WebLab/Protocolos/MedicoSel.aspx.designer.cs
+++ b/WebLab/Protocolos/MedicoSel.aspx.designer.cs
@@ -7,11 +7,13 @@
//
//------------------------------------------------------------------------------
-namespace WebLab.Protocolos {
-
-
- public partial class MedicoSel {
-
+namespace WebLab.Protocolos
+{
+
+
+ public partial class MedicoSel
+ {
+
///
/// form1 control.
///
@@ -20,7 +22,7 @@ public partial class MedicoSel {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
-
+
///
/// txtApellido control.
///
@@ -29,7 +31,7 @@ public partial class MedicoSel {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.TextBox txtApellido;
-
+
///
/// txtNombre control.
///
@@ -38,7 +40,7 @@ public partial class MedicoSel {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.TextBox txtNombre;
-
+
///
/// btnBuscar control.
///
@@ -47,7 +49,16 @@ public partial class MedicoSel {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Button btnBuscar;
-
+
+ ///
+ /// lblErrorAPI control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblErrorAPI;
+
///
/// gvMedico control.
///
diff --git a/WebLab/Protocolos/ProcesaRenaper.aspx.cs b/WebLab/Protocolos/ProcesaRenaper.aspx.cs
index ca2083d8..b9031bc8 100644
--- a/WebLab/Protocolos/ProcesaRenaper.aspx.cs
+++ b/WebLab/Protocolos/ProcesaRenaper.aspx.cs
@@ -12,7 +12,7 @@
using System.Web.Script.Serialization;
using Business.Data;
using NHibernate;
-using Business.Data.Laboratorio;
+using Business.Data.Laboratorio;
using NHibernate.Expression;
using System.Collections;
using System.Data;
@@ -24,6 +24,7 @@
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
+using Newtonsoft.Json;
namespace WebLab.Protocolos
{
@@ -280,7 +281,8 @@ protected void Page_Load(object sender, EventArgs e)
if (!conOK)// si no funcionó la conexion con renaper se fija se está activado MPI
if (oCon.ConectaMPI)
{
- conOK = SolicitarServicioMPI();
+ // conOK = SolicitarServicioMPI();
+ conOK = ConectarMPIXRoad();
if (!conOK)
HabilitaCargaManual();
}
@@ -289,7 +291,8 @@ protected void Page_Load(object sender, EventArgs e)
{
if (oCon.ConectaMPI)
{
- conOK = SolicitarServicioMPI();
+ conOK = ConectarMPIXRoad();
+ ///conOK = SolicitarServicioMPI();
if (!conOK)
HabilitaCargaManual();
}
@@ -767,6 +770,158 @@ private bool SolicitarServicio()
return ok;
}
+ private bool ConectarMPIXRoad()
+ {
+ bool ok = false;
+ try
+ {
+ string tipo = "MPI";
+ imgAndes.Visible = false;
+ imgRenaper.Visible = false; lblFechaDomicilio.Visible = false;
+ GrabarLogAcceso(tipo, Request["dni"].ToString());
+
+ long nrodocumento = long.Parse(Request["dni"].ToString());
+ // string sexo = Request["sexo"].ToString();
+
+ string rutaCert = ConfigurationManager.AppSettings["RutaCert"].ToString();
+ string BaseUrl = "https://xroadss.andes.gob.ar/r1/OPTIC/GOB/GOB00008/GP-SALUD/MPI";///ConfigurationManager.AppSettings["BaseUrlXroad"].ToString();
+ string Serv = "?identifier=http://www.renaper.gob.ar;";// GP-RENAPER/WS_RENAPER_DOCUMENTO/";
+ string clie = "OPTIC/GOB/GOB00008/GP-SALUD";//ConfigurationManager.AppSettings["ClienteXroad"].ToString();//"OPTIC/GOB/GOB00008/GP-SALUD/MPI";//
+ string param = nrodocumento.ToString(); ///+ "/" + sexo.ToUpper();
+ string host = BaseUrl + Serv + param;
+
+ ServicePointManager.Expect100Continue = true;
+ ServicePointManager.ServerCertificateValidationCallback = (snder, cert, chain, error) => true;
+ // ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(host);
+
+ //certificado
+ X509Certificate certificate = new X509Certificate(rutaCert, "", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.MachineKeySet
+ | X509KeyStorageFlags.PersistKeySet);
+
+ req.ClientCertificates = new X509CertificateCollection() { certificate };
+ req.ContentType = "application/json";
+ req.AllowAutoRedirect = true;
+ req.Timeout = 10 * 1000;
+ req.Method = "GET";
+ req.Headers.Add("X-Road-Client", clie);
+
+
+
+
+ using (WebResponse response = req.GetResponse())
+ {
+ JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
+
+ using (Stream strReader = response.GetResponseStream())
+ {
+
+ using (StreamReader objReader = new StreamReader(strReader))
+ {
+
+ string responseBody = objReader.ReadToEnd();
+
+ var lista = JsonConvert.DeserializeObject>(responseBody);
+ var resultado2 = lista?.FirstOrDefault();
+
+ if (resultado2 != null)
+ {
+ lblValidador.Visible = true;
+ lblValidador.Text = "Paciente VALIDADO POR " + tipo;
+ ok = true;
+
+ txtDNI.Text = Request["dni"]?.ToString();
+
+ // Nombre y apellido
+ var nombreData = resultado2.Name?.FirstOrDefault();
+ txtApellido.Text = nombreData?.Family?.FirstOrDefault()?.ToUpper() ?? "";
+ txtNombre.Text = string.Join(" ", nombreData?.Given ?? new List()).ToUpper();
+
+ // Fecha nacimiento
+ txtFechaNacimiento.Value = resultado2.BirthDate.ToString("dd/MM/yyyy");
+
+ // Domicilio (toma el primero)
+ var direccion = resultado2.Address?.FirstOrDefault();
+
+ txtCalle.Value = direccion?.Line?.FirstOrDefault() ?? "SIN DATOS";
+ txtCiudad.Value = string.IsNullOrEmpty(direccion?.City) ? "SIN DATOS" : direccion.City;
+ txtProvincia.Value = string.IsNullOrEmpty(direccion?.State) ? "SIN DATOS" : direccion.State;
+ txtPais.Value = string.IsNullOrEmpty(direccion?.Country) ? "SIN DATOS" : direccion.Country;
+ txtCodigoPostal.Value = string.IsNullOrEmpty(direccion?.PostalCode) ? "SIN DATOS" : direccion.PostalCode;
+
+ // CUIL
+ txtCuil.Value = resultado2.Identifier?
+ .FirstOrDefault(x => x.System.Contains("cuil"))?.Value ?? "";
+
+ // Campos que ya no existen en este JSON
+ txtBarrio.Value = "SIN DATOS";
+ fallecimiento.Text = "";
+ fechaDomicilio.Text = "";
+
+ txtTelefono.Value = resultado2.Telecom?
+ .Where(x => x.System == "phone")
+ .OrderBy(x => x.Rank)
+ .FirstOrDefault()
+ ?.Value ?? "SIN DATOS";
+
+ var sexo = resultado2.Gender?.ToLower();
+
+ if (sexo == "female")
+ {
+ txtSexo.Value = "FEMENINO";
+ ddlSexo.SelectedValue = "2";
+ }
+ else if (sexo == "male")
+ {
+ txtSexo.Value = "MASCULINO";
+ ddlSexo.SelectedValue = "3";
+ }
+ else if (sexo == "other")
+ {
+ txtSexo.Value = "X";
+ ddlSexo.SelectedValue = "0";
+ }
+ else
+ {
+ txtSexo.Value = "SIN DATOS";
+ ddlSexo.SelectedValue = "0";
+ }
+ /// traer al paciente si no es nuevo, es modificacion
+ int id = Convert.ToInt32(Request.QueryString["id"]);
+ //datos del Paciente
+ Paciente pac = new Paciente();
+ if (id != 0) pac = (Paciente)pac.Get(typeof(Paciente), id);
+ txtTelefono.Value = pac.InformacionContacto;
+
+
+ }
+ else
+ ok = false;
+
+
+
+ }
+ response.Close();
+ }
+
+ }
+
+
+ }
+ catch (WebException ex)
+ {
+ ok = false;
+ string mensaje = ex.ToString();
+
+ }
+
+
+ return ok;
+
+ }
+
public void GrabarLogAcceso(string servicio, string dni)
{
try
@@ -792,6 +947,83 @@ INSERT INTO LAB_LogAccesoServicio
{ }
}
+ public class ResultadoMPIModel
+ {
+ [JsonProperty("resourceType")]
+ public string ResourceType { get; set; }
+
+ [JsonProperty("identifier")]
+ public List Identifier { get; set; }
+
+ [JsonProperty("active")]
+ public bool Active { get; set; }
+
+ [JsonProperty("name")]
+ public List Name { get; set; }
+
+ [JsonProperty("telecom")]
+ public List Telecom { get; set; }
+
+ [JsonProperty("gender")]
+ public string Gender { get; set; }
+
+ [JsonProperty("birthDate")]
+ public DateTime BirthDate { get; set; }
+
+ [JsonProperty("address")]
+ public List Address { get; set; }
+ }
+ public class IdentifierRenaper
+ {
+ [JsonProperty("system")]
+ public string System { get; set; }
+
+ [JsonProperty("value")]
+ public string Value { get; set; }
+ }
+ public class NameRenaper
+ {
+ [JsonProperty("use")]
+ public string Use { get; set; }
+
+ [JsonProperty("text")]
+ public string Text { get; set; }
+
+ [JsonProperty("family")]
+ public List Family { get; set; }
+
+ [JsonProperty("given")]
+ public List Given { get; set; }
+ }
+ public class TelecomRenaper
+ {
+ [JsonProperty("system")]
+ public string System { get; set; } // phone, email
+
+ [JsonProperty("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("rank")]
+ public int Rank { get; set; }
+ }
+ public class AddressRenaper
+ {
+ [JsonProperty("line")]
+ public List Line { get; set; }
+
+ [JsonProperty("city")]
+ public string City { get; set; }
+
+ [JsonProperty("state")]
+ public string State { get; set; }
+
+ [JsonProperty("postalCode")]
+ public string PostalCode { get; set; }
+
+ [JsonProperty("country")]
+ public string Country { get; set; }
+ }
+
protected void btnConfirmar_Click(object sender, EventArgs e)
{
if (validadatos())
@@ -799,15 +1031,10 @@ protected void btnConfirmar_Click(object sender, EventArgs e)
{
if (validamail())
{
- //Configuracion oC = new Configuracion();
-
- //oC = (Configuracion)oC.Get(typeof(Configuracion), 1); // "IdEfector", oUser.IdEfector);
-
+
Utility oUtil = new Utility();
- ////instancio el usuario
- //Usuario us = new Usuario();
- //us = (Usuario)us.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+
int id = Convert.ToInt32(Request.QueryString["id"]);
//datos del Paciente
diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx b/WebLab/Protocolos/ProtocoloEdit2.aspx
index 12b331e0..d633a85c 100644
--- a/WebLab/Protocolos/ProtocoloEdit2.aspx
+++ b/WebLab/Protocolos/ProtocoloEdit2.aspx
@@ -235,6 +235,9 @@
+
+
+
Cambiar Paciente
Datos del Paciente
@@ -397,10 +400,10 @@
-
-
+
+
|
@@ -451,11 +454,11 @@
|
-
+
|
+ ToolTip="Seleccione el caracter" TabIndex="14" Width="200px" class="form-control input-sm">
|
|
@@ -493,7 +496,7 @@
-
+
-
-
- Impresora de Etiquetas:
-
-
+
@@ -644,7 +643,7 @@
Diagnósticos encontrados
+ class="form-control input-sm" Height="90px" Width="750px">
@@ -661,18 +660,11 @@
|
-
- |
- Diagnósticos del Paciente
- |
-
- |
-
- |
+ | Diagnósticos del Paciente
+ Height="90px" Width="750px" SelectionMode="Multiple">
|
@@ -690,18 +682,32 @@
+ onkeyup="mascara(this,'/',patron,true)" tabindex="1" class="form-control input-sm" title="Fecha de inicio de sintomas" />
+ onkeyup="mascara(this,'/',patron,true)" tabindex="1" class="form-control input-sm" title="Fecha de Ultimo Control" />
|
|
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
@@ -794,7 +800,13 @@
-
+
+
+
+
+
+
+
@@ -857,597 +869,728 @@
+
+
+
-
-
-
+
+
+
diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
index 9b1513ac..26e0d81c 100644
--- a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
+++ b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
@@ -141,7 +141,9 @@ protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
- {
+ {
+ Session["matricula"] = ""; //para que lo borre de la sesion al entrar a un nuevo protocolo
+ Session["apellidoNombre"] = null;
SetToken();
PreventingDoubleSubmit(btnGuardar);
if (Session["idUsuario"] != null)
@@ -178,6 +180,11 @@ protected void Page_Load(object sender, EventArgs e)
pnlNavegacion.Visible = false;
}
+
+ if(Request["idPaciente"] != null) //Cambio de paciente
+ {
+ HFModificarPaciente.Value = "Si";
+ }
}
else
@@ -249,7 +256,6 @@ protected void Page_Load(object sender, EventArgs e)
}
if (Request["Operacion"].ToString() == "AltaDerivacionMultiEfector" )
{
-
int numeroProtocolo = int.Parse(Session["numeroProtocolo"].ToString());
Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), "Numero", numeroProtocolo);
@@ -790,6 +796,9 @@ private void MuestraDatos()
oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
if (oRegistro != null)
{
+ // si es modificacion no se recuerda analisis
+ chkRecordarPractica.Visible = false;
+ //fin si es modificacion no se recuerda analisis
oRegistro.GrabarAuditoriaProtocolo("Consulta", int.Parse(Session["idUsuario"].ToString()));
if (oRegistro.IdTipoServicio.IdTipoServicio == 6)
{
@@ -1025,7 +1034,8 @@ private void MuestraDatos()
MostrarDiagnosticos(oRegistro);
-
+ //muestra enfermedad base
+ MostrarEnfermedadBase(oRegistro);
//chkRecordarConfiguracion.Checked = false;
@@ -1049,9 +1059,9 @@ private void MostrarDiagnosticos(Protocolo oRegistro)
{
string m_strSQL = @"select c.id, c.codigo + ' -' + c.nombre
-from sys_cie10 c (nolock)
-inner join LAB_ProtocoloDiagnostico pd (nolock) on c.id = pd.idDiagnostico
-where pd.idProtocolo=" + oRegistro.IdProtocolo.ToString();
+from sys_cie10 c with (nolock)
+inner join LAB_ProtocoloDiagnostico pd with (nolock) on c.id = pd.idDiagnostico
+where pd.tipo='D' and pd.idProtocolo=" + oRegistro.IdProtocolo.ToString();
DataSet Ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
@@ -1105,12 +1115,16 @@ private void MostrarDeterminaciones(Protocolo oRegistro)
crit.AddOrder(Order.Asc("IdDetalleProtocolo"));
IList items = crit.List();
- string pivot = "";
+ string pivot = "";
string sDatos = "";
-
+ HashSet pivote = new HashSet();
+
foreach (DetalleProtocolo oDet in items)
{
- if (pivot != oDet.IdItem.Nombre)
+ //Debo cambiar la manera que verifica los repetidos, porque ahora cuando se regenera un subItem el IdDetalleProtocolo no es secuencial
+ //Y en la vista del protocolo se ve "duplicado"
+ //if (pivot != oDet.IdItem.Nombre)
+ if (pivote.Add(oDet.IdItem.Nombre)) // Si Add devuelve True es porque lo agrego porque no hay duplicados
{
/*if (sDatos == "")
sDatos = oDet.IdItem.Codigo + "#" + oDet.TrajoMuestra + "#" + oDet.ConResultado;
@@ -1143,8 +1157,40 @@ private void MostrarDeterminaciones(Protocolo oRegistro)
}
+ private void MostrarEnfermedadBase(Protocolo oRegistro)
+ {
+
+ Utility oUtil = new Utility();
+ string m_strSQL = @"select top 1 c.id, c.codigo
+from sys_cie10 c with (nolock)
+inner join LAB_ProtocoloDiagnostico pd with (nolock) on c.id = pd.idDiagnostico
+where pd.tipo='B' and pd.idProtocolo=" + oRegistro.IdProtocolo.ToString();
+
+ DataSet Ds = new DataSet();
+ SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
+ SqlDataAdapter adapter = new SqlDataAdapter();
+ adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
+ adapter.Fill(Ds);
+
+ for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
+ {
+ if (!oC.HabilitaEnfermedadBase)
+ {
+ CargarListaEnfermedadesBase();
+
+ }
+ string s_id=Ds.Tables[0].Rows[i][0].ToString();
+ string s_codigo= Ds.Tables[0].Rows[i][1].ToString();
+ ddlEnfermedadBase.SelectedValue = s_id;
+ txtCodigoEnfermedadBase.Text = s_codigo;
+ txtCodigoEnfermedadBase.UpdateAfterCallBack=true;
+ ddlEnfermedadBase.UpdateAfterCallBack = true;
+
+ }
+
+ }
+
-
@@ -1284,30 +1330,7 @@ private void CargarListas()
string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
ddlMuestra.Items.Insert(0, new ListItem("--Seleccione Muestra--", "0"));
- pnlMuestra.Visible = false;
-
- //if (int.Parse(Session["idServicio"].ToString()) == 1)
- //{
- // pnlComprobantePaciente.Visible = oC.GeneraComprobanteProtocolo;
- // lblImprimeComprobantePaciente.Enabled = oC.GeneraComprobanteProtocolo;
- // chkImprimir.Enabled = oC.GeneraComprobanteProtocolo;
- // ddlImpresora.Enabled = oC.GeneraComprobanteProtocolo;
- // lnkReimprimirComprobante.Enabled = oC.GeneraComprobanteProtocolo;
- // lnkReimprimirCodigoBarras.Enabled = oC.GeneraComprobanteProtocolo;
-
- //}
-
- //if (int.Parse(Session["idServicio"].ToString()) == 3)
- //{
- // pnlComprobantePaciente.Visible = oC.GeneraComprobanteProtocoloMicrobiologia;
- // lblImprimeComprobantePaciente.Enabled = oC.GeneraComprobanteProtocoloMicrobiologia;
- // chkImprimir.Enabled = oC.GeneraComprobanteProtocoloMicrobiologia;
- // ddlImpresora.Enabled = oC.GeneraComprobanteProtocoloMicrobiologia;
- // lnkReimprimirComprobante.Enabled = oC.GeneraComprobanteProtocoloMicrobiologia;
- // lnkReimprimirCodigoBarras.Enabled = oC.GeneraComprobanteProtocoloMicrobiologia;
- //}
-
-
+ pnlMuestra.Visible = false;
///Carga de combos de tipos de servicios
@@ -1317,15 +1340,33 @@ private void CargarListas()
///Carga de grupos de numeración solo si el tipo de numeración es 2: por Grupos
- string m_ssql = "SELECT idSectorServicio, prefijo + ' - ' + nombre as nombre FROM LAB_SectorServicio with (nolock) WHERE (baja = 0) order by nombre";
+ //string m_ssql = "SELECT idSectorServicio, prefijo + ' - ' + nombre as nombre FROM LAB_SectorServicio with (nolock) WHERE (baja = 0) order by nombre";
+
+ //oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
+ //ddlSectorServicio.Items.Insert(0, new ListItem("Seleccione", "0"));
+ //if (oC.IdSectorDefecto > 0)
+ //{
+ // ddlSectorServicio.SelectedValue = oC.IdSectorDefecto.ToString();
+ // // ddlSectorServicio.Visible = false;
+ //}
+
+ ///Carga de grupos de numeración solo si el tipo de numeración es 2: por Grupos
+ string str_condicion = ")";
+ if ((Request["Operacion"].ToString() == "Modifica") && (Request["idProtocolo"]!=null))
+ str_condicion = " or exists (select 1 from LAB_Protocolo p WHERE p.idsector = s.idSectorServicio and idProtocolo = " + Request["idProtocolo"].ToString() + ")) ";
+
+
+ string m_ssql = @"SELECT s.idSectorServicio, s.prefijo + ' - ' + s.nombre as nombre FROM LAB_SectorServicio S with (nolock)
+ WHERE (baja = 0)
+ and ( exists (select 1 from Lab_SectorServicioEfector SE where SE.idSectorServicio=S.idSectorServicio and se.idefector="+oUser.IdEfector.IdEfector.ToString()+@" )" + str_condicion +@" order by nombre";
oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
ddlSectorServicio.Items.Insert(0, new ListItem("Seleccione", "0"));
- if (oC.IdSectorDefecto > 0)
+ /* if (oC.IdSectorDefecto > 0)
{
ddlSectorServicio.SelectedValue = oC.IdSectorDefecto.ToString();
- // ddlSectorServicio.Visible = false;
- }
+ // ddlSectorServicio.Visible = false;
+ }*/
/////////////////////////////////////////////CODIGO DE BARRAS//////////////////////////////////////////////////////////////////////
tab3Titulo.Visible = false;
@@ -1445,7 +1486,14 @@ inner join lab_item P with (nolock) on dp.idsubitem = p.iditem
m_ssql += " order by nombre ";
oUtil.CargarCombo(ddlMuestra, m_ssql, "idMuestra", "nombre", connReady);
ddlMuestra.Items.Insert(0, new ListItem("--Seleccione Muestra--", "0"));
-
+
+ ////Carga de combo de enfermedad base
+ if (oC.HabilitaEnfermedadBase)
+ {
+ CargarListaEnfermedadesBase();
+
+ }
+ else pnlEnfermedadBase.Visible = false;
}
@@ -1472,17 +1520,21 @@ inner join lab_item P with (nolock) on dp.idsubitem = p.iditem
-
-
- m_ssql = "SELECT idCaracter, nombre FROM LAB_Caracter with (nolock) ";
- oUtil.CargarCombo(ddlCaracter, m_ssql, "idCaracter", "nombre", connReady);
- ddlCaracter.Items.Insert(0, new ListItem("--Seleccione Caracteristica--", "0"));
-
- if ((ddlCaracter.Items.Count > 1) && (oUser.IdEfector.IdEfector==228) )///Se agrega control exclusivo para Laboratorio Central
+ if (Session["idServicio"].ToString() == "3")///Se agrega para todos los efectores y solo para servicio microbiologia
{
- lblCaracterSisa.Visible = true;
- ddlCaracter.Visible = true;
+ m_ssql = "SELECT idCaracter, nombre FROM LAB_Caracter with (nolock) ";
+ oUtil.CargarCombo(ddlCaracter, m_ssql, "idCaracter", "nombre", connReady);
+ ddlCaracter.Items.Insert(0, new ListItem("--Seleccione Caracteristica--", "0"));
+
+ //if ((ddlCaracter.Items.Count > 1) && (oUser.IdEfector.IdEfector==228) )///Se agrega control exclusivo para Laboratorio Central
+ if (ddlCaracter.Items.Count > 1) ///Se agrega para todos los efectores y solo para servicio microbiologia
+ {
+ lblCaracterSisa.Visible = true;
+ ddlCaracter.Visible = true;
+ }
}
+ else
+ ddlCaracter.Items.Insert(0, new ListItem("", "0"));
////////////////////////////Carga de combos de ObraSocial//////////////////////////////////////////
//m_ssql = "SELECT idObraSocial, nombre AS nombre FROM Sys_ObraSocial order by idObraSocial ";
//oUtil.CargarCombo(ddlObraSocial, m_ssql, "idObraSocial", "nombre");
@@ -1559,6 +1611,19 @@ inner join lab_item P with (nolock) on dp.idsubitem = p.iditem
oUtil = null;
}
+ private void CargarListaEnfermedadesBase()
+ {
+ Utility oUtil = new Utility();
+ //Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
+
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
+ pnlEnfermedadBase.Visible = true;
+ string m_ssql = @"select id as idDiag, nombre + ' - ' + codigo as nombre from sys_cie10 with (nolock) where tipo='BASE' order by nombre ";
+ oUtil.CargarCombo(ddlEnfermedadBase, m_ssql, "idDiag", "nombre", connReady);
+ ddlEnfermedadBase.Items.Insert(0, new ListItem("--Seleccione Enfermedad Base--", "0"));
+ }
+
private void IniciarValores(Configuracion oC)
{
if (Session["ProtocoloLaboratorio"] != null)
@@ -1654,8 +1719,8 @@ private void IniciarValores(Configuracion oC)
chkRecordarPractica.Checked = true;
}
break;
- case "prácticas":
- TxtDatosCargados.Value = s_control[1].ToString(); break;
+ case "prácticas": if(Request["idServicio"] == "1") TxtDatosCargados.Value = s_control[1].ToString(); break;
+ case "prácticasMicro": if(Request["idServicio"] == "3") TxtDatosCargados.Value = s_control[1].ToString(); break;
//case "ddlImpresora":
// ddlImpresora.SelectedValue = s_control[1].ToString(); break;
@@ -1743,9 +1808,11 @@ protected void btnGuardar_Click(object sender, EventArgs e)
/// actualiza al paciente con la ultima obra social guardada: solo en las altas
+ /* No es necesario siempre se guarda -1 con el sil2
oRegistro.IdPaciente.IdObraSocial = oRegistro.IdObraSocial.IdObraSocial;
oRegistro.IdPaciente.FechaUltimaActualizacion = DateTime.Now;
oRegistro.IdPaciente.Save();
+ */
if (ddlImpresoraEtiqueta.SelectedValue != "0")
// oRegistro.ImprimirCodigoBarras(ddlImpresoraEtiqueta.SelectedItem.Text, int.Parse(Session["idUsuario"].ToString()));
@@ -1765,9 +1832,7 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
-
- /////////////////
-
+ EnviarEquipo(oRegistro);
///Imprimir codigo de barras.
//string s_AreasCodigosBarras = getListaAreasCodigoBarras();
@@ -1883,10 +1948,54 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
+ private void EnviarEquipo(Protocolo oRegistro)
+ {
+ /*
+ Caro: Primer version para enviar de forma automatica (sin intervencion del usuario) muestras el equipo.
+ En este caso para el equipo REAL: Si el servicio es micro solo para los efectores 205 y 221 (HPN y HEller)
+ Se debe mejorar para algo mas generico
+ Se agrega try/cath para que ante cualquier problema no haya inconvenientes con el ingreso de la muestra
+ */
+
+ try
+ {
+ if ((oRegistro.IdTipoServicio.IdTipoServicio == 3) &&
+ (oRegistro.IdEfector.IdEfector == 205 || oRegistro.IdEfector.IdEfector == 221))
+ {
+ using (SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection)
+ {
+
+ using (SqlCommand cmd = new SqlCommand("dbo.LAB_GeneraProtocoloEnvioAutomaticoREAL", conn))
+ {
+ cmd.CommandType = CommandType.StoredProcedure;
+
+ // Parámetros del SP
+ cmd.Parameters.AddWithValue("@idEfector", oRegistro.IdEfector.IdEfector);
+ cmd.Parameters.AddWithValue("@idProtocolo", oRegistro.IdProtocolo);
+
+ // Ejecuta sin devolver resultados
+ cmd.ExecuteNonQuery();
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ string exception = "";
+ exception = ex.Message + " ";
+ }
+ }
+
private void ActualizarEstadoDerivacion(Protocolo oRegistro, Protocolo oRegistroAnterior)
{
- Business.Data.Laboratorio.Derivacion oDerivacion = new Business.Data.Laboratorio.Derivacion();
- oDerivacion.MarcarComoRecibidas(oRegistroAnterior,oRegistro, oUser, Convert.ToInt32(Request["idLote"]));
+
+ DetalleProtocolo dp = new DetalleProtocolo();
+ dp.ActualizarItemsDerivados(oRegistro, oRegistroAnterior, Convert.ToInt32(Request["idLote"]), oUser);
+
+ //Business.Data.Laboratorio.Derivacion oDerivacion = new Business.Data.Laboratorio.Derivacion();
+ //oDerivacion.MarcarComoRecibidas(oRegistroAnterior,oRegistro, oUser, Convert.ToInt32(Request["idLote"]));
+ //Business.Data.Laboratorio.DetalleProtocolo oDetalle = new Business.Data.Laboratorio.DetalleProtocolo();
+ //oDetalle.ActualizoResultado(oRegistro, oRegistroAnterior,Convert.ToInt32(Request["idLote"]));
}
private string getListaAreasCodigoBarras()
@@ -2317,6 +2426,8 @@ private bool Guardar(Business.Data.Laboratorio.Protocolo oRegistro)
// if (Request["idSolicitudScreening"] != null) ActualizarSolicitudScreening(Request["idSolicitudScreening"].ToString(),oRegistro);
GuardarDiagnosticos(oRegistro);
+ if (oRegistro.IdTipoServicio.IdTipoServicio==3) GuardarEnfermedadBase(oRegistro);
+
GuardarDetalle(oRegistro);
//GuardarDiagnosticos(oRegistro);
this.IncidenciaEdit1.GuardarProtocoloIncidencia(oRegistro);
@@ -2423,6 +2534,63 @@ private bool Guardar(Business.Data.Laboratorio.Protocolo oRegistro)
return guardo;
}
+
+
+
+ private void GuardarEnfermedadBase(Protocolo oRegistro)
+ {
+ if ((ddlEnfermedadBase.SelectedValue != "0")&& (ddlEnfermedadBase.SelectedValue != ""))
+ {
+ int nuevoIdDiagnostico = int.Parse(ddlEnfermedadBase.SelectedValue);
+ string nuevoNombre = ddlEnfermedadBase.SelectedItem.Text;
+ string accion = "Graba";
+
+ ISession m_session = NHibernateHttpModule.CurrentSession;
+
+ // Buscar si ya existe un registro de enfermedad base
+ ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloDiagnostico));
+ crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ crit.Add(Expression.Eq("Tipo", "B")); // enfermedad base
+ IList detalleExistente = crit.List();
+
+ if (detalleExistente.Count > 0)
+ {
+ ProtocoloDiagnostico existente = (ProtocoloDiagnostico)detalleExistente[0];
+
+ // Verificar si es distinto al seleccionado
+ if (existente.IdDiagnostico != nuevoIdDiagnostico)
+ {
+ // Eliminar el registro anterior
+ existente.Delete();
+
+ // Crear el nuevo registro
+ ProtocoloDiagnostico oDetalle = new ProtocoloDiagnostico();
+ oDetalle.IdProtocolo = oRegistro;
+ oDetalle.IdEfector = oRegistro.IdEfector;
+ oDetalle.IdDiagnostico = nuevoIdDiagnostico;
+ oDetalle.Tipo = "B";
+ oDetalle.Save();
+
+ accion = "Cambia";
+ oDetalle.IdProtocolo.GrabarAuditoriaDetalleProtocolo(accion, int.Parse(Session["idUsuario"].ToString()), "Enfermedad Base", nuevoNombre);
+ }
+ // Si es igual, no hacer nada
+ }
+ else
+ {
+ // No existe registro previo, crear uno nuevo
+ ProtocoloDiagnostico oDetalle = new ProtocoloDiagnostico();
+ oDetalle.IdProtocolo = oRegistro;
+ oDetalle.IdEfector = oRegistro.IdEfector;
+ oDetalle.IdDiagnostico = nuevoIdDiagnostico;
+ oDetalle.Tipo = "B";
+ oDetalle.Save();
+
+ oDetalle.IdProtocolo.GrabarAuditoriaDetalleProtocolo(accion, int.Parse(Session["idUsuario"].ToString()), "Enfermedad Base", nuevoNombre);
+ }
+ }
+ }
+
//private void ActualizarSolicitudScreening(string p, Protocolo oProtocolo)
//{
// SolicitudScreening oRegistro = new SolicitudScreening();
@@ -2478,13 +2646,42 @@ private void AlmacenarSesion(Configuracion oC)
{
s_valores += "@ddlSectorServicio:" + ddlSectorServicio.SelectedValue;
}
+///caro: ver si dejar
+ if (chkRecordarPractica.Checked)
+ {//guardo la sesion de general y microbiologia por si vuelvo a cargar esos tipos de labos, luego en GuardarDetalle se actualizan si el usuario lo cambio
+ if(Session["ProtocoloLaboratorio"] != null)
+ {
+ string[] arr = Session["ProtocoloLaboratorio"].ToString().Split(("@").ToCharArray());
+ foreach (string item in arr)
+ {
+ string[] s_control = item.Split((":").ToCharArray());
+ switch (s_control[0].ToString()) {
+
+ case "prácticas":
+ string practicas = "@prácticas:" + s_control[1].ToString();
+ if (Request["idServicio"] == "1")
+ s_valores = s_valores.Replace(practicas, ""); //si es laboratorio general lo borro y lo cargo en GuardarDetalle.
+ else
+ s_valores += practicas; //si no es laboratorio general no quiero perder su session "prácticas"
+ break;
+ case "prácticasMicro":
+ string practicasMicro = "@prácticasMicro:" + s_control[1].ToString();
+ if (Request["idServicio"] != "3") //si no es microbiologia no quiero perder su session "prácticasMicro"
+ s_valores += "@prácticasMicro:" + s_control[1].ToString();
+ else
+ s_valores = s_valores.Replace(practicasMicro, ""); //si es micro lo borro y lo cargo en GuardarDetalle.
+ break;
+ }
+ }
+ }
+ }
Session["ProtocoloLaboratorio"] = s_valores;
}
- private void GuardarDiagnosticos(Business.Data.Laboratorio.Protocolo oRegistro)
+ private void GuardarDiagnosticos_ant(Business.Data.Laboratorio.Protocolo oRegistro)
{
string embarazada = ""; string accion = "Graba";
// dtDiagnosticos = (System.Data.DataTable)(Session["Tabla2"]);
@@ -2549,7 +2746,80 @@ private void GuardarDiagnosticos(Business.Data.Laboratorio.Protocolo oRegistro)
}
-
+ private void GuardarDiagnosticos(Business.Data.Laboratorio.Protocolo oRegistro)
+ {
+ string embarazada = "";
+ string accion = "Graba";
+
+ // Obtener lista de diagnósticos actuales
+ ISession m_session = NHibernateHttpModule.CurrentSession;
+ ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloDiagnostico));
+ crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ crit.Add(Expression.Eq("Tipo", "D"));
+ IList detalleActual = crit.List();
+
+ // Crear lista de IDs de los diagnósticos nuevos
+ List listaNueva = new List();
+ for (int i = 0; i < lstDiagnosticosFinal.Items.Count; i++)
+ {
+ listaNueva.Add(int.Parse(lstDiagnosticosFinal.Items[i].Value));
+ }
+
+ // Comparar si hay cambios
+ bool hayCambios = false;
+
+ if (detalleActual.Count != listaNueva.Count)
+ hayCambios = true;
+ else
+ {
+ foreach (ProtocoloDiagnostico oDetalle in detalleActual)
+ {
+ if (!listaNueva.Contains(oDetalle.IdDiagnostico))
+ {
+ hayCambios = true;
+ break;
+ }
+ }
+ }
+
+ if (hayCambios)
+ {
+ // Eliminar diagnósticos antiguos
+ foreach (ProtocoloDiagnostico oDetalle in detalleActual)
+ {
+ oDetalle.Delete();
+ }
+ accion = "Cambia";
+
+ // Guardar los nuevos diagnósticos
+ string listaDx = "";
+ for (int i = 0; i < lstDiagnosticosFinal.Items.Count; i++)
+ {
+ ProtocoloDiagnostico oDetalle = new ProtocoloDiagnostico();
+ oDetalle.IdProtocolo = oRegistro;
+ oDetalle.IdEfector = oRegistro.IdEfector;
+ oDetalle.IdDiagnostico = int.Parse(lstDiagnosticosFinal.Items[i].Value);
+ oDetalle.Tipo = "D";
+ oDetalle.Save();
+
+ string s_diag = lstDiagnosticosFinal.Items[i].Text;
+ oDetalle.IdProtocolo.GrabarAuditoriaDetalleProtocolo(
+ accion, int.Parse(Session["idUsuario"].ToString()), "Diagnóstico", s_diag);
+
+ embarazada = oDetalle.EsEmbarazada();
+
+ listaDx = listaDx == "" ? lstDiagnosticosFinal.Items[i].Value : listaDx + ";" + lstDiagnosticosFinal.Items[i].Value;
+ }
+
+ if (embarazada == "E")
+ {
+ oRegistro.Embarazada = "S";
+ oRegistro.Save();
+ }
+
+ Session["Dx"] = listaDx;
+ }
+ }
private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro)
{
@@ -2677,6 +2947,39 @@ private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro)
oDetalle.TrajoMuestra = "Si";
oDetalle.GrabarAuditoriaDetalleProtocolo("Con Muestra", oUser.IdUsuario);
oDetalle.Save();
+
+ /* Bug sobre la edición de determinaciones con la marca “sin muestraâ€:
+ * Si se genero el protocolo con un analisis "S/muestra" de una practica no se generan los idItem del diagrama
+ * (porque GuardarDetallePractica solo actualizaba TrajoMuestra del codigo de la practica)
+ * Correcion: si en protocolo se cambia a "Con muestra",se regeneran los detalles faltantes de la practica
+ */
+
+ if (oDetalle.IdItem == oDetalle.IdSubItem)
+ {
+ /* Si ValidadoTotal (en ProtocoloEdit2) cargó idUsuarioValida por un caso de
+ * "sin muestra" se debe resetear idUsuarioValida para evitar inconsistencias
+ */
+
+ //Caso 1: el análisis aún no tiene resultados (simple o compuesto),
+ if (!oDetalle.ConResultado)
+ {
+ oDetalle.IdUsuarioValida = 0;
+ oDetalle.FechaValida = DateTime.Parse("01/01/1900");
+ }
+
+ //Caso 2: Es derivacion.
+ //Los analisis Derivados no tienen IdUsuarioValida, solo idUsuarioResultado
+
+ if (oDetalle.ResultadoCar == "Pendiente de derivar")
+ {
+ oDetalle.IdUsuarioValida = 0;
+ oDetalle.FechaValida = DateTime.Parse("01/01/1900");
+ }
+ if (oItem.IdCategoria == 1 )
+ {
+ GuardarDetallePractica(oDetalle, true); //regenera=true --> se omite si es Derivacion para no generar una nueva Derivacion
+ }
+ }
}
}
@@ -2690,7 +2993,17 @@ private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro)
if (Request["Operacion"].ToString() != "Modifica")
{
if (chkRecordarPractica.Checked)
- Session["ProtocoloLaboratorio"] += "@prácticas:" + recordar_practicas;
+ {
+ //actualizo los analisis a recordar por IdTipoServicio
+ switch (oRegistro.IdTipoServicio.IdTipoServicio)
+ {
+ case 1: Session["ProtocoloLaboratorio"] += "@prácticas:" + recordar_practicas; /*labo general*/ break;
+ case 3: Session["ProtocoloLaboratorio"] += "@prácticasMicro:" + recordar_practicas; /*microbiologia*/ break;
+ }
+
+
+
+ }
}
@@ -2857,11 +3170,11 @@ private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro)
- private void GuardarDetallePractica(DetalleProtocolo oDet)
+ private void GuardarDetallePractica(DetalleProtocolo oDet, bool regenera=false)
{
-
-
- if (oDet.VerificarSiEsDerivable(oUser.IdEfector)) //oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
+ //Alta normal (regenera = false) --> el código funciona como antes
+ // Modificación con regeneración(regenera = true) --> se omite si es Derivacion para no generar una nueva Derivacion
+ if (!regenera && oDet.VerificarSiEsDerivable(oUser.IdEfector)) //oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
{
oDet.IdSubItem = oDet.IdItem;
oDet.Save();
@@ -3037,11 +3350,6 @@ protected void ddlSexo_SelectedIndexChanged(object sender, EventArgs e)
- protected void txtCodigo_TextChanged(object sender, EventArgs e)
- {
-
- }
-
protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e)
{
///////Con la selección del item se muestra el codigo
@@ -3128,11 +3436,6 @@ private void SacarDiagnostico()
- protected void txtCodigo_TextChanged1(object sender, EventArgs e)
- {
-
- }
-
protected void btnCancelar_Click(object sender, EventArgs e)
{
if (Request["Operacion"].ToString() == "Modifica")
@@ -3346,71 +3649,7 @@ private void SelectedEfector()
}
- //private void CargarSolicitantesInternos()
- //{
- // Utility oUtil = new Utility();
- // ///Carga de combos de Medicos Solicitantes
- // string m_ssql = "SELECT idProfesional, apellido + ' ' + nombre AS nombre FROM Sys_Profesional ORDER BY apellido, nombre ";
- // oUtil.CargarCombo(ddlEspecialista, m_ssql, "idProfesional", "nombre");
- // ddlEspecialista.Items.Insert(0, new ListItem("No identificado", "0"));
- // ddlEspecialista.UpdateAfterCallBack = true;
- // //imgCrearSolicitante.Visible = false;
- // //imgCrearSolicitante.UpdateAfterCallBack = true;
- //}
-
- //private void CargarSolicitantesExternos(string m_solicitante)
- //{
- // Utility oUtil = new Utility();
-
- // ///Carga de combos de solicitantes expertos
- // string m_ssql = "select idSolicitanteExterno, apellido + ', ' + nombre as nombre from Lab_SolicitanteExterno where baja=0 order by apellido, nombre";
- // oUtil.CargarCombo(ddlEspecialista, m_ssql, "idSolicitanteExterno", "nombre");
- // ddlEspecialista.Items.Insert(0, new ListItem("No identificado", "0"));
- // if (m_solicitante != "") ddlEspecialista.SelectedValue = m_solicitante;
- // ddlEspecialista.UpdateAfterCallBack = true;
- // //imgCrearSolicitante.Visible = true;
- // //imgCrearSolicitante.UpdateAfterCallBack = true;
- //}
-
- //protected void btnGuardarSolicitante_Click(object sender, EventArgs e)
- //{
- // if (Page.IsValid)
- // {
- // GuardarSolicitanteExterno();
-
- // LimpiarDatosSolicitante();
- // //Panel1.Visible = false;
- // //Panel1.UpdateAfterCallBack = true;
- // }
- //}
-
- //private void GuardarSolicitanteExterno()
- //{
- // Usuario oUser = new Usuario();
- // SolicitanteExterno oRegistro = new SolicitanteExterno();
- // Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
- // oRegistro.IdEfector = oC.IdEfector;
- // oRegistro.Matricula = txtMatricula.Text;
- // oRegistro.Apellido = txtApellidoSolicitante.Text;
- // oRegistro.Nombre = txtNombreSolicitante.Text;
- // oRegistro.IdUsuarioRegistro = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
- // oRegistro.FechaRegistro = DateTime.Now;
- // oRegistro.Save();
- // CargarSolicitantesExternos(oRegistro.IdSolicitanteExterno.ToString());
- //}
-
- //protected void btnCancelarSolicitante_Click(object sender, EventArgs e)
- //{
- // LimpiarDatosSolicitante();
-
- //}
-
- //private void LimpiarDatosSolicitante()
- //{
- // txtMatricula.Text = "";
- // txtApellidoSolicitante.Text = "";
- // txtNombreSolicitante.Text = "";
- //}
+
protected void gvLista_SelectedIndexChanged(object sender, EventArgs e)
{
@@ -3423,7 +3662,10 @@ protected void txtCodigoDiagnostico_TextChanged(object sender, EventArgs e)
//BuscarCodigoDiagnostico();
}
-
+ private bool ExisteItem(ListControl lista, string value)
+ {
+ return lista.Items.FindByValue(value) != null;
+ }
private void BuscarCodigoDiagnostico()
{
@@ -3435,7 +3677,7 @@ private void BuscarCodigoDiagnostico()
if (oC.NomencladorDiagnostico == 0) /// Cie10
{
- string m_strSQL = @"select id, codigo + ' -' + nombre from sys_cie10 with (nolock) where CODIGO like '%" + txtCodigoDiagnostico.Text.Trim() + "%'";
+ string m_strSQL = @"select id, codigo + ' -' + nombre from sys_cie10 with (nolock) where tipo='DIAG' and CODIGO like '%" + txtCodigoDiagnostico.Text.Trim() + "%'";
DataSet Ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
@@ -3443,7 +3685,8 @@ private void BuscarCodigoDiagnostico()
adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
adapter.Fill(Ds);
lstDiagnosticos.Items.Clear();
- for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
+ int cantDiag = Ds.Tables[0].Rows.Count;
+ for (int i = 0; i < cantDiag; i++)
{
ListItem oDia = new ListItem();
@@ -3451,15 +3694,22 @@ private void BuscarCodigoDiagnostico()
oDia.Value = Ds.Tables[0].Rows[i][0].ToString();
lstDiagnosticos.Items.Add(oDia);
-
+ if (cantDiag == 1) //Si encuentra por codigo un unico diagnsotico se pasa automatico a diagnostico del paciente para evitar mas clic: sug. H. Plottier
+ {
+ // lstDiagnosticosFinal.Items.Clear();
+ if (!ExisteItem(lstDiagnosticosFinal, oDia.Value))
+ {
+ lstDiagnosticosFinal.Items.Add(oDia);
+ lstDiagnosticosFinal.UpdateAfterCallBack = true;
+ }
+
+
+ }
}
-
-
-
-
+
}
else /// diagnostico propio
{
@@ -3545,21 +3795,10 @@ private void BuscarNombreDiagnostico()
ISession m_session = NHibernateHttpModule.CurrentSession;
if (oC.NomencladorDiagnostico == 0)
{
- //ICriteria crit = m_session.CreateCriteria(typeof(Cie10));
- //crit.Add(Expression.Sql(" Nombre like '%" + txtNombreDiagnostico.Text + "%' order by Nombre"));
-
- //IList items = crit.List();
-
- //foreach (Cie10 oDiagnostico in items)
- //{
- // ListItem oDia = new ListItem();
- // oDia.Text = oDiagnostico.Codigo + " - " + oDiagnostico.Nombre;
- // oDia.Value = oDiagnostico.Id.ToString();
- // lstDiagnosticos.Items.Add(oDia);
- //}
+
- string m_strSQL = @"select id, codigo + ' -' + nombre from sys_cie10 (nolock) where Nombre like '%" + txtNombreDiagnostico.Text.Trim() + "%' order by Nombre";
+ string m_strSQL = @"select id, codigo + ' -' + nombre from sys_cie10 (nolock) where tipo='DIAG' and Nombre like '%" + txtNombreDiagnostico.Text.Trim() + "%' order by Nombre";
DataSet Ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
@@ -3669,11 +3908,10 @@ protected void cvAnalisis_ServerValidate(object source, ServerValidateEventArgs
}
- protected void cvValidacionInput_ServerValidate_vane(object source, ServerValidateEventArgs args)
+ protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args)
{
- string[] bk = TxtDatosCargados.Value.Split(';');
-
+
TxtDatosCargados.Value = TxtDatos.Value;
string sDatos = "";
@@ -3683,20 +3921,19 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
for (int i = 0; i < tabla.Length - 1; i++)
{
string[] fila = tabla[i].Split('#');
- string codigo = fila[1].ToString();
- string muestra= fila[2].ToString();
- string conResultado = "false";
- //Cargo el valor del resultado para no perderlo si da error la validacion
- if (i < bk.Length && bk.Length > 1) //TxtDatosCargados en Alta no tiene valores!
- {
- string[] filaBk = bk[i].Split('#');
- conResultado = filaBk[2].ToString();
- }
+ string codigo = fila[1].ToString();
+ string tarea = fila[2].ToString();
+ string muestra= fila[3].ToString();
+ string estado = "false";
+
+ if (tabla.Length > 1) //TxtDatosCargados en Alta no tiene valores!
+ estado = fila[4].ToString();
+
if (sDatos == "")
- sDatos = codigo + "#" + muestra + "#" + conResultado;
+ sDatos = codigo + "#" + muestra + "#" + estado;
else
- sDatos += ";" + codigo + "#" + muestra + "#" + conResultado;
+ sDatos += ";" + codigo + "#" + muestra + "#" + estado;
}
@@ -3715,7 +3952,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
// }
if (!VerificarAnalisisContenidos() )
- { TxtDatos.Value = "";
+ { //TxtDatos.Value = "";
args.IsValid = false;
return;
@@ -3727,7 +3964,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
///
- if ((TxtDatos.Value == "") || (TxtDatos.Value == "1###on@"))
+ if ((TxtDatos.Value == "") || (TxtDatos.Value == "1###on@") || (TxtDatos.Value == "1###on#0@") || TxtDatos.Value == "1###false#0@")
{
args.IsValid = false;
@@ -3741,7 +3978,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if (oC.DiagObligatorio)
{if (lstDiagnosticosFinal.Items.Count == 0)
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar al menos un diagnóstico presuntivo del paciente";
return;
@@ -3751,7 +3988,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
///Validacion de la fecha de protocolo
if (txtFecha.Value == "")
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha del protocolo";
return;
@@ -3761,7 +3998,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if (DateTime.Parse(txtFecha.Value) > DateTime.Now)
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La fecha del protocolo no puede ser superior a la fecha actual";
return;
@@ -3773,7 +4010,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((ddlSectorServicio.SelectedValue == "0"))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar sector";
return;
@@ -3781,7 +4018,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((ddlOrigen.SelectedValue == "0"))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar Origen";
return;
@@ -3789,7 +4026,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((ddlPrioridad.SelectedValue == "0"))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar Prioridad";
return;
@@ -3797,7 +4034,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((ddlMuestra.SelectedValue == "0") && (pnlMuestra.Visible))
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar Tipo de Muestra";
return;
@@ -3809,7 +4046,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((VerificaRequiereCaracter(sDatos)) && (ddlCaracter.SelectedValue == "0"))
//if ((sDatos.Contains(oC.CodigoCovid) && (ddlCaracter.SelectedValue=="0")))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe seleccionar el caracter del protocolo";
return;
@@ -3821,7 +4058,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if ((txtFechaFIS.Value == "") && (chkSinFIS.Checked==false))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar fecha de inicio de sÃntomas";
return;
@@ -3831,7 +4068,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((ddlCaracter.SelectedValue == "4") && (txtFechaFUC.Value=="") && (chkSinFUC.Checked==false))
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar fecha de último contacto";
return;
@@ -3839,21 +4076,21 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
}
if ((ddlEspecialista.SelectedValue=="-1") && (oC.MedicoObligatorio))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar la mátricula del médico solicitante";
return;
}
if (ddlOrigen.SelectedValue == "0")
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar el origen";
return;
}
if ((oC.IdSectorDefecto== 0) && (ddlSectorServicio.SelectedValue == "0"))
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar el Servicio";
return;
@@ -3862,7 +4099,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if ((lblAlertaObraSocial.Visible) && (lblObraSocial.Text == "-"))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar la obra social/financiador";
return;
@@ -3872,7 +4109,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if (txtFechaOrden.Value == "")
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha de la orden";
return;
@@ -3881,7 +4118,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaOrden.Value) > DateTime.Now)
{
- TxtDatos.Value = "";
+ // TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La fecha de la orden no puede ser superior a la fecha actual";
return;
@@ -3890,7 +4127,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaOrden.Value) > DateTime.Parse(txtFecha.Value))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La fecha de la orden no puede ser superior a la fecha del protocolo";
return;
@@ -3905,7 +4142,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
if (txtFechaTomaMuestra.Value == "")
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha de toma de muestra";
return;
@@ -3914,7 +4151,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaTomaMuestra.Value) > DateTime.Now)
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La fecha de toma de muestra no puede ser superior a la fecha actual";
return;
@@ -3923,7 +4160,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaTomaMuestra.Value) > DateTime.Parse(txtFecha.Value))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La fecha de toma de muestra no puede ser superior a la fecha del protocolo";
return;
@@ -3942,7 +4179,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaFIS.Value) > DateTime.Now)
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La FIS no puede ser superior a la fecha actual";
return;
@@ -3951,7 +4188,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaTomaMuestra.Value) < DateTime.Parse(txtFechaFIS.Value))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La FIS no puede ser despues de la fecha de toma de muestra";
return;
@@ -3971,7 +4208,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaFUC.Value) > DateTime.Now)
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La FUC no puede ser superior a la fecha actual";
return;
@@ -3980,7 +4217,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
{
if (DateTime.Parse(txtFechaTomaMuestra.Value) < DateTime.Parse(txtFechaFUC.Value))
{
- TxtDatos.Value = "";
+ //TxtDatos.Value = "";
args.IsValid = false;
this.cvValidacionInput.ErrorMessage = "La FUC no puede ser despues de la fecha de toma de muestra";
return;
@@ -3990,324 +4227,279 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida
}
}//fin control
+ if (txtEspecialista.Text != "0" && ddlEspecialista.SelectedValue == "0")
+ {
+ args.IsValid = false;
+ this.cvValidacionInput.ErrorMessage = "Debe seleccionar un medico del listado";
+ return;
+ }
}
}
-
- protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args)
- {
-
-
- TxtDatosCargados.Value = TxtDatos.Value;
- string sDatos = "";
+ private bool VerificarAnalisisContenidos()
+ {
+ bool devolver = true;
+ string[] tabla = TxtDatos.Value.Split('@');
+ string listaCodigo = "";
- string[] tabla = TxtDatos.Value.Split('@');
-
for (int i = 0; i < tabla.Length - 1; i++)
+
{
string[] fila = tabla[i].Split('#');
string codigo = fila[1].ToString();
- string muestra= fila[2].ToString();
-
- if (sDatos == "")
- sDatos = codigo + "#" + muestra;
- else
- sDatos += ";" + codigo + "#" + muestra;
+ if (listaCodigo == "")
+ listaCodigo = "'" + codigo + "'";
+ else
+ listaCodigo += ",'" + codigo + "'";
- }
+ int i_idItemPractica = 0;
+ if (codigo != "")
+ {
-
+ Item oItem = new Item();
+ oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+ if (oItem.VerificaMuestrasAsociadas(int.Parse(ddlMuestra.SelectedValue)))
+ {
+ i_idItemPractica = oItem.IdItem;
+ for (int j = 0; j < tabla.Length - 1; j++)
- TxtDatosCargados.Value = sDatos;
- //saco restriccion de forma temporal
- //if (Request["Operacion"].ToString()!="Modifica")
- // if (!VerificarFechaPacienteMuestra())
- // {
- // TxtDatos.Value = "";
- // args.IsValid = false;
- // this.cvValidacionInput.ErrorMessage = "No es posible ingresar para la misma fecha, muestra y paciente un nuevo protocolo.";
- // return;
- // }
+ {
+ string[] fila2 = tabla[j].Split('#');
+ string codigo2 = fila2[1].ToString();
+ if ((codigo2 != "") && (codigo != codigo2))
+ {
+ Item oItem2 = new Item();
+ oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
- if (!VerificarAnalisisContenidos() )
- { TxtDatos.Value = "";
- args.IsValid = false;
-
- return;
- }
- else
- {
+ //MultiEfector: filtro por efector
-
- ///
+ ISession m_session = NHibernateHttpModule.CurrentSession;
+ ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ crit.Add(Expression.Eq("IdItemPractica", oItem));
+ crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
+ crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
- if ((TxtDatos.Value == "") || (TxtDatos.Value == "1###on@"))
- {
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe completar al menos un análisis";
- return;
- }
- else args.IsValid = true;
+ if (oGrupo != null)
+ {
- //validacion Diagnostico
- if (oC.DiagObligatorio)
- {if (lstDiagnosticosFinal.Items.Count == 0)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar al menos un diagnóstico presuntivo del paciente";
- return;
- }
- }
+ this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
+ devolver = false; break;
- ///Validacion de la fecha de protocolo
- if (txtFecha.Value == "")
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha del protocolo";
- return;
- }
- else
- {
+ }
- if (DateTime.Parse(txtFecha.Value) > DateTime.Now)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La fecha del protocolo no puede ser superior a la fecha actual";
- return;
+ }
+
+ }////for
}
else
- args.IsValid = true;
- }
+ {
+ this.cvValidacionInput.ErrorMessage = "Ha ingresado tipo de muestra que no corresponde con el codigo " + codigo + ". Verifique configuracion.";
+ devolver = false; break;
+ }
- if ((ddlSectorServicio.SelectedValue == "0"))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar sector";
- return;
- }
+ }/// if codigo
+ if (!devolver) break;
+ }
- if ((ddlOrigen.SelectedValue == "0"))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar Origen";
- return;
- }
-
- if ((ddlPrioridad.SelectedValue == "0"))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar Prioridad";
- return;
- }
-
- if ((ddlMuestra.SelectedValue == "0") && (pnlMuestra.Visible))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar Tipo de Muestra";
- return;
- }
- /// Valida que debe seleccionar un caracter si es un caso notificable a SISA
+ if ((devolver) && (listaCodigo != ""))
+ { devolver = VerificarAnalisisComplejosContenidos(listaCodigo); }
+ return devolver;
+ }
- if ((VerificaRequiereCaracter(sDatos)) && (ddlCaracter.SelectedValue == "0"))
- //if ((sDatos.Contains(oC.CodigoCovid) && (ddlCaracter.SelectedValue=="0")))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe seleccionar el caracter del protocolo";
- return;
- }
- // fin valida
- // validacion si es sospechoso o detctar ingresar fecha de inicio de sintomas
+ //LAB-192: Bug análisis Repetidos en protocolos. No lo pasamos a produccion porque baja la perfomance del sistema.
- if (VerificaObligatoriedadFIS())
- {
- if ((txtFechaFIS.Value == "") && (chkSinFIS.Checked==false))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar fecha de inicio de sÃntomas";
- return;
- }
- }
- // validacion si es contacto ingresar fecha de ultimo contacto
- if ((ddlCaracter.SelectedValue == "4") && (txtFechaFUC.Value=="") && (chkSinFUC.Checked==false))
- {
-
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar fecha de último contacto";
- return;
-
- }
- if ((ddlEspecialista.SelectedValue=="-1") && (oC.MedicoObligatorio))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar la mátricula del médico solicitante";
- return;
- }
- if (ddlOrigen.SelectedValue == "0")
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar el origen";
- return;
- }
- if ((oC.IdSectorDefecto== 0) && (ddlSectorServicio.SelectedValue == "0"))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar el Servicio";
- return;
- }
-
+ //private bool VerificarAnalisisContenidos_LAB192()
+ //{
+ // bool devolver = true;
+ // string[] tabla = TxtDatos.Value.Split('@');
+ // string listaCodigo = "";
- if ((lblAlertaObraSocial.Visible) && (lblObraSocial.Text == "-"))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar la obra social/financiador";
- return;
- }
+ // var subItemsEnBD = new Dictionary();
+ // //List- subItemsEnDB = new List
- ();
- ///Validacion de la fecha de la orden
- if (txtFechaOrden.Value == "")
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha de la orden";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaOrden.Value) > DateTime.Now)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La fecha de la orden no puede ser superior a la fecha actual";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaOrden.Value) > DateTime.Parse(txtFecha.Value))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La fecha de la orden no puede ser superior a la fecha del protocolo";
- return;
- }
- else
- args.IsValid = true;
- }
- }
+ // for (int i = 0; i < tabla.Length - 1; i++)
-
+ // {
+ // string[] fila = tabla[i].Split('#');
+ // string codigo = fila[1].ToString();
+ // if (listaCodigo == "")
+ // listaCodigo = "'" + codigo + "'";
+ // else
+ // listaCodigo += ",'" + codigo + "'";
+
+ // if (codigo != "")
+ // {
+ // Item oItem = new Item();
+ // oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+ // //1- Si el idItem ya esta en DetalleProtocolo (para los casos de "Modifica" no verifico Analisis)
+ // // if (Request["Operacion"].ToString() == "Modifica")
+ // if (Request["idProtocolo"] != null)//Caro: unifco instanciacion de protocolo cuando es modificacion
+ // {
+ // Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
+ // oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
+ // //try //Caro: saco try cath por errores silenciosos
+ // //{
+ // if ((oRegistro != null) && (oItem != null))
+ // {
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
+ // crit.Add(Expression.Eq("IdItem", oItem));
+ // crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ // IList lista = crit.List();
+
+ // if (lista.Count == 0)//no esta en la base
+ // {
+ // devolver = VerificaMuestrasAsociadas(codigo, oItem, tabla, subItemsEnBD);
+
+ // }
+ // else
+ // {
+ // foreach (DetalleProtocolo oDetalle in lista)
+ // {
+ // subItemsEnBD[oDetalle.IdSubItem.IdItem] = oDetalle.IdItem.IdItem;
+ // }
+
+ // }
+ // }
+ // //}
+ // //catch(Exception e)
+ // //{
+ // // this.cvValidacionInput.ErrorMessage = e.Message;
+ // // devolver = false; break;
+ // //}
- if (txtFechaTomaMuestra.Value == "")
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "Debe ingresar la fecha de toma de muestra";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaTomaMuestra.Value) > DateTime.Now)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La fecha de toma de muestra no puede ser superior a la fecha actual";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaTomaMuestra.Value) > DateTime.Parse(txtFecha.Value))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La fecha de toma de muestra no puede ser superior a la fecha del protocolo";
- return;
- }
- else
- args.IsValid = true;
- }
- }
+ // }
+ // else // no es modificacion
+ // {
+ // devolver = VerificaMuestrasAsociadas(codigo, oItem, tabla);
+ // }
- /// control de fecha inicio de sintomas
- ///
-
- if (txtFechaFIS.Value != "")
-
- {
- if (DateTime.Parse(txtFechaFIS.Value) > DateTime.Now)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La FIS no puede ser superior a la fecha actual";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaTomaMuestra.Value) < DateTime.Parse(txtFechaFIS.Value))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La FIS no puede ser despues de la fecha de toma de muestra";
- return;
- }
- else
- args.IsValid = true;
- }
- }//fin control
+ // }/// if codigo
+ // if (!devolver) break;
+ // }
+ // if ((devolver) && (listaCodigo != ""))
+ // { devolver = VerificarAnalisisComplejosContenidos(listaCodigo); }
- /// control de fecha inicio de sintomas
- ///
-
+ // return devolver;
- if (txtFechaFUC.Value != "")
+ //}
- {
- if (DateTime.Parse(txtFechaFUC.Value) > DateTime.Now)
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La FUC no puede ser superior a la fecha actual";
- return;
- }
- else
- {
- if (DateTime.Parse(txtFechaTomaMuestra.Value) < DateTime.Parse(txtFechaFUC.Value))
- {
- TxtDatos.Value = "";
- args.IsValid = false;
- this.cvValidacionInput.ErrorMessage = "La FUC no puede ser despues de la fecha de toma de muestra";
- return;
- }
- else
- args.IsValid = true;
- }
- }//fin control
+ //private bool VerificaMuestrasAsociadas(string codigo, Item oItem, string[] tabla, Dictionary itemsEnBD = null)
+ //{
+ // bool devolver = true;
- }
- }
+
+ // if (oItem.VerificaMuestrasAsociadas(int.Parse(ddlMuestra.SelectedValue)))
+ // {
+
+
+ // for (int j = 0; j < tabla.Length - 1; j++)
+
+ // {
+ // string[] fila2 = tabla[j].Split('#');
+ // string codigo2 = fila2[1].ToString();
+ // if ((codigo2 != "") && (codigo != codigo2))
+ // {
+ // Item oItem2 = new Item();
+ // oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
+
+ // //MultiEfector: filtro por efector
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ // crit.Add(Expression.Eq("IdItemPractica", oItem));
+ // crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
+ // crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ // PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
+
+
+
+ // if (oGrupo != null)
+ // {
+
+ // this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
+ // devolver = false; break;
+
+ // }
+
+ // //-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+ // //Verifico que el codigo cargado tampoco este en mi lista de subItems de la base de datos!
+
+ // if (itemsEnBD != null)
+ // {
+ // Item oItemExistente = new Item();
+ // bool hayConflicto = false;
+ // int itemExistente = 0;
+
+ // m_session = NHibernateHttpModule.CurrentSession;
+ // crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ // crit.Add(Expression.Eq("IdItemPractica", oItem));
+ // crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ // IList detalle = crit.List();
+
+ // if (detalle.Count > 0) //Es practica
+ // {
+ // foreach (PracticaDeterminacion item in detalle)
+ // {
+ // if (itemsEnBD.ContainsKey(item.IdItemDeterminacion))
+ // {
+ // itemExistente = itemsEnBD[item.IdItemDeterminacion];
+ // hayConflicto = true; break;
+ // }
+ // }
+ // }
+ // else //es determinacion simple idItem=idSubitem
+ // {
+ // if (itemsEnBD.ContainsKey(oItem.IdItem))
+ // {
+ // itemExistente = itemsEnBD[oItem.IdItem];
+ // hayConflicto = true;
+ // }
+ // }
+
+ // if (hayConflicto)
+ // {
+ // string mensajeerror = "";
+ // oItemExistente = (Item)oItemExistente.Get(typeof(Item), "IdItem", itemExistente);//, "Baja", false); //Caro: le saco la condicion de baja porque si fue grabado en la base y despues lo pusieron de baja no lo va a encontrar
+ // if (oItemExistente != null)///Caro agrego control de que exista si no va a dar error al usarlo
+ // {
+ // mensajeerror =
+ // "Ha cargado análisis contenidos en otros. Verifique los códigos " +
+ // codigo + " y " + oItemExistente.Codigo + "!";
+
+ // }
+ // else
+ // mensajeerror = "Ha cargado análisis contenidos en otros. Verifique los códigos ";
+
+ // this.cvValidacionInput.ErrorMessage = mensajeerror;
+ // devolver = false;
+ // }
+
+ // }
+ // }
+
+ // }////for
+ // }
+ // else
+ // {
+ // this.cvValidacionInput.ErrorMessage = "Ha ingresado tipo de muestra que no corresponde con el codigo " + codigo + ". Verifique configuracion.";
+ // devolver = false; //break;
+
+ // }
+
+ // return devolver;
+ //}
private bool VerificaRequiereCaracter(string sDatos)
{
@@ -4344,101 +4536,15 @@ private bool VerificaObligatoriedadFIS()
string[] arrfis = oC.FISCaracter.Split((",").ToCharArray());
foreach (string item in arrfis)
{
- if (item == ddlCaracter.SelectedValue)
+ if ((item == ddlCaracter.SelectedValue) && (ddlCaracter.SelectedValue!=""))
{ obligafis = true; break; }
}
return obligafis;
}
- //private bool VerificarFechaPacienteMuestra()
- //{
- // Paciente oPaciente = new Paciente();
- // oPaciente = (Paciente)oPaciente.Get(typeof(Paciente), int.Parse(HFIdPaciente.Value));
-
- // string tieneingreso = oPaciente.GetFechaProtocolosReciente(Request["idServicio"].ToString(),ddlMuestra.SelectedValue);
- // if (tieneingreso==txtFecha.Value) return false;
- // else return true;
- //}
-
-
- private bool VerificarAnalisisContenidos()
- {
- bool devolver = true;
- string[] tabla = TxtDatos.Value.Split('@');
- string listaCodigo = "";
-
- for (int i = 0; i < tabla.Length - 1; i++)
-
- {
- string[] fila = tabla[i].Split('#');
- string codigo = fila[1].ToString();
- if (listaCodigo == "")
- listaCodigo = "'" + codigo + "'";
- else
- listaCodigo += ",'" + codigo + "'";
-
- int i_idItemPractica = 0;
- if (codigo != "")
- {
-
- Item oItem = new Item();
- oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
- if (oItem.VerificaMuestrasAsociadas(int.Parse(ddlMuestra.SelectedValue)))
- {
-
- i_idItemPractica = oItem.IdItem;
- for (int j = 0; j < tabla.Length - 1; j++)
-
- {
- string[] fila2 = tabla[j].Split('#');
- string codigo2 = fila2[1].ToString();
- if ((codigo2 != "") && (codigo != codigo2))
- {
- Item oItem2 = new Item();
- oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
-
- //MultiEfector: filtro por efector
-
-
- ISession m_session = NHibernateHttpModule.CurrentSession;
- ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
- crit.Add(Expression.Eq("IdItemPractica", oItem));
- crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
- crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
- PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
-
-
-
- if (oGrupo != null)
- {
-
- this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
- devolver = false; break;
-
- }
-
- }
-
- }////for
- }
- else
- {
- this.cvValidacionInput.ErrorMessage = "Ha ingresado tipo de muestra que no corresponde con el codigo " + codigo + ". Verifique configuracion.";
- devolver = false; break;
-
- }
-
- }/// if codigo
- if (!devolver) break;
- }
-
- if ((devolver) && (listaCodigo != ""))
- { devolver = VerificarAnalisisComplejosContenidos(listaCodigo); }
-
- return devolver;
-
- }
+
+
private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
{ ///Este es un segundo nivel de validacion en donde los analisis contenidos no estan directamente sino en diagramas
@@ -4475,17 +4581,6 @@ private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
- //protected void lnkReimprimirComprobante_Click(object sender, EventArgs e)
- //{
- // Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
- // oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
-
- // ////Imprimir Comprobante para el paciente
- // Imprimir(oRegistro);
-
-
-
- //}
protected void lnkReimprimirCodigoBarras_Click(object sender, EventArgs e)
{
@@ -4561,15 +4656,7 @@ private void Avanzar(int avance)
}
}
- }
- //if (avance == 1)
- //{
- // ProtocoloNuevo = ProtocoloActual+1;
- //}
- //else //retrocede
- // ProtocoloNuevo = ProtocoloActual - 1;
-
-
+ }
ISession m_session = NHibernateHttpModule.CurrentSession;
ICriteria crit = m_session.CreateCriteria(typeof(Protocolo));
@@ -4634,7 +4721,8 @@ private void CargarDiagnosticosFrecuentes()
string m_ssql = @"SELECT top 20 ID, Codigo + ' - ' + Nombre as nombre, count (*) cantidad
FROM Sys_CIE10 c (nolock)
inner join LAB_ProtocoloDiagnostico p (nolock) on c.id = p.idDiagnostico
-where p.idEfector=" + oUser.IdEfector.IdEfector.ToString() + @"
+where c.tipo='DIAG' and
+p.idEfector=" + oUser.IdEfector.IdEfector.ToString() + @"
group by id, codigo, nombre
ORDER BY cantidad desc";
@@ -4764,9 +4852,42 @@ private void MostrarMedico()
ddlEspecialista.Items.Insert(0, new ListItem(espe, matricula+ '#' + espe));
}
if (pro.Count > 1)
+ {
if (Request["idProtocolo"] == null)
{ ddlEspecialista.Items.Insert(0, new ListItem("--Seleccione--", "0")); }
+ #region SelecionProfesional
+ if (Session["apellidoNombre"] != null)
+ {
+ foreach (ListItem item in ddlEspecialista.Items)
+ {
+
+ //EJEMPLO DE item.Value:
+ //1541#CAVIEZA NAIR AMANCAY - TÉCNICO SUPERIOR EN RADIOLOGIA#
+ int positionFinal = item.Value.IndexOf("-");
+ if (positionFinal < 0)
+ continue; //Es el caso de "--Seleccione--", "0"
+
+ string apellidoNombre = item.Value.Substring(0, positionFinal);
+ int posicion = apellidoNombre.IndexOf("#");
+
+ if (posicion < 0)
+ continue;
+
+ apellidoNombre = apellidoNombre.Substring(posicion + 1).Trim();
+
+
+ if (apellidoNombre.Equals(Session["apellidoNombre"].ToString()))
+ {
+ ddlEspecialista.SelectedValue = item.Value;
+ break;
+ }
+ }
+ }
+ #endregion
+ }
+
+
lblErrorMedico.Visible = false;
}
@@ -4796,7 +4917,7 @@ private void MostrarMedico()
}
-
+
public class Profesiones
{
public List matriculacion { get; set; }
@@ -4804,19 +4925,21 @@ public class Profesiones
}
public class Matricula
-
{
public string matriculaNumero { get; set; }
-
+ public DateTime fin { get; set; }
+
}
- public class ProfesionalMatriculado
+ public class ProfesionalMatriculado
{
// public int documento { get; set; }
public string nombre { get; set; }
public string apellido { get; set; }
+ public string cuit { get; set; }
public List profesiones { get; set; }
+ public string id { get; set; } //id que trae de ANDES
//public string Nombre { get; set; }
//public string FechaNacimiento { get; set; }
//public string FechaNac { get; set; }
@@ -4876,13 +4999,16 @@ public class ProfesionalMatriculado
protected void Button1_Click(object sender, EventArgs e)
{
- if (Session["matricula"] != null)
+ if (Session["matricula"] != null && Session["matricula"].ToString() != "")
+ //Agregue que sea distinto de vacio porque al Cancelar sin traer matricula,
+ //deja un string vacio, que hacia que entrara al if y buscara nuevamente un medico
+ //haciendo que la ejecucion se extendiera innecesariamente
{
txtEspecialista.Text = Session["matricula"].ToString();
MostrarMedico();
- TxtDatos.Value = "";
+ //TxtDatos.Value = ""; //No quiero pisar los datos cargados
}
}
@@ -5335,6 +5461,42 @@ private void CargarProtocoloDerivadoLote()
}
}
+ protected void txtCodigoEnfermedadBase_TextChanged(object sender, EventArgs e)
+ {
+
+ try
+ {
+ Cie10 oRegistro = new Cie10();
+ oRegistro = (Cie10)oRegistro.Get(typeof(Cie10), "Codigo", txtCodigoEnfermedadBase.Text );
+ if (oRegistro != null) ddlEnfermedadBase.SelectedValue = oRegistro.Id.ToString();
+ ddlEnfermedadBase.UpdateAfterCallBack = true;
+ }
+ catch (Exception ex)
+ {
+ string exception = "";
+ //while (ex != null)
+ //{
+ exception = ex.Message + "
";
+
+ //}
+ }
+ }
+
+ protected void ddlEnfermedadBase_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ mostrarCodigoEnfermedadBase();
+ }
+
+ private void mostrarCodigoEnfermedadBase()
+ {
+ if ((ddlEnfermedadBase.SelectedValue != "0") && (ddlEnfermedadBase.SelectedValue != ""))
+ {
+ Cie10 oRegistro = new Cie10();
+ oRegistro = (Cie10)oRegistro.Get(typeof(Cie10), int.Parse(ddlEnfermedadBase.SelectedValue.ToString()));
+ if (oRegistro != null) txtCodigoEnfermedadBase.Text = oRegistro.Codigo;
+ txtCodigoEnfermedadBase.UpdateAfterCallBack = true;
+ }
+ }
}
}
diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs
index 8ff1ffc6..e144026b 100644
--- a/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs
+++ b/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs
@@ -138,6 +138,33 @@ public partial class ProtocoloEdit2 {
///
protected global::System.Web.UI.WebControls.HiddenField HFSexo;
+ ///
+ /// HFSelMedico control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField HFSelMedico;
+
+ ///
+ /// HFSelRenaper control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField HFSelRenaper;
+
+ ///
+ /// HFModificarPaciente control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField HFModificarPaciente;
+
///
/// hplModificarPaciente control.
///
@@ -633,24 +660,6 @@ public partial class ProtocoloEdit2 {
///
protected global::Anthem.LinkButton lnkAgregarItem;
- ///
- /// pnlImpresoraAlta control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlImpresoraAlta;
-
- ///
- /// ddlImpresoraEtiqueta control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.DropDownList ddlImpresoraEtiqueta;
-
///
/// TxtDatosCargados control.
///
@@ -822,6 +831,42 @@ public partial class ProtocoloEdit2 {
///
protected global::System.Web.UI.WebControls.CheckBox chkSinFUC;
+ ///
+ /// pnlEnfermedadBase control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel pnlEnfermedadBase;
+
+ ///
+ /// lblEB control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Anthem.Label lblEB;
+
+ ///
+ /// txtCodigoEnfermedadBase control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Anthem.TextBox txtCodigoEnfermedadBase;
+
+ ///
+ /// ddlEnfermedadBase control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Anthem.DropDownList ddlEnfermedadBase;
+
///
/// pnlEtiquetas control.
///
@@ -912,6 +957,24 @@ public partial class ProtocoloEdit2 {
///
protected global::WebLab.Calidad.IncidenciaEdit IncidenciaEdit1;
+ ///
+ /// pnlImpresoraAlta control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlImpresoraAlta;
+
+ ///
+ /// ddlImpresoraEtiqueta control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlImpresoraEtiqueta;
+
///
/// txtObservacion control.
///
diff --git a/WebLab/Protocolos/ProtocoloList.aspx.cs b/WebLab/Protocolos/ProtocoloList.aspx.cs
index f73afc08..685b1c2a 100644
--- a/WebLab/Protocolos/ProtocoloList.aspx.cs
+++ b/WebLab/Protocolos/ProtocoloList.aspx.cs
@@ -242,23 +242,7 @@ private void CargarListas()
m_ssql += " and idTipoServicio>0";
oUtil.CargarCombo(ddlServicio, m_ssql, "idTipoServicio", "nombre", connReady);
-
-
- //if (oUser.Administrador)
- //{
- // m_ssql = "select distinct E.idEfector, E.nombre from sys_efector E " +
- // " INNER JOIN lab_Configuracion C on C.idEfector=E.idEfector " +
- // "order by E.nombre";
-
- // oUtil.CargarCombo(ddlEfector, m_ssql, "idEfector", "nombre");
- // ddlEfector.Items.Insert(0, new ListItem("Configuracion General", "227"));
- //}
- //else
- //{
- // m_ssql = "select E.idEfector, E.nombre from sys_efector E where E.idEfector= " + oUser.IdEfector.IdEfector.ToString();
- // oUtil.CargarCombo(ddlEfector, m_ssql, "idEfector", "nombre");
- //}
-
+
@@ -314,7 +298,8 @@ private void CargarListas()
ddlPrioridad.Visible = false;
}
///Carga de Sectores
- m_ssql = "SELECT idSectorServicio, nombre + ' - ' + prefijo as nombre FROM LAB_SectorServicio with (nolock) WHERE (baja = 0) order by nombre";
+ m_ssql = @"SELECT idSectorServicio, nombre + ' - ' + prefijo as nombre FROM LAB_SectorServicio S with (nolock) WHERE (baja = 0)
+ and exists(select 1 from Lab_SectorServicioEfector SE where SE.idSectorServicio = S.idSectorServicio and se.idefector = "+oUser.IdEfector.IdEfector.ToString()+@") order by nombre";
oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
ddlSectorServicio.Items.Insert(0, new ListItem("-- Todos --", "0"));
diff --git a/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs b/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs
index 193a2389..c0b4d968 100644
--- a/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs
+++ b/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs
@@ -164,7 +164,7 @@ protected void Page_Load(object sender, EventArgs e)
CargarProtocoloDerivadoLote();
}
-
+
}
}
else
@@ -472,11 +472,22 @@ private void CargarListas()
///Carga de grupos de numeración solo si el tipo de numeración es 2: por Grupos => obsoleto con sil2
- string m_ssql = "SELECT idSectorServicio, prefijo + ' - ' + nombre as nombre FROM LAB_SectorServicio with (nolock) WHERE (baja = 0) order by nombre";
- oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
- ddlSectorServicio.Items.Insert(0, new ListItem("Seleccione", "0"));
+ //string m_ssql = "SELECT idSectorServicio, prefijo + ' - ' + nombre as nombre FROM LAB_SectorServicio with (nolock) WHERE (baja = 0) order by nombre";
+ //oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
+ //ddlSectorServicio.Items.Insert(0, new ListItem("Seleccione", "0"));
+
+
+ string str_condicion = ")";
+ if ((Request["Operacion"].ToString() == "Modifica") && (Request["idProtocolo"] != null))
+ str_condicion = " or exists (select 1 from LAB_Protocolo p WHERE p.idsector = s.idSectorServicio and idProtocolo = " + Request["idProtocolo"].ToString() + ")) ";
+ string m_ssql = @"SELECT s.idSectorServicio, s.prefijo + ' - ' + s.nombre as nombre FROM LAB_SectorServicio S with (nolock)
+ WHERE (baja = 0)
+ and ( exists (select 1 from Lab_SectorServicioEfector SE where SE.idSectorServicio=S.idSectorServicio and se.idefector=" + oUser.IdEfector.IdEfector.ToString() + @" )" + str_condicion + @" order by nombre";
+
+ oUtil.CargarCombo(ddlSectorServicio, m_ssql, "idSectorServicio", "nombre", connReady);
+ ddlSectorServicio.Items.Insert(0, new ListItem("Seleccione", "0"));
/////////////////////////////////////////////CODIGO DE BARRAS//////////////////////////////////////////////////////////////////////
tab3Titulo.Visible = false;
pnlEtiquetas.Visible = false;
@@ -800,7 +811,7 @@ protected void btnGuardar_Click(object sender, EventArgs e)
case "ProtocoloList": Response.Redirect("ProtocoloList.aspx?idServicio=" + Session["idServicio"].ToString() + "&Tipo=ListaProducto"); break;
case "Control": Avanzar(1); break;
}
- }
+ }
if (Request["Operacion"].ToString() == "AltaDerivacionMultiEfectorLote")
{
Business.Data.Laboratorio.Protocolo oRegistroAnterior = new Business.Data.Laboratorio.Protocolo();
@@ -1231,7 +1242,8 @@ private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro)
GuardarDetallePractica(oDetalle);
- GuardarDerivacion(oDetalle);
+ //GuardarDerivacion(oDetalle);
+ oDetalle.GuardarDerivacion(oUser);
}
else //si ya esta actualizo si trajo muestra o no
{
@@ -1608,8 +1620,6 @@ protected void btnCancelar_Click(object sender, EventArgs e)
case "Control": Response.Redirect("ProtocoloList.aspx?idServicio=" + Session["idServicio"].ToString() + "&Tipo=Control"); break;
case "AltaDerivacionMultiEfectorLote": Response.Redirect("DerivacionMultiEfectorLote.aspx?idEfectorSolicitante=" + Request["idEfectorSolicitante"].ToString() + "&idServicio=1&idLote=" + Request["idLote"]); break;
}
-
-
}
@@ -1720,6 +1730,8 @@ protected void cvAnalisis_ServerValidate(object source, ServerValidateEventArgs
protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args)
{
+ string[] bk = TxtDatosCargados.Value.Split(';');
+
TxtDatosCargados.Value = TxtDatos.Value;
string sDatos = "";
@@ -1730,12 +1742,19 @@ protected void cvValidacionInput_ServerValidate(object source, ServerValidateEve
{
string[] fila = tabla[i].Split('#');
string codigo = fila[1].ToString();
- string muestra= fila[2].ToString();
-
- if (sDatos == "")
- sDatos = codigo + "#" + muestra;
+ string muestra= fila[2].ToString();
+ string conResultado = "false";
+
+ //Cargo el valor del resultado para no perderlo si da error la validacion
+ if (i < bk.Length && bk.Length > 1) //TxtDatosCargados en Alta no tiene valores!
+ {
+ string[] filaBk = bk[i].Split('#');
+ conResultado = filaBk[2].ToString();
+ }
+ if (sDatos == "")
+ sDatos = codigo + "#" + muestra + "#" + conResultado;
else
- sDatos += ";" + codigo + "#" + muestra;
+ sDatos += ";" + codigo + "#" + muestra + "#" + conResultado;
}
@@ -1816,14 +1835,14 @@ protected void cvValidacionInput_ServerValidate(object source, ServerValidateEve
}
}
-
private bool VerificarAnalisisContenidos()
{
bool devolver = true;
string[] tabla = TxtDatos.Value.Split('@');
string listaCodigo = "";
-
+
for (int i = 0; i < tabla.Length - 1; i++)
+
{
string[] fila = tabla[i].Split('#');
string codigo = fila[1].ToString();
@@ -1837,52 +1856,245 @@ private bool VerificarAnalisisContenidos()
{
Item oItem = new Item();
- oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+ oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+ if (oItem.VerificaMuestrasAsociadas(int.Parse(ddlMuestra.SelectedValue)))
+ {
+ i_idItemPractica = oItem.IdItem;
+ for (int j = 0; j < tabla.Length - 1; j++)
- i_idItemPractica = oItem.IdItem;
- for (int j = 0; j < tabla.Length - 1; j++)
- {
- string[] fila2 = tabla[j].Split('#');
- string codigo2 = fila2[1].ToString();
- if ((codigo2 != "") && (codigo!=codigo2))
{
- Item oItem2 = new Item();
- oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
+ string[] fila2 = tabla[j].Split('#');
+ string codigo2 = fila2[1].ToString();
+ if ((codigo2 != "") && (codigo != codigo2))
+ {
+ Item oItem2 = new Item();
+ oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
- //PracticaDeterminacion oGrupo = new PracticaDeterminacion();
- //oGrupo = (PracticaDeterminacion)oGrupo.Get(typeof(PracticaDeterminacion), "IdItemPractica", oItem, "IdItemDeterminacion", oItem2.IdItem);
+ //MultiEfector: filtro por efector
- ISession m_session = NHibernateHttpModule.CurrentSession;
- ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
- crit.Add(Expression.Eq("IdItemPractica", oItem));
- crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
- crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
- PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
+ ISession m_session = NHibernateHttpModule.CurrentSession;
+ ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ crit.Add(Expression.Eq("IdItemPractica", oItem));
+ crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
+ crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
+
+
+
+ if (oGrupo != null)
+ {
+
+ this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
+ devolver = false; break;
+
+ }
- if (oGrupo != null)
- {
-
- this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
- devolver = false; break;
-
}
-
- }
- }////for
+
+ }////for
+ }
+ else
+ {
+ this.cvValidacionInput.ErrorMessage = "Ha ingresado tipo de muestra que no corresponde con el codigo " + codigo + ". Verifique configuracion.";
+ devolver = false; break;
+
+ }
+
}/// if codigo
if (!devolver) break;
}
if ((devolver) && (listaCodigo != ""))
{ devolver = VerificarAnalisisComplejosContenidos(listaCodigo); }
-
+
return devolver;
-
- }
- private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
+ }
+
+ //LAB-192: Bug análisis Repetidos en protocolos. No lo pasamos a produccion porque baja la perfomance del sistema.
+
+ // private bool VerificarAnalisisContenidos_LAB192()
+ // {
+ // bool devolver = true;
+ // string[] tabla = TxtDatos.Value.Split('@');
+ // string listaCodigo = "";
+ // var subItemsEnBD = new Dictionary();
+ // for (int i = 0; i < tabla.Length - 1; i++)
+ // {
+ // string[] fila = tabla[i].Split('#');
+ // string codigo = fila[1].ToString();
+ // if (listaCodigo == "")
+ // listaCodigo = "'" + codigo + "'";
+ // else
+ // listaCodigo += ",'" + codigo + "'";
+
+ // if (codigo != "")
+ // {
+
+ // Item oItem = new Item();
+ // oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+
+ // //1- Si el idItem ya esta en DetalleProtocolo (para los casos de "Modifica" no verifico Analisis)
+ // // if (Request["Operacion"].ToString() == "Modifica")
+ // if (Request["idProtocolo"] != null)//Caro: unifco instanciacion de protocolo cuando es modificacion
+ // {
+ // Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
+ // oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
+ // //try //Caro: saco try cath por errores silenciosos
+ // //{
+ // if ((oRegistro != null) && (oItem != null))
+ // {
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
+ // crit.Add(Expression.Eq("IdItem", oItem));
+ // crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ // IList lista = crit.List();
+
+ // if (lista.Count == 0)//no esta en la base
+ // {
+ // devolver = VerificaMuestrasAsociadas(codigo, oItem, tabla, subItemsEnBD);
+
+ // }
+ // else
+ // {
+ // foreach (DetalleProtocolo oDetalle in lista)
+ // {
+ // subItemsEnBD[oDetalle.IdSubItem.IdItem] = oDetalle.IdItem.IdItem;
+ // }
+
+ // }
+ // }
+ // //}
+ // //catch(Exception e)
+ // //{
+ // // this.cvValidacionInput.ErrorMessage = e.Message;
+ // // devolver = false; break;
+ // //}
+
+ // }
+ // else // no es modificacion
+ // {
+ // devolver = VerificaMuestrasAsociadas(codigo, oItem, tabla);
+ // }
+
+ // }/// if codigo
+ // if (!devolver) break;
+ // }
+
+ // if ((devolver) && (listaCodigo != ""))
+ // { devolver = VerificarAnalisisComplejosContenidos(listaCodigo); }
+
+ // return devolver;
+
+ // }
+ // private bool VerificaMuestrasAsociadas(string codigo, Item oItem, string[] tabla, Dictionary itemsEnBD = null)
+ //{
+ // bool devolver = true;
+
+
+ // if (oItem.VerificaMuestrasAsociadas(int.Parse(ddlMuestra.SelectedValue)))
+ // {
+
+
+ // for (int j = 0; j < tabla.Length - 1; j++)
+
+ // {
+ // string[] fila2 = tabla[j].Split('#');
+ // string codigo2 = fila2[1].ToString();
+ // if ((codigo2 != "") && (codigo != codigo2))
+ // {
+ // Item oItem2 = new Item();
+ // oItem2 = (Item)oItem2.Get(typeof(Item), "Codigo", codigo2, "Baja", false);
+
+ // //MultiEfector: filtro por efector
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ // crit.Add(Expression.Eq("IdItemPractica", oItem));
+ // crit.Add(Expression.Eq("IdItemDeterminacion", oItem2.IdItem));
+ // crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ // PracticaDeterminacion oGrupo = (PracticaDeterminacion)crit.UniqueResult();
+
+
+
+ // if (oGrupo != null)
+ // {
+
+ // this.cvValidacionInput.ErrorMessage = "Ha cargado análisis contenidos en otros. Verifique los códigos " + codigo + " y " + codigo2 + "!";
+ // devolver = false; break;
+
+ // }
+
+ // // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+ // //Verifico que el codigo cargado tampoco este en mi lista de subItems de la base de datos!
+
+ // if (itemsEnBD != null)
+ // {
+ // Item oItemExistente = new Item();
+ // bool hayConflicto = false;
+ // int itemExistente = 0;
+
+ // m_session = NHibernateHttpModule.CurrentSession;
+ // crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ // crit.Add(Expression.Eq("IdItemPractica", oItem));
+ // crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ // IList detalle = crit.List();
+
+ // if (detalle.Count > 0) //Es practica
+ // {
+ // foreach (PracticaDeterminacion item in detalle)
+ // {
+ // if (itemsEnBD.ContainsKey(item.IdItemDeterminacion))
+ // {
+ // itemExistente = itemsEnBD[item.IdItemDeterminacion];
+ // hayConflicto = true; break;
+ // }
+ // }
+ // }
+ // else //es determinacion simple idItem=idSubitem
+ // {
+ // if (itemsEnBD.ContainsKey(oItem.IdItem))
+ // {
+ // itemExistente = itemsEnBD[oItem.IdItem];
+ // hayConflicto = true;
+ // }
+ // }
+
+ // if (hayConflicto)
+ // {
+ // string mensajeerror = "";
+ // oItemExistente = (Item)oItemExistente.Get(typeof(Item), "IdItem", itemExistente);//, "Baja", false); //Caro: le saco la condicion de baja porque si fue grabado en la base y despues lo pusieron de baja no lo va a encontrar
+ // if (oItemExistente != null)///Caro agrego control de que exista si no va a dar error al usarlo
+ // {
+ // mensajeerror =
+ // "Ha cargado análisis contenidos en otros. Verifique los códigos " +
+ // codigo + " y " + oItemExistente.Codigo + "!";
+
+ // }
+ // else
+ // mensajeerror = "Ha cargado análisis contenidos en otros. Verifique los códigos ";
+
+ // this.cvValidacionInput.ErrorMessage = mensajeerror;
+ // devolver = false;
+ // }
+
+ // }
+ // }
+
+ // }////for
+ // }
+ // else
+ // {
+ // this.cvValidacionInput.ErrorMessage = "Ha ingresado tipo de muestra que no corresponde con el codigo " + codigo + ". Verifique configuracion.";
+ // devolver = false; //break;
+
+ // }
+
+ // return devolver;
+ //}
+
+ private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
{ ///Este es un segundo nivel de validacion en donde los analisis contenidos no estan directamente sino en diagramas
bool devolver = true;
string m_ssql = "SELECT PD.idItemDeterminacion, I.codigo" +
@@ -2136,8 +2348,10 @@ private void CargarProtocoloDerivadoLote()
private void ActualizarEstadoDerivacion(Protocolo oRegistro, Protocolo oAnterior)
{
- Business.Data.Laboratorio.Derivacion oDerivacion = new Business.Data.Laboratorio.Derivacion();
- oDerivacion.MarcarComoRecibidas(oAnterior, oRegistro, oUser, Convert.ToInt32(Request["idLote"]));
+ //Business.Data.Laboratorio.Derivacion oDerivacion = new Business.Data.Laboratorio.Derivacion();
+ //oDerivacion.MarcarComoRecibidas(oAnterior, oRegistro, oUser, Convert.ToInt32(Request["idLote"]));
+ DetalleProtocolo dp = new DetalleProtocolo();
+ dp.ActualizarItemsDerivados(oRegistro, oAnterior, Convert.ToInt32(Request["idLote"]), oUser);
}
private void VerificacionEstadoLote(Protocolo oRegistro, Protocolo oAnterior)
diff --git a/WebLab/Resultados/ATBEdit.aspx b/WebLab/Resultados/ATBEdit.aspx
index 3896bb4e..6ea62d6d 100644
--- a/WebLab/Resultados/ATBEdit.aspx
+++ b/WebLab/Resultados/ATBEdit.aspx
@@ -50,7 +50,7 @@
-
+
|
@@ -91,7 +91,7 @@
+ Width="200px" >
|
@@ -99,7 +99,7 @@
Antibiótico: |
-
+
@@ -143,7 +143,7 @@
-
+
+
diff --git a/WebLab/Resultados/ATBEdit.aspx.cs b/WebLab/Resultados/ATBEdit.aspx.cs
index d98ef937..58caff84 100644
--- a/WebLab/Resultados/ATBEdit.aspx.cs
+++ b/WebLab/Resultados/ATBEdit.aspx.cs
@@ -49,7 +49,7 @@ protected void Page_Load(object sender, EventArgs e)
lblGermen.Text = s_numeroAislamiento + " " + oGermen.Nombre;
lblPractica.Text = oItem.Nombre;
- CargarMecanismos(oProtocolo, oGermen, oItem, int.Parse(s_idMetodo));
+ CargarMecanismos(oProtocolo, oGermen, oItem, int.Parse(s_idMetodo), int.Parse(s_numeroAislamiento));
CargarPerfilAntibiotico();
CargarListaAntibiotico();
@@ -74,7 +74,7 @@ LAB_Antibiotico AS A with (nolock) ON DPA.idAntibiotico = A.idAntibiotico
//////////////////////////////
}
- private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem, int v)
+ private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem, int v, int n)
{
Utility oUtil = new Utility();
string m_ssql = @"SELECT idMecanismoResistencia, sigla as nombre FROM LAB_MecanismoResistencia with (nolock) order by nombre";
@@ -93,6 +93,7 @@ private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem,
ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloAtbMecanismo));
crit.Add(Expression.Eq("IdProtocolo", oProtocolo));
crit.Add(Expression.Eq("IdMetodologia", v));
+ crit.Add(Expression.Eq("NumeroAislamiento", n));
crit.Add(Expression.Eq("IdGermen", oGermen));
crit.Add(Expression.Eq("IdItem", oItem.IdItem));
@@ -130,8 +131,16 @@ private void ActualizarVistaAntibiograma()
//lblCantidadAntibiograma.Text = " *" + cantidadAntibiogramas.ToString();
string m_ssql = @" SELECT ATB.idAntibiograma, A.descripcion, ATB.resultado, ATB.valor, ATB.idMetodologia
+,ATB.idUsuarioRegistro,
+ATB.idUsuarioValida,
+ATB.fechaRegistro,
+UR.apellido + ' ' + UR.nombre as UsuarioRegistro,
+UV.apellido + ' ' + UV.nombre as UsuarioValida
+
FROM LAB_Antibiograma AS ATB with (nolock) INNER JOIN
LAB_Antibiotico AS A with (nolock) ON ATB.idAntibiotico = A.idAntibiotico
+LEFT JOIN Sys_Usuario UR ON UR.idUsuario = ATB.idUsuarioRegistro
+ LEFT JOIN Sys_Usuario UV ON UV.idUsuario = ATB.idUsuarioValida
WHERE ATB.numeroAislamiento=" + s_numeroAislamiento +" and ATB.idMetodologia=" + s_idMetodo + " AND (ATB.idProtocolo = " + s_idProtocolo + ") AND (ATB.idItem = " + s_iditem + ") AND (ATB.idGermen = " + s_idGermen + ") order by A.descripcion";
@@ -284,47 +293,97 @@ private void EliminarAntibiotico(string anti)
protected void gvAntiobiograma_RowDataBound(object sender, GridViewRowEventArgs e)
{
- if (e.Row.RowType == DataControlRowType.DataRow)
+ /* if (e.Row.RowType == DataControlRowType.DataRow)
+ {
+ ImageButton CmdModificar = (ImageButton)e.Row.Cells[4].Controls[1];
+ CmdModificar.CommandArgument = this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString();
+ CmdModificar.CommandName = "Eliminar";
+ CmdModificar.ToolTip = "Eliminar";
+
+ // si esta validado no se puede eliminar
+ Antibiograma oRegistro = new Antibiograma();
+ oRegistro = (Antibiograma)oRegistro.Get(typeof(Antibiograma), int.Parse(this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString()));
+ if ((oRegistro.IdUsuarioValida > 0) && (Request["Operacion"] == "Carga"))
+ CmdModificar.Visible = false;
+ /////
+ Label lbl = (e.Row.Cells[3].FindControl("lblEstado") as Label);
+ if (oRegistro.IdUsuarioRegistro == 0) //enviado por el equipo
+ {
+ //lblPersona.Text = "AUTOMÃTICO: " + oDetalle.FechaResultado.ToShortDateString() + " - " + oDetalle.FechaResultado.ToShortTimeString();
+ lbl.Text = "AUTOMATICO " + oRegistro.FechaRegistro.ToShortDateString() + " - " + oRegistro.FechaRegistro.ToShortTimeString();
+ lbl.ForeColor = Color.Red;
+ }
+ else
+ {
+ Usuario oUser = new Usuario();
+
+ oUser = (Usuario)oUser.Get(typeof(Usuario), oRegistro.IdUsuarioRegistro);
+ lbl.Text = "Carg.: " + oUser.Apellido + " " + oUser.Nombre;
+ lbl.ForeColor = Color.Black;
+
+ }
+ if (oRegistro.IdUsuarioValida > 0) //enviado por el equipo
+ {
+ Usuario oUser = new Usuario();
+
+ oUser = (Usuario)oUser.Get(typeof(Usuario), oRegistro.IdUsuarioValida);
+ lbl.Text = "Val.: " + oUser.Apellido + " " + oUser.Nombre;
+ lbl.ForeColor = Color.Blue;
+ }
+ lbl.Font.Size = FontUnit.Point(7);
+ lbl.Font.Italic = true;
+
+
+ }
+ */
+ if (e.Row.RowType != DataControlRowType.DataRow)
+ return;
+
+ DataRowView drv = (DataRowView)e.Row.DataItem;
+
+
+ ImageButton CmdModificar = e.Row.FindControl("Eliminar") as ImageButton;
+ CmdModificar.CommandArgument = this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString();
+ CmdModificar.CommandName = "Eliminar";
+ CmdModificar.ToolTip = "Eliminar";
+
+
+ if (CmdModificar != null)
{
- ImageButton CmdModificar = (ImageButton)e.Row.Cells[4].Controls[1];
- CmdModificar.CommandArgument = this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString();
- CmdModificar.CommandName = "Eliminar";
- CmdModificar.ToolTip = "Eliminar";
-
- // si esta validado no se puede eliminar
- Antibiograma oRegistro = new Antibiograma();
- oRegistro = (Antibiograma)oRegistro.Get(typeof(Antibiograma), int.Parse(this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString()));
- if ((oRegistro.IdUsuarioValida > 0) && (Request["Operacion"] == "Carga"))
+ int idUsuarioValida = drv["idUsuarioValida"] != DBNull.Value ? Convert.ToInt32(drv["idUsuarioValida"]) : 0;
+
+ if (idUsuarioValida > 0 && Request["Operacion"]?.ToString() == "Carga")
CmdModificar.Visible = false;
- /////
- Label lbl = (e.Row.Cells[3].FindControl("lblEstado") as Label);
- if (oRegistro.IdUsuarioRegistro == 0) //enviado por el equipo
+ }
+
+
+ Label lbl = e.Row.FindControl("lblEstado") as Label;
+
+ if (lbl != null)
+ {
+ int idUsuarioRegistro = drv["idUsuarioRegistro"] != DBNull.Value ? Convert.ToInt32(drv["idUsuarioRegistro"]) : 0;
+ int idUsuarioValida = drv["idUsuarioValida"] != DBNull.Value ? Convert.ToInt32(drv["idUsuarioValida"]) : 0;
+
+ if (idUsuarioRegistro == 0)
{
- //lblPersona.Text = "AUTOMÃTICO: " + oDetalle.FechaResultado.ToShortDateString() + " - " + oDetalle.FechaResultado.ToShortTimeString();
- lbl.Text = "AUTOMATICO " + oRegistro.FechaRegistro.ToShortDateString() + " - " + oRegistro.FechaRegistro.ToShortTimeString();
+ DateTime fecha = Convert.ToDateTime(drv["fechaRegistro"]);
+ lbl.Text = "AUTOMATICO " + fecha.ToString("dd/MM/yyyy HH:mm");
lbl.ForeColor = Color.Red;
}
else
{
- Usuario oUser = new Usuario();
-
- oUser = (Usuario)oUser.Get(typeof(Usuario), oRegistro.IdUsuarioRegistro);
- lbl.Text = "Carg.: " + oUser.Apellido + " " + oUser.Nombre;
+ lbl.Text = "Carg.: " + drv["UsuarioRegistro"].ToString();
lbl.ForeColor = Color.Black;
-
}
- if (oRegistro.IdUsuarioValida > 0) //enviado por el equipo
- {
- Usuario oUser = new Usuario();
- oUser = (Usuario)oUser.Get(typeof(Usuario), oRegistro.IdUsuarioValida);
- lbl.Text = "Val.: " + oUser.Apellido + " " + oUser.Nombre;
+ if (idUsuarioValida > 0)
+ {
+ lbl.Text = "Val.: " + drv["UsuarioValida"].ToString();
lbl.ForeColor = Color.Blue;
}
+
lbl.Font.Size = FontUnit.Point(7);
lbl.Font.Italic = true;
-
-
}
}
@@ -395,7 +454,7 @@ protected void btnGuardarMecanismo_Click(object sender, EventArgs e)
Germen oGermen = new Germen();
oGermen = (Germen)oGermen.Get(typeof(Germen), int.Parse(s_idGermen));
if ((oProtocolo != null) && (oGermen != null))
- GuardarMecanismo(oProtocolo, oGermen, int.Parse(s_idMetodo), int.Parse(s_iditem));
+ GuardarMecanismo(oProtocolo, oGermen, int.Parse(s_idMetodo), int.Parse(s_iditem), int.Parse(s_numeroAislamiento));
lblMensajeMecanismo.Visible = true;
lblMensajeMecanismo.Text = "Mecanismos actualizados";
@@ -407,7 +466,7 @@ protected void btnGuardarMecanismo_Click(object sender, EventArgs e)
}
}
- private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodologia, int iditem)
+ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodologia, int iditem, int n)
{
try
{
@@ -430,6 +489,7 @@ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodo
crit2.Add(Expression.Eq("IdGermen", oGermen));
crit2.Add(Expression.Eq("IdItem", iditem));
crit2.Add(Expression.Eq("IdMetodologia", idmetodologia));
+ crit2.Add(Expression.Eq("NumeroAislamiento", n));
crit2.Add(Expression.Eq("IdMecanismoResistencia", oM));
IList lista2 = crit2.List();
@@ -442,6 +502,7 @@ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodo
oRegistro.IdMetodologia = idmetodologia;
oRegistro.IdItem = iditem;
oRegistro.IdMecanismoResistencia = oM;
+ oRegistro.NumeroAislamiento = n;
oRegistro.Save();
oProtocolo.GrabarAuditoriaDetalleProtocolo("Graba", oUser.IdUsuario, "ATB: " + oGermen.Nombre + "- Mecanismo", oM.Nombre);
}
diff --git a/WebLab/Resultados/ATBValida.aspx b/WebLab/Resultados/ATBValida.aspx
index 7277b894..9afa8ac4 100644
--- a/WebLab/Resultados/ATBValida.aspx
+++ b/WebLab/Resultados/ATBValida.aspx
@@ -218,7 +218,14 @@
-
+
+
+
+
+
+
diff --git a/WebLab/Resultados/ATBValida.aspx.cs b/WebLab/Resultados/ATBValida.aspx.cs
index aac9d58f..d8c3237e 100644
--- a/WebLab/Resultados/ATBValida.aspx.cs
+++ b/WebLab/Resultados/ATBValida.aspx.cs
@@ -54,14 +54,14 @@ protected void Page_Load(object sender, EventArgs e)
CargarPerfilAntibiotico();
CargarListaAntibiotico();
- CargarMecanismos(oProtocolo, oGermen, oItem, int.Parse(s_idMetodo));
+ CargarMecanismos(oProtocolo, oGermen, oItem, int.Parse(s_idMetodo), int.Parse(s_numeroAislamiento));
ActualizarVistaAntibiograma();
}
}
- private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem, int v)
+ private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem, int v, int n)
{
Utility oUtil = new Utility();
string m_ssql = @"SELECT idMecanismoResistencia, sigla as nombre FROM LAB_MecanismoResistencia with (nolock) order by nombre";
@@ -79,6 +79,7 @@ private void CargarMecanismos(Protocolo oProtocolo, Germen oGermen, Item oItem,
ISession m_session = NHibernateHttpModule.CurrentSession;
ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloAtbMecanismo));
crit.Add(Expression.Eq("IdProtocolo", oProtocolo));
+ crit.Add(Expression.Eq("NumeroAislamiento", n));
crit.Add(Expression.Eq("IdMetodologia", v));
crit.Add(Expression.Eq("IdGermen", oGermen));
crit.Add(Expression.Eq("IdItem", oItem.IdItem));
@@ -141,6 +142,7 @@ private void ActualizarVistaAntibiograma()
/*
* store nuevo: parametros int grupo, int subgrupo, int etiologia, int anio, string semana, string codigo, string sexo, int id_establecimiento, string usuario_sivila
+ El store trae todos los datos que se necesita para la grilla
*/
cmd.Parameters.Add("@idItem", SqlDbType.Int); cmd.Parameters["@idItem"].Value = s_iditem;
@@ -155,49 +157,7 @@ private void ActualizarVistaAntibiograma()
da.Fill(Ds);
gvAntiobiograma.DataSource = Ds.Tables[0];
- gvAntiobiograma.DataBind();
-
-
- foreach (GridViewRow row in gvAntiobiograma.Rows)
- {
- if (row.RowType == DataControlRowType.DataRow)
- {
- Label lbl = (row.Cells[6].FindControl("lblEstado") as Label);
- if (lbl!=null)
- {
- Antibiograma oAtb = new Antibiograma();
- oAtb = (Antibiograma)oAtb.Get(typeof(Antibiograma), int.Parse(gvAntiobiograma.DataKeys[row.RowIndex].Value.ToString()));
-
- if (oAtb.IdUsuarioRegistro == 0) //enviado por el equipo
- {
- //lblPersona.Text = "AUTOMÃTICO: " + oDetalle.FechaResultado.ToShortDateString() + " - " + oDetalle.FechaResultado.ToShortTimeString();
- lbl.Text = "AUTOMATICO " + oAtb.FechaRegistro.ToShortDateString() + " - " + oAtb.FechaRegistro.ToShortTimeString();
- lbl.ForeColor = Color.Red;
- }
- else
- {
- Usuario oUser = new Usuario();
-
- oUser = (Usuario)oUser.Get(typeof(Usuario), oAtb.IdUsuarioRegistro);
- lbl.Text = "Carg.: " + oUser.Apellido + " " + oUser.Nombre + " " + oAtb.FechaRegistro.ToShortDateString() + " " + oAtb.FechaRegistro.ToShortTimeString(); ;
- lbl.ForeColor = Color.Black;
-
- }
- if (oAtb.IdUsuarioValida > 0) //enviado por el equipo
- {
- Usuario oUser = new Usuario();
-
- oUser = (Usuario)oUser.Get(typeof(Usuario), oAtb.IdUsuarioValida);
- lbl.Text = "Val.: "+ oUser.FirmaValidacion + " " + oAtb.FechaValida.ToShortDateString() + " " + oAtb.FechaValida.ToShortTimeString();
- lbl.ForeColor = Color.Blue;
- }
- lbl.Font.Size = FontUnit.Point(7);
- lbl.Font.Italic = true;
-
- }
- }
- }
-
+ gvAntiobiograma.DataBind();
@@ -284,11 +244,11 @@ private void GuardarAntibiograma()
oRegistro.Resultado = ddlResultado.SelectedValue;
oRegistro.Valor = txtValor.Text;
-
+
oRegistro.IdUsuarioRegistro = oUser.IdUsuario;
oRegistro.FechaRegistro = DateTime.Now;
- oRegistro.IdUsuarioValida = oUser.IdUsuario;
+ oRegistro.IdUsuarioValida = 0;// oUser.IdUsuario; ///en el alta no se graba como validado, se valida cuando se marca la validacion.
oRegistro.FechaValida = DateTime.Parse("01/01/1900");
oRegistro.Save();
@@ -333,15 +293,48 @@ private void EliminarAntibiotico(string anti)
protected void gvAntiobiograma_RowDataBound(object sender, GridViewRowEventArgs e)
{
- if (e.Row.RowType == DataControlRowType.DataRow)
+
+ if (e.Row.RowType != DataControlRowType.DataRow)
+ return;
+
+ DataRowView drv = (DataRowView)e.Row.DataItem;
+
+ string estadoTexto = drv["EstadoTexto"] != DBNull.Value ? drv["EstadoTexto"].ToString() : "";
+ string estadoColor = drv["EstadoColor"] != DBNull.Value ? drv["EstadoColor"].ToString() : "";
+
+ // 🔹 Label estado
+ Label lbl = e.Row.FindControl("lblEstado") as Label;
+ if (lbl != null)
{
- ImageButton CmdModificar = (ImageButton)e.Row.Cells[7].Controls[1];
- CmdModificar.CommandArgument = this.gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString();
+ lbl.Text = estadoTexto;
+
+ switch (estadoColor)
+ {
+ case "Red":
+ lbl.ForeColor = Color.Red;
+ break;
+ case "Blue":
+ lbl.ForeColor = Color.Blue;
+ break;
+ default:
+ lbl.ForeColor = Color.Black;
+ break;
+ }
+
+ lbl.Font.Size = FontUnit.Point(7);
+ lbl.Font.Italic = true;
+ }
+
+
+ ImageButton CmdModificar = e.Row.FindControl("Eliminar") as ImageButton;
+
+ if (CmdModificar != null)
+ {
+ CmdModificar.CommandArgument = gvAntiobiograma.DataKeys[e.Row.RowIndex].Value.ToString();
CmdModificar.CommandName = "Eliminar";
CmdModificar.ToolTip = "Eliminar";
-
-
}
+
}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
@@ -428,7 +421,7 @@ private void ValidarATB(bool accion)
/// graba auditoria
- oProtocolo.GrabarAuditoriaDetalleProtocolo(operacion, oAtb.IdUsuarioValida, "ATB " + oAtb.NumeroAislamiento.ToString() + " " + oAtb.IdGermen.Nombre + " (" + oAtb.IdMetodologia.ToString() + ") - " + oAtb.IdAntibiotico.Descripcion, oAtb.Resultado);
+ oProtocolo.GrabarAuditoriaDetalleProtocolo(operacion, oAtb.IdUsuarioValida, "ATB " + oAtb.NumeroAislamiento.ToString() + " " + oAtb.IdGermen.Nombre + " (" + lblMetodo.Text + ") - " + oAtb.IdAntibiotico.Descripcion, oAtb.Resultado);
/// fin de grabar auditoria
}
@@ -498,7 +491,7 @@ protected void btnValidarMecanismo_Click(object sender, EventArgs e)
Germen oGermen = new Germen();
oGermen = (Germen)oGermen.Get(typeof(Germen), int.Parse(s_idGermen));
if ((oProtocolo!=null) && (oGermen!= null))
- GuardarMecanismo(oProtocolo, oGermen, int.Parse(s_idMetodo), int.Parse(s_iditem));
+ GuardarMecanismo(oProtocolo, oGermen, int.Parse(s_idMetodo), int.Parse(s_iditem), int.Parse(s_numeroAislamiento));
lblMensajeMecanismo.Visible = true;
lblMensajeMecanismo.Text = "Mecanismos actualizados";
@@ -510,7 +503,7 @@ protected void btnValidarMecanismo_Click(object sender, EventArgs e)
}
}
- private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodologia, int iditem)
+ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodologia, int iditem, int n)
{
try
{
@@ -533,6 +526,7 @@ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodo
crit2.Add(Expression.Eq("IdGermen", oGermen));
crit2.Add(Expression.Eq("IdItem", iditem));
crit2.Add(Expression.Eq("IdMetodologia", idmetodologia));
+ crit2.Add(Expression.Eq("NumeroAislamiento", n));
crit2.Add(Expression.Eq("IdMecanismoResistencia", oM));
IList lista2 = crit2.List();
@@ -543,6 +537,7 @@ private void GuardarMecanismo(Protocolo oProtocolo, Germen oGermen, int idmetodo
oRegistro.IdProtocolo = oProtocolo;
oRegistro.IdGermen = oGermen;
oRegistro.IdMetodologia = idmetodologia;
+ oRegistro.NumeroAislamiento = n;
oRegistro.IdItem = iditem;
oRegistro.IdMecanismoResistencia = oM;
oRegistro.Save();
diff --git a/WebLab/Resultados/AnalisisEdit.aspx b/WebLab/Resultados/AnalisisEdit.aspx
index e0baedda..25ced2f4 100644
--- a/WebLab/Resultados/AnalisisEdit.aspx
+++ b/WebLab/Resultados/AnalisisEdit.aspx
@@ -66,9 +66,10 @@
-
+
Muestra:
@@ -91,7 +92,7 @@
-
+
@@ -126,10 +127,10 @@
-
+ >--%>
@@ -219,7 +220,9 @@
@@ -368,10 +373,10 @@
-
+ <%--
-
+ --%>
@@ -380,7 +385,7 @@
-
+
@@ -448,8 +453,8 @@
-
+ <%-- --%>
|
diff --git a/WebLab/Resultados/ResultadoView.aspx.cs b/WebLab/Resultados/ResultadoView.aspx.cs
index 1f0eb12c..f0884e4e 100644
--- a/WebLab/Resultados/ResultadoView.aspx.cs
+++ b/WebLab/Resultados/ResultadoView.aspx.cs
@@ -88,11 +88,7 @@ protected void Page_PreInit(object sender, EventArgs e)
}
}
- //protected void Page_UnLoad(object sender, EventArgs e)
- //{
- // oCr.Dispose();
- //}
-
+
protected void Page_Load(object sender, EventArgs e)
{
@@ -115,7 +111,7 @@ private void Inicializar()
pnlAntecedentes.Visible = false;
- pnlHC.Visible = true;
+ // pnlHC.Visible = true;
if (Session["validado"].ToString() == "1")
lblTitulo.Text = "HISTORIAL DE RESULTADOS";
else
@@ -206,14 +202,9 @@ private void CargarGrilla()
if (Request["Operacion"].ToString() == "HC")
m_strSQL += " order by idProtocolo desc "; // desde el mas reciente al mas antiguo.
- else
- {
- // Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
- //if (oC.TipoNumeracionProtocolo == 0)
- m_strSQL += " order by idProtocolo ";
- //if (oC.TipoNumeracionProtocolo == 1) m_strSQL += " order by numerodiario ";
- //if (oC.TipoNumeracionProtocolo == 2) m_strSQL += " order by prefijosector, numerosector ";
- }
+ else
+ m_strSQL += " order by idProtocolo ";
+
DataSet Ds = new DataSet();
@@ -273,18 +264,16 @@ private void MuestraDatos(string p)
if (oRegistro != null)
{
- //Configuracion oCon = new Configuracion();
- //oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oRegistro.IdEfector);
- //Image1.= oRegistro.getQRResultados(oCon);
-
+
HFIdProtocolo.Value = p;
//Actualiza los datos de los objetos : alta o modificacion .
lblEfector.Text = oRegistro.IdEfector.Nombre;
oRegistro.GrabarAuditoriaProtocolo("Consulta", int.Parse(Session["idUsuario"].ToString()));
- if (oRegistro.tieneAdjuntoProtocoloVisible())
- { imgAdjunto.Visible = true; spanadjunto.Visible = true; }
- else
- { imgAdjunto.Visible = false; spanadjunto.Visible = false; }
+
+
+ bool tieneAdjunto = oRegistro.tieneAdjuntoProtocoloVisible();
+ imgAdjunto.Visible = tieneAdjunto;
+ spanadjunto.Visible = tieneAdjunto;
if ((oRegistro.IdTipoServicio.IdTipoServicio == 3) || (oRegistro.IdTipoServicio.IdTipoServicio == 5)) //Microbiologia
@@ -313,7 +302,7 @@ private void MuestraDatos(string p)
lblCovid.Visible = true;
Caracter oCaracter = new Caracter();
oCaracter = (Caracter)oCaracter.Get(typeof(Caracter), oRegistro.IdCaracter);
- lblCovid.Text = "Clasificación Covid-19: " + oCaracter.Nombre;
+ lblCovid.Text = "Clasificación SNVS: " + oCaracter.Nombre;
if (oRegistro.FechaInicioSintomas.Year != 1900)
lblCovid.Text = lblCovid.Text + " - F. Inicio SÃntomas: " + oRegistro.FechaInicioSintomas.ToShortDateString();
@@ -368,28 +357,17 @@ private void MuestraDatos(string p)
lblUsuario.Text = oRegistro.IdUsuarioRegistro.Apellido;
lblFechaRegistro.Text = oRegistro.FechaRegistro.ToShortDateString() + " " + oRegistro.FechaRegistro.ToShortTimeString();
- //int len = oRegistro.FechaRegistro.ToString().Length - 11;
- //lblHoraRegistro.Text = oRegistro.FechaRegistro.ToString().Substring(11, oRegistro.FechaRegistro.ToString().Length - 11);
+
lblFecha.Text = oRegistro.Fecha.ToShortDateString();
lblProtocolo.Text = oRegistro.Numero.ToString();
- //hplProtocolo.NavigateUrl = "../Protocolos/ProtocoloEdit2.aspx?idServicio=" + oRegistro.IdTipoServicio.IdTipoServicio.ToString()+ "&Operacion=Modifica&idProtocolo=" +oRegistro.IdProtocolo.ToString();
-
- //if (oRegistro.IdEfector == oRegistro.IdEfectorSolicitante)
- lblOrigen.Text = oRegistro.IdOrigen.Nombre;
+ lblOrigen.Text = oRegistro.IdOrigen.Nombre;
//else
lblSolicitante.Text = oRegistro.IdEfectorSolicitante.Nombre;
if (oRegistro.MatriculaEspecialista != "-1")
lblMedico.Text = oRegistro.Especialista + " MP:" + oRegistro.MatriculaEspecialista;
-
- //lblPrioridad.Text = oRegistro.IdPrioridad.Nombre;
- // if (oRegistro.IdPrioridad.Nombre == "URGENTE")
- // {
- // lblPrioridad.ForeColor = Color.Red;
- // lblPrioridad.Font.Bold = true;
- // }
-
- //lblSector.Text = oRegistro.IdSector.Nombre;
+
+
if (oRegistro.Sala != "") lblOrigen.Text += " Sala: " + oRegistro.Sala;
if (oRegistro.Cama != "") lblOrigen.Text += " Cama: " + oRegistro.Cama;
@@ -448,14 +426,12 @@ private void MuestraDatos(string p)
}
-
-
-
+
private void LlenarTabla(string p)
{
- // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
- SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
+ string conexion = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString;
+ SqlConnection conn = new SqlConnection(conexion); ///Performance: conexion de solo lectura
DataSet Ds = new DataSet();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
@@ -467,13 +443,8 @@ private void LlenarTabla(string p)
SqlDataAdapter da = new SqlDataAdapter(cmd);
- da.Fill(Ds);
-
-
- //int cantidadResultadosValidados = Ds.Tables[0].Rows.Count;
- //if (cantidadResultadosValidados > 0)
-
- //{
+ da.Fill(Ds);
+
string s = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator;
@@ -544,26 +515,12 @@ private void LlenarTabla(string p)
else
lblCargadoPor.Text = "ESTADO";
- objCellPersona_TITULO.Controls.Add(lblCargadoPor);
-
-
- /////observaciones
- //if (Request["Operacion"].ToString() == "Valida")
- //{
-
-
+ objCellPersona_TITULO.Controls.Add(lblCargadoPor);
objFila_TITULO.Cells.Add(objCellAnalisis_TITULO);
- objFila_TITULO.Cells.Add(objCellResultado_TITULO);
-
-
-
-
- objFila_TITULO.Cells.Add(objCellValoresReferencia_TITULO);
-
-
+ objFila_TITULO.Cells.Add(objCellResultado_TITULO);
+ objFila_TITULO.Cells.Add(objCellValoresReferencia_TITULO);
objFila_TITULO.Cells.Add(objCellPersona_TITULO);
objFila_TITULO.Cells.Add(objCellResultadoAnterior_TITULO);
-
objFila_TITULO.CssClass = "myLabelIzquierda";
objFila_TITULO.BackColor = Color.Gainsboro;
@@ -576,7 +533,41 @@ private void LlenarTabla(string p)
int tablas = Ds.Tables.Count;
if (tablas > 0)
- {
+ {
+
+ ////Caro PF: Cache de resultado item
+
+ ISession session = NHibernateHttpModule.CurrentSession;
+ ///CARO PF: traer detalleprotocolos y derivaciones antes del for para no ir a la base N veces
+ var idsDetallesList = Ds.Tables[0].AsEnumerable()
+ .Select(r => r.Field("idDetalleProtocolo"))
+ .ToList();
+
+ var detallesList = session.CreateCriteria(typeof(DetalleProtocolo))
+ .Add(Expression.In("IdDetalleProtocolo", idsDetallesList.ToArray()))
+ .List()
+ .Cast()
+ .ToList();
+
+ var detallesDict = detallesList
+ .ToDictionary(d => d.IdDetalleProtocolo);
+
+ // Traer todas las Derivaciones juntas
+ var derivacionesList = session.CreateCriteria(typeof(Derivacion))
+ .CreateAlias("IdDetalleProtocolo", "dp")
+ .Add(Expression.In("dp.IdDetalleProtocolo", idsDetallesList.ToArray()))
+ .List()
+ .Cast()
+ .ToList();
+
+ var derivacionesDict = derivacionesList
+ .ToDictionary(d => d.IdDetalleProtocolo.IdDetalleProtocolo);
+ /// CARO PF : fin
+
+ Protocolo oRegistro = new Protocolo();
+ oRegistro = (Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(p));
+ var resultadosAnteriores = oRegistro.ObtenerResultadosAnteriores(conexion);
+
for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
{
//decimal m_minimoReferencia=-1;
@@ -630,35 +621,24 @@ private void LlenarTabla(string p)
TableCell objCellPersona = new TableCell();
TableCell objCellObservaciones = new TableCell();
-
decimal x = 0;
-
-
if (m_area != pivot_Area) ///poner titulo del area
{
TableRow objRow = new TableRow();
TableCell objCell = new TableCell();
- Label lbl0 = new Label();
- //lbl0.ForeColor = Color
+ Label lbl0 = new Label();
lbl0.Text = m_area.ToUpper();
lbl0.TabIndex = short.Parse("500");
lbl0.Font.Bold = true;
-
Master.FindControl("ContentPlaceHolder1").FindControl("Panel1").Controls.Add(lbl0);
objCell.Controls.Add(lbl0);
- //if (Request["Operacion"].ToString() == "HC")
- // objCell.ColumnSpan = 8;
- //else
objCell.ColumnSpan = 8;
-
objRow.BackColor = Color.Beige;
objRow.HorizontalAlign = HorizontalAlign.Center;
- objRow.Cells.Add(objCell);
- // objRow.CssClass = "myLabelIzquierda";
+ objRow.Cells.Add(objCell);
tContenido.Controls.Add(objRow);
-
pivot_Area = m_area;
}
@@ -691,20 +671,14 @@ private void LlenarTabla(string p)
lblSinMuestra.TabIndex = short.Parse("500");
lblSinMuestra.Text = "Sin Muestra";// +oItem.IdEfectorDerivacion.Nombre; /// Ds.Tables[0].Rows[i].ItemArray[1].ToString();
lblSinMuestra.Font.Italic = true;
- lblSinMuestra.ForeColor = Color.Blue;
- // objCellResultado.ColumnSpan = 5;
+ lblSinMuestra.ForeColor = Color.Blue;
objCellResultado.Controls.Add(lblSinMuestra);
}
}
-
-
-
Label lbl1 = new Label();
if (m_hijo == m_titulo) lbl1.Text = m_hijo;
else lbl1.Text = " " + m_hijo;
-
-
-
+
lbl1.TabIndex = short.Parse("500");
lbl1.ForeColor = Color.Black;
lbl1.Font.Size = FontUnit.Point(9);
@@ -717,6 +691,21 @@ private void LlenarTabla(string p)
objCellAnalisis.Controls.Add(lbl1);
+
+ /* var row = Ds.Tables[0].Rows[i];
+ int idDetalle = Convert.ToInt32(row["idDetalleProtocolo"]);
+ */
+ DetalleProtocolo oDetalle;
+ detallesDict.TryGetValue(i_iddetalleProtocolo, out oDetalle);
+
+ Derivacion oDeriva;
+ derivacionesDict.TryGetValue(i_iddetalleProtocolo, out oDeriva);
+ //fin
+ Item oItem = new Item();
+ oItem = oDetalle.IdSubItem; // (Item)oItem.Get(typeof(Item), m_idItem);
+
+
+ /*antes /
DetalleProtocolo oDetalle = new DetalleProtocolo();
oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
@@ -725,7 +714,7 @@ private void LlenarTabla(string p)
//DetalleProtocolo oDetalle = new DetalleProtocolo();
//oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
-
+ fin antes*/
// bool es_Bacteriologia = false;
string observacionesDetalle = "";
@@ -733,11 +722,12 @@ private void LlenarTabla(string p)
///
observacionesDetalle = oDetalle.Observaciones;
// m_usuariovalida += " " + oDetalle.FechaValida.ToShortDateString();
+
+ /*antes
Derivacion oDeriva = new Derivacion();
oDeriva = (Derivacion)oDeriva.Get(typeof(Derivacion), "IdDetalleProtocolo", oDetalle);
- if (oDeriva != null) /// esta pendiente
-
- //if (oItem.IdEfectorDerivacion != oItem.IdEfector) //es derivado
+ fin antes*/
+ if (oDeriva != null) /// esta pendiente
{
Label lblDerivacion = new Label();
lblDerivacion.Font.Italic = true;
@@ -745,41 +735,11 @@ private void LlenarTabla(string p)
//Verifica el estado de la derivacion
string estadoDerivacion = "";
- //if (i_iddetalleProtocolo != 0)
- //{
- // DetalleProtocolo oDetalle = new DetalleProtocolo();
- // oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
-
-
-
- // observacionesDetalle = oDetalle.Observaciones;
- // m_usuariovalida += " " + oDetalle.FechaValida.ToShortDateString();
- // Derivacion oDeriva = new Derivacion();
- // oDeriva = (Derivacion)oDeriva.Get(typeof(Derivacion), "IdDetalleProtocolo", oDetalle);
- // if (oDeriva == null) /// esta pendiente
- // {
- // estadoDerivacion = "Pendiente de Derivacion";
- // lblDerivacion.ForeColor = Color.Red;
- // }
- // else
- // {
- /* if (oDeriva.Estado == 0) /// pendiente
- {
- estadoDerivacion = "Pendiente de Derivacion";
- lblDerivacion.ForeColor = Color.Red;
- }
- if (oDeriva.Estado == 1) /// enviado
- estadoDerivacion = oDetalle.ResultadoCar; // "Derivado: " + oItem.GetEfectorDerivacion(oCon.IdEfector);
- if (oDeriva.Estado == 2) /// no enviado
- estadoDerivacion = oDetalle.ResultadoCar; //" No Derivado. " + oDeriva.Observacion;
- lblDerivacion.Font.Bold = true;*/
+
estadoDerivacion = oDetalle.ResultadoCar;
if (oDeriva.Resultado != "")
estadoDerivacion += " - Resultado Informado: " + oDeriva.Resultado;
-
- //}
-
- //}
+
lblDerivacion.Text = estadoDerivacion;
objCellResultado.ColumnSpan = 1;
@@ -810,9 +770,7 @@ private void LlenarTabla(string p)
//if (Request["Operacion"].ToString() != "HC")
if (m_conResultado!= "False")
{
- // DetalleProtocolo oDetalle = new DetalleProtocolo();
- // oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
-
+
Anthem.GridView Gd1 = new Anthem.GridView();
Gd1.ID = m_idItem.ToString();
ProtocoloLuminex oFusion = new ProtocoloLuminex();
@@ -846,11 +804,8 @@ private void LlenarTabla(string p)
if (i_iddetalleProtocolo != 0)
{
- if (i_iddetalleProtocolo != 9999999)
- {
- //DetalleProtocolo oDetalle = new DetalleProtocolo();
- //oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
-
+ //if (i_iddetalleProtocolo != 9999999)
+ //{
m_usuariovalida += " " + oDetalle.FechaValida.ToShortDateString();
if (Observaciones != "")
{
@@ -874,31 +829,32 @@ private void LlenarTabla(string p)
if (oDetalle.IdProtocolo.IdTipoServicio.IdTipoServicio!=5)
{
- string resultadoAnterior = oDetalle.BuscarResultadoAnterior(oDetalle.IdSubItem, oDetalle.IdItem, false);
- if (resultadoAnterior != "")
- {
+ //string resultadoAnterior = oDetalle.BuscarResultadoAnterior(oDetalle.IdSubItem, oDetalle.IdItem, false);
+
+ string resultadoAnterior = "";
+
+ if (resultadosAnteriores.ContainsKey(oDetalle.IdSubItem.IdItem))
+ {
+ resultadoAnterior = resultadosAnteriores[oDetalle.IdSubItem.IdItem];
+ }
+
+ if (resultadoAnterior != "")
+ {
hayAntecedente = true;
Label olblResultadoAnterior = new Label();
olblResultadoAnterior.TabIndex = short.Parse("500");
olblResultadoAnterior.Font.Size = FontUnit.Point(8);
olblResultadoAnterior.CssClass = "myLittleLink";
olblResultadoAnterior.Attributes.Add("onClick", "javascript: AntecedenteView (" + oDetalle.IdSubItem.IdItem.ToString() + "," + oDetalle.IdProtocolo.IdPaciente.IdPaciente.ToString() + ",790,540); return false");
- olblResultadoAnterior.ToolTip = "Haga clic aqui para ver gráfico de evolución";
- //olblResultadoAnterior.ForeColor = Color.Green;
- olblResultadoAnterior.Width = Unit.Pixel(20);
+ olblResultadoAnterior.ToolTip = "Haga clic aqui para ver gráfico de evolución";
+ olblResultadoAnterior.Width = Unit.Pixel(30);
olblResultadoAnterior.Text = resultadoAnterior;
-
objCellResultadoAnterior.Controls.Add(olblResultadoAnterior);
- //Button oB = new Button();
- //oB.Text = "R.ANT";
- //oB.OnClientClick = "javascript: AntecedenteView (" + oDetalle.IdSubItem.IdItem.ToString() + "," + oDetalle.IdProtocolo.IdPaciente.IdPaciente.ToString() + "); return false";
- //objCellResultadoAnterior.Controls.Add(oB);
- }
+ }
- }
- // if (VerificaValorReferencia(m_minimoReferencia, m_maximoReferencia, x, m_tipoValorReferencia))
+ }
if (oDetalle.VerificaValorReferencia(x))
olbl.ForeColor = Color.Black;
else
@@ -924,7 +880,7 @@ private void LlenarTabla(string p)
- if (oDetalle.tieneAdjuntoVisible())//tiene observaciones
+ if (oDetalle.tieneAdjuntoVisible())//Caro: falta mejorar esto
{
imgAdj = true;
btnImagen.TabIndex = short.Parse("500");
@@ -942,22 +898,15 @@ private void LlenarTabla(string p)
- }
+ //}
}
objCellResultado.Controls.Add(olbl);
if (imgAdj)objCellResultado.Controls.Add(btnImagen);
///etiqueta de unidad de medida
- Label olblUM = new Label();
-
-
- // olblUM.ID = "UM" + m_idItem.ToString();
+ Label olblUM = new Label();
olblUM.Font.Size = FontUnit.Point(7);
- olblUM.Text = unMedida;
-
-
-
-
+ olblUM.Text = unMedida;
objCellResultado.Controls.Add(olblUM);
olblUM.Visible = false;
@@ -986,11 +935,7 @@ private void LlenarTabla(string p)
}
- ///IMAGENES ADJUNTAS
-
-
-
-
+ ///IMAGENES ADJUNTAS
// fin de imagenes adjuntas
@@ -998,15 +943,22 @@ private void LlenarTabla(string p)
if ((i_iddetalleProtocolo != 0) )
{
- if (i_iddetalleProtocolo != 9999999)
- {
+ //if (i_iddetalleProtocolo != 9999999)
+ //{
//DetalleProtocolo oDetalle = new DetalleProtocolo();
//oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
m_usuariovalida += " " + oDetalle.FechaValida.ToShortDateString();
if (oDetalle.IdProtocolo.IdTipoServicio.IdTipoServicio != 5)
{
- string resultadoAnterior = oDetalle.BuscarResultadoAnterior(oDetalle.IdSubItem, oDetalle.IdItem, false);
+ //string resultadoAnterior = oDetalle.BuscarResultadoAnterior(oDetalle.IdSubItem, oDetalle.IdItem, false);
+ string resultadoAnterior = "";
+
+ if (resultadosAnteriores.ContainsKey(oDetalle.IdSubItem.IdItem))
+ {
+ resultadoAnterior = resultadosAnteriores[oDetalle.IdSubItem.IdItem];
+ }
+
if (resultadoAnterior != "")
{
hayAntecedente = true;
@@ -1017,32 +969,25 @@ private void LlenarTabla(string p)
olblResultadoAnterior.Attributes.Add("onClick", "javascript: AntecedenteView (" + oDetalle.IdSubItem.IdItem.ToString() + "," + oDetalle.IdProtocolo.IdPaciente.IdPaciente.ToString() + ",790,450); return false");
olblResultadoAnterior.ToolTip = "Haga clic aqui para ver más datos.";
//olblResultadoAnterior.ForeColor = Color.Green;
- olblResultadoAnterior.Width = Unit.Pixel(20);
+ olblResultadoAnterior.Width = Unit.Pixel(30);
olblResultadoAnterior.Text = resultadoAnterior;
-
objCellResultadoAnterior.Controls.Add(olblResultadoAnterior);
- //Button oB = new Button();
- //oB.Text = "R.ANT";
- //oB.OnClientClick = "javascript: AntecedenteView (" + oDetalle.IdSubItem.IdItem.ToString() + "," + oDetalle.IdProtocolo.IdPaciente.IdPaciente.ToString() + "); return false";
- //objCellResultadoAnterior.Controls.Add(oB);
+
}
}
if (oDetalle.tieneAdjuntoVisible())//tiene observaciones
- {
- // ImageButton btnImagen = new ImageButton();
+ {
btnImagen.TabIndex = short.Parse("500");
btnImagen.ID = "IMG" + oDetalle.IdDetalleProtocolo.ToString();
btnImagen.ImageUrl = "~/App_Themes/default/images/obs_validado.png";
-
btnImagen.ToolTip = "Adjunto imprimible para " + lbl1.Text.Replace(" ", "");
-
btnImagen.Attributes.Add("onClick", "javascript: AdjuntoEdit (" + oDetalle.IdDetalleProtocolo.ToString() + "," + oDetalle.IdProtocolo.IdTipoServicio.IdTipoServicio.ToString() + ",'" + Request["Operacion"].ToString() + "'); return false");
objCellResultado.Controls.Add(btnImagen);
}
}
- }
+ //}
} // fin case 1
break;
@@ -1050,39 +995,26 @@ private void LlenarTabla(string p)
}//fin swicth
-
-
- Label lblPersona = new Label();
- // lblPersona.TabIndex = short.Parse("500");
- lblPersona.Text = m_usuariovalida; /// Ds.Tables[0].Rows[i].ItemArray[1].ToString();
-
-
+ Label lblPersona = new Label();
+ lblPersona.Text = m_usuariovalida;
///
lblPersona.Font.Size = FontUnit.Point(7);
lblPersona.Font.Italic = true;
lblPersona.Text = m_usuariovalida ;
-
- objCellPersona.Controls.Add(lblPersona);
-
-
+ objCellPersona.Controls.Add(lblPersona);
}
- Label lblValoresReferencia = new Label();
-
- // lblValoresReferencia.ID = "VR" + m_idItem.ToString();
+ Label lblValoresReferencia = new Label();
lblValoresReferencia.Font.Italic = true;
lblValoresReferencia.Font.Size = FontUnit.Point(8);
if (valorReferencia != "")
{// muestra el valor guardado
lblValoresReferencia.Text = valorReferencia;
- if (m_metodo != "")
- // lblValoresReferencia.Text += " |Método:" + m_metodo;
+ if (m_metodo != "")
lblValoresReferencia.Text += Environment.NewLine + m_metodo;
- }
- //else
- // lblValoresReferencia.Text = oDetalle.CalcularValoresReferencia();
+ }
objCellValoresReferencia.Controls.Add(lblValoresReferencia);
}
@@ -1091,30 +1023,21 @@ private void LlenarTabla(string p)
///Definir los anchos de las columnas
objCellAnalisis.Width = Unit.Percentage(30);
- objCellResultado.Width = Unit.Percentage(30);
+ objCellResultado.Width = Unit.Percentage(25);
objCellValoresReferencia.Width = Unit.Percentage(20);
// objCellValida.Width = Unit.Percentage(5);
- objCellPersona.Width = Unit.Percentage(20);
-
+ objCellPersona.Width = Unit.Percentage(15);
+ objCellResultadoAnterior.Width = Unit.Percentage(10);
///////////////////////
///agrega a la fila cada una de las celdas
objFila.Cells.Add(objCellAnalisis);
- objFila.Cells.Add(objCellResultado);
-
- //if (Request["Operacion"].ToString() != "HC") objFila.Cells.Add(objCellUnMedida);
-
- objFila.Cells.Add(objCellValoresReferencia);
-
- //if ((Request["Operacion"].ToString() == "Valida") || (Request["Operacion"].ToString() == "Control")) objFila.Cells.Add(objCellValida);
-
+ objFila.Cells.Add(objCellResultado);
+ objFila.Cells.Add(objCellValoresReferencia);
objFila.Cells.Add(objCellPersona);
-
objFila.Cells.Add(objCellResultadoAnterior);
- //if (Request["Operacion"].ToString() != "HC") objFila.Cells.Add(objCellObservaciones);
-
- //////
+ //////
Master.FindControl("ContentPlaceHolder1").FindControl("Panel1").Controls.Add(tContenido);
//'añadimos la fila a la tabla
@@ -1142,11 +1065,7 @@ private void LlenarTablaATB(string p)
da.Fill(Ds);
-
- //int cantidadResultadosValidados = Ds.Tables[0].Rows.Count;
- //if (cantidadResultadosValidados > 0)
-
- //{
+
string s = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator;
@@ -1196,43 +1115,13 @@ private void LlenarTablaATB(string p)
for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
{
- //decimal m_minimoReferencia=-1;
- //decimal m_maximoReferencia=-1;
- // string valorReferencia = Ds.Tables[0].Rows[i].ItemArray[11].ToString();
- // int m_idItem = int.Parse(Ds.Tables[0].Rows[i].ItemArray[2].ToString());
- // int m_idMecanismo = int.Parse(Ds.Tables[0].Rows[i].ItemArray[3].ToString());
- // string unMedida = Ds.Tables[0].Rows[i].ItemArray[8].ToString();
- // string Observaciones = Ds.Tables[0].Rows[i].ItemArray[5].ToString();
+
int tiporesultado = (int.Parse(Ds.Tables[0].Rows[i].ItemArray[4].ToString()));
- // int tipodeterminacion = int.Parse(Ds.Tables[0].Rows[i].ItemArray[6].ToString());
- // int estado = int.Parse(Ds.Tables[0].Rows[i].ItemArray[9].ToString());
- // string m_metodo = Ds.Tables[0].Rows[i].ItemArray[10].ToString();
-
- // string m_observacionReferencia = Ds.Tables[0].Rows[i].ItemArray[13].ToString();
- // string m_usuarioCarga = Ds.Tables[0].Rows[i].ItemArray[14].ToString();
- // string m_trajoMuestra = Ds.Tables[0].Rows[i].ItemArray[15].ToString();
- // string m_tipoValorReferencia = Ds.Tables[0].Rows[i].ItemArray[16].ToString();
- // string m_conResultado = Ds.Tables[0].Rows[i].ItemArray[17].ToString();
- // string m_formatoDecimal = Ds.Tables[0].Rows[i].ItemArray[18].ToString();
- //string m_formato0 = Ds.Tables[0].Rows[i].ItemArray[19].ToString();
- //string m_formato1 = Ds.Tables[0].Rows[i].ItemArray[20].ToString();
- //string m_formato2 = Ds.Tables[0].Rows[i].ItemArray[21].ToString();
- //string m_formato3 = Ds.Tables[0].Rows[i].ItemArray[22].ToString();
- //string m_formato4 = Ds.Tables[0].Rows[i].ItemArray[23].ToString();
- //string m_resultadoDefecto = Ds.Tables[0].Rows[i].ItemArray[24].ToString();
- // string m_usuariocontrol = Ds.Tables[0].Rows[i].ItemArray[25].ToString();
+
string m_usuariovalida = Ds.Tables[0].Rows[i].ItemArray[5].ToString();
- // int i_iddetalleProtocolo = int.Parse(Ds.Tables[0].Rows[i].ItemArray[26].ToString());
- //string m_codificaPaciente = Ds.Tables[0].Rows[i].ItemArray[27].ToString();
-
- // string m_estadoObservacion = Ds.Tables[0].Rows[i].ItemArray[29].ToString();
+
string m_area = "ATB";//Ds.Tables[0].Rows[i].ItemArray[30].ToString();
-
- //if (m_codificaPaciente == "True")
- //{
- // lblPaciente.Visible = false;
- // lblCodigoPaciente.Visible = true;
- //}
+
m_hijo = Ds.Tables[0].Rows[i].ItemArray[2].ToString();
@@ -1257,24 +1146,19 @@ private void LlenarTablaATB(string p)
{
TableRow objRow = new TableRow();
TableCell objCell = new TableCell();
- Label lbl0 = new Label();
- //lbl0.ForeColor = Color
+ Label lbl0 = new Label();
lbl0.Text = m_area.ToUpper();
lbl0.TabIndex = short.Parse("500");
lbl0.Font.Bold = true;
Master.FindControl("ContentPlaceHolder1").FindControl("Panel1").Controls.Add(lbl0);
- objCell.Controls.Add(lbl0);
- //if (Request["Operacion"].ToString() == "HC")
- // objCell.ColumnSpan = 8;
- //else
+ objCell.Controls.Add(lbl0);
objCell.ColumnSpan = 8;
objRow.BackColor = Color.Beige;
objRow.HorizontalAlign = HorizontalAlign.Center;
- objRow.Cells.Add(objCell);
- // objRow.CssClass = "myLabelIzquierda";
+ objRow.Cells.Add(objCell);
tContenido.Controls.Add(objRow);
pivot_Area = m_area;
@@ -1317,45 +1201,26 @@ private void LlenarTablaATB(string p)
lbl1.TabIndex = short.Parse("500");
lbl1.ForeColor = Color.Black;
lbl1.Font.Size = FontUnit.Point(9);
- //if (tipodeterminacion != 0)
- //{
+
lbl1.Font.Bold = true;
lbl1.Font.Italic = true;
objCellAnalisis.ColumnSpan = 1;
- //}
+
objCellAnalisis.Controls.Add(lbl1);
-
- //if (tipodeterminacion == 0) // si es una determinacion simple
- //{
Label olbl = new Label();
olbl.Font.Bold = true;
olbl.Font.Size = FontUnit.Point(9);
- //if (m_conResultado == "0")
- // olbl.Text = "";
- //else
olbl.Text = Ds.Tables[0].Rows[i].ItemArray[3].ToString();
- //if (Observaciones != "")
- //{
- // if (olbl.Text == "")
- // olbl.Text += Observaciones;
- // else
- // olbl.Text += Environment.NewLine + " " + Observaciones;
-
- //}
-
objCellResultado.Controls.Add(olbl);
-
- //DetalleProtocolo oDetalle = new DetalleProtocolo();
- //oDetalle = (DetalleProtocolo)oDetalle.Get(typeof(DetalleProtocolo), i_iddetalleProtocolo);
-
+
m_usuariovalida += " "; //+ fefecha validad
@@ -1364,8 +1229,7 @@ private void LlenarTablaATB(string p)
- Label lblPersona = new Label();
- // lblPersona.TabIndex = short.Parse("500");
+ Label lblPersona = new Label();
lblPersona.Text = m_usuariovalida; /// Ds.Tables[0].Rows[i].ItemArray[1].ToString();
@@ -1378,27 +1242,7 @@ private void LlenarTablaATB(string p)
objCellPersona.Controls.Add(lblPersona);
-
-
- ///no se usa valor referencia con los ATB
- //Label lblValoresReferencia = new Label();
-
- //// lblValoresReferencia.ID = "VR" + m_idItem.ToString();
- //lblValoresReferencia.Font.Italic = true;
- //lblValoresReferencia.Font.Size = FontUnit.Point(8);
- //if (valorReferencia != "")
- //{// muestra el valor guardado
- // lblValoresReferencia.Text = valorReferencia;
- // if (m_metodo != "")
- // // lblValoresReferencia.Text += " |Método:" + m_metodo;
- // lblValoresReferencia.Text += Environment.NewLine + m_metodo;
- //}
- ////else
- //// lblValoresReferencia.Text = oDetalle.CalcularValoresReferencia();
-
- //objCellValoresReferencia.Controls.Add(lblValoresReferencia);
- //}
-
+
///Definir los anchos de las columnas
@@ -1447,10 +1291,6 @@ private void Imprimir(Protocolo oProtocolo, string tipo)
Configuracion oCon = new Configuracion();
oCon = (Configuracion)oCon.Get(typeof(Configuracion),"IdEfector", oProtocolo.IdEfector);
- // CrystalReportSource oCr = new CrystalReportSource();
- //oCr.Report.FileName = "";
- //oCr.CacheDuration =10000;
- //oCr.EnableCaching = true;
string parametroPaciente = "";
string parametroProtocolo = "";
@@ -1672,7 +1512,7 @@ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
string idProtocolo= this.gvLista.DataKeys[e.Row.RowIndex].Value.ToString();
- string s_detalle = e.Row.Cells[0].Text + ": " + getDetalleProtocolo(idProtocolo);
+ string s_detalle = e.Row.Cells[0].Text;// + ": " + getDetalleProtocolo(idProtocolo);
e.Row.Cells[0].ToolTip = s_detalle;
e.Row.Cells[1].ToolTip = s_detalle;
@@ -1699,22 +1539,7 @@ private bool AnalizarLimites(string p)
throw new NotImplementedException();
}
- private bool estaVisibleControl(string idarea)
- {
- bool visible=true;
- //if (HidArea.Value == "0")
- // visible = true;
- //else
- //{
- // if (idarea == HidArea.Value)
- // visible = true;
- // else
- // visible = false;
- //}
- return visible;
-
- }
-
+
@@ -1784,84 +1609,8 @@ protected void lnkAuditoria_Click(object sender, EventArgs e)
- protected void lnkMarcar_Click(object sender, EventArgs e)
- {
-
- Marcar(true);
-
- }
-
- private void Marcar(bool p)
- {
-
- CheckBox chk;
-
-
- if (Page.Master != null)
- {
- foreach (Control control in Page.Master.Controls)
- {
- if (control is HtmlForm)
- {
- foreach (Control controlform in control.Controls)
- {
- if (controlform is ContentPlaceHolder)
- {
- foreach (Control control1 in controlform.Controls)
- {
- if (control1 is Panel)
- foreach (Control control2 in control1.Controls)
- {
- if (control2 is Table)
- foreach (Control control3 in control2.Controls)
- {
-
- if (control3 is TableRow)
- foreach (Control control4 in control3.Controls)
- {
-
- if (control4 is TableCell)
- foreach (Control control5 in control4.Controls)
- {
-
- if (control5 is CheckBox)
- {
- chk = (CheckBox)control5;
- chk.Checked = p;
-
-
-
- }
-
-
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- }
-
- protected void lnkDesmarcar_Click(object sender, EventArgs e)
- {
- Marcar(false);
- }
-
- protected void btnVerAntecendente_Click(object sender, EventArgs e)
- {
- //if (ddlItem.SelectedValue != "0")
- //{
- // Protocolo oProtocolo = new Protocolo();
- // oProtocolo = (Protocolo)oProtocolo.Get(typeof(Protocolo), CurrentPageIndex);//int.Parse(Request["idProtocolo"].ToString()));r();
- // CargarGrillaAntecedentes(oProtocolo);
- // SetSelectedTab(TabIndex.THREE);
- //}
- }
+
+
@@ -1887,35 +1636,35 @@ protected void btnPeticion_Click(object sender, EventArgs e)
}
- private string getDetalleProtocolo(string idProtocolo)
- {
- string dev = ""; int i = 0;
- Protocolo oRegistro = new Protocolo();
- oRegistro = (Protocolo)oRegistro.Get(typeof(Protocolo), int.Parse(idProtocolo));
-
- ISession m_session = NHibernateHttpModule.CurrentSession;
- ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
- crit.Add(Expression.Eq("IdProtocolo", oRegistro));
- IList items = crit.List();
- foreach (DetalleProtocolo oDet in items)
- {
- i += 1;
- if (dev == "")
- dev = oDet.IdItem.Nombre;
- else
- {
- if (dev.IndexOf(oDet.IdItem.Nombre) == -1)
- dev = dev + " - " + oDet.IdItem.Nombre;
- }
- }
- //return i.ToString() + ": " + dev;
- return dev;
- }
+ //private string getDetalleProtocolo(string idProtocolo)
+ //{
+ // string dev = ""; int i = 0;
+ // Protocolo oRegistro = new Protocolo();
+ // oRegistro = (Protocolo)oRegistro.Get(typeof(Protocolo), int.Parse(idProtocolo));
+
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
+ // crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ // IList items = crit.List();
+ // foreach (DetalleProtocolo oDet in items)
+ // {
+ // i += 1;
+ // if (dev == "")
+ // dev = oDet.IdItem.Nombre;
+ // else
+ // {
+ // if (dev.IndexOf(oDet.IdItem.Nombre) == -1)
+ // dev = dev + " - " + oDet.IdItem.Nombre;
+ // }
+ // }
+ // //return i.ToString() + ": " + dev;
+ // return dev;
+ //}
- protected void btnArchivos_Click(object sender, EventArgs e)
- {
- Response.Redirect("../Protocolos/ProtocoloAdjuntar.aspx?idProtocolo=" + Session["idProtocolo"].ToString()+"&desde=resultado");
- }
+ //protected void btnArchivos_Click(object sender, EventArgs e)
+ //{
+ // Response.Redirect("../Protocolos/ProtocoloAdjuntar.aspx?idProtocolo=" + Session["idProtocolo"].ToString()+"&desde=resultado");
+ //}
protected void imgPdf_Click(object sender, EventArgs e)
{
diff --git a/WebLab/Resultados/ResultadoView.aspx.designer.cs b/WebLab/Resultados/ResultadoView.aspx.designer.cs
index 2bcb64d5..091f5509 100644
--- a/WebLab/Resultados/ResultadoView.aspx.designer.cs
+++ b/WebLab/Resultados/ResultadoView.aspx.designer.cs
@@ -283,49 +283,40 @@ public partial class ResultadoView {
protected global::System.Web.UI.WebControls.Label lblDiagnostico;
///
- /// lblNroSISA control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.Label lblNroSISA;
-
- ///
- /// lblPedidoOriginal control.
+ /// lblCovid control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Label lblPedidoOriginal;
+ protected global::System.Web.UI.WebControls.Label lblCovid;
///
- /// HFCurrTabIndex control.
+ /// lblNroSISA control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.HiddenField HFCurrTabIndex;
+ protected global::System.Web.UI.WebControls.Label lblNroSISA;
///
- /// pnlHC control.
+ /// lblPedidoOriginal control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Panel pnlHC;
+ protected global::System.Web.UI.WebControls.Label lblPedidoOriginal;
///
- /// lblCovid control.
+ /// HFCurrTabIndex control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Label lblCovid;
+ protected global::System.Web.UI.WebControls.HiddenField HFCurrTabIndex;
///
/// lblMuestra control.
@@ -435,15 +426,6 @@ public partial class ResultadoView {
///
protected global::System.Web.UI.WebControls.DropDownList ddlItem;
- ///
- /// btnVerAntecendente control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.Button btnVerAntecendente;
-
///
/// gvAntecedente control.
///
diff --git a/WebLab/Site1.Master b/WebLab/Site1.Master
index f63daa62..0b042a64 100644
--- a/WebLab/Site1.Master
+++ b/WebLab/Site1.Master
@@ -222,7 +222,7 @@ document.onkeydown=checkKeyCode;
font-weight: normal;
font-size: 14px;
font-family: Arial;
- text-align:center;">Versión MultiEfector Dic.2025-22. " target="_blank" >Ver Cambios Version
+ text-align:center;">Versión MultiEfector Abril 2026-22." target="_blank" >Ver Cambios Version
| | | | |