FHM09062601IBL - guard patient visit search info

This commit is contained in:
sas.fajri
2026-06-12 15:42:19 +07:00
parent 567f85a0b9
commit 1601ec6573

View File

@@ -979,9 +979,14 @@ class Registrationv3 extends MY_Controller
}
unset($rows[$k]['M_PatientNameRaw']);
$info = $this->db_onedev->query("SELECT fn_fo_patient_visit(?) info", [$v['M_PatientID']])->row();
$rows[$k]['info'] = json_decode($info->info);
}
$info_query = $this->db_onedev->query("SELECT fn_fo_patient_visit(?) info", [$v['M_PatientID']]);
if ($info_query) {
$info = $info_query->row();
$rows[$k]['info'] = ($info && isset($info->info)) ? json_decode($info->info) : null;
} else {
$rows[$k]['info'] = null;
}
}
$this->sys_ok(["total" => 0, "records" => $rows]);
}