-- Cache de exámenes enviados desde RIPS Manager junto con la ingesta de pacientes. -- Se usa en get_examenes_rips.php para evitar el round-trip a RIPS cuando ya vienen precargados. CREATE TABLE IF NOT EXISTS rips_examenes_pendientes ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, numero_documento VARCHAR(30) NOT NULL, datos JSON NOT NULL, recepcion_id INT DEFAULT NULL, hora_recepcion VARCHAR(20) DEFAULT NULL, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, INDEX idx_doc (numero_documento), INDEX idx_created (created_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;