diff --git a/Business/BaseDataAccess.cs b/Business/BaseDataAccess.cs index da937100..73792a2b 100644 --- a/Business/BaseDataAccess.cs +++ b/Business/BaseDataAccess.cs @@ -297,11 +297,29 @@ public object Get(Type type, object id) } } - public object Get(object id) + public object Get(object id) + { + return this.Get(this.GetType(), id); + } + + + + public object GetIfExists(Type type, object id) { - return this.Get(this.GetType(),id); - } + object returnValue = null; + try + { + returnValue = m_session.Get(type, id); + + return returnValue; + } + catch (Exception ex) + { + //TODO: disciminar en caso q la excepcion sea del tipo id inexistente. + throw ex; + } + } public IList GetListByPropertyValue(Type type, string propertyName, object propertyValue) { try diff --git a/Business/Data/Laboratorio/Derivacion.cs b/Business/Data/Laboratorio/Derivacion.cs index 3eebb651..f7fd4f20 100644 --- a/Business/Data/Laboratorio/Derivacion.cs +++ b/Business/Data/Laboratorio/Derivacion.cs @@ -267,46 +267,46 @@ public int IdMotivoCancelacion { } #endregion - public static List DerivacionesByLote(int idLote) { - List derivaciones = new List(); - try { - ISession session = NHibernateHttpModule.CurrentSession; - IList lista = session.CreateQuery("from Derivacion where idLote="+idLote).List(); - - foreach (Derivacion item in lista) { - derivaciones.Add(item); - } - } catch (Exception) { - - } - return derivaciones; - } - - public void MarcarComoRecibidas(Protocolo oAnterior, Protocolo oNuevo, Usuario oUser, int idLoteDerivacion) - { - string query = - @"update LAB_Derivacion - set estado=3---recibido - ,idProtocoloDerivacion=" + oNuevo.IdProtocolo.ToString() + @" - from LAB_Derivacion D - inner join LAB_DetalleProtocolo Det on Det.idDetalleProtocolo= d.idDetalleProtocolo - where Det.idProtocolo=" + oAnterior.IdProtocolo.ToString() + " and idLote=" + idLoteDerivacion; - - SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; - SqlCommand cmd = new SqlCommand(query, conn); - int idRealizado = Convert.ToInt32(cmd.ExecuteScalar()); - - //Se indica en el protocolo de Origen que fue recibido en el destino - if (oAnterior != null) - { - if (idLoteDerivacion != 0) - oAnterior.GrabarAuditoriaDetalleProtocolo("Recepcion Derivacion", oUser.IdUsuario, "Lote " + idLoteDerivacion, "Protocolo " + oNuevo.Numero.ToString()); - else - oAnterior.GrabarAuditoriaDetalleProtocolo("Recepcion Derivacion", oUser.IdUsuario, "Protocolo", oNuevo.Numero.ToString()); - } - } - - public string ObtenerItemsPendientes(string idLoteDerivacion, string idProtocolo) + //public static List DerivacionesByLote(int idLote) { + // List derivaciones = new List(); + // try { + // ISession session = NHibernateHttpModule.CurrentSession; + // IList lista = session.CreateQuery("from Derivacion where idLote="+idLote).List(); + + // foreach (Derivacion item in lista) { + // derivaciones.Add(item); + // } + // } catch (Exception) { + + // } + // return derivaciones; + //} + + //public void MarcarComoRecibidas(Protocolo oAnterior, Protocolo oNuevo, Usuario oUser, int idLoteDerivacion) //Se hace ahora en DetalleProtocolo.ActualizarItemsDerivados + // { + // string query = + // @"update LAB_Derivacion + // set estado=3---recibido + // ,idProtocoloDerivacion=" + oNuevo.IdProtocolo.ToString() + @" + // from LAB_Derivacion D + // inner join LAB_DetalleProtocolo Det on Det.idDetalleProtocolo= d.idDetalleProtocolo + // where Det.idProtocolo=" + oAnterior.IdProtocolo.ToString() + " and idLote=" + idLoteDerivacion; + + // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; + // SqlCommand cmd = new SqlCommand(query, conn); + // int idRealizado = Convert.ToInt32(cmd.ExecuteScalar()); + + // //Se indica en el protocolo de Origen que fue recibido en el destino + // if (oAnterior != null) + // { + // if (idLoteDerivacion != 0) + // oAnterior.GrabarAuditoriaDetalleProtocolo("Recepcion Derivacion", oUser.IdUsuario, "Lote " + idLoteDerivacion, "Protocolo " + oNuevo.Numero.ToString()); + // else + // oAnterior.GrabarAuditoriaDetalleProtocolo("Recepcion Derivacion", oUser.IdUsuario, "Protocolo", oNuevo.Numero.ToString()); + // } + //} + + public string ObtenerItemsPendientes(string idLoteDerivacion, string idProtocolo) { ////// ---------------------->Buscar las derivaciones que no han sido ingresadas //los protocolos detalles me dan las derivaciones diff --git a/Business/Data/Laboratorio/DetalleProtocolo.cs b/Business/Data/Laboratorio/DetalleProtocolo.cs index 10b806c6..22695b84 100644 --- a/Business/Data/Laboratorio/DetalleProtocolo.cs +++ b/Business/Data/Laboratorio/DetalleProtocolo.cs @@ -470,6 +470,35 @@ public int IdUsuarioPreValida } + public void GuardarDisponible( ) + {/// saca las marcas de validacion + //ItemEfector oItem = new ItemEfector(); + //oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), "IdItem", this.IdSubItem, "IdEfector", this.IdEfector); + //if (oItem != null) //Siempre tiene que haber + // if (oItem.IdEfectorDerivacion == this.IdEfector) + // { + // if (!oItem.SinInsumo) + // { + //resul = "Sin Insumo"; + + if (this.IdSubItem.IdTipoResultado != 2)///numerico o predefinido + { + this.Observaciones = ""; + this.IdUsuarioValidaObservacion =0; + this.FechaValidaObservacion = DateTime.Parse("01/01/1900"); + this.FechaValida = DateTime.Parse("01/01/1900"); + } + if (this.IdSubItem.IdTipoResultado == 2)///texto + { + this.ResultadoCar = ""; + this.IdUsuarioValida = 0; // oItem.IdUsuarioRegistro.IdUsuario; + this.FechaValida = DateTime.Parse("01/01/1900"); + } + this.Save(); + // } + //} + + } /// /// /// @@ -1330,36 +1359,68 @@ public bool esDerivado() return sederiva; } - public void GuardarSinInsumo() + public void GuardarSinInsumo(Usuario oUser) { - + //Llamado desde marca de sin insumo string resul = ""; - ItemEfector oItem = new ItemEfector(); - oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), "IdItem", this.IdSubItem, "IdEfector", this.IdEfector); - if (oItem != null) //Siempre tiene que haber - if (oItem.IdEfectorDerivacion == this.IdEfector) - { - if (oItem.SinInsumo) - { + //ItemEfector oItem = new ItemEfector(); + //oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), "IdItem", this.IdSubItem, "IdEfector", this.IdEfector); + //if (oItem != null) //Siempre tiene que haber + // if (oItem.IdEfectorDerivacion == this.IdEfector) + // { + // if (oItem.SinInsumo) + // { resul = "Sin Insumo"; if (this.IdSubItem.IdTipoResultado != 2)///numerico o predefinido { this.Observaciones = resul; - this.IdUsuarioValidaObservacion = oItem.IdUsuarioRegistro.IdUsuario; + this.IdUsuarioValidaObservacion = oUser.IdUsuario; this.FechaValidaObservacion = DateTime.Now; this.FechaValida = DateTime.Now; } if (this.IdSubItem.IdTipoResultado == 2)///texto { this.ResultadoCar = resul; - this.IdUsuarioValida = oItem.IdUsuarioRegistro.IdUsuario; - this.FechaValida = DateTime.Now; + this.IdUsuarioValida = oUser.IdUsuario; + this.FechaValida = DateTime.Now; } this.Save(); + // } + //} + + + } + public void GuardarSinInsumo( ) + {//Llamado de guardado de protocolo + + string resul = ""; + ItemEfector oItem = new ItemEfector(); + oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), "IdItem", this.IdSubItem, "IdEfector", this.IdEfector); + if (oItem != null) //Siempre tiene que haber + if (oItem.IdEfectorDerivacion == this.IdEfector) + { + if (oItem.SinInsumo) + { + resul = "Sin Insumo"; + + if (this.IdSubItem.IdTipoResultado != 2)///numerico o predefinido + { + this.Observaciones = resul; + this.IdUsuarioValidaObservacion = oItem.IdUsuarioRegistro.IdUsuario; + this.FechaValidaObservacion = DateTime.Now; + this.FechaValida = DateTime.Now; + } + if (this.IdSubItem.IdTipoResultado == 2)///texto + { + this.ResultadoCar = resul; + this.IdUsuarioValida = oItem.IdUsuarioRegistro.IdUsuario; + this.FechaValida = DateTime.Now; + } + this.Save(); } } - + } @@ -1449,11 +1510,80 @@ public void GuardarDerivacion(Usuario oUser) oRegistro.Save(); - // graba el resultado en ResultadCar "Derivado: " + oItem.GetEfectorDerivacion(oCon.IdEfector); - //oDetalle.ResultadoCar = "Pendiente de Derivacion";//"se podria poner a que efector.... - //oDetalle.Save(); + // graba el resultado en ResultadCar "Pendiente de derivar" + this.ResultadoCar = "Pendiente de derivar"; + this.Save(); this.GrabarAuditoriaDetalleProtocolo("Graba Derivado", oUser.IdUsuario); } } + + //public void ActualizoResultado(Protocolo oRegistro, Protocolo oAnterior, int idLoteDerivacion) + //{ + + //Se hace ahora en el metodo ActualizarItemsDerivados + //ResultadoCar: “Recibido en YYYY Protocolo Nro. XXXX” + + //string query = + // " update LAB_DetalleProtocolo " + + // " set resultadoCar= 'Recibido en " + oRegistro.IdEfector.Nombre + " Protocolo Nro. " + oRegistro.Numero + + // "' from LAB_DetalleProtocolo Det " + + // " inner join LAB_Derivacion D on Det.idDetalleProtocolo = d.idDetalleProtocolo " + + // " where Det.idProtocolo=" + oAnterior.IdProtocolo.ToString() + " and idLote=" + idLoteDerivacion; + + + //// Pero que pasa en los casos que en el efector destino un analisis no se ingrese? + //// Tendriamos como recibido el analisis en el emisor pero en el receptor no estaria cargado + + //SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; + //SqlCommand cmd = new SqlCommand(query, conn); + //int idRealizado = Convert.ToInt32(cmd.ExecuteScalar()); + + //} + + public void ActualizarItemsDerivados(Protocolo oRegistro, Protocolo oAnterior, int idLoteDerivacion, Usuario oUser) + { + // PREMISA: Cuales son los idDetalle del protocolo emisor que si se grabaron en el protocolo nuevo + string query = + @" SELECT dp_origen.idDetalleProtocolo + FROM LAB_DetalleProtocolo dp_origen + INNER JOIN LAB_Derivacion d on d.idDetalleProtocolo = dp_origen.idDetalleProtocolo + WHERE dp_origen.idProtocolo = " + oAnterior.IdProtocolo + " and idLote = " + idLoteDerivacion + @" + AND EXISTS ( + SELECT 1 + FROM LAB_DetalleProtocolo dp_dest + WHERE dp_dest.idProtocolo = " + oRegistro.IdProtocolo + @" + AND dp_dest.idItem = dp_origen.idItem + ); "; + + SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; + DataSet Ds = new DataSet(); + SqlDataAdapter adapter = new SqlDataAdapter(); + adapter.SelectCommand = new SqlCommand(query, conn); + adapter.Fill(Ds); + DataTable dt = Ds.Tables[0]; + + foreach (DataRow item in dt.Rows) + { + int idDetalleProtocolo = int.Parse(item[0].ToString()); + + DetalleProtocolo dp = new DetalleProtocolo(); + dp = (DetalleProtocolo)dp.Get(typeof(DetalleProtocolo), "IdDetalleProtocolo", idDetalleProtocolo); + dp.ResultadoCar = "Recibido en " + oRegistro.IdEfector.Nombre + " Protocolo Nro. " + oRegistro.Numero; + dp.Save(); + + Derivacion de = new Derivacion(); + de = (Derivacion)de.Get(typeof(Derivacion), "IdDetalleProtocolo", dp); + de.Estado = 3; + de.IdProtocoloDerivacion = oAnterior.IdProtocolo; + de.Save(); + } + + //Se indica en el protocolo de Origen que fue recibido en el destino + if (oAnterior != null) + { + oAnterior.GrabarAuditoriaDetalleProtocolo("Recepcion Derivacion", oUser.IdUsuario, "Lote " + idLoteDerivacion, "Protocolo " + oRegistro.Numero.ToString()); + + } + } } } diff --git a/Business/Data/Laboratorio/LoteDerivacion.cs b/Business/Data/Laboratorio/LoteDerivacion.cs index 12e32c7c..ef7ace96 100644 --- a/Business/Data/Laboratorio/LoteDerivacion.cs +++ b/Business/Data/Laboratorio/LoteDerivacion.cs @@ -1,5 +1,10 @@ -using System; -using System.Collections.Generic; +using NHibernate; +using NHibernate.Expression; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; using System.Text; @@ -143,34 +148,55 @@ public string descripcionEstadoLote() { return estado.Nombre; } - public bool HayDerivacionesPendientes() { - List dList = Derivacion.DerivacionesByLote(this.IdLoteDerivacion); - dList = dList.FindAll(x => x.IdProtocoloDerivacion == 0 && x.Estado == 1); - - if (dList.Count > 0) - return true; + public bool HayDerivacionesPendientes() + { + //List dList = Derivacion.DerivacionesByLote(this.IdLoteDerivacion); + //dList = dList.FindAll(x => x.IdProtocoloDerivacion == 0 && x.Estado == 1); + + //Revisar que Derivacion tenga DetalleProtocolo + string m_strSQL = " Select idDerivacion FROM LAB_Derivacion WHERE idLote=" +this.IdLoteDerivacion+ " and idProtocoloDerivacion=0 and estado=1 and " + + " idDetalleProtocolo in (Select idDetalleProtocolo FROM LAB_DetalleProtocolo where IdEfector = " + this.IdEfectorOrigen.IdEfector + ")"; + DataSet Ds = new DataSet(); + SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; + SqlDataAdapter adapter = new SqlDataAdapter(); + adapter.SelectCommand = new SqlCommand(m_strSQL, conn); + adapter.Fill(Ds); + DataTable dt = Ds.Tables[0]; + + if(dt != null) + { + if (dt.Rows.Count > 0) + return true; + else + return false; + } else return false; - + } + public void ActualizaEstadoLote(int idUsuario, string ProtocoloNuevo, string ProtocoloAnterior) { if (Estado == 4) //Pasa de Recibido a Ingresado { Estado = 5; - GrabarAuditoriaLoteDerivacion(descripcionEstadoLote(), idUsuario); + LoteDerivacionEstado oEstado = new LoteDerivacionEstado(); + oEstado = (LoteDerivacionEstado)oEstado.Get(typeof(LoteDerivacionEstado), Estado); + GrabarAuditoriaLoteDerivacion(oEstado.Nombre, idUsuario); FechaIngreso = DateTime.Now; } //Graba el ingreso del protocolo en el lote GrabarAuditoriaLoteDerivacion("Ingresa protocolo", idUsuario, "Número Protocolo", ProtocoloNuevo, ProtocoloAnterior); - //Si al generar este nuevo protocolo se finalizo la carga del lote, cambiar estado a Completado + //No hay derivaciones pendientes, cambio el estado del lote a Ingresado Total if (!HayDerivacionesPendientes()) { Estado = 6; //Pasa a Completado si no tiene más derivaciones pendientes - GrabarAuditoriaLoteDerivacion(descripcionEstadoLote(), idUsuario); + LoteDerivacionEstado oEstado = new LoteDerivacionEstado(); + oEstado = (LoteDerivacionEstado)oEstado.Get(typeof(LoteDerivacionEstado), Estado); + GrabarAuditoriaLoteDerivacion(oEstado.Nombre, idUsuario); } Save(); diff --git a/Business/Data/Laboratorio/LoteDerivacion.hbm.xml b/Business/Data/Laboratorio/LoteDerivacion.hbm.xml index 499cc40d..41a49f27 100644 --- a/Business/Data/Laboratorio/LoteDerivacion.hbm.xml +++ b/Business/Data/Laboratorio/LoteDerivacion.hbm.xml @@ -3,7 +3,7 @@ - + diff --git a/Business/Data/Laboratorio/Placa.cs b/Business/Data/Laboratorio/Placa.cs index b17f7d95..2b4e38f9 100644 --- a/Business/Data/Laboratorio/Placa.cs +++ b/Business/Data/Laboratorio/Placa.cs @@ -20,6 +20,7 @@ public sealed class Placa : Business.BaseDataAccess private bool m_isChanged; private int m_idPlaca; + private Efector m_idefector; private DateTime m_fecha; private string m_operador; private string m_equipo; @@ -37,6 +38,7 @@ public sealed class Placa : Business.BaseDataAccess public Placa() { m_idPlaca = 0; + m_idefector = new Efector(); m_fecha = DateTime.MinValue; m_operador = String.Empty; m_equipo = String.Empty; @@ -53,6 +55,7 @@ public Placa() /// public Placa( int idPlaca, + Efector idefector, DateTime fecha, string operador, string equipo, @@ -62,6 +65,7 @@ public Placa( : this() { m_idPlaca = idPlaca; + m_idefector = idefector; m_fecha = fecha; m_operador = operador; m_equipo = equipo; @@ -86,6 +90,18 @@ public int IdPlaca } + public Efector IdEfector + { + get { return m_idefector; } + set + { + m_isChanged |= (m_idefector != value); + m_idefector = value; + } + + } + + public DateTime Fecha { get { return m_fecha; } diff --git a/Business/Data/Laboratorio/Placa.hbm.xml b/Business/Data/Laboratorio/Placa.hbm.xml index 5b2b1b31..2895d149 100644 --- a/Business/Data/Laboratorio/Placa.hbm.xml +++ b/Business/Data/Laboratorio/Placa.hbm.xml @@ -5,7 +5,7 @@ - + diff --git a/Business/Data/Laboratorio/Protocolo.cs b/Business/Data/Laboratorio/Protocolo.cs index 97cc0395..f3c9818c 100644 --- a/Business/Data/Laboratorio/Protocolo.cs +++ b/Business/Data/Laboratorio/Protocolo.cs @@ -2161,10 +2161,18 @@ public void CalcularFormulas(string s_operacion, int i_idusuario, bool solovacio IList lista = crit.List(); - if (lista.Count > 0) - { + //if (lista.Count > 0) + //{ foreach (DetalleProtocolo oDet in lista) - { + { + + /*Agrego control si no tiene insumo no calcula*/ + ItemEfector oItem = new ItemEfector(); + oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), "IdItem", oDet.IdSubItem, "IdEfector", this.IdEfector); + + if (oItem.SinInsumo) continue; + + /*fin control insumo */ ICriteria critFormula = m_session.CreateCriteria(typeof(Formula)); critFormula.Add(Expression.Eq("IdItem", oDet.IdSubItem)); critFormula.Add(Expression.Eq("IdTipoFormula", 1)); @@ -2199,22 +2207,26 @@ public void CalcularFormulas(string s_operacion, int i_idusuario, bool solovacio ///evaluar si la condicion de determinacion habilita el calculo de la formula } - - - if (idraza == 1) // si es afro - { - if (idraza == oDet.IdProtocolo.IdPaciente.IdRaza) - sicalcula = true; - else - sicalcula = false; - } - if (idraza == 0) - { - if ( oDet.IdProtocolo.IdPaciente.IdRaza!=1) - sicalcula = true; - else - sicalcula = false; - } + /* if (idraza == 1) // si es afro + { + if (idraza == oDet.IdProtocolo.IdPaciente.IdRaza) + sicalcula = true; + else + sicalcula = false; + } + if (idraza == 0) + { + if ( oDet.IdProtocolo.IdPaciente.IdRaza!=1) + sicalcula = true; + else + sicalcula = false; + } + */ + if ((idraza == 1) && (oDet.IdProtocolo.IdPaciente.IdRaza != 1)) + sicalcula = false; + + if ((idraza == 0) && (oDet.IdProtocolo.IdPaciente.IdRaza == 1)) + sicalcula = false; } @@ -2308,7 +2320,7 @@ public void CalcularFormulas(string s_operacion, int i_idusuario, bool solovacio //valor = resultado.ToString(); } } - } + //return valor; diff --git a/Business/Data/Laboratorio/ValorReferencia.cs b/Business/Data/Laboratorio/ValorReferencia.cs index c1f138be..f7479268 100644 --- a/Business/Data/Laboratorio/ValorReferencia.cs +++ b/Business/Data/Laboratorio/ValorReferencia.cs @@ -304,7 +304,7 @@ public string Observacion if (value == null) throw new ArgumentOutOfRangeException("Null value not allowed for Descripcion", value, "null"); - if (value.Length > 500) + if (value.Length > 1000) throw new ArgumentOutOfRangeException("Invalid value for Descripcion", value, value.ToString()); m_isChanged |= (m_observacion != value); m_observacion = value; diff --git a/Business/Data/Usuario.cs b/Business/Data/Usuario.cs index af779a53..374e901c 100644 --- a/Business/Data/Usuario.cs +++ b/Business/Data/Usuario.cs @@ -36,6 +36,7 @@ public sealed class Usuario: Business.BaseDataAccess private bool m_externo; private string m_email; private string m_telefono; + private string m_tipoAutenticacion; #endregion #region Default ( Empty ) Class Constuctor @@ -63,7 +64,7 @@ public Usuario() m_externo = false; m_email= String.Empty; m_telefono = String.Empty; - + m_tipoAutenticacion = String.Empty; } @@ -93,7 +94,7 @@ public Usuario( m_requiereCambioPass = false; m_administrador = false; m_externo = false; - + m_tipoAutenticacion = String.Empty; } #endregion // End Required Fields Only Constructor @@ -429,24 +430,38 @@ public bool IsChanged get { return m_isChanged; } } - - #endregion + /// + /// + /// + public string TipoAutenticacion + { + get { return m_tipoAutenticacion; } + set + { + if (value != null && value.Length > 10) + throw new ArgumentOutOfRangeException("Invalid value for m_tipoAutenticacion", value, value.ToString()); - #region Metodos + m_isChanged |= (m_tipoAutenticacion != value); m_tipoAutenticacion = value; + } + } + #endregion + + + #region Metodos - #endregion + #endregion - //public bool esHemoterapia() - //{ - // var index=this.IdPerfil.Nombre.ToUpper().IndexOf("HEMOTERAPIA"); - // if (index > -1) return true; - // else return false; + //public bool esHemoterapia() + //{ + // var index=this.IdPerfil.Nombre.ToUpper().IndexOf("HEMOTERAPIA"); + // if (index > -1) return true; + // else return false; - //} + //} - } + } } diff --git a/Business/Data/Usuario.hbm.xml b/Business/Data/Usuario.hbm.xml index c0208ff7..85737535 100644 --- a/Business/Data/Usuario.hbm.xml +++ b/Business/Data/Usuario.hbm.xml @@ -27,7 +27,7 @@ - + diff --git a/WebLab/Agendas/AgendaEdit.aspx.cs b/WebLab/Agendas/AgendaEdit.aspx.cs index e8f89d2e..78ae6658 100644 --- a/WebLab/Agendas/AgendaEdit.aspx.cs +++ b/WebLab/Agendas/AgendaEdit.aspx.cs @@ -84,8 +84,18 @@ private void MostrarDatos() IList items = crit.List(); foreach (AgendaDia oDia in items) { - int i = oDia.Dia; - cklDias.Items[i - 1].Selected = true; + ///Correccion ppara dias domingo grabar 0 en base de datos. + int diagrabado = oDia.Dia; + // cklDias.Items[i - 1].Selected = true; + + for (int i = 0; i < cklDias.Items.Count; i++) + { + if (int.Parse(cklDias.Items[i].Value)== diagrabado) + { + cklDias.Items[i].Selected = true; break; + + } + } txtLimite.Value = oDia.LimiteTurnos.ToString(); txtHoraDesde.Value = oDia.HoraDesde.ToString(); txtHoraHasta.Value = oDia.HoraHasta.ToString(); @@ -180,7 +190,7 @@ private void Guardar(Agenda oRegistro) AgendaDia oDia = new AgendaDia(); oDia.IdAgenda = oRegistro; oDia.IdEfector = oRegistro.IdEfector; - oDia.Dia = i + 1; + oDia.Dia = int.Parse(cklDias.Items[i].Value); //i + 1; oDia.LimiteTurnos = int.Parse(txtLimite.Value); oDia.HoraDesde = txtHoraDesde.Value; oDia.HoraHasta = txtHoraHasta.Value; diff --git a/WebLab/ControlResultados/ControlPlanilla.aspx.cs b/WebLab/ControlResultados/ControlPlanilla.aspx.cs index 6e86645f..ba6e3f64 100644 --- a/WebLab/ControlResultados/ControlPlanilla.aspx.cs +++ b/WebLab/ControlResultados/ControlPlanilla.aspx.cs @@ -190,31 +190,31 @@ protected void btnBuscar_Click(object sender, EventArgs e) //if (ddlArea.SelectedValue != "0") m_parametro += " AND i.idArea=" + ddlArea.SelectedValue; - Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1); - switch (oCon.TipoNumeracionProtocolo)// busqueda con autonumerico - { - case 0: - { + //Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1); + //switch (oCon.TipoNumeracionProtocolo)// busqueda con autonumerico + //{ + // case 0: + // { if (txtProtocoloDesde.Value != "") m_parametro += " And P.numero>=" + int.Parse(txtProtocoloDesde.Value); if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numero<=" + int.Parse(txtProtocoloHasta.Value); - } break; - case 1: - { - if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroDiario>=" + int.Parse(txtProtocoloDesde.Value); - if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroDiario<=" + int.Parse(txtProtocoloHasta.Value); - } break; - case 2: - { - if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroSector>=" + int.Parse(txtProtocoloDesde.Value); - if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroSector<=" + int.Parse(txtProtocoloHasta.Value); - } break; - - case 3: - { - if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroTipoServicio>=" + int.Parse(txtProtocoloDesde.Value); - if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroTipoServicio<=" + int.Parse(txtProtocoloHasta.Value); - } break; - } + // } break; + // case 1: + // { + // if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroDiario>=" + int.Parse(txtProtocoloDesde.Value); + // if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroDiario<=" + int.Parse(txtProtocoloHasta.Value); + // } break; + // case 2: + // { + // if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroSector>=" + int.Parse(txtProtocoloDesde.Value); + // if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroSector<=" + int.Parse(txtProtocoloHasta.Value); + // } break; + + // case 3: + // { + // if (txtProtocoloDesde.Value != "") m_parametro += " And P.numeroTipoServicio>=" + int.Parse(txtProtocoloDesde.Value); + // if (txtProtocoloHasta.Value != "") m_parametro += " AND P.numeroTipoServicio<=" + int.Parse(txtProtocoloHasta.Value); + // } break; + //} if (ddlEfector.SelectedValue != "0") m_parametro += " AND P.idEfectorSolicitante=" + ddlEfector.SelectedValue; diff --git a/WebLab/ControlResultados/ProtocoloList.aspx.cs b/WebLab/ControlResultados/ProtocoloList.aspx.cs index 8f067068..b839ef24 100644 --- a/WebLab/ControlResultados/ProtocoloList.aspx.cs +++ b/WebLab/ControlResultados/ProtocoloList.aspx.cs @@ -72,20 +72,47 @@ private object LeerDatos() /* Filtra los protocolos con analisis con formulas a calcular sin resultados*/ + //string m_strSQL = @" SELECT P.idProtocolo, P.numero as numero, cONVERT(varchar(10),P.fecha,103) as fecha, + // CASE + // WHEN Pa.idestado = 2 THEN CAST(Pa.numeroAdic AS varchar(20)) + // ELSE CAST(Pa.numeroDocumento AS varchar(20)) + // END AS dni, + // Pa.apellido+ ' ' + Pa.nombre as paciente, + // O.nombre as origen, Pri.nombre as prioridad, SS.nombre as sector,P.estado, P.impreso + // FROM Lab_Protocolo P with (nolock) + // INNER JOIN Lab_Origen O with (nolock) on O.idOrigen= P.idOrigen + // INNER JOIN Lab_Prioridad Pri with (nolock) on Pri.idPrioridad= P.idPrioridad + // INNER JOIN Sys_Paciente Pa with (nolock) on Pa.idPaciente= P.idPaciente + // INNER JOIN LAB_SectorServicio SS with (nolock) ON P.idSector= SS.idSectorServicio + // INNER JOIN LAB_DetalleProtocolo AS DP with (nolock) ON P.idProtocolo = DP.idProtocolo + // INNER JOIN LAB_Item AS I with (nolock) ON DP.idSubItem = I.idItem + // INNER JOIN LAB_Formula AS F with (nolock) ON I.idItem = F.idItem + // WHERE (F.idTipoFormula = 1) AND (P.estado =1) AND (DP.conResultado = 0) AND " + Request["Parametros"].ToString(); // +str_orden; + + /*Se reformula sql con mejor preformance para no mostrar protocolos duplicados */ string m_strSQL = @" SELECT P.idProtocolo, P.numero as numero, cONVERT(varchar(10),P.fecha,103) as fecha, - case when Pa.idestado=2 then Pa.numeroAdic else Pa.numeroDocumento end as dni,Pa.apellido+ ' ' + Pa.nombre as paciente, + CASE + WHEN Pa.idestado = 2 THEN CAST(Pa.numeroAdic AS varchar(20)) + ELSE CAST(Pa.numeroDocumento AS varchar(20)) + END AS dni, + LTRIM(RTRIM(ISNULL(Pa.apellido,'') + ' ' + ISNULL(Pa.nombre,''))) AS paciente, O.nombre as origen, Pri.nombre as prioridad, SS.nombre as sector,P.estado, P.impreso - FROM Lab_Protocolo P with (nolock) - INNER JOIN Lab_Origen O with (nolock) on O.idOrigen= P.idOrigen - INNER JOIN Lab_Prioridad Pri with (nolock) on Pri.idPrioridad= P.idPrioridad - INNER JOIN Sys_Paciente Pa with (nolock) on Pa.idPaciente= P.idPaciente - INNER JOIN LAB_SectorServicio SS with (nolock) ON P.idSector= SS.idSectorServicio - INNER JOIN LAB_DetalleProtocolo AS DP with (nolock) ON P.idProtocolo = DP.idProtocolo - INNER JOIN LAB_Item AS I with (nolock) ON DP.idSubItem = I.idItem - INNER JOIN LAB_Formula AS F with (nolock) ON I.idItem = F.idItem - WHERE (F.idTipoFormula = 1) AND (P.estado =1) AND (DP.conResultado = 0) AND " + Request["Parametros"].ToString(); // +str_orden; - - //" INNER JOIN Lab_Configuracion Con ON Con.idEfector= P.idEfector " + + FROM Lab_Protocolo P WITH (NOLOCK) + INNER JOIN Lab_Origen O WITH (NOLOCK) ON O.idOrigen = P.idOrigen + INNER JOIN Lab_Prioridad Pri WITH (NOLOCK) ON Pri.idPrioridad = P.idPrioridad + INNER JOIN Sys_Paciente Pa WITH (NOLOCK) ON Pa.idPaciente = P.idPaciente + INNER JOIN LAB_SectorServicio SS WITH (NOLOCK) ON P.idSector = SS.idSectorServicio + WHERE (P.estado =1) AND " + Request["Parametros"].ToString()+ + @" AND EXISTS ( SELECT 1 + FROM LAB_DetalleProtocolo DP WITH (NOLOCK) + + INNER JOIN LAB_Formula F WITH (NOLOCK) ON DP.idSubItem = F.idItem + WHERE DP.idProtocolo = P.idProtocolo and P.idEfector = DP.idEfector + AND DP.conResultado = 0 + AND F.idTipoFormula = 1 ) + order by P.numero " ; + + DataSet Ds = new DataSet(); // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura diff --git a/WebLab/Derivaciones/InformeLote.aspx b/WebLab/Derivaciones/InformeLote.aspx index 6b01eb65..fb9427e9 100644 --- a/WebLab/Derivaciones/InformeLote.aspx +++ b/WebLab/Derivaciones/InformeLote.aspx @@ -3,6 +3,12 @@ diff --git a/WebLab/Derivaciones/InformeLote.aspx.cs b/WebLab/Derivaciones/InformeLote.aspx.cs index b6914eca..9b0efd72 100644 --- a/WebLab/Derivaciones/InformeLote.aspx.cs +++ b/WebLab/Derivaciones/InformeLote.aspx.cs @@ -65,10 +65,10 @@ protected void Page_Load(object sender, EventArgs e) CargarGrilla(); CargarControles(); } - else - { - CargarFechaHoraActual(); //Despues de guardar, si no tenia fecha seleccionada lo trae ahora sin datos - } + //else + //{ + // CargarFechaHoraActual(); //Despues de guardar, si no tenia fecha seleccionada lo trae ahora sin datos --> NO recuerdo cuando sucedia, pero si ahora lo dejo, pone la fecha actual en envio y no la del formulario. + //} } else diff --git a/WebLab/ImpresionResult/ResultadoList.aspx.cs b/WebLab/ImpresionResult/ResultadoList.aspx.cs index 77b83c5d..eb50a559 100644 --- a/WebLab/ImpresionResult/ResultadoList.aspx.cs +++ b/WebLab/ImpresionResult/ResultadoList.aspx.cs @@ -202,17 +202,24 @@ private object LeerDatos() string m_strSQL = ""; if (Request["idTipoServicio"].ToString() != "5") - m_strSQL = @" SELECT DISTINCT P.idProtocolo, - P.numero as numero, CONVERT(varchar(10),P.fecha,103) as fecha, case when Pa.idestado= 2 then Pa.numeroAdic else convert(varchar,Pa.numeroDocumento) end as dni ,Pa.apellido+ ' ' + Pa.nombre as paciente, + m_strSQL = @" SELECT P.idProtocolo, + P.numero as numero, CONVERT(varchar(10),P.fecha,103) as fecha, + CASE + WHEN Pa.idestado = 2 THEN CAST(Pa.numeroAdic AS varchar(20)) + ELSE CAST(Pa.numeroDocumento AS varchar(20)) + END as dni ,Pa.apellido+ ' ' + Pa.nombre as paciente, O.nombre as origen, Pri.nombre as prioridad, SS.nombre as sector,P.estado, P.impreso FROM Lab_Protocolo P (nolock) INNER JOIN Lab_Origen O (nolock) on O.idOrigen= P.idOrigen INNER JOIN Lab_Prioridad Pri (nolock) on Pri.idPrioridad= P.idPrioridad INNER JOIN Sys_Paciente Pa (nolock) on Pa.idPaciente= P.idPaciente - INNER JOIN LAB_SectorServicio SS (nolock) ON P.idSector= SS.idSectorServicio - INNER JOIN LAB_DetalleProtocolo AS DP (nolock) ON P.idProtocolo = DP.idProtocolo - INNER JOIN LAB_Item AS I (nolock) ON DP.idItem = I.idItem - WHERE " + str_condicion +str_orden; + INNER JOIN LAB_SectorServicio SS (nolock) ON P.idSector= SS.idSectorServicio + WHERE " + str_condicion + + @" AND EXISTS ( + SELECT 1 + FROM LAB_DetalleProtocolo DP WITH (NOLOCK) + WHERE DP.idProtocolo = P.idProtocolo + )"+ str_orden; else m_strSQL = @" SELECT DISTINCT P.idProtocolo, P.numero as numero, CONVERT(varchar(10),P.fecha,103) as fecha, M.nombre as muestra, C.descripcion as conservacion, diff --git a/WebLab/Items/ItemInsumo.aspx b/WebLab/Items/ItemInsumo.aspx index 4e625433..b73055b7 100644 --- a/WebLab/Items/ItemInsumo.aspx +++ b/WebLab/Items/ItemInsumo.aspx @@ -2,16 +2,47 @@ <%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %> + - - - <%----%> - + + + + + + + + + + + - - - @@ -19,7 +50,6 @@ -
@@ -35,7 +65,7 @@ - Efector:  + Efector:  @@ -44,7 +74,7 @@ - Servicio: + Servicio: - + Area: @@ -66,7 +96,7 @@ - + Estado: @@ -80,6 +110,31 @@ + + + Fecha Desde: + + + <%-- Fecha Hasta: + --%> + + + + + + + + + + @@ -137,7 +192,7 @@
+ Text="Guardar" ValidationGroup="0" /> diff --git a/WebLab/Items/ItemInsumo.aspx.cs b/WebLab/Items/ItemInsumo.aspx.cs index 897102f5..304a1ecf 100644 --- a/WebLab/Items/ItemInsumo.aspx.cs +++ b/WebLab/Items/ItemInsumo.aspx.cs @@ -50,6 +50,67 @@ protected void Page_Load(object sender, EventArgs e) } + protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args) + { + + + + + if (txtFechaDesde.Value != "") + + { + if (DateTime.Parse(txtFechaDesde.Value) > DateTime.Now) + { + //TxtDatos.Value = ""; + args.IsValid = false; + this.cvValidacionInput.ErrorMessage = "La Fecha Desde no puede ser superior a la fecha actual"; + return; + } + else + { + //if (DateTime.Parse(txtFechaHasta.Value) < DateTime.Parse(txtFechaDesde.Value)) + //{ + // //TxtDatos.Value = ""; + // args.IsValid = false; + // this.cvValidacionInput.ErrorMessage = "La Fecha desde no puede ser mayor a fecha hasta"; + // return; + //} + //else + args.IsValid = true; + } + } + else args.IsValid = false; + + + + //if (txtFechaHasta.Value != "") + + //{ + // if (DateTime.Parse(txtFechaHasta.Value) > DateTime.Now) + // { + // //TxtDatos.Value = ""; + // args.IsValid = false; + // this.cvValidacionInput.ErrorMessage = "La Fecha Hasta no puede ser superior a la fecha actual"; + // return; + // } + // else + // { + // if (DateTime.Parse(txtFechaHasta.Value) < DateTime.Parse(txtFechaDesde.Value)) + // { + // //TxtDatos.Value = ""; + // args.IsValid = false; + // this.cvValidacionInput.ErrorMessage = "La Fecha desde no puede ser mayor a fecha hasta"; + // return; + // } + // else + // args.IsValid = true; + + // } + //} + //else + // args.IsValid = false; + + } private void CargarListas() { @@ -234,66 +295,106 @@ protected void btnGuardar_Click(object sender, EventArgs e) private void Guardar() { - foreach (GridViewRow row in gvLista.Rows) + if (Page.IsValid) { - CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1"))); - if (a.Checked == true) + foreach (GridViewRow row in gvLista.Rows) { - - ItemEfector oItem = new ItemEfector(); - oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), int.Parse(gvLista.DataKeys[row.RowIndex].Value.ToString())); + CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1"))); + if (a.Checked == true) + { + ItemEfector oItem = new ItemEfector(); + oItem = (ItemEfector)oItem.Get(typeof(ItemEfector), int.Parse(gvLista.DataKeys[row.RowIndex].Value.ToString())); - if (oItem != null) - { - ISession m_session = NHibernateHttpModule.CurrentSession; - ICriteria crit = m_session.CreateCriteria(typeof(ItemEfector)); - crit.Add(Expression.Eq("IdEfector", oUser.IdEfector)); - crit.Add(Expression.Eq("IdItem", oItem.IdItem)); - IList items = crit.List(); - foreach (ItemEfector oResultado in items) + if (oItem != null) { - if (oResultado.SinInsumo) + if (oItem.SinInsumo) { - oResultado.SinInsumo = false; - oResultado.IdUsuarioRegistro = oUser; - oResultado.FechaRegistro = DateTime.Now; - oResultado.Save(); - + oItem.SinInsumo = false; + oItem.IdUsuarioRegistro = oUser; + oItem.FechaRegistro = DateTime.Now; + oItem.Save(); + oItem.IdItem.GrabarAuditoriaDetalleItem("Cambia estado", oUser, "Disponible", oUser.IdEfector.Nombre, ""); + + ActualizarProtocolos(oItem.IdItem, "0", oUser); } else { - oResultado.SinInsumo = true; - oResultado.IdUsuarioRegistro = oUser; - oResultado.FechaRegistro = DateTime.Now; - oResultado.Save(); + oItem.SinInsumo = true; + oItem.IdUsuarioRegistro = oUser; + oItem.FechaRegistro = DateTime.Now; + oItem.Save(); oItem.IdItem.GrabarAuditoriaDetalleItem("Cambia estado", oUser, "Sin Insumo", oUser.IdEfector.Nombre, ""); - ActualizarProtocolos(oItem.IdItem); + ActualizarProtocolos(oItem.IdItem, "1", oUser); } + //ISession m_session = NHibernateHttpModule.CurrentSession; + //ICriteria crit = m_session.CreateCriteria(typeof(ItemEfector)); + //crit.Add(Expression.Eq("IdEfector", oUser.IdEfector)); + //crit.Add(Expression.Eq("IdItem", oItem.IdItem)); + //IList items = crit.List(); + //foreach (ItemEfector oResultado in items) + //{ + // if (oResultado.SinInsumo) + // { + // oResultado.SinInsumo = false; + // oResultado.IdUsuarioRegistro = oUser; + // oResultado.FechaRegistro = DateTime.Now; + // oResultado.Save(); + + // oItem.IdItem.GrabarAuditoriaDetalleItem("Cambia estado", oUser, "Disponible", oUser.IdEfector.Nombre, ""); + + // ActualizarProtocolos(oItem.IdItem, "0", oUser); + // } + // else + // { + // oResultado.SinInsumo = true; + // oResultado.IdUsuarioRegistro = oUser; + // oResultado.FechaRegistro = DateTime.Now; + // oResultado.Save(); + // oItem.IdItem.GrabarAuditoriaDetalleItem("Cambia estado", oUser, "Sin Insumo", oUser.IdEfector.Nombre, ""); + + // ActualizarProtocolos(oItem.IdItem, "1", oUser); + // } + + //} // foreach - } // foreach - - } - }// chececk - }// primero + } + }// chececk + }// primero + } } - private void ActualizarProtocolos(Item oItem) + private void ActualizarProtocolos(Item oItem, string s_tipo, Usuario oUser) { + string str_condicion = ""; string m_strSQL = @" select DP.iddetalleprotocolo from lab_detalleprotocolo DP (nolock) inner join LAb_Protocolo P (nolock) on DP.idprotocolo=p.idprotocolo - - where P.baja=0 and P.estado<2 - and P.IdEfector=" + oUser.IdEfector.IdEfector.ToString() + @" and P.fecha>getdate()-3 - and DP.idsubitem="+oItem.IdItem.ToString()+@" and DP.idusuariovalida=0 "; + and P.IdEfector=" + oUser.IdEfector.IdEfector.ToString() + @" + and DP.idsubitem=" + oItem.IdItem.ToString() ; + if (txtFechaDesde.Value != "") + { + DateTime fecha1 = DateTime.Parse(txtFechaDesde.Value); + str_condicion += " AND P.fecha>= '" + fecha1.ToString("yyyyMMdd") + "'"; + } + //if (txtFechaHasta.Value != "") + //{ + // DateTime fecha2 = DateTime.Parse(txtFechaHasta.Value); + // str_condicion += " AND P.fecha<= '" + fecha2.ToString("yyyyMMdd") + "'"; + //} + + if (s_tipo=="1") // poner marca sin insumo solo trae los anteriores a tres dias y sin validar + str_condicion += @" and DP.idusuariovalida=0 "; + //if (s_tipo == "0") // poner marca disponible es sacar la marca de validado lo de estaba a partir de hoy. + // str_condicion += @" and DP.idusuariovalida>0 "; + m_strSQL += str_condicion; DataSet Ds = new DataSet(); SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; @@ -309,29 +410,14 @@ and P.estado<2 detalle = (DetalleProtocolo)detalle.Get(typeof(DetalleProtocolo), int.Parse(Ds.Tables[0].Rows[i][0].ToString())); if (detalle != null) { - detalle.GuardarSinInsumo(); + if (s_tipo == "1") + detalle.GuardarSinInsumo(oUser); + if (s_tipo == "0") + detalle.GuardarDisponible(); ActualizaEstadoProtocolo(detalle.IdProtocolo); } } - - //string ssql_Protocolo = @" IdProtocolo in (Select LAb_Protocolo.IdProtocolo - // From LAb_Protocolo - // where LAb_Protocolo.baja=0 - // and LAb_Protocolo.estado<2 - // and lab_Protocolo.IdEfector=" + oUser.IdEfector.IdEfector.ToString() + " and Lab_Protocolo.fecha>getdate()-5 )"; - //critProtocolo.Add(Expression.Sql(ssql_Protocolo)); - //critProtocolo.Add(Expression.Eq("IdEfector", oUser.IdEfector)); - //critProtocolo.Add(Expression.Eq("IdSubItem", oItem)); - ////Protocolo oUltimoProtocolo = (Protocolo)critProtocolo.List; - - //IList detalle = critProtocolo.List(); - - //foreach (DetalleProtocolo oResultado in detalle) - //{ - // if (oResultado.IdUsuarioValida==0) - // oResultado.GuardarSinInsumo(); - - //} + } private void ActualizaEstadoProtocolo(Protocolo oRegistro) diff --git a/WebLab/Items/ItemInsumo.aspx.designer.cs b/WebLab/Items/ItemInsumo.aspx.designer.cs index f704b540..fbe0a199 100644 --- a/WebLab/Items/ItemInsumo.aspx.designer.cs +++ b/WebLab/Items/ItemInsumo.aspx.designer.cs @@ -48,6 +48,24 @@ public partial class ItemInsumo { /// protected global::Anthem.DropDownList ddlEstado; + /// + /// txtFechaDesde control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaDesde; + + /// + /// cvValidacionInput control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator cvValidacionInput; + /// /// estatus control. /// diff --git a/WebLab/ParametrosEdit.aspx b/WebLab/ParametrosEdit.aspx index 4090aecc..191df725 100644 --- a/WebLab/ParametrosEdit.aspx +++ b/WebLab/ParametrosEdit.aspx @@ -1672,6 +1672,16 @@ $("#tabContainer").tabs({ selected: currTab }); + + +
Mapeo SIL y SISA:
+ + + + Descargar Excel + + diff --git a/WebLab/ParametrosEdit.aspx.cs b/WebLab/ParametrosEdit.aspx.cs index f2877f9c..a6846872 100644 --- a/WebLab/ParametrosEdit.aspx.cs +++ b/WebLab/ParametrosEdit.aspx.cs @@ -20,6 +20,8 @@ using CrystalDecisions.Web; using CrystalDecisions.Shared; using System.Web.Script.Serialization; +using System.Text; +using System.IO; namespace WebLab { @@ -54,7 +56,7 @@ protected void Page_PreInit(object sender, EventArgs e) oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString())); - else Response.Redirect("../FinSesion.aspx", false); + else Response.Redirect("FinSesion.aspx", false); } @@ -64,12 +66,16 @@ protected void Page_PreInit(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) - { - VerificaPermisos("Parametros SI"); - CargarListas(); - MostrarDatos(); - HabilitarDatosModificables(); - + { + if (Session["idUsuario"] != null) + { + VerificaPermisos("Parametros SI"); + CargarListas(); + MostrarDatos(); + HabilitarDatosModificables(); + } + else Response.Redirect("FinSesion.aspx", false); + } } @@ -469,6 +475,7 @@ private void MostrarDatosCodigoBarrasPesquisa() } private void MostrarDatos() { + Efector oEfector = new Efector(); oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(ddlEfector.SelectedValue)); if (oEfector != null) @@ -859,7 +866,74 @@ private void MostrarDatos() } } - private bool SiNoHayProtocolosCargados() + + protected void lnkExcel_Click(object sender, EventArgs e) + { + + dataTableAExcel(LeerDatosSISA(), "MapeoSIL_SISA"); + } + + private void dataTableAExcel(DataTable tabla, string nombreArchivo) + { + if (tabla.Rows.Count > 0) + { + StringBuilder sb = new StringBuilder(); + StringWriter sw = new StringWriter(sb); + HtmlTextWriter htw = new HtmlTextWriter(sw); + Page pagina = new Page(); + HtmlForm form = new HtmlForm(); + GridView dg = new GridView(); + dg.EnableViewState = false; + dg.DataSource = tabla; + dg.DataBind(); + pagina.EnableEventValidation = false; + pagina.DesignerInitialize(); + pagina.Controls.Add(form); + form.Controls.Add(dg); + pagina.RenderControl(htw); + Response.Clear(); + Response.Buffer = true; + Response.ContentType = "application/vnd.ms-excel"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + nombreArchivo + ".xls"); + Response.Charset = "UTF-8"; + Response.ContentEncoding = Encoding.Default; + Response.Write(sb.ToString()); + Response.End(); + } + } + private DataTable LeerDatosSISA() + { + + string m_strSQL = @"select idEvento as [idEventoSISA], nombreevento [Nombre Evento], idClasificacionManual, nombreClasificacionManual, idGrupoEvento, nombreGrupoEvento, +s.idmuestra as idmuestrasisa, idTipoMuestra as idtipomuestrasisa, idPrueba as idPruebaSISA , idTipoPrueba as idTipoPruebaSISA, +I.codigo as [codigo SIL],case when i.baja=0 then 'Activa' else 'Dada de baja' end as [Estado en SIL] ,I.nombre as [Det. Sil] , +fechaVigenciaDesde as [Fecha Vigencia Desde], case when fechaVigenciaHasta='19000101' then '' else convert(varchar,fechaVigenciaHasta) end [Fecha Vigencia Hasta], +isnull(o.nombre, 'Todos') as [Origen SIL], isnull(E.nombre, 'Todos') as [Efector Solicitante], edaddesde as [Edad Desde], edadHasta [Edad Hasta], +case unidadEdad when -1 then 'Todas las edades' + when 0 then 'Años' + when 1 then 'meses' + when 2 then 'dias' + end as [Tipo Edad], isnull(M.nombre, 'No aplica') as [Muestra SIL], isnull(c.nombre,'No aplica') as [Caracter SIL] +from lab_configuracionsisa s with (nolock) +left join LAB_Caracter c with (nolock) on C.idCaracter= s.idCaracter +inner join lab_item i with (nolock) on i.idItem= S.idItem +left join lab_origen O with (nolock) on S.idOrigen= O.idOrigen +left join Sys_Efector E with (nolock) on E.idEfector= S.idEfectorSolicitante +left join LAB_Muestra as M with (nolock) on M.idMuestra= S.idMuestraSIL +order by s.idEvento,s.idClasificacionManual,s.idGrupoEvento +"; + + DataSet Ds = new DataSet(); + SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; + SqlDataAdapter adapter = new SqlDataAdapter(); + adapter.SelectCommand = new SqlCommand(m_strSQL, conn); + adapter.Fill(Ds); + + return Ds.Tables[0]; + } + + + private bool SiNoHayProtocolosCargados() { bool dev=true; ISession m_session = NHibernateHttpModule.CurrentSession; diff --git a/WebLab/ParametrosEdit.aspx.designer.cs b/WebLab/ParametrosEdit.aspx.designer.cs index 2e297f8d..3eb72a50 100644 --- a/WebLab/ParametrosEdit.aspx.designer.cs +++ b/WebLab/ParametrosEdit.aspx.designer.cs @@ -930,6 +930,15 @@ public partial class ParametrosEdit { /// protected global::System.Web.UI.WebControls.TextBox txtCodigoEstablecimientoSISA; + /// + /// lnkExcel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkExcel; + /// /// btnReinializacion control. /// diff --git a/WebLab/Placas/PlacaEdit2.aspx.cs b/WebLab/Placas/PlacaEdit2.aspx.cs index 8a823670..d0e40ae2 100644 --- a/WebLab/Placas/PlacaEdit2.aspx.cs +++ b/WebLab/Placas/PlacaEdit2.aspx.cs @@ -437,7 +437,7 @@ private void Guardar(Placa oRegistro, string estado) oRegistro.Operador = ddlOperador.SelectedItem.Text + " -" + ddlOperador0.SelectedItem.Text; oRegistro.Equipo = lblEquipo.Text; oRegistro.Fecha =DateTime.Parse( lblFecha.Text); - + oRegistro.IdEfector = oC.IdEfector; if (Request["id"] == null) { oRegistro.FechaRegistro = DateTime.Now; @@ -445,7 +445,7 @@ private void Guardar(Placa oRegistro, string estado) } oRegistro.Estado = estado; oRegistro.Save(); - if (estado=="C") oRegistro.GrabarAuditoria("Graba y Cierra", int.Parse(Session["idUsuario"].ToString()), ""); + if (estado=="C") oRegistro.GrabarAuditoria("Graba y Cierra", int.Parse(Session["idUsuario"].ToString()), ""); //Caro: hago que recorra las determinacoines del tipo de placa @@ -728,7 +728,7 @@ private void guardarvalorCeldaAlplex(Placa oRegistro, Item oItem, string value, oDet.IdProtocolo.GrabarAuditoriaDetalleProtocolo("Vincula a Placa Alplex", int.Parse(Session["idUsuario"].ToString()), "", oRegistro.IdPlaca.ToString()); } else - { Session["errores"] += "- Protocolo " + value + " ya validado. No es posible incorporar a la placa."; } + { Session["errores"] += "- Protocolo " + value + " ya validado. No es posible incorporar a la placa."; break; } } } @@ -790,7 +790,7 @@ private void guardarvalorCelda(Placa oRegistro, Item oItem, string value, string oDet.IdProtocolo.GrabarAuditoriaDetalleProtocolo("Vincula a Placa Promega", int.Parse(Session["idUsuario"].ToString()), "", oRegistro.IdPlaca.ToString()); } else - { Session["errores"] += "- Protocolo " + value + " ya fue validado. No es posible incorporar en la placa"; } + { Session["errores"] += "- Protocolo " + value + " ya fue validado. No es posible incorporar en la placa"; break; } } } diff --git a/WebLab/Placas/PlacaEdit3.aspx.cs b/WebLab/Placas/PlacaEdit3.aspx.cs index 25680fc1..51533094 100644 --- a/WebLab/Placas/PlacaEdit3.aspx.cs +++ b/WebLab/Placas/PlacaEdit3.aspx.cs @@ -429,6 +429,7 @@ private void Guardar(Placa oRegistro, string estado) oRegistro.Operador = ddlOperador.SelectedItem.Text + " -" + ddlOperador0.SelectedItem.Text; oRegistro.Equipo = lblEquipo.Text; + oRegistro.IdEfector = oC.IdEfector; oRegistro.Fecha =DateTime.Parse( lblFecha.Text); if (Request["id"] == null) @@ -852,7 +853,7 @@ private void Imprimir(string id) Business.Data.Laboratorio.Placa oRegistro = new Business.Data.Laboratorio.Placa(); oRegistro = (Business.Data.Laboratorio.Placa)oRegistro.Get(typeof(Business.Data.Laboratorio.Placa), int.Parse(id)); - Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1); + // Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oC.IdEfector); CrystalReportSource oCr = new CrystalReportSource(); diff --git a/WebLab/Placas/PlacaList.aspx.cs b/WebLab/Placas/PlacaList.aspx.cs index 912f6980..e7b386b5 100644 --- a/WebLab/Placas/PlacaList.aspx.cs +++ b/WebLab/Placas/PlacaList.aspx.cs @@ -161,7 +161,7 @@ private string getEstado(string estado) } private object LeerDatos( ) { - string m_condicion = " 1=1 "; + string m_condicion = " 1=1 and P.idEfector="+ oUser.IdEfector.IdEfector.ToString(); ///placas del efector if (txtNumero.Text != "") m_condicion += " and IDPlaca =" + txtNumero.Text.Trim(); @@ -408,7 +408,7 @@ private void ImprimirAuditoria(string v) DataTable dtAuditoria = GetDataSetAuditoria(v); if (dtAuditoria.Columns.Count > 2) { - Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1); + Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oUser.IdEfector);///encabezado del efector ParameterDiscreteValue encabezado1 = new ParameterDiscreteValue(); encabezado1.Value = oCon.EncabezadoLinea1; diff --git a/WebLab/Placas/PlacaMixtaEdit.aspx.cs b/WebLab/Placas/PlacaMixtaEdit.aspx.cs index 9fd24399..8c84831c 100644 --- a/WebLab/Placas/PlacaMixtaEdit.aspx.cs +++ b/WebLab/Placas/PlacaMixtaEdit.aspx.cs @@ -411,6 +411,7 @@ private void Guardar(Placa oRegistro, string estado) oRegistro.Operador = ddlOperador.SelectedItem.Text + " -" + ddlOperador0.SelectedItem.Text; oRegistro.Equipo = lblEquipo.Text; oRegistro.Fecha =DateTime.Parse( lblFecha.Text); + oRegistro.IdEfector = oC.IdEfector; if (Request["id"] == null) { diff --git a/WebLab/Principal.aspx b/WebLab/Principal.aspx index 0cc4eb11..5818f350 100644 --- a/WebLab/Principal.aspx +++ b/WebLab/Principal.aspx @@ -113,8 +113,12 @@ -
- +
+ + +
+ +
@@ -126,7 +130,6 @@

-
protected global::System.Web.UI.HtmlControls.HtmlGenericControl Div1; + /// + /// btnProtocoloEfector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnProtocoloEfector; + /// /// gvProtocolosxEfector control. /// @@ -139,40 +148,49 @@ public partial class Principal { protected global::System.Web.UI.WebControls.GridView gvProtocolosxEfector; /// - /// Div2 control. + /// btnSISA control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl Div2; + protected global::System.Web.UI.WebControls.Button btnSISA; /// - /// LinkButton1 control. + /// gvProtocolosxSISA control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.LinkButton LinkButton1; + protected global::System.Web.UI.WebControls.GridView gvProtocolosxSISA; /// - /// lnkCambioEfector control. + /// Div2 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.LinkButton lnkCambioEfector; + protected global::System.Web.UI.HtmlControls.HtmlGenericControl Div2; /// - /// gvProtocolosxSISA control. + /// LinkButton1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.GridView gvProtocolosxSISA; + protected global::System.Web.UI.WebControls.LinkButton LinkButton1; + + /// + /// lnkCambioEfector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkCambioEfector; /// /// mensajeria control. diff --git a/WebLab/Protocolos/Default2.aspx b/WebLab/Protocolos/Default2.aspx index b9e42a30..35777437 100644 --- a/WebLab/Protocolos/Default2.aspx +++ b/WebLab/Protocolos/Default2.aspx @@ -119,7 +119,7 @@ - Nro. Ident. Adicional/Parentesco: + Nro. Ident. Adicional: '); //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 @@
- - - + + Nro. Lote: + +
@@ -93,20 +94,14 @@
+ DataKeyNames="idProtocolo" OnRowDataBound="gvProtocolosDerivados_RowDataBound" OnRowCommand="gvProtocolosDerivados_RowCommand"> - - <%----%> - - - + + - diff --git a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.cs b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.cs index d1a4a55a..6e0bb7c0 100644 --- a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.cs +++ b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.cs @@ -23,7 +23,7 @@ public partial class DerivacionMultiEfectorLote : System.Web.UI.Page public Configuracion oC = new Configuracion(); public Usuario oUser = new Usuario(); - #region Carga + protected void Page_PreInit(object sender, EventArgs e) { @@ -56,6 +56,7 @@ protected void Page_Load(object sender, EventArgs e) txtNumeroLote.Focus(); } + } private void VerificaPermisos(string sObjeto) { @@ -110,28 +111,23 @@ protected bool NoIngresado(int estado) break; } return tiene; - } - #endregion - - #region Buscar + } protected void btnBuscar_Click(object sender, EventArgs e) { - try - { - resetearForm(); - LoteDerivacion lote = new LoteDerivacion(); - lote = (LoteDerivacion)lote.Get(typeof(LoteDerivacion), Convert.ToInt32(txtNumeroLote.Text)); + + resetearForm(); + LoteDerivacion lote = new LoteDerivacion(); + lote = (LoteDerivacion)lote.GetIfExists(typeof(LoteDerivacion),int.Parse(txtNumeroLote.Text)); + if (lote != null) + { if (efectorCorrecto(lote)) { //El efector destino es el efector logueado CargarControladores(lote); } + } - catch (Exception) - { - ScriptManager.RegisterStartupScript(this, GetType(), "mensajeError", "alert('Número de lote inexistente.');", true); - } - + else ScriptManager.RegisterStartupScript(this, GetType(), "mensajeError", "alert('Número de lote inexistente.');", true); } private void CargarControladores(LoteDerivacion lote) { @@ -142,60 +138,66 @@ private void CargarControladores(LoteDerivacion lote) } //Cargo el estado - lblEstadoLote.Text = lote.descripcionEstadoLote(); + // lblEstadoLote.Text = lote.descripcionEstadoLote(); + + LoteDerivacionEstado estado = new LoteDerivacionEstado(); + estado = (LoteDerivacionEstado)estado.Get(typeof(LoteDerivacionEstado), lote.Estado); + lblEstadoLote.Text = estado.Nombre; //Cargo el efector de Origen - Efector efectorOrigen = new Efector(); - efectorOrigen = (Efector)efectorOrigen.Get(typeof(Efector), "IdEfector", lote.IdEfectorOrigen.IdEfector); - lblEfectorOrigen.Text = efectorOrigen.Nombre; + if (lote.IdEfectorOrigen != null) + lblEfectorOrigen.Text = lote.IdEfectorOrigen.Nombre; + + //Cargo grilla de protocolos para ingresar + DataTable dt = LeerDatosProtocolosDerivados(); + if (dt != null) + { + gvProtocolosDerivados.DataSource = dt; + gvProtocolosDerivados.DataBind(); + + } + - //Cargo grilla de protocolos para ingresar - DataTable dt = LeerDatosProtocolosDerivados(); int cantidad = dt.Rows.Count; if (cantidad > 0) - { - gvProtocolosDerivados.DataSource = dt; + { lblCantidadRegistros.Text = "Cantidad de registros encontrados " + cantidad; if (cantidad <= 10) divScroll.Style["height"] = "auto"; // altura mínima else divScroll.Style["height"] = "500px"; // altura grande con scroll - + } else - { - gvProtocolosDerivados.DataSource = null; - gvProtocolosDerivados.Visible = true; //asi sale el cartel de grilla vacia "EmptyDataText" + { //Si no trajo datos verifico el estado del lote - gvProtocolosDerivados.EmptyDataRowStyle.ForeColor = System.Drawing.Color.Red; + // gvProtocolosDerivados.EmptyDataRowStyle.ForeColor = System.Drawing.Color.Red; switch (lote.Estado) { case 1: - gvProtocolosDerivados.EmptyDataText = "No se puede recepcionar lote, todavia no se ha derivado."; break; + // gvProtocolosDerivados.EmptyDataText = "No se puede recepcionar lote, todavia no se ha derivado."; break; + lblCantidadRegistros.Text = "No se puede recepcionar lote, todavia no se ha derivado "; break; case 2: case 3: case 4: - case 5: - gvProtocolosDerivados.EmptyDataText = "No se encontraron protocolos para el lote ingresado."; - - break; - case 6: //Si esta el lote esta completo muestro otro mensaje de la grilla - gvProtocolosDerivados.EmptyDataText = "Ya se ingresaron todos los protocolos del lote."; - gvProtocolosDerivados.EmptyDataRowStyle.ForeColor = System.Drawing.Color.Black; - break; - } - divScroll.Style["height"] = "auto"; - } - gvProtocolosDerivados.DataBind(); - + case 5: + lblCantidadRegistros.Text = "No se encontraron protocolos para el lote ingresado."; break; + + case 6: //Si esta el lote esta completo muestro otro mensaje de la grilla + lblCantidadRegistros.Text = "Ya se ingresaron todos los protocolos del lote."; break; + + + } + divScroll.Style["height"] = "auto"; + } + } private bool efectorCorrecto(LoteDerivacion lote) { - try - { + //Verifico que el efector de Destino sea el que se tenga que ingresar if (lote.IdEfectorDestino.IdEfector == oUser.IdEfector.IdEfector) { @@ -204,8 +206,9 @@ private bool efectorCorrecto(LoteDerivacion lote) } else { - Efector e = new Efector(); - e = (Efector)e.Get(typeof(Efector), lote.IdEfectorDestino.IdEfector); + //Efector e = new Efector(); + //e = (Efector)e.Get(typeof(Efector), lote.IdEfectorDestino.IdEfector); + lblErrorEfectorOrigen.Visible = true; lblErrorEfectorOrigen.Text = "El lote no corresponde al efector del usuario '" + oC.IdEfector.Nombre + "'"; divControlLote.Attributes["class"] = "form-group has-error"; @@ -214,13 +217,6 @@ private bool efectorCorrecto(LoteDerivacion lote) } - } - catch (Exception excep) - { - - // if(excep.Message.Contains("")) - return false; //Cuando da error idlote inexistente que devuelva falso - } } @@ -253,41 +249,42 @@ and L.estado in (2, 4, 5) DataSet Ds = new DataSet(); SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura - SqlDataAdapter adapter = new SqlDataAdapter - { - SelectCommand = new SqlCommand(m_strSQL, conn) - }; + SqlDataAdapter adapter = new SqlDataAdapter(); + adapter.SelectCommand = new SqlCommand(m_strSQL, conn); + + adapter.Fill(Ds); return Ds.Tables[0]; } - - protected bool HabilitarIngreso() - { - bool puedeIngresarProtocolo = false; - LoteDerivacion lote = new LoteDerivacion(); - lote = (LoteDerivacion)lote.Get(typeof(LoteDerivacion), Convert.ToInt32(txtNumeroLote.Text)); - - /* Estados del Lote - idEstado nombre - 1 Creado -> NO permitir cargar protocolo - 2 Derivado -> NO permitir cargar protocolo - 3 Cancelado -> NO permitir cargar protocolo - 4 Recibido -> permitir cargar protocolo - 5 Ingresado -> permitir cargar protocolo - 6 Completado -> No hay más protocolos para cargar + //protected bool HabilitarIngreso() + //{ + // bool puedeIngresarProtocolo = false; + + // LoteDerivacion lote = new LoteDerivacion(); + // lote = (LoteDerivacion)lote.Get(typeof(LoteDerivacion), Convert.ToInt32(txtNumeroLote.Text)); + + // /* Estados del Lote + // idEstado nombre + // 1 Creado -> NO permitir cargar protocolo + // 2 Derivado -> NO permitir cargar protocolo + // 3 Cancelado -> NO permitir cargar protocolo + // 4 Recibido -> permitir cargar protocolo + // 5 Ingresado -> permitir cargar protocolo + // 6 Completado -> No hay más protocolos para cargar - */ - if (lote.Estado == 5 || lote.Estado == 4) - { - puedeIngresarProtocolo = true; - } - return puedeIngresarProtocolo; - } - #endregion + // */ + // if (lote.Estado == 5 || lote.Estado == 4) + // { + // puedeIngresarProtocolo = true; + // } + // return puedeIngresarProtocolo; + //} #region NuevoLote + + /* protected void lnkIngresoProtocolo_Command(object sender, CommandEventArgs e) { int idProtocolo = Convert.ToInt32(e.CommandArgument); @@ -325,6 +322,42 @@ private void GenerarNuevoProtocolo(int idProtocoloOrigen, int idPaciente) "&Operacion=AltaDerivacionMultiEfectorLote" , false); } + } + */ + + private void GenerarNuevoProtocolo(object idProtocoloOrigen ) + { + + string s_idServicio, idLote; + int i_idProtocoloOrigen = int.Parse(idProtocoloOrigen.ToString()); + + Protocolo p = new Protocolo(); + p = (Protocolo)p.Get(typeof(Protocolo), i_idProtocoloOrigen); + + s_idServicio = p.IdTipoServicio.IdTipoServicio.ToString(); + idLote = txtNumeroLote.Text; + int idPaciente= p.IdPaciente.IdPaciente; + + if (p.IdPaciente.IdPaciente > 0) + { + Response.Redirect("ProtocoloEdit2.aspx?idEfectorSolicitante=" + p.IdEfector.IdEfector + + "&idProtocolo=" + idProtocoloOrigen + + "&idServicio=" + s_idServicio + + "&idLote=" + idLote + + "&idPaciente=" + idPaciente + + "&Operacion=AltaDerivacionMultiEfectorLote", false); + } + else + { + //Es Muestra No Pacientes + Response.Redirect("ProtocoloProductoEdit.aspx?idEfectorSolicitante=" + p.IdEfector.IdEfector + + "&idProtocolo=" + idProtocoloOrigen + + "&idServicio=" + s_idServicio + + "&idLote=" + idLote + + "&Desde=AltaDerivacionMultiEfectorLote" + + "&Operacion=AltaDerivacionMultiEfectorLote", false); + } + } #endregion @@ -334,14 +367,35 @@ protected void btn_recibirLote_Click(object sender, EventArgs e) { Response.Redirect("DerivacionRecibirLote.aspx?idLote=" + txtNumeroLote.Text + "&idServicio=" + Request["idServicio"], false); } + + #endregion - protected void txtNumeroLote_TextChanged(object sender, EventArgs e) - { - //Si cambia el numero de lote, que vuelva a realizar la busqueda para que refresque los datos de busqueda - btnBuscar_Click(null, null); - } + protected void gvProtocolosDerivados_RowDataBound(object sender, GridViewRowEventArgs e) + { + + ///Cuando se carga la grilla es porque ya verifiqué el estado del lote + + if (e.Row.RowType == DataControlRowType.DataRow) + { + LinkButton cmdProtocolo = (LinkButton)e.Row.Cells[3].Controls[1]; + cmdProtocolo.CommandArgument = this.gvProtocolosDerivados.DataKeys[e.Row.RowIndex].Value.ToString(); + cmdProtocolo.ToolTip = "Ingresar Protocolo"; + if ((lblEstadoLote.Text == "Recibido") || (lblEstadoLote.Text == "Ingresado Parcial")) + cmdProtocolo.Enabled = true; + else + + cmdProtocolo.Enabled = false; + } + + } + protected void gvProtocolosDerivados_RowCommand(object sender, GridViewCommandEventArgs e) + { + + + GenerarNuevoProtocolo (e.CommandArgument); + } } } \ No newline at end of file diff --git a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.designer.cs b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.designer.cs index 05179157..4b6dedc4 100644 --- a/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.designer.cs +++ b/WebLab/Protocolos/DerivacionMultiEfectorLote.aspx.designer.cs @@ -50,6 +50,15 @@ public partial class DerivacionMultiEfectorLote /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divControlLote; + /// + /// lblNumeroLote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumeroLote; + /// /// txtNumeroLote control. /// diff --git a/WebLab/Protocolos/DerivacionRecibirLote.aspx b/WebLab/Protocolos/DerivacionRecibirLote.aspx index 625adea2..dd94a4d7 100644 --- a/WebLab/Protocolos/DerivacionRecibirLote.aspx +++ b/WebLab/Protocolos/DerivacionRecibirLote.aspx @@ -8,10 +8,10 @@ - + --%> @@ -109,13 +110,13 @@ Fecha y Hora: - <%----%> + <%-- --%> - *Error en Fecha + <%-- *Error en Fecha *Error en Hora - + --%> @@ -128,12 +129,16 @@ - + + + +
diff --git a/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs b/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs index 31b87abd..41cd5772 100644 --- a/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs +++ b/WebLab/Protocolos/DerivacionRecibirLote.aspx.cs @@ -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/ProtocoloEdit2.aspx b/WebLab/Protocolos/ProtocoloEdit2.aspx index 12b331e0..76b93786 100644 --- a/WebLab/Protocolos/ProtocoloEdit2.aspx +++ b/WebLab/Protocolos/ProtocoloEdit2.aspx @@ -235,6 +235,9 @@ + + + Cambiar Paciente  Datos del Paciente @@ -397,10 +400,10 @@ - - + + @@ -493,7 +496,7 @@ -
+
@@ -574,11 +577,7 @@
-
- - Impresora de Etiquetas: - -
+ @@ -794,7 +793,13 @@ - +
+
+ + + +
+ @@ -857,597 +862,728 @@ + - - - - + + + diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs index 9b1513ac..af7d241b 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); @@ -1885,8 +1891,14 @@ protected void btnGuardar_Click(object sender, EventArgs e) 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() @@ -2069,7 +2081,7 @@ private void ImprimirCodigoBarrasAreas(Protocolo oProt, string s_listaAreas, str // ticket.AddSubHeaderLine("PRACTICAS SOLICITADAS"); // for (int i = 1; i <= cantidadFilas; i++) // { - // int l = i * 90; + // int td = i * 90; // analisis = analisis.Insert(l, "&"); // } @@ -3443,7 +3455,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,7 +3464,12 @@ 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(); + lstDiagnosticosFinal.Items.Add(oDia); + lstDiagnosticosFinal.UpdateAfterCallBack = true; + } } @@ -3669,11 +3687,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 +3700,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 +3731,7 @@ protected void cvValidacionInput_ServerValidate_vane(object source, ServerValida // } if (!VerificarAnalisisContenidos() ) - { TxtDatos.Value = ""; + { //TxtDatos.Value = ""; args.IsValid = false; return; @@ -3741,7 +3757,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 +3767,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 +3777,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 +3789,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 +3797,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 +3805,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 +3813,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 +3825,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 +3837,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 +3847,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 +3855,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 +3878,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 +3888,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 +3897,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 +3906,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 +3921,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 +3930,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 +3939,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 +3958,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 +3967,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 +3987,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 +3996,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 +4006,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) { @@ -4362,83 +4333,7 @@ private bool VerificaObligatoriedadFIS() //} - 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 @@ -4764,9 +4659,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 +4724,7 @@ private void MostrarMedico() } - + public class Profesiones { public List matriculacion { get; set; } @@ -4804,19 +4732,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 +4806,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 } } @@ -5334,7 +5267,6 @@ private void CargarProtocoloDerivadoLote() CargarProtocoloDerivado(oRegistro, analisis); } } - } } diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs index 8ff1ffc6..26829d6d 100644 --- a/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs +++ b/WebLab/Protocolos/ProtocoloEdit2.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace WebLab.Protocolos { - - - public partial class ProtocoloEdit2 { - +namespace WebLab.Protocolos +{ + + + public partial class ProtocoloEdit2 + { + /// /// pnlLista control. /// @@ -20,7 +22,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlLista; - + /// /// gvLista control. /// @@ -29,7 +31,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvLista; - + /// /// lblServicio control. /// @@ -38,7 +40,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblServicio; - + /// /// pnlNavegacion control. /// @@ -47,7 +49,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlNavegacion; - + /// /// lblEstado control. /// @@ -56,7 +58,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblEstado; - + /// /// lnkAnterior control. /// @@ -65,7 +67,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkAnterior; - + /// /// lnkSiguiente control. /// @@ -74,7 +76,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkSiguiente; - + /// /// pnlTitulo control. /// @@ -83,7 +85,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl pnlTitulo; - + /// /// pnlPaciente control. /// @@ -92,7 +94,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlPaciente; - + /// /// logoRenaper control. /// @@ -101,7 +103,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlImage logoRenaper; - + /// /// lblPaciente control. /// @@ -110,7 +112,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblPaciente; - + /// /// HFIdPaciente control. /// @@ -119,7 +121,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HiddenField HFIdPaciente; - + /// /// HFNumeroDocumento control. /// @@ -128,7 +130,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HiddenField HFNumeroDocumento; - + /// /// HFSexo control. /// @@ -137,7 +139,34 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// 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. /// @@ -146,7 +175,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HyperLink hplModificarPaciente; - + /// /// hplActualizarPaciente control. /// @@ -155,7 +184,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HyperLink hplActualizarPaciente; - + /// /// lblAlertaProtocolo control. /// @@ -164,7 +193,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblAlertaProtocolo; - + /// /// pnlNumero control. /// @@ -173,7 +202,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlNumero; - + /// /// lblTitulo control. /// @@ -182,7 +211,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblTitulo; - + /// /// lblUsuario control. /// @@ -191,7 +220,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblUsuario; - + /// /// btnNotificarSISA control. /// @@ -200,7 +229,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnNotificarSISA; - + /// /// lblNroSISA control. /// @@ -209,7 +238,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblNroSISA; - + /// /// spanadjunto control. /// @@ -218,7 +247,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl spanadjunto; - + /// /// lblAdjunto control. /// @@ -227,7 +256,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblAdjunto; - + /// /// lblFechaNacimiento control. /// @@ -236,7 +265,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblFechaNacimiento; - + /// /// lblEdad control. /// @@ -245,7 +274,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblEdad; - + /// /// lblUnidadEdad control. /// @@ -254,7 +283,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblUnidadEdad; - + /// /// lblSexo control. /// @@ -263,7 +292,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblSexo; - + /// /// lnkValidarRenaper control. /// @@ -272,7 +301,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton lnkValidarRenaper; - + /// /// lblObraSocial control. /// @@ -281,7 +310,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblObraSocial; - + /// /// btnSelObraSocial control. /// @@ -290,7 +319,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton btnSelObraSocial; - + /// /// lblAlertaObraSocial control. /// @@ -299,7 +328,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label lblAlertaObraSocial; - + /// /// txtTelefono control. /// @@ -308,7 +337,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtTelefono; - + /// /// cvValidacionInput control. /// @@ -317,7 +346,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator cvValidacionInput; - + /// /// lblIdPaciente control. /// @@ -326,7 +355,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblIdPaciente; - + /// /// txtFecha control. /// @@ -335,7 +364,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFecha; - + /// /// txtFechaOrden control. /// @@ -344,7 +373,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaOrden; - + /// /// txtFechaTomaMuestra control. /// @@ -353,7 +382,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaTomaMuestra; - + /// /// txtNumeroOrigen control. /// @@ -362,7 +391,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtNumeroOrigen; - + /// /// ddlEfector control. /// @@ -371,7 +400,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlEfector; - + /// /// txtEspecialista control. /// @@ -380,7 +409,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtEspecialista; - + /// /// ddlEspecialista control. /// @@ -389,7 +418,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlEspecialista; - + /// /// LinkButton1 control. /// @@ -398,7 +427,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.LinkButton LinkButton1; - + /// /// ddlOrigen control. /// @@ -407,7 +436,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlOrigen; - + /// /// ddlSectorServicio control. /// @@ -416,7 +445,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlSectorServicio; - + /// /// ddlPrioridad control. /// @@ -425,7 +454,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddlPrioridad; - + /// /// lblSalaCama control. /// @@ -434,7 +463,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblSalaCama; - + /// /// txtSala control. /// @@ -443,7 +472,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtSala; - + /// /// txtCama control. /// @@ -452,7 +481,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtCama; - + /// /// pnlMuestra control. /// @@ -461,7 +490,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlMuestra; - + /// /// txtCodigoMuestra control. /// @@ -470,7 +499,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtCodigoMuestra; - + /// /// ddlMuestra control. /// @@ -479,7 +508,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlMuestra; - + /// /// lblCaracterSisa control. /// @@ -488,7 +517,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl lblCaracterSisa; - + /// /// ddlCaracter control. /// @@ -497,7 +526,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlCaracter; - + /// /// lblNroHisopado control. /// @@ -506,7 +535,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl lblNroHisopado; - + /// /// txtNumeroOrigen2 control. /// @@ -515,7 +544,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtNumeroOrigen2; - + /// /// lblErrorMedico control. /// @@ -524,7 +553,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label lblErrorMedico; - + /// /// diag control. /// @@ -533,7 +562,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlImage diag; - + /// /// tab3Titulo control. /// @@ -542,7 +571,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl tab3Titulo; - + /// /// tituloCalidad control. /// @@ -551,7 +580,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl tituloCalidad; - + /// /// inci control. /// @@ -560,7 +589,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlImage inci; - + /// /// tableTitulo control. /// @@ -569,7 +598,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlTable tableTitulo; - + /// /// TxtCantidadFilas control. /// @@ -578,7 +607,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden TxtCantidadFilas; - + /// /// CodOS control. /// @@ -587,7 +616,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden CodOS; - + /// /// chkRecordarPractica control. /// @@ -596,7 +625,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkRecordarPractica; - + /// /// ddlRutina control. /// @@ -605,7 +634,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlRutina; - + /// /// lnkAgregarRutina control. /// @@ -614,7 +643,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.LinkButton lnkAgregarRutina; - + /// /// ddlItem control. /// @@ -623,7 +652,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlItem; - + /// /// lnkAgregarItem control. /// @@ -632,25 +661,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// 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. /// @@ -659,7 +670,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden TxtDatosCargados; - + /// /// TxtDatos control. /// @@ -668,7 +679,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden TxtDatos; - + /// /// txtTareas control. /// @@ -677,7 +688,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden txtTareas; - + /// /// txtCodigoDiagnostico control. /// @@ -686,7 +697,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtCodigoDiagnostico; - + /// /// txtNombreDiagnostico control. /// @@ -695,7 +706,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtNombreDiagnostico; - + /// /// btnBusquedaDiagnostico control. /// @@ -704,7 +715,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Button btnBusquedaDiagnostico; - + /// /// btnBusquedaFrecuente control. /// @@ -713,7 +724,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Button btnBusquedaFrecuente; - + /// /// btnRecordarDiagnostico control. /// @@ -722,7 +733,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Button btnRecordarDiagnostico; - + /// /// lstDiagnosticos control. /// @@ -731,7 +742,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.ListBox lstDiagnosticos; - + /// /// lblMensajeDiagnostico control. /// @@ -740,7 +751,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label lblMensajeDiagnostico; - + /// /// btnAgregarDiagnostico control. /// @@ -749,7 +760,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.ImageButton btnAgregarDiagnostico; - + /// /// lstDiagnosticosFinal control. /// @@ -758,7 +769,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.ListBox lstDiagnosticosFinal; - + /// /// btnSacarDiagnostico control. /// @@ -767,7 +778,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.ImageButton btnSacarDiagnostico; - + /// /// lblFechaFIS control. /// @@ -776,7 +787,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label lblFechaFIS; - + /// /// txtFechaFIS control. /// @@ -785,7 +796,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaFIS; - + /// /// chkSinFIS control. /// @@ -794,7 +805,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkSinFIS; - + /// /// Label1 control. /// @@ -803,7 +814,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label Label1; - + /// /// txtFechaFUC control. /// @@ -812,7 +823,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaFUC; - + /// /// chkSinFUC control. /// @@ -821,7 +832,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkSinFUC; - + /// /// pnlEtiquetas control. /// @@ -830,7 +841,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlEtiquetas; - + /// /// rdbSeleccionarAreasEtiquetas control. /// @@ -839,7 +850,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.RadioButtonList rdbSeleccionarAreasEtiquetas; - + /// /// chkAreaCodigoBarra control. /// @@ -848,7 +859,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.CheckBoxList chkAreaCodigoBarra; - + /// /// ddlImpresora2 control. /// @@ -857,7 +868,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.DropDownList ddlImpresora2; - + /// /// btnReimprimirCodigoBarras control. /// @@ -866,7 +877,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Button btnReimprimirCodigoBarras; - + /// /// lblMensajeImpresion control. /// @@ -875,7 +886,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.Label lblMensajeImpresion; - + /// /// chkRecordarConfiguracion control. /// @@ -884,7 +895,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.CheckBox chkRecordarConfiguracion; - + /// /// chkCodificaPaciente control. /// @@ -893,7 +904,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.CheckBox chkCodificaPaciente; - + /// /// pnlIncidencia control. /// @@ -902,7 +913,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlIncidencia; - + /// /// IncidenciaEdit1 control. /// @@ -911,6 +922,24 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// 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. @@ -920,7 +949,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtObservacion; - + /// /// chkNotificar control. /// @@ -929,7 +958,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkNotificar; - + /// /// hidToken control. /// @@ -938,7 +967,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden hidToken; - + /// /// txtCodigo control. /// @@ -947,7 +976,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtCodigo; - + /// /// txtCodigosRutina control. /// @@ -956,7 +985,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::Anthem.TextBox txtCodigosRutina; - + /// /// btnCancelar control. /// @@ -965,7 +994,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnCancelar; - + /// /// btnGuardar control. /// @@ -974,7 +1003,7 @@ public partial class ProtocoloEdit2 { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnGuardar; - + /// /// ValidationSummary1 control. /// diff --git a/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs b/WebLab/Protocolos/ProtocoloProductoEdit.aspx.cs index 193a2389..8f546259 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 @@ -800,7 +800,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 +1231,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 +1609,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 +1719,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 +1731,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 +1824,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 +1845,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 +2337,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/AnalisisEdit.aspx b/WebLab/Resultados/AnalisisEdit.aspx index e0baedda..a0d38992 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 @@ diff --git a/WebLab/SiteTurnos.Master b/WebLab/SiteTurnos.Master index a7f26ac8..64bc785e 100644 --- a/WebLab/SiteTurnos.Master +++ b/WebLab/SiteTurnos.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 Marzo 2026-10" target="_blank" >Ver Cambios Version

diff --git a/WebLab/Turnos/Default.aspx b/WebLab/Turnos/Default.aspx index d9b785df..7bfe40d8 100644 --- a/WebLab/Turnos/Default.aspx +++ b/WebLab/Turnos/Default.aspx @@ -226,7 +226,7 @@ Tipo de Doc.: @@ -294,14 +294,14 @@ @@ -309,7 +309,7 @@ DU Madre/Tutor: @@ -318,7 +318,7 @@ @@ -327,14 +327,14 @@ @@ -354,7 +354,7 @@ + EmptyDataText="No se encontraron pacientes para los parametros de busqueda ingresados" ForeColor="#666666" GridLines="Horizontal" onpageindexchanging="gvLista_PageIndexChanging" onrowcommand="gvLista_RowCommand" onrowdatabound="gvLista_RowDataBound" PageSize="13" Width="100%" TabIndex="11"> diff --git a/WebLab/Turnos/Default.aspx.cs b/WebLab/Turnos/Default.aspx.cs index 9442d2a6..eff3f2dd 100644 --- a/WebLab/Turnos/Default.aspx.cs +++ b/WebLab/Turnos/Default.aspx.cs @@ -338,9 +338,9 @@ private object LeerDatosAdicionales() if (txtApellido.Text != "") str_condicion += " AND (Pa.apellido like '%" + txtApellido.Text + "%')"; if (txtNombre.Text != "") str_condicion += " AND (Pa.nombre like '%" + txtNombre.Text + "%')"; - if (txtDniMadre.Value != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and numeroDocumento=" + txtDniMadre.Value + "))"; - if (txtApellidoMadre.Text != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and apellido=" + txtApellidoMadre.Text + "))"; - if (txtNombreMadre.Text != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and apellido=" + txtNombreMadre.Text + "))"; + if (txtDniMadre.Value != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and numeroDocumento=" + txtDniMadre.Value + ")"; + if (txtApellidoMadre.Text != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and apellido=" + txtApellidoMadre.Text + ")"; + if (txtNombreMadre.Text != "") str_condicion += " and exists (select 1 from sys_parentesco Par with (nolock) where Pa.idpaciente=Par.idPaciente and apellido=" + txtNombreMadre.Text + ")"; 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, " + " case Pa.idSexo when 1 then 'Ind' when 2 then 'Fem' when 3 then 'Masc' end as sexo, " + diff --git a/WebLab/Turnos/TurnoList.aspx b/WebLab/Turnos/TurnoList.aspx index 4e247901..a830b6bd 100644 --- a/WebLab/Turnos/TurnoList.aspx +++ b/WebLab/Turnos/TurnoList.aspx @@ -78,20 +78,18 @@ - - + - + diff --git a/WebLab/Turnos/TurnosEdit2.aspx b/WebLab/Turnos/TurnosEdit2.aspx index f1619fba..0ea2965d 100644 --- a/WebLab/Turnos/TurnosEdit2.aspx +++ b/WebLab/Turnos/TurnosEdit2.aspx @@ -1,331 +1,340 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TurnosEdit2.aspx.cs" Inherits="WebLab.Turnos.TurnosEdit2" MasterPageFile="~/Site1.Master" %> -<%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %> + +<%@ Register Assembly="Anthem" Namespace="Anthem" TagPrefix="anthem" %> - - - - + + + + - + - - + + + + - - -

