FHM08062601IBL - tambah endpoint delete_cache di Rv_patient untuk hapus patient_print_cache setelah BIRT selesai load

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sas.fajri
2026-06-08 16:31:34 +07:00
parent 3138c7f508
commit edf60f5574

View File

@@ -1082,4 +1082,21 @@ private function get_fallback_report($group_name, $type, $ready_print)
$this->sys_ok(['cached' => true]);
}
public function delete_cache()
{
$prm = $this->sys_input;
$order_id = intval($prm['order_id'] ?? 0);
if ($order_id > 0) {
$this->db_smartone->query(
"DELETE FROM patient_print_cache WHERE ppc_order_id = ? OR ppc_created < NOW() - INTERVAL 5 MINUTE",
[$order_id]
);
} else {
$this->db_smartone->query(
"DELETE FROM patient_print_cache WHERE ppc_created < NOW() - INTERVAL 5 MINUTE"
);
}
$this->sys_ok(['deleted' => true]);
}
}