recepcion: ocultar checkbox embarazada si el paciente es masculino
Al vincular un paciente con genero='M' se oculta el bloque y se desmarca el check. Al desvincular/resetear vuelve a mostrarse. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
0a09b07ea1
commit
3a865d5c9f
@@ -653,7 +653,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Embarazo -->
|
<!-- Embarazo -->
|
||||||
<div class="mt-2">
|
<div class="mt-2" id="bloque-embarazada">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="chk-embarazada">
|
<input class="form-check-input" type="checkbox" id="chk-embarazada">
|
||||||
<label class="form-check-label small fw-semibold text-danger" for="chk-embarazada">
|
<label class="form-check-label small fw-semibold text-danger" for="chk-embarazada">
|
||||||
@@ -1577,6 +1577,10 @@ function seleccionarPaciente(pac) {
|
|||||||
}
|
}
|
||||||
document.getElementById('bloque-pac-no-vinculado').classList.add('d-none');
|
document.getElementById('bloque-pac-no-vinculado').classList.add('d-none');
|
||||||
document.getElementById('bloque-pac-seleccionado').classList.remove('d-none');
|
document.getElementById('bloque-pac-seleccionado').classList.remove('d-none');
|
||||||
|
const esMasculino = (pac.genero || '').toUpperCase() === 'M';
|
||||||
|
const bloqueEmb = document.getElementById('bloque-embarazada');
|
||||||
|
bloqueEmb.style.display = esMasculino ? 'none' : '';
|
||||||
|
if (esMasculino) document.getElementById('chk-embarazada').checked = false;
|
||||||
const pacNombre = (pac.full_name || pac.nombre_completo || (pac.nombre||'') + ' ' + (pac.apellido||'')).trim();
|
const pacNombre = (pac.full_name || pac.nombre_completo || (pac.nombre||'') + ' ' + (pac.apellido||'')).trim();
|
||||||
document.getElementById('lbl-pac-nombre').textContent = pacNombre;
|
document.getElementById('lbl-pac-nombre').textContent = pacNombre;
|
||||||
document.getElementById('lbl-pac-doc').textContent =
|
document.getElementById('lbl-pac-doc').textContent =
|
||||||
@@ -1682,6 +1686,7 @@ function desvincularPaciente() {
|
|||||||
document.getElementById('lista-pacientes-res').innerHTML = '';
|
document.getElementById('lista-pacientes-res').innerHTML = '';
|
||||||
document.getElementById('inp-buscar-pac').value = '';
|
document.getElementById('inp-buscar-pac').value = '';
|
||||||
document.getElementById('chk-embarazada').checked = false;
|
document.getElementById('chk-embarazada').checked = false;
|
||||||
|
document.getElementById('bloque-embarazada').style.display = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function cambiarPaciente() {
|
function cambiarPaciente() {
|
||||||
|
|||||||
Reference in New Issue
Block a user