Update
This commit is contained in:
@@ -1062,25 +1062,31 @@ class DokterController extends Controller
|
||||
if ($request->input('isi') != 0){
|
||||
if ($request->input('komponen') == 'analis'){
|
||||
$analis = $request->input('isi');
|
||||
$getnama = User::where('id', $analis)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'analis' => $analis,
|
||||
'nmanalis' => $getnama->nama ?? ''
|
||||
]);
|
||||
if ($analis){
|
||||
$getnama = User::where('id', $analis)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'analis' => $analis,
|
||||
'nmanalis' => $getnama->nama ?? ''
|
||||
]);
|
||||
}
|
||||
} else if ($request->input('komponen') == 'ppds3'){
|
||||
$ppds3 = $request->input('isi');
|
||||
$getnama = User::where('id', $ppds3)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'ppdssenior' => $ppds3,
|
||||
'nmppdssenior' => $getnama->nama ?? ''
|
||||
]);
|
||||
if ($ppds3){
|
||||
$getnama = User::where('id', $ppds3)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'ppdssenior' => $ppds3,
|
||||
'nmppdssenior' => $getnama->nama ?? ''
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$dokter_id = $request->input('isi');
|
||||
$getnama = User::where('id', $dokter_id)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'dokter_id' => $dokter_id,
|
||||
'nmdokter' => $getnama->nama ?? ''
|
||||
]);
|
||||
if ($dokter_id){
|
||||
$getnama = User::where('id', $dokter_id)->first();
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'dokter_id' => $dokter_id,
|
||||
'nmdokter' => $getnama->nama ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($request->input('komponen') == 'analis'){
|
||||
@@ -1406,6 +1412,62 @@ class DokterController extends Controller
|
||||
}
|
||||
return response()->json(['pesan' => $pesan, 'organism' => $organism]);
|
||||
return back();
|
||||
} else if ($worklist == 'generatetabelantibiotik'){
|
||||
$arraysurat = [];
|
||||
$i = 0;
|
||||
$data = new RekapAntibiotik();
|
||||
$limit = ($request->input('limit') == null ? '20' : $request->input('limit'));
|
||||
$order = ($request->input('order') == null ? 'id asc' : $request->input('order'));
|
||||
$data = $data->where('orderid', $nofoto);
|
||||
$data = $data->orderByRaw($order)->paginate($limit);
|
||||
$totaldata = $data->total();
|
||||
if ($data) {
|
||||
foreach($data as $rows){
|
||||
$arraysurat[$i] = $rows;
|
||||
$i++;
|
||||
}
|
||||
$response = [
|
||||
'message' => 'List Data Antibiotik',
|
||||
'total' => $totaldata,
|
||||
'data' => $arraysurat
|
||||
];
|
||||
return response()->json($response, 200);
|
||||
}
|
||||
$response = [
|
||||
'message' => 'No Data'
|
||||
];
|
||||
return response()->json($response, 500);
|
||||
} else if ($worklist == 'printunprinttblantibiotik'){
|
||||
try {
|
||||
if ($request->input('isi') == 'unprintrow'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'printrow' => false
|
||||
]);
|
||||
}
|
||||
if ($request->input('isi') == 'printrow'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'printrow' => true
|
||||
]);
|
||||
}
|
||||
if ($request->input('isi') == 'unprintmic'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'printcol'=> false
|
||||
]);
|
||||
}
|
||||
if ($request->input('isi') == 'printmic'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'printcol'=> true
|
||||
]);
|
||||
}
|
||||
|
||||
$pesan = 'Success';
|
||||
} catch (Exception $e) {
|
||||
$pesan = $e->getMessage();
|
||||
Log::error('Gagal Arsipkan Data.', [
|
||||
'message' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
return $pesan;
|
||||
} else if ($worklist == 'getbbachtect' OR $worklist == 'getmgit' OR $worklist == 'getabbot'){
|
||||
$isidata = $request->input('isi');
|
||||
try {
|
||||
@@ -1585,17 +1647,8 @@ class DokterController extends Controller
|
||||
$tabelawal = $request->input('tabelawal');
|
||||
$idtabel = $request->input('idtabel');
|
||||
$setnilai = $request->input('setnilai');
|
||||
$cekada = explode('</table', $tabelawal);
|
||||
if (isset($cekada[1])){
|
||||
$cekbaris = explode('</tr>', $tabelawal);
|
||||
$jumlahbaris= count($cekbaris);
|
||||
$nomor = $jumlahbaris - 1;
|
||||
} else {
|
||||
$nomor = 1;
|
||||
}
|
||||
$getdataawal = Periksa::where('nofoto', $nofoto)->first();
|
||||
$orderid = $getdataawal->id ?? 0;
|
||||
$tabel = '';
|
||||
$getdata = SiraB::where('id', $idtabel)->first();
|
||||
if (isset($getdata->id)){
|
||||
$batasatas = $getdata->batasatas;
|
||||
@@ -1608,14 +1661,7 @@ class DokterController extends Controller
|
||||
} else {
|
||||
$setval = $batasbawah;
|
||||
}
|
||||
if ($nomor == 1){
|
||||
$tabel = '<table border="1" cellpadding="0" cellspacing="0" width="80%"><tr><td style="text-align:center;" width="5%"><strong>No</strong></td><td style="text-align:center;" width="20%"><strong>Antibiotik</strong></td><td style="text-align:center;" width="20%"><strong>Sub</strong></td><td style="text-align:center;" width="10%"><strong>Disc Content</strong></td><td style="text-align:center;" width="5%"><strong>S/I/R</strong></td></tr><tr><td style="text-align:center;">'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td style="text-align:center;">'.$getdata->diskcontent.'</td><td style="text-align:center;">'.$setnilai.'</td></tr></table>';
|
||||
|
||||
} else {
|
||||
$baris = '<tr><td style="text-align:center;">'.$nomor.'</td><td>'.$getdata->antibiotik.'</td><td>'.$getdata->subantibiotik.'</td><td style="text-align:center;">'.$getdata->diskcontent.'</td><td style="text-align:center;">'.$setnilai.'</td></tr>';
|
||||
$tabel = str_replace('</table>', $baris, $tabelawal);
|
||||
$tabel = $tabel.'</table>';
|
||||
}
|
||||
|
||||
if ($orderid != 0){
|
||||
if ($getdata->subantibiotik !== null && $getdata->subantibiotik != ''){
|
||||
$antibiotik = $getdata->subantibiotik;
|
||||
@@ -1631,16 +1677,15 @@ class DokterController extends Controller
|
||||
'resistance' => $getdata->diskcontent,
|
||||
'value' => $setval,
|
||||
'interpretation' => $setnilai,
|
||||
'printrow' => true,
|
||||
'printcol' => false,
|
||||
'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'),
|
||||
'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
Periksa::where('nofoto', $nofoto)->update([
|
||||
'keterangan' => $tabel
|
||||
]);
|
||||
return $tabel;
|
||||
return 'Success';
|
||||
} else {
|
||||
$periksa = Periksa::where('id', $idperiksa)->first();
|
||||
if (isset($periksa->id)){
|
||||
|
||||
Reference in New Issue
Block a user