@@ -60,6 +68,12 @@
+
+
+
+
+
+
diff --git a/WebLab/Agendas/AgendaList.aspx.cs b/WebLab/Agendas/AgendaList.aspx.cs
index 6f71fc18..c828c19a 100644
--- a/WebLab/Agendas/AgendaList.aspx.cs
+++ b/WebLab/Agendas/AgendaList.aspx.cs
@@ -41,7 +41,10 @@ protected void Page_Load(object sender, EventArgs e)
CargarListas();
CargarGrilla();
-
+ if (oUser.IdEfector.IdEfector == 227)
+ btnAgregar.Visible = false;
+
+
}
}
private int Permiso /*el permiso */
@@ -79,18 +82,51 @@ private object LeerDatos()
{
//Usuario oUser = new Usuario();
//oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
-
- string m_condicion = " and A.idEfector = " + oUser.IdEfector.IdEfector.ToString();
+
+ string m_condicion="";
+
+ if (oUser.IdEfector.IdEfector != 227)
+ m_condicion = " and A.idEfector = " + oUser.IdEfector.IdEfector.ToString();
if (ddlTipoServicio.SelectedValue != "0") m_condicion += " and A.idTipoServicio=" + ddlTipoServicio.SelectedValue;
+ if (ddlEfectorSolicitante.SelectedValue != "0") m_condicion += " and A.idEfectorSolicitante=" + ddlEfectorSolicitante.SelectedValue;
- string m_strSQL = @" select top 20 A.idAgenda, T.nombre, I.nombre as item, convert(varchar(10),A.fechaDesde,103) as fechaDesde,
- convert(varchar(10),A.fechaHasta,103) as fechaHasta ,E.nombre as efector, U.apellido as usuario, A.fechaRegistro
+ string m_strSQL = @" select top 20 A.idAgenda, T.nombre, (I.codigo +'-' +I.nombre) as item, convert(varchar(10),A.fechaDesde,103) as fechaDesde,
+ convert(varchar(10),A.fechaHasta,103) as fechaHasta ,E.nombre as efector, U.apellido as usuario,
+ A.fechaRegistro,D.dias, D.limiteTurnos
from Lab_TipoServicio T (nolock)
- INNER JOIN lAB_aGENDA A (nolock) on A.idTipoServicio= T.idTipoServicio
- LEFT JOIN lab_item I (nolock) on A.iditem=i.iditem
- inner join sys_Efector E (nolock) on E.idEfector=A.idEfectorSolicitante
- inner join sys_usuario U (nolock) on U.idUsuario= A.idUsuarioRegistro
- where A.baja=0 " + m_condicion +" order by A.idAgenda desc ";
+ INNER JOIN lAB_aGENDA A (nolock) on A.idTipoServicio= T.idTipoServicio
+ LEFT JOIN lab_item I (nolock) on A.iditem=i.iditem
+ inner join sys_Efector E (nolock) on E.idEfector=A.idEfectorSolicitante
+ inner join sys_usuario U (nolock) on U.idUsuario= A.idUsuarioRegistro
+ INNER JOIN (
+ SELECT
+ D1.idAgenda,
+
+ STUFF((
+ SELECT ', ' +
+ case
+ when D2.dia = 1 then 'Lunes'
+ when D2.dia = 2 then 'Martes'
+ when D2.dia = 3 then 'Miercoles'
+ when D2.dia = 4 then 'Jueves'
+ when D2.dia = 5 then 'Viernes'
+ when D2.dia = 6 then 'Sabado'
+ when D2.dia = 7 then 'Domingo'
+
+ end
+ FROM LAB_AgendaDia D2 (NOLOCK)
+ WHERE D2.idAgenda = D1.idAgenda
+ ORDER BY D2.dia
+ FOR XML PATH('')
+ ), 1, 1, '') AS dias,
+
+ MAX(D1.limiteTurnos) AS limiteTurnos
+
+ FROM LAB_AgendaDia D1 (NOLOCK)
+ GROUP BY D1.idAgenda
+ ) D
+ ON D.idAgenda = A.idAgenda
+ where A.baja=0 " + m_condicion +" order by A.idAgenda desc ";
DataSet Ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
@@ -109,10 +145,30 @@ inner join sys_usuario U (nolock) on U.idUsuario= A.idUsuarioRegistro
private void CargarListas()
{
Utility oUtil = new Utility(); ///Carga de combos de Areas
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
string m_ssql = "select idTipoServicio, nombre from Lab_TipoServicio WHERE idtipoServicio<4 and (baja = 0)";
oUtil.CargarCombo(ddlTipoServicio, m_ssql, "idTipoServicio", "nombre");
ddlTipoServicio.Items.Insert(0, new ListItem("Todos", "0"));
+ ////////////Carga de combos de Efector
+ if (oUser.IdEfector.IdEfector == 227)
+ {
+ m_ssql = @"SELECT idEfector, nombre FROM sys_Efector E (nolock)
+ where idEfector in (select distinct D.idEfectorSolicitante from LAB_Agenda D (nolock)
+ where D.baja =0)
+ order by nombre ";
+ }
+ else
+ m_ssql = @"SELECT idEfector, nombre FROM sys_Efector E (nolock)
+ where idEfector in (select distinct R.idefectorRel from LAB_EfectorRelacionado R (nolock)
+ inner join LAB_Agenda D (nolock) ON D.idEfectorSolicitante=R.idefectorRel and D.idEfector=R.idEfector
+ where D.baja =0 and R.idefector = " + oUser.IdEfector.IdEfector.ToString() +
+ ") or (E.idEfector= " + oUser.IdEfector.IdEfector.ToString() + @") order by nombre ";
+
+ oUtil.CargarCombo(ddlEfectorSolicitante, m_ssql, "idEfector", "nombre");
+ if(ddlEfectorSolicitante.Items.Count > 1)
+ ddlEfectorSolicitante.Items.Insert(0, new ListItem("Todos", "0"));
m_ssql = null;
oUtil = null;
@@ -133,12 +189,12 @@ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
{
- ImageButton CmdModificar = (ImageButton)e.Row.Cells[7].Controls[1];
+ ImageButton CmdModificar = (ImageButton)e.Row.Cells[9].Controls[1];
CmdModificar.CommandArgument = this.gvLista.DataKeys[e.Row.RowIndex].Value.ToString();
CmdModificar.CommandName = "Modificar";
CmdModificar.ToolTip="Modifica";
- ImageButton CmdEliminar = (ImageButton)e.Row.Cells[8].Controls[1];
+ ImageButton CmdEliminar = (ImageButton)e.Row.Cells[10].Controls[1];
CmdEliminar.CommandArgument = this.gvLista.DataKeys[e.Row.RowIndex].Value.ToString();
if (Permiso == 1)
{
@@ -192,5 +248,9 @@ protected void ddlTipoServicio_SelectedIndexChanged(object sender, EventArgs e)
CargarGrilla();
}
+ protected void ddlEfectorSolicitante_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ CargarGrilla();
+ }
}
}
diff --git a/WebLab/Agendas/AgendaList.aspx.designer.cs b/WebLab/Agendas/AgendaList.aspx.designer.cs
index 24ed57e8..eae8585f 100644
--- a/WebLab/Agendas/AgendaList.aspx.designer.cs
+++ b/WebLab/Agendas/AgendaList.aspx.designer.cs
@@ -1,41 +1,52 @@
//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
+//
+// Este código fue generado por una herramienta.
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
+// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
+// se vuelve a generar el código.
+//
//------------------------------------------------------------------------------
-namespace WebLab.Agendas {
-
-
- public partial class AgendaList {
-
+namespace WebLab.Agendas
+{
+
+
+ public partial class AgendaList
+ {
+
///
- /// ddlTipoServicio control.
+ /// Control ddlTipoServicio.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.DropDownList ddlTipoServicio;
-
+
+ ///
+ /// Control ddlEfectorSolicitante.
+ ///
+ ///
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlEfectorSolicitante;
+
///
- /// btnAgregar control.
+ /// Control btnAgregar.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.Button btnAgregar;
-
+
///
- /// gvLista control.
+ /// Control gvLista.
///
///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
+ /// Campo generado automáticamente.
+ /// Para modificarlo, mueva la declaración del campo del archivo del diseñador al archivo de código subyacente.
///
protected global::System.Web.UI.WebControls.GridView gvLista;
}
diff --git a/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx
new file mode 100644
index 00000000..0221967d
--- /dev/null
+++ b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx
@@ -0,0 +1,144 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConfiguracionEdit.aspx.cs" Inherits="WebLab.AutoAnalizador.REAL.ConfiguracionEdit" MasterPageFile="~/Site1.Master" %>
+<%@ Register assembly="Anthem" namespace="Anthem" tagprefix="anthem" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
Configuración SIL - REAL
+
+
+
+
+
+
+
+
+ Area:
+
+
+
+
+
+
+
+
+ Análisis del LIS:
+
+
+
+
+
+
+
+
+
+
+
+
+ ID en Equipo:
+
+
+
+
+
+
+
+ <%--
+ --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.cs
new file mode 100644
index 00000000..f8bf8818
--- /dev/null
+++ b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.cs
@@ -0,0 +1,297 @@
+using System;
+using System.Collections;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using System.Web.UI.WebControls.WebParts;
+using System.Xml.Linq;
+using System.Data.SqlClient;
+using Business;
+using Business.Data.AutoAnalizador;
+using NHibernate;
+using NHibernate.Expression;
+using System.Text;
+using System.IO;
+using Business.Data;
+
+namespace WebLab.AutoAnalizador.REAL
+{
+ public partial class ConfiguracionEdit : System.Web.UI.Page
+ {
+ Usuario oUser = new Usuario();
+
+ protected void Page_PreInit(object sender, EventArgs e)
+ {
+ if (Session["idUsuario"] != null)
+ oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+ // oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1, "IdEfector", oEfector);
+ else
+ Response.Redirect("../FinSesion.aspx", false);
+
+ }
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ VerificaPermisos("Config. REAL");
+ CargarCombos();
+ CargarGrilla();
+ }
+ }
+ private void VerificaPermisos(string sObjeto)
+ {
+ if (Session["s_permiso"] != null)
+ {
+ Utility oUtil = new Utility();
+ int i_permiso = oUtil.VerificaPermisos((ArrayList)Session["s_permiso"], sObjeto);
+ switch (i_permiso)
+ {
+ case 0: Response.Redirect("../AccesoDenegado.aspx", false); break;
+ //case 1: btn .Visible = false; break;
+ }
+ }
+ else Response.Redirect("../FinSesion.aspx", false);
+ }
+ private void CargarGrilla()
+ {
+ gvLista.DataSource = LeerDatos();
+ gvLista.DataBind();
+ }
+
+ private DataTable LeerDatos()
+ {
+ string m_strSQL = @" SELECT M.idrealitem, I.codigo, I.nombre, M.idreal, M.habilitado as Habilitado
+ FROM lab_realitem AS M
+ INNER JOIN LAB_Item AS I ON M.idItem = I.idItem Order by I.nombre ";
+
+ DataSet Ds = new DataSet();
+ SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+ SqlDataAdapter adapter = new SqlDataAdapter();
+ adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
+ adapter.Fill(Ds);
+
+ // CantidadRegistros.Text = Ds.Tables[0].Rows.Count.ToString() + " registros encontrados";
+
+ return Ds.Tables[0];
+ }
+ private DataTable LeerDatosExcel()
+ {
+ string m_strSQL = @" SELECT I.codigo as [Codigo SIL], I.nombre as [Descripcion], M.idreal as [Codigo Real], M.habilitado as Habilitado
+ FROM lab_realitem AS M
+ INNER JOIN LAB_Item AS I ON M.idItem = I.idItem Order by I.nombre ";
+
+ DataSet Ds = new DataSet();
+ SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+ SqlDataAdapter adapter = new SqlDataAdapter();
+ adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
+ adapter.Fill(Ds);
+
+ // CantidadRegistros.Text = Ds.Tables[0].Rows.Count.ToString() + " registros encontrados";
+
+ return Ds.Tables[0];
+ }
+
+ private void CargarCombos()
+ {
+
+ Utility oUtil = new Utility();
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
+ string m_ssql = "select idArea, nombre from Lab_Area where baja=0 and idtiposervicio=3 order by nombre";
+ oUtil.CargarCombo(ddlArea, m_ssql, "idArea", "nombre", connReady);
+
+
+
+ CargarItem();
+ //ddlArea.Items.Insert(0, new ListItem("Seleccione Area", "0"));
+
+
+ m_ssql = null;
+ oUtil = null;
+ }
+
+
+
+
+
+
+ private void GuardarDetalleConfiguracion()
+ {
+ RealItem oDetalle = new RealItem();
+ oDetalle.IdReal = txtIDEquipo.Text;
+ oDetalle.IdItem = int.Parse(ddlItem.SelectedValue);
+ oDetalle.Habilitado = true;
+ oDetalle.Save();
+
+
+
+ }
+
+
+ protected void btnGuardar_Click2(object sender, EventArgs e)
+ {
+ if (Page.IsValid)
+ {
+ string validacion = existe();
+ if (validacion == "")
+ {
+ lblMensajeValidacion.Text = "";
+ GuardarDetalleConfiguracion();
+ CargarGrilla();
+ }
+ else
+ lblMensajeValidacion.Text = validacion;
+ }
+ }
+
+ private string existe()
+ {
+ //////////////////////////////////////////////////////////////////////////////////////////
+ ///Verifica de que no exista un item para la combincacion orden y tipo de muestra
+ //////////////////////////////////////////////////////////////////////////////////////////
+ string hay = "";
+
+ RealItem oItem = new RealItem();
+ oItem = (RealItem)oItem.Get(typeof(RealItem), "IdItem", int.Parse(ddlItem.SelectedValue));
+ if (oItem == null)
+ {
+
+ ISession m_session = NHibernateHttpModule.CurrentSession;
+ ICriteria crit = m_session.CreateCriteria(typeof(RealItem));
+ crit.Add(Expression.Eq("IdReal", txtIDEquipo.Text));
+ IList detalle = crit.List();
+ if (detalle.Count > 0)
+ hay = "Ya existe una vinculación para el ID de muestra seleccionado. Verifique.";
+ }
+ else
+ hay = "Ya existe una configuración para el análisis seleccionado";
+
+ return hay;
+ }
+
+ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
+ {
+ if (e.Row.RowType == DataControlRowType.DataRow)
+ {
+
+ ImageButton CmdEliminar = (ImageButton)e.Row.Cells[4].Controls[1];
+ CmdEliminar.CommandArgument = this.gvLista.DataKeys[e.Row.RowIndex].Value.ToString();
+ CmdEliminar.CommandName = "Eliminar";
+ CmdEliminar.ToolTip = "Eliminar";
+
+
+ CheckBox chkStatus = (CheckBox)e.Row.Cells[3].Controls[1];
+ if (oUser.IdEfector.IdEfector == 227)
+ {
+ CmdEliminar.Visible = true;
+ chkStatus.Visible = true;
+
+ }
+ else
+ {
+ CmdEliminar.Visible = false;
+ chkStatus.Enabled = false;
+ }
+
+
+ }
+ }
+
+ protected void gvLista_RowCommand(object sender, GridViewCommandEventArgs e)
+ {
+ if (e.CommandName == "Eliminar")
+ {
+ RealItem oRegistro = new RealItem();
+ oRegistro = (RealItem)oRegistro.Get(typeof(RealItem), int.Parse(e.CommandArgument.ToString()));
+ oRegistro.Delete();
+
+ CargarGrilla();
+
+ }
+
+ }
+ protected void chkStatus_OnCheckedChanged(object sender, EventArgs e)
+ {
+ CheckBox chkStatus = (CheckBox)sender;
+ GridViewRow row = (GridViewRow)chkStatus.NamingContainer;
+
+ int i_id = int.Parse(gvLista.DataKeys[row.RowIndex].Value.ToString());
+
+ RealItem oRegistro = new RealItem();
+ oRegistro = (RealItem)oRegistro.Get(typeof(RealItem), i_id);
+ oRegistro.Habilitado = chkStatus.Checked;
+ oRegistro.Save();
+
+
+ }
+ protected void lnkRegresar_Click(object sender, EventArgs e)
+ {
+ // Response.Redirect("../PrincipalSysmex.aspx", false);
+ }
+
+ protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ CargarItem();
+ }
+
+ private void CargarItem()
+ {
+
+
+
+
+ Utility oUtil = new Utility();
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
+ ///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
+ string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item I
+ where baja=0 AND idArea=" + ddlArea.SelectedValue +
+ " order by nombre";
+
+ oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre", connReady);
+ ddlItem.Items.Insert(0, new ListItem("Seleccione Item", "0"));
+ ddlItem.UpdateAfterCallBack = true;
+ }
+
+ protected void btnExcel_Click(object sender, EventArgs e)
+ {
+ if (Page.IsValid)
+ dataTableAExcel(LeerDatosExcel(), "REAL_SIL");
+ }
+
+
+ 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();
+ }
+ }
+ }
+}
diff --git a/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.designer.cs b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.designer.cs
new file mode 100644
index 00000000..ce56935f
--- /dev/null
+++ b/WebLab/AutoAnalizador/REAL/ConfiguracionEdit.aspx.designer.cs
@@ -0,0 +1,96 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WebLab.AutoAnalizador.REAL {
+
+
+ public partial class ConfiguracionEdit {
+
+ ///
+ /// ddlArea control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Anthem.DropDownList ddlArea;
+
+ ///
+ /// ddlItem control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Anthem.DropDownList ddlItem;
+
+ ///
+ /// RangeValidator1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RangeValidator RangeValidator1;
+
+ ///
+ /// txtIDEquipo control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtIDEquipo;
+
+ ///
+ /// RequiredFieldValidator1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
+
+ ///
+ /// btnGuardar control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnGuardar;
+
+ ///
+ /// lblMensajeValidacion control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblMensajeValidacion;
+
+ ///
+ /// btnExcel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnExcel;
+
+ ///
+ /// gvLista control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvLista;
+ }
+}
diff --git a/WebLab/ControlResultados/ControlPlanilla.aspx.cs b/WebLab/ControlResultados/ControlPlanilla.aspx.cs
index 983127e8..52f6059c 100644
--- a/WebLab/ControlResultados/ControlPlanilla.aspx.cs
+++ b/WebLab/ControlResultados/ControlPlanilla.aspx.cs
@@ -188,46 +188,20 @@ protected void btnBuscar_Click(object sender, EventArgs e)
string m_parametro = " P.idTipoServicio=" + ddlServicio.SelectedValue;
m_parametro += " AND P.Fecha>='" + fecha1.ToString("yyyyMMdd") + "' AND P.fecha<='" + fecha2.ToString("yyyyMMdd") + "'";
m_parametro += " and P.idEfector =" + oUser.IdEfector.IdEfector.ToString();
- //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:
- // {
+
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;
- //}
+
if (ddlEfector.SelectedValue != "0") m_parametro += " AND P.idEfectorSolicitante=" + ddlEfector.SelectedValue;
if (ddlOrigen.SelectedValue != "0") m_parametro += " AND P.idOrigen=" + ddlOrigen.SelectedValue;
if (ddlPrioridad.SelectedValue != "0") m_parametro += " AND P.idPrioridad=" + ddlPrioridad.SelectedValue;
- // if (ddlSectorServicio.SelectedValue != "0") m_parametro += " AND P.idSector = " + ddlSectorServicio.SelectedValue;
-
+
m_parametro += " AND P.idSector in (" + getListaSectores() + ")";
string m_orden = " order by P.numero ";
- //string operacion = "Carga";
- // string modoCarga = "HT";
+
if (chkRecordarFiltro.Checked) AlmacenarSesion();
diff --git a/WebLab/Informes/Auditoria.aspx.cs b/WebLab/Informes/Auditoria.aspx.cs
index b1e2c999..e7f53358 100644
--- a/WebLab/Informes/Auditoria.aspx.cs
+++ b/WebLab/Informes/Auditoria.aspx.cs
@@ -124,11 +124,11 @@ private void CargarListas()
string m_ssql = @" select idusuario, apellido + ' ' +nombre as nombre
from sys_usuario u with (nolock)
- where activo = 1
+ where activo = 1 and username <>'adminapi'
and exists (select 1 from sys_usuarioefector e (nolock) where e.idusuario = u.idusuario and e.idEfector = " + oUser.IdEfector.IdEfector.ToString() + @") order by apellido, nombre";
if (oUser.Administrador)
{
- m_ssql = @" select idusuario, apellido + ' ' +nombre as nombre from sys_usuario u with (nolock) where activo = 1 order by apellido, nombre";
+ m_ssql = @" select idusuario, apellido + ' ' +nombre as nombre from sys_usuario u with (nolock) where activo = 1 and username <>'adminapi' order by apellido, nombre";
}
oUtil.CargarCombo(ddlUsuario, m_ssql, "idusuario", "nombre", connReady);
oUtil.CargarCombo(ddlUsuario2, m_ssql, "idusuario", "nombre", connReady);
diff --git a/WebLab/Informes/AuditoriaUsuario.aspx.cs b/WebLab/Informes/AuditoriaUsuario.aspx.cs
index afb4eff7..225967c0 100644
--- a/WebLab/Informes/AuditoriaUsuario.aspx.cs
+++ b/WebLab/Informes/AuditoriaUsuario.aspx.cs
@@ -68,7 +68,7 @@ private void CargarListas()
{
Utility oUtil = new Utility();
///Carga de combos de tipos de servicios
- string m_ssql = "select idusuario, apellido + ' ' +nombre as nombre from sys_usuario order by apellido, nombre";
+ string m_ssql = "select idusuario, apellido + ' ' +nombre as nombre from sys_usuario where username<>'adminapi' order by apellido, nombre";
oUtil.CargarCombo(ddlUsuarioModificado, m_ssql, "idusuario", "nombre");
oUtil.CargarCombo(ddlUsuarioABM, m_ssql, "idusuario", "nombre");
diff --git a/WebLab/Informes/HistoriaClinica.aspx.cs b/WebLab/Informes/HistoriaClinica.aspx.cs
index d1f36f04..ad26db10 100644
--- a/WebLab/Informes/HistoriaClinica.aspx.cs
+++ b/WebLab/Informes/HistoriaClinica.aspx.cs
@@ -24,17 +24,26 @@ namespace WebLab.Informes
public partial class HistoriaClinica : System.Web.UI.Page
{
Paciente oPaciente = new Paciente();
-
+ Configuracion oCon = new Configuracion();
public CrystalReportSource oCr = new CrystalReportSource();
-
+ public Usuario oUser = new Usuario();
protected void Page_PreInit(object sender, EventArgs e)
{
oCr.Report.FileName = "";
oCr.CacheDuration = 0;
oCr.EnableCaching = false;
+ if (Session["idUsuario"] != null)
+ {
+
+ oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+ oCon = (Configuracion)oCon.Get(typeof(Configuracion), "IdEfector", oUser.IdEfector);
- }
+ }
+ else
+ Response.Redirect("SinDatos.aspx", false);
+
+ }
protected void Page_Load(object sender, EventArgs e)
{
@@ -131,7 +140,8 @@ private void MostrarPaciente()
private DataTable LlenarDatos()
{
DataSet Ds = new DataSet();
- SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+ string conexion = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString;
+ SqlConnection conn = new SqlConnection(conexion); ///Performance: conexion de solo lectura
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
@@ -186,16 +196,25 @@ private void ExportarPDF()
dt =LlenarDatos();
if (dt.Rows.Count > 0)
{
- Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);
+ /// Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);
+ string enc1 = "SUBSECRETARIA DE SALUD";
+ string enc2 = "SISTEMA INFORMATICO PROVINCIAL DE LABORATORIO";
+ string enc3 = "";
+ if (oUser.IdEfector.IdEfector != 227)
+ {
+ enc1= oCon.EncabezadoLinea1;
+ enc2 = oCon.EncabezadoLinea2;
+ enc3 = oCon.EncabezadoLinea3;
+ }
ParameterDiscreteValue encabezado1 = new ParameterDiscreteValue();
- encabezado1.Value = oCon.EncabezadoLinea1;
+ encabezado1.Value = enc1;// oCon.EncabezadoLinea1;
ParameterDiscreteValue encabezado2 = new ParameterDiscreteValue();
- encabezado2.Value = oCon.EncabezadoLinea2;
+ encabezado2.Value = enc2; // oCon.EncabezadoLinea2;
ParameterDiscreteValue encabezado3 = new ParameterDiscreteValue();
- encabezado3.Value = oCon.EncabezadoLinea3;
+ encabezado3.Value = enc3;// oCon.EncabezadoLinea3;
ParameterDiscreteValue encabezado4 = new ParameterDiscreteValue();
encabezado4.Value = lblAnalisis.Text;
@@ -244,15 +263,7 @@ private void ExportarPDF()
oCr.DataBind();
oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Historial_Resultados.pdf");
- //MemoryStream oStream; // using System.IO
- //oStream = (MemoryStream)oCr.ReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
- //Response.Clear();
- //Response.Buffer = true;
- //Response.ContentType = "application/pdf";
- //Response.AddHeader("Content-Disposition", "attachment;filename=Historial_Resultados.pdf");
-
- //Response.BinaryWrite(oStream.ToArray());
- //Response.End();
+
}
else
Response.Redirect("SinDatos.aspx", false);
diff --git a/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.cs b/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.cs
new file mode 100644
index 00000000..da616cbc
--- /dev/null
+++ b/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.cs
@@ -0,0 +1,217 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WebLab.Informes.HojasdeTrabajo {
+ using System;
+ using System.ComponentModel;
+ using CrystalDecisions.Shared;
+ using CrystalDecisions.ReportSource;
+ using CrystalDecisions.CrystalReports.Engine;
+
+
+ public class HTrabajoProtocolo2Horizontal : ReportClass {
+
+ public HTrabajoProtocolo2Horizontal() {
+ }
+
+ public override string ResourceName {
+ get {
+ return "HTrabajoProtocolo2Horizontal.rpt";
+ }
+ set {
+ // Do nothing
+ }
+ }
+
+ public override bool NewGenerator {
+ get {
+ return true;
+ }
+ set {
+ // Do nothing
+ }
+ }
+
+ public override string FullResourceName {
+ get {
+ return "WebLab.Informes.HojasdeTrabajo.HTrabajoProtocolo2Horizontal.rpt";
+ }
+ set {
+ // Do nothing
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section Section1 {
+ get {
+ return this.ReportDefinition.Sections[0];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section Section2 {
+ get {
+ return this.ReportDefinition.Sections[1];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection1 {
+ get {
+ return this.ReportDefinition.Sections[2];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section GroupHeaderSection2 {
+ get {
+ return this.ReportDefinition.Sections[3];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section Section3 {
+ get {
+ return this.ReportDefinition.Sections[4];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection2 {
+ get {
+ return this.ReportDefinition.Sections[5];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section GroupFooterSection1 {
+ get {
+ return this.ReportDefinition.Sections[6];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section Section4 {
+ get {
+ return this.ReportDefinition.Sections[7];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.CrystalReports.Engine.Section Section5 {
+ get {
+ return this.ReportDefinition.Sections[8];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.Shared.IParameterField Parameter_encabezado1 {
+ get {
+ return this.DataDefinition.ParameterFields[0];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.Shared.IParameterField Parameter_encabezado2 {
+ get {
+ return this.DataDefinition.ParameterFields[1];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.Shared.IParameterField Parameter_encabezado3 {
+ get {
+ return this.DataDefinition.ParameterFields[2];
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public CrystalDecisions.Shared.IParameterField Parameter_imprimirFechaHora {
+ get {
+ return this.DataDefinition.ParameterFields[3];
+ }
+ }
+ }
+
+ [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")]
+ public class CachedHTrabajoProtocolo2Horizontal : Component, ICachedReport {
+
+ public CachedHTrabajoProtocolo2Horizontal() {
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public virtual bool IsCacheable {
+ get {
+ return true;
+ }
+ set {
+ //
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public virtual bool ShareDBLogonInfo {
+ get {
+ return false;
+ }
+ set {
+ //
+ }
+ }
+
+ [Browsable(false)]
+ [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+ public virtual System.TimeSpan CacheTimeOut {
+ get {
+ return CachedReportConstants.DEFAULT_TIMEOUT;
+ }
+ set {
+ //
+ }
+ }
+
+ public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
+ HTrabajoProtocolo2Horizontal rpt = new HTrabajoProtocolo2Horizontal();
+ rpt.Site = this.Site;
+ return rpt;
+ }
+
+ public virtual string GetCustomizedCacheKey(RequestContext request) {
+ String key = null;
+ // // The following is the code used to generate the default
+ // // cache key for caching report jobs in the ASP.NET Cache.
+ // // Feel free to modify this code to suit your needs.
+ // // Returning key == null causes the default cache key to
+ // // be generated.
+ //
+ // key = RequestContext.BuildCompleteCacheKey(
+ // request,
+ // null, // sReportFilename
+ // this.GetType(),
+ // this.ShareDBLogonInfo );
+ return key;
+ }
+ }
+}
diff --git a/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.rpt b/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.rpt
index 61d55423..5beb3223 100644
Binary files a/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.rpt and b/WebLab/Informes/HojasdeTrabajo/HTrabajoProtocolo2Horizontal.rpt differ
diff --git a/WebLab/Informes/Informe.aspx b/WebLab/Informes/Informe.aspx
index 9cf9458a..a6c55f61 100644
--- a/WebLab/Informes/Informe.aspx
+++ b/WebLab/Informes/Informe.aspx
@@ -271,7 +271,7 @@
-
+
diff --git a/WebLab/Informes/Informe.aspx.cs b/WebLab/Informes/Informe.aspx.cs
index 45443b99..de25e7f7 100644
--- a/WebLab/Informes/Informe.aspx.cs
+++ b/WebLab/Informes/Informe.aspx.cs
@@ -628,12 +628,7 @@ private void VistaPreeliminar(object p, string accion)
}
if (accion == "PDF")
{
-
- oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, nombrePDF);
-
- //oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, nombrePDF+".pdf");
-
-
+ oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, nombrePDF);
}
else
{
diff --git a/WebLab/Protocolos/ProcesaRenaper.aspx.cs b/WebLab/Protocolos/ProcesaRenaper.aspx.cs
index ca2083d8..b9031bc8 100644
--- a/WebLab/Protocolos/ProcesaRenaper.aspx.cs
+++ b/WebLab/Protocolos/ProcesaRenaper.aspx.cs
@@ -12,7 +12,7 @@
using System.Web.Script.Serialization;
using Business.Data;
using NHibernate;
-using Business.Data.Laboratorio;
+using Business.Data.Laboratorio;
using NHibernate.Expression;
using System.Collections;
using System.Data;
@@ -24,6 +24,7 @@
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
+using Newtonsoft.Json;
namespace WebLab.Protocolos
{
@@ -280,7 +281,8 @@ protected void Page_Load(object sender, EventArgs e)
if (!conOK)// si no funcionó la conexion con renaper se fija se está activado MPI
if (oCon.ConectaMPI)
{
- conOK = SolicitarServicioMPI();
+ // conOK = SolicitarServicioMPI();
+ conOK = ConectarMPIXRoad();
if (!conOK)
HabilitaCargaManual();
}
@@ -289,7 +291,8 @@ protected void Page_Load(object sender, EventArgs e)
{
if (oCon.ConectaMPI)
{
- conOK = SolicitarServicioMPI();
+ conOK = ConectarMPIXRoad();
+ ///conOK = SolicitarServicioMPI();
if (!conOK)
HabilitaCargaManual();
}
@@ -767,6 +770,158 @@ private bool SolicitarServicio()
return ok;
}
+ private bool ConectarMPIXRoad()
+ {
+ bool ok = false;
+ try
+ {
+ string tipo = "MPI";
+ imgAndes.Visible = false;
+ imgRenaper.Visible = false; lblFechaDomicilio.Visible = false;
+ GrabarLogAcceso(tipo, Request["dni"].ToString());
+
+ long nrodocumento = long.Parse(Request["dni"].ToString());
+ // string sexo = Request["sexo"].ToString();
+
+ string rutaCert = ConfigurationManager.AppSettings["RutaCert"].ToString();
+ string BaseUrl = "https://xroadss.andes.gob.ar/r1/OPTIC/GOB/GOB00008/GP-SALUD/MPI";///ConfigurationManager.AppSettings["BaseUrlXroad"].ToString();
+ string Serv = "?identifier=http://www.renaper.gob.ar;";// GP-RENAPER/WS_RENAPER_DOCUMENTO/";
+ string clie = "OPTIC/GOB/GOB00008/GP-SALUD";//ConfigurationManager.AppSettings["ClienteXroad"].ToString();//"OPTIC/GOB/GOB00008/GP-SALUD/MPI";//
+ string param = nrodocumento.ToString(); ///+ "/" + sexo.ToUpper();
+ string host = BaseUrl + Serv + param;
+
+ ServicePointManager.Expect100Continue = true;
+ ServicePointManager.ServerCertificateValidationCallback = (snder, cert, chain, error) => true;
+ // ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
+
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(host);
+
+ //certificado
+ X509Certificate certificate = new X509Certificate(rutaCert, "", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.MachineKeySet
+ | X509KeyStorageFlags.PersistKeySet);
+
+ req.ClientCertificates = new X509CertificateCollection() { certificate };
+ req.ContentType = "application/json";
+ req.AllowAutoRedirect = true;
+ req.Timeout = 10 * 1000;
+ req.Method = "GET";
+ req.Headers.Add("X-Road-Client", clie);
+
+
+
+
+ using (WebResponse response = req.GetResponse())
+ {
+ JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
+
+ using (Stream strReader = response.GetResponseStream())
+ {
+
+ using (StreamReader objReader = new StreamReader(strReader))
+ {
+
+ string responseBody = objReader.ReadToEnd();
+
+ var lista = JsonConvert.DeserializeObject>(responseBody);
+ var resultado2 = lista?.FirstOrDefault();
+
+ if (resultado2 != null)
+ {
+ lblValidador.Visible = true;
+ lblValidador.Text = "Paciente VALIDADO POR " + tipo;
+ ok = true;
+
+ txtDNI.Text = Request["dni"]?.ToString();
+
+ // Nombre y apellido
+ var nombreData = resultado2.Name?.FirstOrDefault();
+ txtApellido.Text = nombreData?.Family?.FirstOrDefault()?.ToUpper() ?? "";
+ txtNombre.Text = string.Join(" ", nombreData?.Given ?? new List()).ToUpper();
+
+ // Fecha nacimiento
+ txtFechaNacimiento.Value = resultado2.BirthDate.ToString("dd/MM/yyyy");
+
+ // Domicilio (toma el primero)
+ var direccion = resultado2.Address?.FirstOrDefault();
+
+ txtCalle.Value = direccion?.Line?.FirstOrDefault() ?? "SIN DATOS";
+ txtCiudad.Value = string.IsNullOrEmpty(direccion?.City) ? "SIN DATOS" : direccion.City;
+ txtProvincia.Value = string.IsNullOrEmpty(direccion?.State) ? "SIN DATOS" : direccion.State;
+ txtPais.Value = string.IsNullOrEmpty(direccion?.Country) ? "SIN DATOS" : direccion.Country;
+ txtCodigoPostal.Value = string.IsNullOrEmpty(direccion?.PostalCode) ? "SIN DATOS" : direccion.PostalCode;
+
+ // CUIL
+ txtCuil.Value = resultado2.Identifier?
+ .FirstOrDefault(x => x.System.Contains("cuil"))?.Value ?? "";
+
+ // Campos que ya no existen en este JSON
+ txtBarrio.Value = "SIN DATOS";
+ fallecimiento.Text = "";
+ fechaDomicilio.Text = "";
+
+ txtTelefono.Value = resultado2.Telecom?
+ .Where(x => x.System == "phone")
+ .OrderBy(x => x.Rank)
+ .FirstOrDefault()
+ ?.Value ?? "SIN DATOS";
+
+ var sexo = resultado2.Gender?.ToLower();
+
+ if (sexo == "female")
+ {
+ txtSexo.Value = "FEMENINO";
+ ddlSexo.SelectedValue = "2";
+ }
+ else if (sexo == "male")
+ {
+ txtSexo.Value = "MASCULINO";
+ ddlSexo.SelectedValue = "3";
+ }
+ else if (sexo == "other")
+ {
+ txtSexo.Value = "X";
+ ddlSexo.SelectedValue = "0";
+ }
+ else
+ {
+ txtSexo.Value = "SIN DATOS";
+ ddlSexo.SelectedValue = "0";
+ }
+ /// traer al paciente si no es nuevo, es modificacion
+ int id = Convert.ToInt32(Request.QueryString["id"]);
+ //datos del Paciente
+ Paciente pac = new Paciente();
+ if (id != 0) pac = (Paciente)pac.Get(typeof(Paciente), id);
+ txtTelefono.Value = pac.InformacionContacto;
+
+
+ }
+ else
+ ok = false;
+
+
+
+ }
+ response.Close();
+ }
+
+ }
+
+
+ }
+ catch (WebException ex)
+ {
+ ok = false;
+ string mensaje = ex.ToString();
+
+ }
+
+
+ return ok;
+
+ }
+
public void GrabarLogAcceso(string servicio, string dni)
{
try
@@ -792,6 +947,83 @@ INSERT INTO LAB_LogAccesoServicio
{ }
}
+ public class ResultadoMPIModel
+ {
+ [JsonProperty("resourceType")]
+ public string ResourceType { get; set; }
+
+ [JsonProperty("identifier")]
+ public List Identifier { get; set; }
+
+ [JsonProperty("active")]
+ public bool Active { get; set; }
+
+ [JsonProperty("name")]
+ public List Name { get; set; }
+
+ [JsonProperty("telecom")]
+ public List Telecom { get; set; }
+
+ [JsonProperty("gender")]
+ public string Gender { get; set; }
+
+ [JsonProperty("birthDate")]
+ public DateTime BirthDate { get; set; }
+
+ [JsonProperty("address")]
+ public List Address { get; set; }
+ }
+ public class IdentifierRenaper
+ {
+ [JsonProperty("system")]
+ public string System { get; set; }
+
+ [JsonProperty("value")]
+ public string Value { get; set; }
+ }
+ public class NameRenaper
+ {
+ [JsonProperty("use")]
+ public string Use { get; set; }
+
+ [JsonProperty("text")]
+ public string Text { get; set; }
+
+ [JsonProperty("family")]
+ public List Family { get; set; }
+
+ [JsonProperty("given")]
+ public List Given { get; set; }
+ }
+ public class TelecomRenaper
+ {
+ [JsonProperty("system")]
+ public string System { get; set; } // phone, email
+
+ [JsonProperty("value")]
+ public string Value { get; set; }
+
+ [JsonProperty("rank")]
+ public int Rank { get; set; }
+ }
+ public class AddressRenaper
+ {
+ [JsonProperty("line")]
+ public List Line { get; set; }
+
+ [JsonProperty("city")]
+ public string City { get; set; }
+
+ [JsonProperty("state")]
+ public string State { get; set; }
+
+ [JsonProperty("postalCode")]
+ public string PostalCode { get; set; }
+
+ [JsonProperty("country")]
+ public string Country { get; set; }
+ }
+
protected void btnConfirmar_Click(object sender, EventArgs e)
{
if (validadatos())
@@ -799,15 +1031,10 @@ protected void btnConfirmar_Click(object sender, EventArgs e)
{
if (validamail())
{
- //Configuracion oC = new Configuracion();
-
- //oC = (Configuracion)oC.Get(typeof(Configuracion), 1); // "IdEfector", oUser.IdEfector);
-
+
Utility oUtil = new Utility();
- ////instancio el usuario
- //Usuario us = new Usuario();
- //us = (Usuario)us.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+
int id = Convert.ToInt32(Request.QueryString["id"]);
//datos del Paciente
diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
index e3942200..26e0d81c 100644
--- a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
+++ b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
@@ -3649,71 +3649,7 @@ private void SelectedEfector()
}
- //private void CargarSolicitantesInternos()
- //{
- // Utility oUtil = new Utility();
- // ///Carga de combos de Medicos Solicitantes
- // string m_ssql = "SELECT idProfesional, apellido + ' ' + nombre AS nombre FROM Sys_Profesional ORDER BY apellido, nombre ";
- // oUtil.CargarCombo(ddlEspecialista, m_ssql, "idProfesional", "nombre");
- // ddlEspecialista.Items.Insert(0, new ListItem("No identificado", "0"));
- // ddlEspecialista.UpdateAfterCallBack = true;
- // //imgCrearSolicitante.Visible = false;
- // //imgCrearSolicitante.UpdateAfterCallBack = true;
- //}
-
- //private void CargarSolicitantesExternos(string m_solicitante)
- //{
- // Utility oUtil = new Utility();
-
- // ///Carga de combos de solicitantes expertos
- // string m_ssql = "select idSolicitanteExterno, apellido + ', ' + nombre as nombre from Lab_SolicitanteExterno where baja=0 order by apellido, nombre";
- // oUtil.CargarCombo(ddlEspecialista, m_ssql, "idSolicitanteExterno", "nombre");
- // ddlEspecialista.Items.Insert(0, new ListItem("No identificado", "0"));
- // if (m_solicitante != "") ddlEspecialista.SelectedValue = m_solicitante;
- // ddlEspecialista.UpdateAfterCallBack = true;
- // //imgCrearSolicitante.Visible = true;
- // //imgCrearSolicitante.UpdateAfterCallBack = true;
- //}
-
- //protected void btnGuardarSolicitante_Click(object sender, EventArgs e)
- //{
- // if (Page.IsValid)
- // {
- // GuardarSolicitanteExterno();
-
- // LimpiarDatosSolicitante();
- // //Panel1.Visible = false;
- // //Panel1.UpdateAfterCallBack = true;
- // }
- //}
-
- //private void GuardarSolicitanteExterno()
- //{
- // Usuario oUser = new Usuario();
- // SolicitanteExterno oRegistro = new SolicitanteExterno();
- // Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
- // oRegistro.IdEfector = oC.IdEfector;
- // oRegistro.Matricula = txtMatricula.Text;
- // oRegistro.Apellido = txtApellidoSolicitante.Text;
- // oRegistro.Nombre = txtNombreSolicitante.Text;
- // oRegistro.IdUsuarioRegistro = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
- // oRegistro.FechaRegistro = DateTime.Now;
- // oRegistro.Save();
- // CargarSolicitantesExternos(oRegistro.IdSolicitanteExterno.ToString());
- //}
-
- //protected void btnCancelarSolicitante_Click(object sender, EventArgs e)
- //{
- // LimpiarDatosSolicitante();
-
- //}
-
- //private void LimpiarDatosSolicitante()
- //{
- // txtMatricula.Text = "";
- // txtApellidoSolicitante.Text = "";
- // txtNombreSolicitante.Text = "";
- //}
+
protected void gvLista_SelectedIndexChanged(object sender, EventArgs e)
{
@@ -3859,18 +3795,7 @@ private void BuscarNombreDiagnostico()
ISession m_session = NHibernateHttpModule.CurrentSession;
if (oC.NomencladorDiagnostico == 0)
{
- //ICriteria crit = m_session.CreateCriteria(typeof(Cie10));
- //crit.Add(Expression.Sql(" Nombre like '%" + txtNombreDiagnostico.Text + "%' order by Nombre"));
-
- //IList items = crit.List();
-
- //foreach (Cie10 oDiagnostico in items)
- //{
- // ListItem oDia = new ListItem();
- // oDia.Text = oDiagnostico.Codigo + " - " + oDiagnostico.Nombre;
- // oDia.Value = oDiagnostico.Id.ToString();
- // lstDiagnosticos.Items.Add(oDia);
- //}
+
string m_strSQL = @"select id, codigo + ' -' + nombre from sys_cie10 (nolock) where tipo='DIAG' and Nombre like '%" + txtNombreDiagnostico.Text.Trim() + "%' order by Nombre";
@@ -4618,17 +4543,7 @@ private bool VerificaObligatoriedadFIS()
}
- //private bool VerificarFechaPacienteMuestra()
- //{
- // Paciente oPaciente = new Paciente();
- // oPaciente = (Paciente)oPaciente.Get(typeof(Paciente), int.Parse(HFIdPaciente.Value));
-
- // string tieneingreso = oPaciente.GetFechaProtocolosReciente(Request["idServicio"].ToString(),ddlMuestra.SelectedValue);
- // if (tieneingreso==txtFecha.Value) return false;
- // else return true;
- //}
-
-
+
private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
@@ -4666,17 +4581,6 @@ private bool VerificarAnalisisComplejosContenidos(string listaCodigo)
- //protected void lnkReimprimirComprobante_Click(object sender, EventArgs e)
- //{
- // Business.Data.Laboratorio.Protocolo oRegistro = new Business.Data.Laboratorio.Protocolo();
- // oRegistro = (Business.Data.Laboratorio.Protocolo)oRegistro.Get(typeof(Business.Data.Laboratorio.Protocolo), int.Parse(Request["idProtocolo"].ToString()));
-
- // ////Imprimir Comprobante para el paciente
- // Imprimir(oRegistro);
-
-
-
- //}
protected void lnkReimprimirCodigoBarras_Click(object sender, EventArgs e)
{
@@ -4752,15 +4656,7 @@ private void Avanzar(int avance)
}
}
- }
- //if (avance == 1)
- //{
- // ProtocoloNuevo = ProtocoloActual+1;
- //}
- //else //retrocede
- // ProtocoloNuevo = ProtocoloActual - 1;
-
-
+ }
ISession m_session = NHibernateHttpModule.CurrentSession;
ICriteria crit = m_session.CreateCriteria(typeof(Protocolo));
diff --git a/WebLab/Resultados/ResultadoBusqueda.aspx b/WebLab/Resultados/ResultadoBusqueda.aspx
index 06d8bd7a..4bb0fd69 100644
--- a/WebLab/Resultados/ResultadoBusqueda.aspx
+++ b/WebLab/Resultados/ResultadoBusqueda.aspx
@@ -349,7 +349,7 @@