Update Patient Create, Transtatus
This commit is contained in:
parent
8acfac74d9
commit
fcf910f987
@ -129,6 +129,9 @@ class Patient extends Controller {
|
|||||||
"DeathDateTime" => $input['DeathDateTime'] ?? null,
|
"DeathDateTime" => $input['DeathDateTime'] ?? null,
|
||||||
"CreateDate" => date('Y-m-d H:i:s'),
|
"CreateDate" => date('Y-m-d H:i:s'),
|
||||||
"DelDate" => null,
|
"DelDate" => null,
|
||||||
|
// Linkto
|
||||||
|
// Mother
|
||||||
|
// AccountNumber
|
||||||
];
|
];
|
||||||
|
|
||||||
$rulesDataPatient = [
|
$rulesDataPatient = [
|
||||||
@ -185,7 +188,11 @@ class Patient extends Controller {
|
|||||||
$this->db->transComplete();
|
$this->db->transComplete();
|
||||||
|
|
||||||
if ($this->db->transStatus() === false) {
|
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([
|
return $this->respondCreated([
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user