Turnero: toma progresiva por examen, Rubeola solo-profesional, kiosko
- configurar_tomas.php: merge config por examen en lugar de overwrite - ver_formulario_enviado.php: auto-abrir panel de tiempos al cargar; soporte formularios solo_profesional con botón Guardar y completar - get_consentimientos.php: leer campo solo_profesional de lab_formularios - recepcion.php: formularios sin firma paciente muestran badge "Completa en laboratorio" - lugar.php: botón "Completar" para formularios solo_profesional DB: ALTER TABLE lab_formularios ADD solo_profesional; UPDATE Rubeola id=8; UPDATE descripcion Niños kiosko Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4012ae97be
commit
a3c19bf4e7
@@ -41,7 +41,9 @@ if ($tc['datos_respuestas']) {
|
||||
if (is_array($d)) $dr = $d;
|
||||
}
|
||||
|
||||
$dr['_tomas_config'] = $cfg;
|
||||
// Merge: preserve config from other exams already saved
|
||||
if (!isset($dr['_tomas_config']) || !is_array($dr['_tomas_config'])) $dr['_tomas_config'] = [];
|
||||
foreach ($cfg as $k => $v) $dr['_tomas_config'][$k] = $v;
|
||||
if ($examType !== '') $dr['_c8j2g16'] = $examType;
|
||||
if ($otroHora !== '') $dr['_otro_hora'] = $otroHora;
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ $stmt = $pdo->prepare(
|
||||
tc.datos_respuestas,
|
||||
f.nombre AS formulario_nombre,
|
||||
f.esquema AS formulario_esquema,
|
||||
f.es_toma_progresiva AS formulario_es_toma_prog
|
||||
f.es_toma_progresiva AS formulario_es_toma_prog,
|
||||
f.solo_profesional AS formulario_solo_profesional
|
||||
FROM turnero_consentimientos tc
|
||||
LEFT JOIN lab_formularios f ON f.id = tc.formulario_id
|
||||
WHERE tc.turno_id = ?
|
||||
@@ -130,8 +131,9 @@ foreach ($consentimientos as &$c) {
|
||||
}
|
||||
}
|
||||
|
||||
$soloPro = !empty($c['formulario_solo_profesional']);
|
||||
$c['requiere_firma_profesional'] = $tieneFirmaPro;
|
||||
$c['requiere_firma_paciente'] = !($tieneFirmaPro && !$tieneFirmaPac);
|
||||
$c['requiere_firma_paciente'] = $soloPro ? false : !($tieneFirmaPro && !$tieneFirmaPac);
|
||||
$c['origen_lugar_id'] = in_array((int)$c['formulario_id'], $fidsDeLugar, true)
|
||||
? ($lugarDestinoId ?: -1) : null;
|
||||
$c['es_toma_progresiva'] = $esTomaProg;
|
||||
@@ -139,7 +141,7 @@ foreach ($consentimientos as &$c) {
|
||||
$c['tomas_firmadas'] = $tomasFirm;
|
||||
// Exponer campos firma_profesional (ids) para el frontend
|
||||
$c['campos_firma_pro'] = array_column($camposFirmaPro, 'id');
|
||||
unset($c['formulario_esquema'], $c['formulario_es_toma_prog'], $c['datos_respuestas']);
|
||||
unset($c['formulario_esquema'], $c['formulario_es_toma_prog'], $c['formulario_solo_profesional'], $c['datos_respuestas']);
|
||||
}
|
||||
unset($c);
|
||||
|
||||
@@ -302,7 +304,8 @@ if ($incluirSolicitud) {
|
||||
tc.datos_respuestas,
|
||||
f.nombre AS formulario_nombre,
|
||||
f.esquema AS formulario_esquema,
|
||||
f.es_toma_progresiva AS formulario_es_toma_prog
|
||||
f.es_toma_progresiva AS formulario_es_toma_prog,
|
||||
f.solo_profesional AS formulario_solo_profesional
|
||||
FROM turnero_consentimientos tc
|
||||
LEFT JOIN lab_formularios f ON f.id = tc.formulario_id
|
||||
WHERE tc.turno_id = ?
|
||||
@@ -358,15 +361,16 @@ if ($incluirSolicitud) {
|
||||
if (!empty($dr2[$fid2]) && strlen($dr2[$fid2]) > 10) $tomasFirm++;
|
||||
}
|
||||
}
|
||||
$soloPro2 = !empty($c['formulario_solo_profesional']);
|
||||
$c['requiere_firma_profesional'] = $tieneFirmaPro;
|
||||
$c['requiere_firma_paciente'] = !($tieneFirmaPro && !$tieneFirmaPac);
|
||||
$c['requiere_firma_paciente'] = $soloPro2 ? false : !($tieneFirmaPro && !$tieneFirmaPac);
|
||||
$c['origen_lugar_id'] = in_array((int)$c['formulario_id'], $fidsDeLugar, true)
|
||||
? $lugarDestinoId : null;
|
||||
$c['es_toma_progresiva'] = $esTomaProg;
|
||||
$c['tomas_total'] = $tomasTotal2;
|
||||
$c['tomas_firmadas'] = $tomasFirm;
|
||||
$c['campos_firma_pro'] = array_column($camposFirmaPro, 'id');
|
||||
unset($c['formulario_esquema'], $c['formulario_es_toma_prog'], $c['datos_respuestas']);
|
||||
unset($c['formulario_esquema'], $c['formulario_es_toma_prog'], $c['formulario_solo_profesional'], $c['datos_respuestas']);
|
||||
}
|
||||
unset($c);
|
||||
$respuesta['consentimientos'] = $consentimientos;
|
||||
|
||||
Reference in New Issue
Block a user