+ + +

+ +


-
-
-
-

- - - -
- Fecha de Nacimiento: -
- - Sexo: -
- - -
- - - - - - +
+
+
+

+ + + +
+ Fecha de Nacimiento: + +
+ + Sexo: + +
+ + +
+ + + + + + - + -
: +
+ : -
-

-
- -
+
+

+
- -
- + DNI Temporal @@ -241,7 +241,7 @@ Nro. Documento: + onblur="valNumeroSinPunto(this)" maxlength="8" tabindex="1" style="width: 100px"/> * - + --Seleccione-- Femenino Masculino @@ -276,7 +276,7 @@ Apellidos: - +
Nombres: - +
+ onblur="valNumero(this)" style="width: 150px" maxlength="8" tabindex="7"/> Sólo numeros (sin puntos ni espacios) Apellido Madre/Tutor: -
Nombres/s Madre/Tutor: - +
  - +
-
+
 
-
-
+
 
2.- Seleccione Fecha del Turno
+
-
- - - - - - - - - - - - @@ -425,623 +427,612 @@ - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - -
 Tipo de Servicio: - - - - - - - -   - -   - -  
 Fecha - - - -  : + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - -
 Tipo de Servicio: + + + + + +    
 Fecha + + + +  : - - - - -   - -   - -  
 Sector: - - - - - - + +    
 Sector: + + + + + Dato requerido - - - - - <%-- + + + <%-- No tiene --%>
