update
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -514,33 +514,36 @@ class DokterController extends Controller
|
||||
);
|
||||
}
|
||||
$yangperludicloning = '';
|
||||
if ($key == 'id_selepitel'){ $yangperludicloning = 'lsg_selepitel'; }
|
||||
if ($key == 'id_selradang'){ $yangperludicloning = 'lsg_selradang'; }
|
||||
if ($key == 'id_mikroorganisme'){ $yangperludicloning = 'lsg_mikroorganisme'; }
|
||||
if ($key == 'id_mikroorganismeoptional'){ $yangperludicloning = 'lsg_mikroorganismeoptional'; }
|
||||
if ($key == 'id_pewarnaanziehlnielsen'){ $yangperludicloning = 'lsg_pewarnaanziehlnielsen'; }
|
||||
if ($key == 'id_pewarnaanziehlnielsensewaktu'){ $yangperludicloning = 'lsg_pewarnaanziehlnielsensewaktu'; }
|
||||
if ($key == 'id_pewarnaankoh'){ $yangperludicloning = 'lsg_pewarnaankoh'; }
|
||||
if ($key == 'id_pewarnaankohoptional'){ $yangperludicloning = 'lsg_pewarnaankohoptional'; }
|
||||
if ($key == 'id_pewarnaanneisser'){ $yangperludicloning = 'lsg_pewarnaanneisser'; }
|
||||
if ($key == 'id_pewarnaannegatif'){ $yangperludicloning = 'lsg_pewarnaannegatif'; }
|
||||
if ($key == 'id_pewarnaanspora'){ $yangperludicloning = 'lsg_pewarnaanspora'; }
|
||||
if ($key == 'id_pewarnaangiesma'){ $yangperludicloning = 'lsg_pewarnaangiesma'; }
|
||||
if ($key == 'id_pewarnaangiesmaoptional'){ $yangperludicloning = 'lsg_pewarnaangiesmaoptional'; }
|
||||
if ($dlp == 'Kultur'){
|
||||
if ($key == 'id_selepitel'){ $yangperludicloning = 'lsg_selepitel'; }
|
||||
if ($key == 'id_selradang'){ $yangperludicloning = 'lsg_selradang'; }
|
||||
if ($key == 'id_mikroorganisme'){ $yangperludicloning = 'lsg_mikroorganisme'; }
|
||||
if ($key == 'id_mikroorganismeoptional'){ $yangperludicloning = 'lsg_mikroorganismeoptional'; }
|
||||
if ($key == 'id_pewarnaanziehlnielsen'){ $yangperludicloning = 'lsg_pewarnaanziehlnielsen'; }
|
||||
if ($key == 'id_pewarnaanziehlnielsensewaktu'){ $yangperludicloning = 'lsg_pewarnaanziehlnielsensewaktu'; }
|
||||
if ($key == 'id_pewarnaankoh'){ $yangperludicloning = 'lsg_pewarnaankoh'; }
|
||||
if ($key == 'id_pewarnaankohoptional'){ $yangperludicloning = 'lsg_pewarnaankohoptional'; }
|
||||
if ($key == 'id_pewarnaanneisser'){ $yangperludicloning = 'lsg_pewarnaanneisser'; }
|
||||
if ($key == 'id_pewarnaannegatif'){ $yangperludicloning = 'lsg_pewarnaannegatif'; }
|
||||
if ($key == 'id_pewarnaanspora'){ $yangperludicloning = 'lsg_pewarnaanspora'; }
|
||||
if ($key == 'id_pewarnaangiesma'){ $yangperludicloning = 'lsg_pewarnaangiesma'; }
|
||||
if ($key == 'id_pewarnaangiesmaoptional'){ $yangperludicloning = 'lsg_pewarnaangiesmaoptional'; }
|
||||
} else {
|
||||
if ($key == 'lsg_selepitel'){ $yangperludicloning = 'id_selepitel'; }
|
||||
if ($key == 'lsg_selradang'){ $yangperludicloning = 'id_selradang'; }
|
||||
if ($key == 'lsg_mikroorganisme'){ $yangperludicloning = 'id_mikroorganisme'; }
|
||||
if ($key == 'lsg_mikroorganismeoptional'){ $yangperludicloning = 'id_mikroorganismeoptional'; }
|
||||
if ($key == 'lsg_pewarnaanziehlnielsen'){ $yangperludicloning = 'id_pewarnaanziehlnielsen'; }
|
||||
if ($key == 'lsg_pewarnaanziehlnielsensewaktu'){ $yangperludicloning = 'id_pewarnaanziehlnielsensewaktu'; }
|
||||
if ($key == 'lsg_pewarnaankoh'){ $yangperludicloning = 'id_pewarnaankoh'; }
|
||||
if ($key == 'lsg_pewarnaankohoptional'){ $yangperludicloning = 'id_pewarnaankohoptional'; }
|
||||
if ($key == 'lsg_pewarnaanneisser'){ $yangperludicloning = 'id_pewarnaanneisser'; }
|
||||
if ($key == 'lsg_pewarnaannegatif'){ $yangperludicloning = 'id_pewarnaannegatif'; }
|
||||
if ($key == 'lsg_pewarnaanspora'){ $yangperludicloning = 'id_pewarnaanspora'; }
|
||||
if ($key == 'lsg_pewarnaangiesma'){ $yangperludicloning = 'id_pewarnaangiesma'; }
|
||||
if ($key == 'lsg_pewarnaangiesmaoptional'){ $yangperludicloning = 'id_pewarnaangiesmaoptional'; }
|
||||
}
|
||||
|
||||
if ($key == 'lsg_selepitel'){ $yangperludicloning = 'id_selepitel'; }
|
||||
if ($key == 'lsg_selradang'){ $yangperludicloning = 'id_selradang'; }
|
||||
if ($key == 'lsg_mikroorganisme'){ $yangperludicloning = 'id_mikroorganisme'; }
|
||||
if ($key == 'lsg_mikroorganismeoptional'){ $yangperludicloning = 'id_mikroorganismeoptional'; }
|
||||
if ($key == 'lsg_pewarnaanziehlnielsen'){ $yangperludicloning = 'id_pewarnaanziehlnielsen'; }
|
||||
if ($key == 'lsg_pewarnaanziehlnielsensewaktu'){ $yangperludicloning = 'id_pewarnaanziehlnielsensewaktu'; }
|
||||
if ($key == 'lsg_pewarnaankoh'){ $yangperludicloning = 'id_pewarnaankoh'; }
|
||||
if ($key == 'lsg_pewarnaankohoptional'){ $yangperludicloning = 'id_pewarnaankohoptional'; }
|
||||
if ($key == 'lsg_pewarnaanneisser'){ $yangperludicloning = 'id_pewarnaanneisser'; }
|
||||
if ($key == 'lsg_pewarnaannegatif'){ $yangperludicloning = 'id_pewarnaannegatif'; }
|
||||
if ($key == 'lsg_pewarnaanspora'){ $yangperludicloning = 'id_pewarnaanspora'; }
|
||||
if ($key == 'lsg_pewarnaangiesma'){ $yangperludicloning = 'id_pewarnaangiesma'; }
|
||||
if ($key == 'lsg_pewarnaangiesmaoptional'){ $yangperludicloning = 'id_pewarnaangiesmaoptional'; }
|
||||
|
||||
if ($nm_spesimen == 'SPUTUM' AND !empty($cekganda) AND $yangperludicloning != ''){
|
||||
foreach($cekganda as $rcloning){
|
||||
|
||||
@@ -94,37 +94,57 @@ class JsonTransferController extends Controller
|
||||
|
||||
return response()->download($zipFile);
|
||||
}
|
||||
|
||||
public function importTable($table) {
|
||||
set_time_limit(0);
|
||||
ini_set('memory_limit', '-1');
|
||||
ini_set('max_execution_time', 0);
|
||||
|
||||
$path = base_path($this->exportPath . $table . '.json');
|
||||
if (!file_exists($path)) {
|
||||
return back()->with('error', "File JSON untuk tabel $table tidak ditemukan.");
|
||||
return back()->with('error', "File tidak ditemukan.");
|
||||
}
|
||||
|
||||
DB::statement("TRUNCATE TABLE $table RESTART IDENTITY CASCADE");
|
||||
DB::disableQueryLog();
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
DB::statement("TRUNCATE TABLE $table RESTART IDENTITY CASCADE");
|
||||
$items = Items::fromFile($path);
|
||||
|
||||
$chunk = [];
|
||||
$batchSize = 1000;
|
||||
$counter = 0;
|
||||
|
||||
$items = Items::fromFile($path);
|
||||
$chunk = [];
|
||||
foreach ($items as $row) {
|
||||
$data = (array) $row;
|
||||
unset($data['id']);
|
||||
$chunk[] = $data;
|
||||
$counter++;
|
||||
|
||||
foreach ($items as $row) {
|
||||
$data = (array) $row;
|
||||
unset($data['id']);
|
||||
$chunk[] = (array) $row;
|
||||
|
||||
if (count($chunk) >= 50) {
|
||||
|
||||
DB::table($table)->insert($chunk);
|
||||
$chunk = [];
|
||||
if (count($chunk) >= $batchSize) {
|
||||
DB::table($table)->insert($chunk);
|
||||
$chunk = [];
|
||||
if ($counter % 5000 == 0) {
|
||||
gc_collect_cycles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($row);
|
||||
}
|
||||
if (!empty($chunk)) {
|
||||
DB::table($table)->insert($chunk);
|
||||
}
|
||||
$resetSequenceSql = "SELECT setval(pg_get_serial_sequence('$table', 'id'), COALESCE(MAX(id), 1)) FROM $table";
|
||||
DB::statement($resetSequenceSql);
|
||||
DB::commit();
|
||||
DB::enableQueryLog();
|
||||
|
||||
if (!empty($chunk)) {
|
||||
DB::table($table)->insert($chunk);
|
||||
}
|
||||
return back()->with('success', 'Import berhasil!');
|
||||
|
||||
return back()->with('success', 'Import berhasil!');
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
\Log::error("Import Error $table: " . $e->getMessage());
|
||||
return back()->with('error', "Error 500 Details: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
public function pull(Request $request){
|
||||
if (session('previlage') !== 'developer') {
|
||||
|
||||
@@ -136,6 +136,6 @@
|
||||
{"id":166,"poli":"Core","ruangan":"R.LANTAI 3 - KLS VIP A","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"},
|
||||
{"id":167,"poli":"Core","ruangan":"R.ICU KAPUAS C - KLS 1 (Dewasa)","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"},
|
||||
{"id":168,"poli":"Core","ruangan":"KLINIK PEL. UTAMA GRAND PAVILIUN","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"},
|
||||
{"id":169,"poli":"Core","ruangan":"LAB MIKROBIOLOGI","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"},
|
||||
{"id":170,"poli":"Core","ruangan":"R.HCU RANU PANI - KLS 2","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"}
|
||||
{"id":170,"poli":"Core","ruangan":"R.HCU RANU PANI - KLS 2","created_at":"2024-09-23 10:13:14","updated_at":"2024-09-23 10:13:14"},
|
||||
{"id":169,"poli":"Core","ruangan":"LAB MIKROBIOLOGI","created_at":"2024-09-23 10:13:14","updated_at":"2026-02-04 13:55:48"}
|
||||
]
|
||||
@@ -615,6 +615,8 @@ def handle_genexpert_client(conn, addr):
|
||||
session.rollback()
|
||||
finally:
|
||||
session.close()
|
||||
# Selesai tangani QRY, jangan lanjut parsing umum
|
||||
continue
|
||||
|
||||
# ==========================================
|
||||
# SKENARIO 2: ALAT KIRIM HASIL (RESULT / ORU)
|
||||
@@ -632,6 +634,7 @@ def handle_genexpert_client(conn, addr):
|
||||
conn.sendall(full_ack.encode('utf-8'))
|
||||
logging.info(f"[ACK SENT] Untuk hasil ID {incoming_control_id}")
|
||||
print(f"[ACK SENT] Untuk hasil ID {incoming_control_id}")
|
||||
continue
|
||||
|
||||
# ==========================================
|
||||
# SKENARIO 3: Handle Pesan Apa Adanya
|
||||
|
||||
Reference in New Issue
Block a user