diff --git a/.github/workflows/label02_has_conflicts.yaml b/.github/workflows/label02_has_conflicts.yaml deleted file mode 100644 index 5f08c0d3..00000000 --- a/.github/workflows/label02_has_conflicts.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: PR conflict label - -on: - pull_request: - types: [opened, synchronize, reopened] - push: - branches: [master] - -permissions: - pull-requests: write - issues: write - contents: read - -jobs: - conflicts: - runs-on: ubuntu-latest - steps: - - name: Check conflicts - uses: actions/github-script@v7 - with: - script: | - const { owner, repo } = context.repo; - - async function checkPR(pr) { - let data; - let retries = 5; - const issue_number = pr.number; - - while (retries > 0) { - const response = await github.rest.pulls.get({ - owner, - repo, - pull_number: issue_number - }); - data = response.data; - console.log(`PR #${issue_number} - mergeable: ${data.mergeable}, state: ${data.mergeable_state}`); - - // Si mergeable es null, GitHub aún está calculando - if (data.mergeable !== null) break; - - await new Promise(r => setTimeout(r, 5000)); - retries--; - } - - // Usamos mergeable === false para detectar conflictos reales - if (data.mergeable === false) { - console.log(`Adding "Conflictos" label to PR #${issue_number}`); - await github.rest.issues.addLabels({ - owner, - repo, - issue_number, - labels: ['Conflictos'] - }); - } else if (data.mergeable === true) { - console.log(`Removing "Conflictos" label from PR #${issue_number} (if exists)`); - try { - await github.rest.issues.removeLabel({ - owner, - repo, - issue_number, - name: 'Conflictos' - }); - } catch (e) { - // label no existía - } - } - } - - if (context.eventName === 'pull_request') { - await checkPR(context.payload.pull_request); - } - - if (context.eventName === 'push') { - const { data: prs } = await github.rest.pulls.list({ - owner, - repo, - state: 'open', - base: 'master' - }); - - for (const pr of prs) { - await checkPR(pr); - } - } diff --git a/Business/Data/Laboratorio/ResultadoItem.cs b/Business/Data/Laboratorio/ResultadoItem.cs index 65070ac7..fe439134 100644 --- a/Business/Data/Laboratorio/ResultadoItem.cs +++ b/Business/Data/Laboratorio/ResultadoItem.cs @@ -25,6 +25,7 @@ public sealed class ResultadoItem : Business.BaseDataAccess private DateTime m_fecharegistro; private int m_idefectorderiva; private bool m_resultadoDefecto; + private string m_estadoValidacion; #endregion #region Default ( Empty ) Class Constuctor @@ -42,7 +43,9 @@ public ResultadoItem() m_fecharegistro = DateTime.MinValue; m_idefectorderiva = 0; m_resultadoDefecto = false; - } + m_estadoValidacion = "D"; + + } #endregion // End of Default ( Empty ) Class Constuctor #region Required Fields Only Constructor @@ -69,7 +72,8 @@ bool resultadoDefecto m_fecharegistro = fecharegistro; m_idefectorderiva = idefectorderiva; m_resultadoDefecto = resultadoDefecto; - } + m_estadoValidacion = "D"; + } #endregion // End Required Fields Only Constructor #region Public Properties @@ -205,7 +209,18 @@ public bool IsChanged { get { return m_isChanged; } } - - #endregion + + + public string EstadoValidacion + { + get { return m_estadoValidacion; } + set + { + m_isChanged |= (m_estadoValidacion != value); + m_estadoValidacion = value; + } + + } + #endregion } } diff --git a/Business/Data/Laboratorio/ResultadoItem.hbm.xml b/Business/Data/Laboratorio/ResultadoItem.hbm.xml index 164b44f7..a89202c4 100644 --- a/Business/Data/Laboratorio/ResultadoItem.hbm.xml +++ b/Business/Data/Laboratorio/ResultadoItem.hbm.xml @@ -18,6 +18,6 @@ - + diff --git a/WebLab/Items/ItemEdit2.aspx b/WebLab/Items/ItemEdit2.aspx index 934dcbe3..d0328ecb 100644 --- a/WebLab/Items/ItemEdit2.aspx +++ b/WebLab/Items/ItemEdit2.aspx @@ -75,7 +75,7 @@
  • Diagrama
  • Resultados Predefinidos
  • Recomendaciones
  • -
  • Muestras
  • +
  • Muestras
  • Mas opciones
  • Turnos
  • AutoAnalizadores
  • @@ -649,8 +649,9 @@ --%> -
    - Sección habilitada para Servicio Microbiologia +
    + + Sección habilitada para Servicio Microbiologia @@ -706,6 +707,8 @@
    Muestra:
    +
    +
    @@ -1095,6 +1098,26 @@ + +

    Diagrama

    + + + + + + + + + + + + + + +
    +
    @@ -1121,8 +1144,19 @@ - + + + + Estado + + + + + + + + @@ -1132,20 +1166,28 @@ - +
     Resultados Predefinidos
    --%> + + + + + + + +
     Resultado PredefinidoEfector DerivanteEstado 
    - + style="font-size:.9em; margin-left:1%; " cellpadding="0" cellspacing="0" > + @@ -1154,13 +1196,12 @@ - + + + - +
    - - - -  
    +
    @@ -1185,7 +1226,28 @@ - + +

    Resultados Predefinidos

    + + + + + + + + + + + + + + + +
    + +
    @@ -1481,7 +1543,7 @@ alert(document.all.getElementById('txtEdadDesde').value); -CargarDetalle(); +CargarDetalle(); CargarDetalleDiagrama(); // var contadorfilas = 0; var tab; @@ -1491,14 +1553,16 @@ var filas; function CrearFila() { var nombre = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtNombreRP").ClientID %>').value; - var idEfector= document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlEfectorItemDeriva").ClientID %>').value; - -if (nombre!='') -{ - NuevaFila(nombre, idEfector); - document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtNombreRP").ClientID %>').value = ''; - document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlEfectorItemDeriva").ClientID %>').value=''; -} + var idEfector = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlEfectorItemDeriva").ClientID %>').value; + var opcionesEstado = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlEstadoPredefinido").ClientID %>'); + var estado = opcionesEstado.options[opcionesEstado.selectedIndex].text; + + if (nombre!='') + { + NuevaFila(nombre, idEfector, estado); + document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("txtNombreRP").ClientID %>').value = ''; + document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlEfectorItemDeriva").ClientID %>').value=''; + } } @@ -1518,163 +1582,179 @@ if (nombre!='') } } -function NuevaFila(nom , efector) +function NuevaFila(nom , efector, estado) { -Grilla = document.getElementById('cuerpo'); - -fila = document.createElement('tr'); - -celdaflecha1= document.createElement('td'); -celdaflecha1.className= "orden"; - -////crea la primera flecha -oFlecha1= document.createElement('img'); -oFlecha1.name= "pru"; -oFlecha1.src="../script/moverfilas/arriba.gif"; -oFlecha1.alt="subir fila"; -////crea la segunda flecha -oFlecha2= document.createElement('img'); -oFlecha2.src="../script/moverfilas/abajo.gif"; -oFlecha2.alt="bajar fila"; - -celdaflecha1.appendChild(oFlecha1); -celdaflecha2= document.createElement('td'); -celdaflecha2.className= "orden"; -celdaflecha2.appendChild(oFlecha2); -fila.appendChild(celdaflecha1); -fila.appendChild(celdaflecha2); - -/////////////////////////////////// -celdaCodigo = document.createElement('td'); -oCodigo = document.createElement('input'); -oCodigo.type = 'text'; -oCodigo.runat = 'server'; -oCodigo.onblur= function () {CargarDatos()}; -oCodigo.className = 'form-control input-sm'; -oCodigo.width = '300px'; -oCodigo.value= nom; - -celdaCodigo.appendChild(oCodigo); -fila.appendChild(celdaCodigo); - /////////////////////////////////// -celdaEfector = document.createElement('td'); -oCodigo1 = document.createElement('input'); -oCodigo1.type = 'text'; -oCodigo1.runat = 'server'; -//oCodigo1.onblur = function () { CargarDatos() }; -oCodigo1.className = 'form-control input-sm'; -oCodigo1.width = '200px'; -oCodigo1.value = efector; - -celdaEfector.appendChild(oCodigo1); -fila.appendChild(celdaEfector); + Grilla = document.getElementById('cuerpo'); + + fila = document.createElement('tr'); + + celdaflecha1= document.createElement('td'); + celdaflecha1.className= "orden"; + + ////crea la primera flecha + oFlecha1= document.createElement('img'); + oFlecha1.name= "pru"; + oFlecha1.src="../script/moverfilas/arriba.gif"; + oFlecha1.alt="subir fila"; + ////crea la segunda flecha + oFlecha2= document.createElement('img'); + oFlecha2.src="../script/moverfilas/abajo.gif"; + oFlecha2.alt="bajar fila"; + + celdaflecha1.appendChild(oFlecha1); + celdaflecha2= document.createElement('td'); + celdaflecha2.className= "orden"; + celdaflecha2.appendChild(oFlecha2); + fila.appendChild(celdaflecha1); + fila.appendChild(celdaflecha2); + + /////////////////////////////////// + celdaCodigo = document.createElement('td'); + oCodigo = document.createElement('input'); + oCodigo.type = 'text'; + oCodigo.runat = 'server'; + oCodigo.onblur= function () {CargarDatos()}; + oCodigo.className = 'form-control input-sm'; + oCodigo.style.width = '300px'; + oCodigo.value= nom; + + celdaCodigo.appendChild(oCodigo); + fila.appendChild(celdaCodigo); + /////////////////////////////////// + celdaEfector = document.createElement('td'); + oCodigo1 = document.createElement('input'); + oCodigo1.type = 'text'; + oCodigo1.runat = 'server'; + //oCodigo1.onblur = function () { CargarDatos() }; + oCodigo1.className = 'form-control input-sm'; + oCodigo1.style.width = '300px'; + oCodigo1.value = (efector == 0) ? "" : efector; + + celdaEfector.appendChild(oCodigo1); + fila.appendChild(celdaEfector); ///////////////////// + //Estado + celdaEstado = document.createElement('td'); + oEstado = document.createElement('input'); + oEstado.type = 'text'; + oEstado.runat = 'server'; + oEstado.className = 'form-control input-sm'; + oEstado.style.width = '100px'; + oEstado.value = estado; + + celdaEstado.appendChild(oEstado); + fila.appendChild(celdaEstado); + + ///////////////////// + -celda6 = document.createElement('td'); -celda6.className= "orden"; -celda6.width="60px"; -oBoton= document.createElement('img'); -// oBoton.name= "pru"; -oBoton.src="../script/moverfilas/eliminar.gif"; -oBoton.alt="eliminar fila"; -oBoton.onclick = function () {borrarfila(this,'cuerpo')}; -celda6.appendChild(oBoton); -fila.appendChild(celda6); -Grilla.appendChild(fila); + celda6 = document.createElement('td'); + celda6.className = "orden"; + celda6.style.width = "60px"; + oBoton = document.createElement('img'); + // oBoton.name= "pru"; + oBoton.src = "../script/moverfilas/eliminar.gif"; + oBoton.alt = "eliminar fila"; + oBoton.onclick = function () { borrarfila(this, 'cuerpo') }; + celda6.appendChild(oBoton); + fila.appendChild(celda6); + + -iniciarTabla('cuerpo'); -CargarDatos(); + Grilla.appendChild(fila); + iniciarTabla('cuerpo'); + CargarDatos(); } function NuevaFilaDiagrama(cod,nom) { -Grilla = document.getElementById('cuerpoDiagrama'); - -fila = document.createElement('tr'); - -celdaflecha1= document.createElement('td'); -celdaflecha1.className= "orden"; - -////crea la primera flecha -oFlecha1= document.createElement('img'); -oFlecha1.name= "pru"; -oFlecha1.src="../script/moverfilas/arriba.gif"; -oFlecha1.alt="subir fila"; -////crea la segunda flecha -oFlecha2= document.createElement('img'); -oFlecha2.src="../script/moverfilas/abajo.gif"; -oFlecha2.alt="bajar fila"; - -celdaflecha1.appendChild(oFlecha1); -celdaflecha2= document.createElement('td'); -celdaflecha2.className= "orden"; -celdaflecha2.appendChild(oFlecha2); -fila.appendChild(celdaflecha1); -fila.appendChild(celdaflecha2); - -/////////////////////////////////// -///celda para el codigo -celdaCodigo = document.createElement('td'); -oCodigo = document.createElement('input'); -oCodigo.type = 'text'; -oCodigo.runat = 'server'; -oCodigo.className = 'textoCorto'; -oCodigo.value= cod; - -celdaCodigo.appendChild(oCodigo); -fila.appendChild(celdaCodigo); -/////////////////////////////////// + Grilla = document.getElementById('cuerpoDiagrama'); + + fila = document.createElement('tr'); + + celdaflecha1= document.createElement('td'); + celdaflecha1.className= "orden"; + + ////crea la primera flecha + oFlecha1= document.createElement('img'); + oFlecha1.name= "pru"; + oFlecha1.src="../script/moverfilas/arriba.gif"; + oFlecha1.alt="subir fila"; + ////crea la segunda flecha + oFlecha2= document.createElement('img'); + oFlecha2.src="../script/moverfilas/abajo.gif"; + oFlecha2.alt="bajar fila"; + + celdaflecha1.appendChild(oFlecha1); + celdaflecha2= document.createElement('td'); + celdaflecha2.className= "orden"; + celdaflecha2.appendChild(oFlecha2); + fila.appendChild(celdaflecha1); + fila.appendChild(celdaflecha2); + + /////////////////////////////////// + ///celda para el codigo + celdaCodigo = document.createElement('td'); + oCodigo = document.createElement('input'); + oCodigo.type = 'text'; + oCodigo.runat = 'server'; + oCodigo.className = 'textoCorto'; + oCodigo.value= cod; + + celdaCodigo.appendChild(oCodigo); + fila.appendChild(celdaCodigo); + /////////////////////////////////// -/////////////////////////////////// -///celda para el NOMBRE -celdaNombre = document.createElement('td'); -oNombre = document.createElement('input'); -oNombre.type = 'text'; -oNombre.runat = 'server'; -oNombre.className = 'textoLargo'; -oNombre.value= nom; + /////////////////////////////////// + ///celda para el NOMBRE + celdaNombre = document.createElement('td'); + oNombre = document.createElement('input'); + oNombre.type = 'text'; + oNombre.runat = 'server'; + oNombre.className = 'textoLargo'; + oNombre.value= nom; -celdaNombre.appendChild(oNombre); -fila.appendChild(celdaNombre); + celdaNombre.appendChild(oNombre); + fila.appendChild(celdaNombre); /////////////////////////////////// - -celda6 = document.createElement('td'); -celda6.className= "orden"; -celda6.width="60px"; -oBoton= document.createElement('img'); -// oBoton.name= "pru"; -oBoton.src="../script/moverfilas/eliminar.gif"; -oBoton.alt="eliminar fila"; -oBoton.onclick = function () {borrarfila(this,'cuerpoDiagrama')}; -celda6.appendChild(oBoton); -fila.appendChild(celda6); - -Grilla.appendChild(fila); -iniciarTabla('cuerpoDiagrama'); -CargarDatosDiagrama(); + celda6 = document.createElement('td'); + celda6.className = "orden"; + celda6.width = "60px"; + oBoton = document.createElement('img'); + // oBoton.name= "pru"; + oBoton.src = "../script/moverfilas/eliminar.gif"; + oBoton.alt = "eliminar fila"; + oBoton.onclick = function () { borrarfila(this, 'cuerpoDiagrama') }; + celda6.appendChild(oBoton); + fila.appendChild(celda6); + + Grilla.appendChild(fila); + iniciarTabla('cuerpoDiagrama'); + CargarDatosDiagrama(); } function CargarDatos() { -var str = ''; -var tab; -var filas; - -tab = document.getElementById('cuerpo'); -filas = tab.getElementsByTagName('tr'); -for (i=0; ele = filas[i]; i++) -{ - var codigo = ele.getElementsByTagName('input')[0].value; - var efector = ele.getElementsByTagName('input')[1].value; - if (codigo!='') - str = str + codigo + '#'+ efector+ '@'; -} -document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("TxtDatosResultados").ClientID %>').value = str; + var str = ''; + var tab; + var filas; + + tab = document.getElementById('cuerpo'); + filas = tab.getElementsByTagName('tr'); + for (i=0; ele = filas[i]; i++) + { + var codigo = ele.getElementsByTagName('input')[0].value; + var efector = ele.getElementsByTagName('input')[1].value; + var estado = ele.getElementsByTagName('input')[2].value; + if (codigo!='') + str = str + codigo + '#'+ efector+'#'+estado+ '@'; + } + document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("TxtDatosResultados").ClientID %>').value = str; } @@ -1698,22 +1778,18 @@ for (i=0; ele = filas[i]; i++) document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("TxtDatosDiagrama").ClientID %>').value = str; } -function CargarDetalle() -{ -var datos= document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("TxtDatosResultados").ClientID %>').value ; -if (datos!="") -{ - var sTab = datos.split('@'); - for (var i=0; i<(sTab.length-1); i++) - { - var sFi = sTab[i].split('#'); - if (sFi[0]!="") - { - NuevaFila(sFi[0], sFi[1]); +function CargarDetalle() { + var datos = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("TxtDatosResultados").ClientID %>').value; + if (datos != "") { + var sTab = datos.split('@'); + for (var i = 0; i < (sTab.length - 1); i++) { + var sFi = sTab[i].split('#'); + if (sFi[0] != "") { + NuevaFila(sFi[0], sFi[1], sFi[2]); + } } } } -} function CargarDetalleDiagrama() { @@ -1776,7 +1852,8 @@ if (confirm('¿Está seguro de eliminar el registro?')) return true; else return false; -} + } + diff --git a/WebLab/Items/ItemEdit2.aspx.cs b/WebLab/Items/ItemEdit2.aspx.cs index e04f9a04..07e83ed2 100644 --- a/WebLab/Items/ItemEdit2.aspx.cs +++ b/WebLab/Items/ItemEdit2.aspx.cs @@ -80,10 +80,24 @@ protected void Page_Load(object sender, EventArgs e) MostrarDatos(oItem); HabilitarDatos(); if (oItem.IdTipoResultado != 0) MostrarDatosValoresReferencia(); - if ((oItem.Tipo=="P") && (oItem.IdTipoResultado ==0)) - MostrarDatosDiagrama(); + + if ((oItem.Tipo == "P") && (oItem.IdTipoResultado == 0)) + MostrarDatosDiagrama(); + else + { + gvDiagrama.DataSource = null; + gvDiagrama.DataBind(); + } + if (oItem.IdTipoResultado >= 2) //si no es numerico muestra los predefinidos MostrarDatosResultadosPredefinidos(oItem); + else + { + tResultadoDefecto.Visible = false; + gvResultadosPredefinidos.DataSource = null; + gvResultadosPredefinidos.DataBind(); + } + MostrarDatosRecomendaciones(); btnGuardarLimiteTurno.Enabled = true; } @@ -147,7 +161,9 @@ private void HabilitarDatos() btnAgregarRecomendacion.Enabled = false; gvListaRecomendacion.Enabled = false; chkEtiquetaAdicional.Enabled = false; - + //22.07.26 no pueden cambiar el tipo de muestra o si imprime la etiqueta de la muestra + chkImprimeMuestra.Enabled = false; + ddlTipoMuestra.Enabled = false; Efector oEfector = new Efector(); oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(Request["idEfector"].ToString())); @@ -167,8 +183,27 @@ private void HabilitarDatos() pnlNuevoVR.Visible = false; ///El efector no puede cargar valores de referencia. Solo puede elegir presentacion. PnlVREfector.Visible = true; gdPresentacion.Enabled = false; + //efectores no puedan eliminar valores de referencia de la grilla pacientes + gvListaVR.Columns[7].Visible = false; + //efectores no puedan eliminar valores de referencia de la grilla NO pacientes + gvListaVRNP.Columns[5].Visible = false; + + //Efectores no ven la grilla dinamica de Resultados Predefinidos, ven su propia grilla en un nuevo panel + pnlPredefinidosEfector.Visible = true; + pnlPredefinidos.Visible = false; + //Efectores no ven la grilla dinamica de Diagramas, ven su propia grilla en un nuevo panel + pnlDiagrama.Visible = false; + pnlDiagramaEfector.Visible = true; } + else + { + //Para usuario administrador muestro el panel para agregar Resultados Predefinidos, sino muestro grilla de consulta + pnlPredefinidosEfector.Visible = false; + pnlPredefinidos.Visible = true; + pnlDiagrama.Visible = true; + pnlDiagramaEfector.Visible = false; + } } @@ -216,7 +251,8 @@ private void MostrarDatosEfector(Efector oEfector) if(oItem.IdPresentacionDefecto == 0) { - lblPresentacionDefecto.Text = "No se ha determinado una presentación por defecto"; + if(ddlPresentacionEfectorDefecto.Items.Count > 0) //22.07.26 Este mensaje debe aparecer solo cuando hay datos en el combo “Presentacion por Defecto”: + lblPresentacionDefecto.Text = "No se ha determinado una presentación por defecto"; } else { @@ -328,53 +364,59 @@ protected void gvListaRecomendacion_RowDataBound(object sender, GridViewRowEvent ///******************************************Inicio de Resultados Predefinidos***************************************************// private void MostrarDatosResultadosPredefinidos(Item oItem) { - - if (oItem != null) + CargarListasRPDefecto(); //Para todos los usuarios cargo el combo donde se eligie que resultado es por defecto + + if (pnlPredefinidos.Visible) //23.07.26- Usuario Admin: Cargo la grilla dinamica que permite agregar/borrar/subir/bajar resultados predefinidos { - //lblItem.Text = oItem.Codigo + " - " + oItem.Nombre; - Efector oEfector = new Efector(); - oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(Request["idEfector"].ToString())); - if (oEfector != null) + if (oItem != null) { - CargarListasRPDefecto(); - - - // dtDeterminaciones = (System.Data.DataTable)(Session["Tabla1"]); - ResultadoItem oDetalle = new ResultadoItem(); - ISession m_session = NHibernateHttpModule.CurrentSession; - ICriteria crit = m_session.CreateCriteria(typeof(ResultadoItem)); - crit.Add(Expression.Eq("IdItem", oItem)); - crit.Add(Expression.Eq("Baja", false)); - crit.Add(Expression.Eq("IdEfector", oEfector)); + + Efector oEfector = new Efector(); + oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(Request["idEfector"].ToString())); + if (oEfector != null) + { + ISession m_session = NHibernateHttpModule.CurrentSession; + ICriteria crit = m_session.CreateCriteria(typeof(ResultadoItem)); + crit.Add(Expression.Eq("IdItem", oItem)); + crit.Add(Expression.Eq("Baja", false)); + crit.Add(Expression.Eq("IdEfector", oEfector)); - string sDatos = ""; - IList items = crit.List(); + string sDatos = ""; + IList items = crit.List(); - foreach (ResultadoItem oDet in items) - { - string efe = "0"; - if (oDet.IdEfectorDeriva > 0) + foreach (ResultadoItem oDet in items) { - Efector oEfectorDer = new Efector(); - oEfectorDer = (Efector)oEfectorDer.Get(typeof(Efector), oDet.IdEfectorDeriva); - efe = oEfectorDer.Nombre + "-" + oEfectorDer.IdEfector.ToString(); + string efe = "0"; + if (oDet.IdEfectorDeriva > 0) + { + Efector oEfectorDer = new Efector(); + oEfectorDer = (Efector)oEfectorDer.Get(typeof(Efector), oDet.IdEfectorDeriva); + efe = oEfectorDer.Nombre + "-" + oEfectorDer.IdEfector.ToString(); + } + + if (sDatos == "") + sDatos = oDet.Resultado + "#" + efe + "#" + (oDet.EstadoValidacion == "D" ? "Definitivo" : "Preliminar") + "@"; + else + sDatos += oDet.Resultado + "#" + efe + "#" + (oDet.EstadoValidacion == "D" ? "Definitivo" : "Preliminar") + "@"; + + if (oDet.ResultadoDefecto) + ddlResultadoPorDefecto.SelectedValue = oDet.IdResultadoItem.ToString(); } - if (sDatos == "") - sDatos = oDet.Resultado + "#" + efe + "@"; - else - sDatos += oDet.Resultado + "#" + efe + "@"; + TxtDatosResultados.Value = sDatos; - if (oDet.ResultadoDefecto) - ddlResultadoPorDefecto.SelectedValue = oDet.IdResultadoItem.ToString(); } - - TxtDatosResultados.Value = sDatos; - // LeerDatosRP(); - //CargarListasRPDefecto(); - //ddlResultadoPorDefecto.SelectedValue = oItem.IdResultadoPorDefecto.ToString(); } } + else //23.07.26 - Usuario Efector: cargo una grilla de solo lectura + { + if (ddlResultadoPorDefecto.Items.Count == 1) + tResultadoDefecto.Visible = false; + + + gvResultadosPredefinidos.DataSource = LeerDatosRP(); + gvResultadosPredefinidos.DataBind(); + } } @@ -387,23 +429,21 @@ private void CargarGrillaRP() //gvLista.DataBind(); } - //private object LeerDatosRP() - //{ - // string m_strSQL = " SELECT idResultadoItem, resultado" + - // " FROM LAB_ResultadoItem " + - // " WHERE (baja = 0) and idItem=" + Request["id"].ToString() + - // " ORDER BY idResultadoItem"; // SE PONE EL ORDEN EN QUE SE FUE AGREGANDO - - // DataSet Ds = new DataSet(); - // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; - // SqlDataAdapter adapter = new SqlDataAdapter(); - // adapter.SelectCommand = new SqlCommand(m_strSQL, conn); - // adapter.Fill(Ds); - - + private object LeerDatosRP() + { + string m_strSQL = " SELECT idResultadoItem, resultado, isnull(e.nombre,'') as efectorDeriva,case when estadoValidacion = 'D' then 'Definitivo' else 'Preliminar' end as Estado " + + " FROM LAB_ResultadoItem rI with (nolock) " + + " LEFT JOIN Sys_efector e with (nolock) ON e.idEfector=rI.idEfectorDeriva "+ + " WHERE (baja = 0) and idItem=" + Request["id"].ToString() + " and rI.idEfector = " + Request["idEfector"].ToString() + + " ORDER BY idResultadoItem"; // SE PONE EL ORDEN EN QUE SE FUE AGREGANDO - // return Ds.Tables[0]; - //} + 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]; + } //protected void btnAgregar_Click(object sender, EventArgs e) //{ @@ -451,13 +491,14 @@ private void GuardarRP() string resultado = ""; string efector = "0"; string[] det = tabla[i].ToString().Split('#'); - + string estado = "D"; if (det.Length > 1) { resultado = det[0].ToString(); string[] e = det[1].ToString().Split('-'); if (e.Length > 1) efector = e[1].ToString(); + estado = (det[2].ToString() == "Definitivo") ? "D" : "P"; } else resultado = det[0].ToString(); @@ -468,7 +509,7 @@ private void GuardarRP() oRegistro.IdUsuarioRegistro = oUser; oRegistro.FechaRegistro = DateTime.Now; - + oRegistro.EstadoValidacion = estado; oRegistro.Save(); oItem.GrabarAuditoriaDetalleItem("Guarda", oUser, "Resultado PreDefinido", resultado, ""); } @@ -541,7 +582,7 @@ private void GuardarRPTodoslosEfectores(Item oItem) oRegistro.IdUsuarioRegistro = oUser; oRegistro.FechaRegistro = DateTime.Now; - + oRegistro.EstadoValidacion = oDetNew.EstadoValidacion; oRegistro.Save(); } @@ -552,7 +593,7 @@ private void CargarListasRPDefecto() { Utility oUtil = new Utility(); string m_ssql = @"select idResultadoItem, resultado as nombre -from Lab_ResultadoItem with (nolock) where baja=0 and idItem= " + Request["id"].ToString() + " and idEfector=" + Request["idEfector"].ToString() + " order by idResultadoItem"; + from Lab_ResultadoItem with (nolock) where baja=0 and idItem= " + Request["id"].ToString() + " and idEfector=" + Request["idEfector"].ToString() + " order by idResultadoItem"; oUtil.CargarCombo(ddlResultadoPorDefecto, m_ssql, "idResultadoItem", "nombre"); ddlResultadoPorDefecto.Items.Insert(0, new ListItem(" ", "0")); ddlResultadoPorDefecto.UpdateAfterCallBack = true; @@ -567,52 +608,54 @@ private void CargarListasRPDefecto() /// private void MostrarDatosDiagrama() { - txtCodigoDiagrama.Text = ""; - // ddlItemDiagrama.SelectedValue = "0"; - txtNombreDiagrama.Text = ""; - // txtTitulo.Text = ""; - - //gvListaDiagrama.AutoGenerateColumns = false; - //gvListaDiagrama.DataSource = LeerDatosDiagrama(); - //gvListaDiagrama.DataBind(); - Item oItem = new Item(); - oItem = (Item)oItem.Get(typeof(Item), int.Parse(Request["id"].ToString())); - //lblItem.Text = oItem.Codigo + " - " + oItem.Nombre; - - Efector oEfector = new Efector(); - oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(Request["idEfector"].ToString())); - + if (pnlDiagrama.Visible) //23.07.26 - Usuario administrador: cargo grilla dinamica + { + txtCodigoDiagrama.Text = ""; + // ddlItemDiagrama.SelectedValue = "0"; + txtNombreDiagrama.Text = ""; + // txtTitulo.Text = ""; - // dtDeterminaciones = (System.Data.DataTable)(Session["Tabla1"]); - ResultadoItem oDetalle = new ResultadoItem(); - ISession m_session = NHibernateHttpModule.CurrentSession; - ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion)); - crit.Add(Expression.Eq("IdItemPractica", oItem)); - crit.Add(Expression.Eq("IdEfector", oEfector)); - crit.Add(Expression.Eq("Orden", 1)); + //gvListaDiagrama.AutoGenerateColumns = false; + //gvListaDiagrama.DataSource = LeerDatosDiagrama(); + //gvListaDiagrama.DataBind(); + Item oItem = new Item(); + oItem = (Item)oItem.Get(typeof(Item), int.Parse(Request["id"].ToString())); + //lblItem.Text = oItem.Codigo + " - " + oItem.Nombre; - string sDatos = ""; - IList items = crit.List(); + Efector oEfector = new Efector(); + oEfector = (Efector)oEfector.Get(typeof(Efector), int.Parse(Request["idEfector"].ToString())); - foreach (PracticaDeterminacion oDet in items) - { - Item oItemDeterminacion = new Item(); - oItemDeterminacion = (Item)oItemDeterminacion.Get(typeof(Item), oDet.IdItemDeterminacion); - if (sDatos == "") - sDatos = oItemDeterminacion.Codigo + "#" + oDet.Titulo + "@"; - else - sDatos += oItemDeterminacion.Codigo + "#" + oDet.Titulo + "@"; + // dtDeterminaciones = (System.Data.DataTable)(Session["Tabla1"]); + ResultadoItem oDetalle = new ResultadoItem(); + ISession m_session = NHibernateHttpModule.CurrentSession; + ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion)); + crit.Add(Expression.Eq("IdItemPractica", oItem)); + crit.Add(Expression.Eq("IdEfector", oEfector)); + crit.Add(Expression.Eq("Orden", 1)); - } + string sDatos = ""; + IList items = crit.List(); - TxtDatosDiagrama.Value = sDatos; - //LeerDatosRP(); - //CargarListasRPDefecto(); - //ddlResultadoPorDefecto.SelectedValue = oItem.IdResultadoPorDefecto.ToString(); + foreach (PracticaDeterminacion oDet in items) + { + Item oItemDeterminacion = new Item(); + oItemDeterminacion = (Item)oItemDeterminacion.Get(typeof(Item), oDet.IdItemDeterminacion); + if (sDatos == "") + sDatos = oItemDeterminacion.Codigo + "#" + oDet.Titulo + "@"; + else + sDatos += oItemDeterminacion.Codigo + "#" + oDet.Titulo + "@"; + } + TxtDatosDiagrama.Value = sDatos; + } + else + { //23.07.26 usuario efector: muestro una grilla de solo lectura + gvDiagrama.DataSource = LeerDatosDiagrama(); + gvDiagrama.DataBind(); + } } @@ -705,26 +748,26 @@ private void GuardarDiagramaTodoslosEfectores(Item oItem) { } } - //private object LeerDatosDiagrama() - //{ - // string m_strSQL = " SELECT PD.idPracticaDeterminacion as idDiagrama, " + - // " CASE WHEN PD.iditemdeterminacion = 0 THEN PD.titulo ELSE I.codigo + ' - ' + I.nombre END AS nombre," + - // " PD.titulo as textoimprimir" + - // " FROM LAB_PracticaDeterminacion AS PD " + - // " left JOIN LAB_Item AS I ON PD.idItemDeterminacion = I.idItem" + - // " WHERE PD.iditempractica=" + Request["id"].ToString() + - // " ORDER BY PD.idPracticaDeterminacion"; // SE PONE EL ORDEN EN QUE SE FUE AGREGANDO + private object LeerDatosDiagrama() + { + string m_strSQL = " SELECT PD.idPracticaDeterminacion as idDiagrama, " + + " CASE WHEN PD.iditemdeterminacion = 0 THEN PD.titulo ELSE I.codigo END AS nombre," + + " PD.titulo as textoimprimir" + + " FROM LAB_PracticaDeterminacion AS PD " + + " left JOIN LAB_Item AS I ON PD.idItemDeterminacion = I.idItem" + + " WHERE PD.iditempractica=" + Request["id"].ToString() + " and PD.IdEfector = " + Request["idEfector"].ToString() + + " ORDER BY PD.idPracticaDeterminacion"; // SE PONE EL ORDEN EN QUE SE FUE AGREGANDO - // DataSet Ds = new DataSet(); - // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection; - // SqlDataAdapter adapter = new SqlDataAdapter(); - // adapter.SelectCommand = new SqlCommand(m_strSQL, conn); - // adapter.Fill(Ds); + 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]; - //} + return Ds.Tables[0]; + } @@ -1671,14 +1714,20 @@ private void MostrarDatos(Item oItem) { // tabMuestra.Visible = true; btnAgregarMuestra.Visible = true; + tituloMuestra.Visible = true; + pnlMuestra.Visible = true; - } else { // tabMuestra.Visible = false; btnAgregarMuestra.Visible = false; - + + //22.07.26 La solapa Muestras mostrar solo cuando la determinación corresponde al servicio de microbiología. + tituloMuestra.Visible = false; + pnlMuestra.Visible = false; + tab8.Style["Display"] = "none"; //para que no se vea el borde cuando se oculta tituloMuestra y pnlMuestra + } if (oItem.Tipo == "P") rdbTipo.Items[0].Selected = true; @@ -1772,7 +1821,6 @@ private void MostrarDatos(Item oItem) txtCodigoNomenclador.Text = oItem.CodigoNomenclador; MostrarItemNomenclador(); - if (oItem.IdTipoResultado == 0) /// compuesta { pnlVR.Enabled = false; @@ -1874,7 +1922,7 @@ private object LeerDatosMuestraItem(string v) string m_strSQL = @" select iditemMuestra, M.nombre as muestra from LAB_ItemMuestra I inner join Lab_muestra M on I.idmuestra = M.idMuestra - where I.iditem = " + Request["id"].ToString(); + where I.iditem = " + Request["id"].ToString() + " order by M.nombre "; //22.07.2026 En la solapa Muestras mostrar la lista de la grilla ordenada alfabéticamente. DataSet Ds = new DataSet(); @@ -2390,8 +2438,7 @@ private void Guardar(Item oRegistro, string m_accion) oReg.ResultadoDefecto = txtValorDefecto.Text; oReg.Save(); - - GuardarLimiteTurno(oReg.IdItem.IdItem, m_accion); + // GuardarLimiteTurno(oReg.IdItem.IdItem, m_accion); 30.07.2026 guardar solo del btn de turnos } @@ -3401,8 +3448,6 @@ private void GuardarLimiteTurno(int id, string accion) // // 1. Efector distinto a Nivel Central: // - Se permite guardar desde el tab - // "Datos Generales". - // - Se permite guardar desde el tab // "Turnos". // // 2. Efector Nivel Central: diff --git a/WebLab/Items/ItemEdit2.aspx.designer.cs b/WebLab/Items/ItemEdit2.aspx.designer.cs index 8a0d97b4..dae9c70f 100644 --- a/WebLab/Items/ItemEdit2.aspx.designer.cs +++ b/WebLab/Items/ItemEdit2.aspx.designer.cs @@ -41,6 +41,15 @@ public partial class ItemEdit2 /// protected global::System.Web.UI.WebControls.Label txtEfector; + /// + /// tituloMuestra control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tituloMuestra; + /// /// rfvCodigo control. /// @@ -536,6 +545,24 @@ public partial class ItemEdit2 /// protected global::Anthem.GridView gvAutoAnalizadores; + /// + /// tab8 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl tab8; + + /// + /// pnlMuestra control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlMuestra; + /// /// lblMensajeMuestra1 control. /// @@ -995,6 +1022,24 @@ public partial class ItemEdit2 /// protected global::System.Web.UI.WebControls.Button btnGuardarDiagrama; + /// + /// pnlDiagramaEfector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlDiagramaEfector; + + /// + /// gvDiagrama control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvDiagrama; + /// /// pnlPredefinidos control. /// @@ -1031,6 +1076,15 @@ public partial class ItemEdit2 /// protected global::Anthem.DropDownList ddlEfectorItemDeriva; + /// + /// ddlEstadoPredefinido control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlEstadoPredefinido; + /// /// btnGuardarRP control. /// @@ -1058,6 +1112,33 @@ public partial class ItemEdit2 /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden TxtDatosResultados; + /// + /// pnlPredefinidosEfector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlPredefinidosEfector; + + /// + /// gvResultadosPredefinidos control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvResultadosPredefinidos; + + /// + /// tResultadoDefecto control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tResultadoDefecto; + /// /// ddlResultadoPorDefecto control. ///
    Resultado por Defecto: