From fcf910f9870bf30ddeb830e7ff3e4297549b8119 Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Fri, 8 Aug 2025 13:59:24 +0700 Subject: [PATCH] Update Patient Create, Transtatus --- app/Controllers/Patient.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index c082259..3b38804 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -129,6 +129,9 @@ class Patient extends Controller { "DeathDateTime" => $input['DeathDateTime'] ?? null, "CreateDate" => date('Y-m-d H:i:s'), "DelDate" => null, + // Linkto + // Mother + // AccountNumber ]; $rulesDataPatient = [ @@ -185,7 +188,11 @@ class Patient extends Controller { $this->db->transComplete(); if ($this->db->transStatus() === false) { - return $this->failServerError('Failed to create patient data (transaction rolled back)'); + $dbError = $this->db->error(); // ambil error terakhir + return $this->failServerError( + 'Failed to create patient data (transaction rolled back): ' . + ($dbError['message'] ?? 'Unknown database error') + ); } return $this->respondCreated([