diff --git a/htdocs/app/Http/Controllers/Controller.php b/htdocs/app/Http/Controllers/Controller.php index 9bd3be94..c2b9fcb0 100644 --- a/htdocs/app/Http/Controllers/Controller.php +++ b/htdocs/app/Http/Controllers/Controller.php @@ -175,7 +175,19 @@ class Controller extends BaseController protected function getDefaultData($jenis, $master, $mulai, $akhir, $valcari) { $query = Periksa::whereNotNull('nofoto'); if ($jenis == 'ThisDay') { - return $query->whereDate('daftar', Carbon::today()); + $url = url()->current(); + $baseurl = url('/'); + $ceklaman = str_replace($baseurl.'/', '', $url); + if ($ceklaman == 'pendaftaran'){ + return $query->whereDate('daftar', Carbon::today()); + } else { + return $query->where(function($q) { + $q->where('status', 'Selesai') + ->orWhereNull('status') + ->orWhere('status', 'not like', 'Dibatalkan%'); + }); + } + } else if ($jenis == 'mundur2') { return $query->whereDate('daftar', '>=', Carbon::today()->subDays(2)); } else if ($jenis == 'mundur3') { diff --git a/htdocs/app/Http/Controllers/DokterController.php b/htdocs/app/Http/Controllers/DokterController.php index 29391aa8..4e153c46 100644 --- a/htdocs/app/Http/Controllers/DokterController.php +++ b/htdocs/app/Http/Controllers/DokterController.php @@ -1709,6 +1709,7 @@ class DokterController extends Controller $idpasien = $request->input('val01'); $arrayfiles = []; if ($idpasien == 'sirab'){ + /* $jumlah = 0; $getklonin = SiraB::orderBy('family', 'ASC')->orderBy('spesies', 'ASC')->whereNull('cek')->get(); foreach($getklonin as $row){ @@ -1739,33 +1740,34 @@ class DokterController extends Controller } } echo $jumlah; - /* - $getsirab = SiraB::orderBy('family', 'ASC')->orderBy('spesies', 'ASC')->get(); - foreach($getsirab as $row){ - if ($row->subantibiotik !== null && $row->subantibiotik != ''){ - $antibiotikall = $row->subantibiotik; - } else { - $antibiotikall = $row->antibiotik; - } - $arrayfiles[] = array( - 'id' => $row->id, - 'family' => $row->family, - 'spesies' => $row->spesies, - 'antibiotik' => $row->antibiotik, - 'subantibiotik' => $row->subantibiotik, - 'diskcontent' => $row->diskcontent, - 'batasatas' => $row->batasatas, - 'midrange' => $row->midrange, - 'batasbawah' => $row->batasbawah, - 'sumber' => $row->sumber, - 'kodedok' => $row->kodedok, - 'atu' => $row->atu, - 'kelompok' => $row->kelompok, - 'antibiotikall' => $antibiotikall, - ); - } - echo json_encode($arrayfiles); */ + $getsirab = SiraB::orderBy('family', 'ASC') + ->orderBy('spesies', 'ASC') + ->get() + ->map(function($row) { + return [ + 'id' => $row->id, + 'family' => $row->family, + 'spesies' => $row->spesies, + 'antibiotik' => $row->antibiotik, + 'subantibiotik' => $row->subantibiotik, + 'diskcontent' => $row->diskcontent, + 'batasatas' => $row->batasatas, + 'midrange' => $row->midrange, + 'batasbawah' => $row->batasbawah, + 'sumber' => $row->sumber, + 'kodedok' => $row->kodedok, + 'atu' => $row->atu, + 'kelompok' => $row->kelompok, + 'antibiotikall' => $row->subantibiotik !== null && $row->subantibiotik !== '' + ? $row->subantibiotik + : $row->antibiotik, + ]; + }) + ->toArray(); + + echo json_encode($getsirab); + } else if ($idpasien == 'Bakteri'){ $getsirab = Organisms::where('kelompok', 'biakankultur')->orderBy('category', 'ASC')->orderBy('name', 'ASC')->get(); echo json_encode($getsirab); diff --git a/htdocs/database/migrations/2025_09_03_072125_create_db_komponenjawaban.php b/htdocs/database/migrations/2025_09_03_072125_create_db_komponenjawaban.php new file mode 100644 index 00000000..67c7ba10 --- /dev/null +++ b/htdocs/database/migrations/2025_09_03_072125_create_db_komponenjawaban.php @@ -0,0 +1,33 @@ +id(); + $table->string('accnumber', 100)->nullable(); + $table->string('template', 100)->nullable(); + $table->string('komponen', 100)->nullable(); + $table->text('isidata')->nullable(); + $table->string('created_by', 255)->nullable(); + $table->timestamp('created_at')->useCurrent(); + $table->timestamp('updated_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('db_komponenjawaban'); + } +};