Update Perbaikan Pemanggilan Tabel Controller Patient
This commit is contained in:
parent
951d5598ad
commit
ea9e7dde26
@ -24,7 +24,7 @@ class Patient extends Controller {
|
||||
$startDate = $this->request->getVar('startDate');
|
||||
$endDate = $this->request->getVar('endDate');
|
||||
|
||||
$builder = $this->db->table('Patient');
|
||||
$builder = $this->db->table('patient');
|
||||
|
||||
if ($name !== null) {
|
||||
$sql = "LOWER(CONCAT_WS(' ', IFNULL(prefix,''), IFNULL(name_first,''), IFNULL(name_middle,''), IFNULL(name_last,''), IFNULL(name_maiden,''), IFNULL(suffix,'')))";
|
||||
@ -72,7 +72,7 @@ class Patient extends Controller {
|
||||
|
||||
try {
|
||||
|
||||
$builder = $this->db->table('Patient');
|
||||
$builder = $this->db->table('patient');
|
||||
$patient = $builder->where('InternalPID', $InternalPID)->get()->getRowArray();
|
||||
|
||||
// Data pasien tidak ada mengembalikan - success 200
|
||||
@ -245,7 +245,7 @@ class Patient extends Controller {
|
||||
'City' => 'permit_empty',
|
||||
];
|
||||
|
||||
$existingPatient = $this->db->table('Patient')->where('InternalPID', $InternalPID)->get()->getRowArray();
|
||||
$existingPatient = $this->db->table('patient')->where('InternalPID', $InternalPID)->get()->getRowArray();
|
||||
|
||||
// Mengembalikan 404
|
||||
if (empty($existingPatient)) {
|
||||
@ -275,7 +275,7 @@ class Patient extends Controller {
|
||||
return $this->failValidationError('No data provided for update.');
|
||||
}
|
||||
|
||||
$this->db->table('Patient')->where('PatientID', $InternalPID)->update($data);
|
||||
$this->db->table('patient')->where('PatientID', $InternalPID)->update($data);
|
||||
|
||||
// Sukses & Insert = 201 - Kirim data patient ID
|
||||
return $this->respondCreated([
|
||||
@ -300,14 +300,14 @@ class Patient extends Controller {
|
||||
}
|
||||
|
||||
// Cari data pasien
|
||||
$patient = $this->db->table('Patient')->where('InternalPID', $InternalPID)->get()->getRow();
|
||||
$patient = $this->db->table('patient')->where('InternalPID', $InternalPID)->get()->getRow();
|
||||
|
||||
if (!$patient) {
|
||||
return $this->failNotFound("Patient ID with {$InternalPID} not found.");
|
||||
}
|
||||
|
||||
// Hapus data pasien berdasarkan pat_num
|
||||
$this->db->table('Patient')->where('InternalPID', $InternalPID)->delete();
|
||||
$this->db->table('patient')->where('InternalPID', $InternalPID)->delete();
|
||||
|
||||
// Mengembalikan 200
|
||||
return $this->respondDeleted([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user