- - -
- -  
 Médico Solicitante (MP): - - - - + + +  
 Médico Solicitante (MP): + + + - - - - - - - -   - -   - -  
-   - - - - - -
-
-  
-   - -
- - -
- - - - - - - + + + + + + + + + + + + + + + + + + + + + + - -
- - - - - - - <%-- --%> - + + + + + + + + + -
- - Codigo - Descripcion - Sin Muestra   
-
- - - - - -
- - -
- - -
- - +
  + + + - - - - -
- - -
- -
- - +
 
  + +
+ + +
+ + + + + + + + +
+ + + + + + + <%-- --%> + +
CodigoDescripcion + Sin Muestra
+
+ + + + +
+ + +
+ + +
+ + + + + + + + +
+ + +
+ + +
+ + + + +
+
+ + + - -
-
- - - -
@@ -341,68 +350,61 @@
Diagnósticos Presuntivos - Codificación CIE 10 - + +
- - - - - - - - - - + + + + - - - - + - - - + + + + + - -
- Codigo:     + + Codigo:     -
- Nombre:   +
+ Nombre:   -
- -
-
+ Diagnosticos encontrados -   - Diagnosticos del Paciente
+ + CssClass="form-control input-sm" Height="150px" Width="800px"> +
-

+
+ +
+ Diagnosticos del Paciente
-
+
+ +
-
-   - - -   + + + + +
  + + + +   + - - - -
- - -
 
+ -
- - - -
- - - + + var idPaciente = $("#<%= lblIdPaciente.ID %>").val(); + function SelObraSocial() { + var dom = document.domain; + var domArray = dom.split('.'); + for (var i = domArray.length - 1; i >= 0; i--) { + try { + var dom = ''; + for (var j = domArray.length - 1; j >= i; j--) { + dom = (j == domArray.length - 1) ? (domArray[j]) : domArray[j] + '.' + dom; + } + document.domain = dom; + break; + } catch (E) { + } + } + + + var $this = $(this); + $('