update
This commit is contained in:
@@ -967,7 +967,75 @@ class DokterController extends Controller
|
||||
$berat = $request->input('val11');
|
||||
$klinisi = $request->input('val12');
|
||||
$klinis = $request->input('val13');
|
||||
$jsonantibiotik = array(
|
||||
'Oxacillin-OX',
|
||||
'Cefoxitin-FOX',
|
||||
'Benzylpenicillin-P',
|
||||
'Ampicillin-AM',
|
||||
'Azithromycin-AZM',
|
||||
'Erythromycin-ERY',
|
||||
'Cefazolin-CZO',
|
||||
'Cefepime-FEP',
|
||||
'Cefixime-CFM',
|
||||
'Cefotaxime-CTX',
|
||||
'Cefuroxime-CXM',
|
||||
'Ceftazidime-CAZ',
|
||||
'Ceftriaxone-CRO',
|
||||
'Ceftazidime/Avibactam-CZA',
|
||||
'Piperacilin/Tazobactam-TZP',
|
||||
'Ampicillin/Sulbactam-SAM',
|
||||
'Amoxicillin/Clavulanate-AMC',
|
||||
'Cefoperazon/Sulbactam-SCF',
|
||||
'Aztreonam-ATM',
|
||||
'Ceftaroline-CPT',
|
||||
'Ciprofloxacin-CIP',
|
||||
'Levofloxacin-LEV',
|
||||
'Moxifloxacin-MFX',
|
||||
'Clindamycin-CLI',
|
||||
'Colistin-CS',
|
||||
'Tetracyclin-TCY',
|
||||
'Tigecycline-TGC',
|
||||
'Gentamicin-GM',
|
||||
'Amikacin-AN',
|
||||
'Meropenem-MEM',
|
||||
'Imipenem-IPM',
|
||||
'Doripenem-DOR',
|
||||
'Ertapenem-ETP',
|
||||
'Minocycline-MNO',
|
||||
'Doxycycline-DOX',
|
||||
'Spectinomycin-SPT',
|
||||
'Tigecycline-TGC',
|
||||
'Trimethoprim/Sulfamethoxazole-SXT',
|
||||
'Fosfomycin-FOS',
|
||||
'Vancomycin-VAN',
|
||||
'Linezolid-LNZ',
|
||||
'Fluconazole',
|
||||
'Voriconazole',
|
||||
'Caspofungin',
|
||||
'Micafungin',
|
||||
'Amphotericin B',
|
||||
'Flucytosine'
|
||||
);
|
||||
if ($worklist == 'getkomponenjawaban'){
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
if (!empty($cekada)){
|
||||
foreach($cekada as $rows){
|
||||
if ($rows->organism !== null){
|
||||
$organism = $rows->organism;
|
||||
KomponenJawaban::updateOrCreate(
|
||||
[
|
||||
'accnumber' => $nofoto,
|
||||
'isidata' => $organism,
|
||||
'komponen' => 'bakteri',
|
||||
],
|
||||
[
|
||||
'template' => $ruangan,
|
||||
'created_by' => Session('nama')
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$cekdatanmaddendum = Periksa::where('nofoto', $nofoto)->first();
|
||||
$getdatapasangannya = Periksa::whereNotNull('nmadendum')->where('dlp', '!=', $ruangan)->where('daftar', $cekdatanmaddendum->daftar)->where('nofoto', '!=', $nofoto)->get();
|
||||
foreach ($getdatapasangannya as $item){
|
||||
@@ -1260,55 +1328,7 @@ class DokterController extends Controller
|
||||
$ketemu = '';
|
||||
$organism = '';
|
||||
$nomor = 1;
|
||||
$jsonantibiotik = array(
|
||||
'Oxacillin-OX',
|
||||
'Cefoxitin-FOX',
|
||||
'Benzylpenicillin-P',
|
||||
'Ampicillin-AM',
|
||||
'Azithromycin-AZM',
|
||||
'Erythromycin-ERY',
|
||||
'Cefazolin-CZO',
|
||||
'Cefepime-FEP',
|
||||
'Cefixime-CFM',
|
||||
'Cefotaxime-CTX',
|
||||
'Cefuroxime-CXM',
|
||||
'Ceftazidime-CAZ',
|
||||
'Ceftriaxone-CRO',
|
||||
'Ceftazidime/Avibactam-CZA',
|
||||
'Piperacilin/Tazobactam-TZP',
|
||||
'Ampicillin/Sulbactam-SAM',
|
||||
'Amoxicillin/Clavulanate-AMC',
|
||||
'Cefoperazon/Sulbactam-SCF',
|
||||
'Aztreonam-ATM',
|
||||
'Ceftaroline-CPT',
|
||||
'Ciprofloxacin-CIP',
|
||||
'Levofloxacin-LEV',
|
||||
'Moxifloxacin-MFX',
|
||||
'Clindamycin-CLI',
|
||||
'Colistin-CS',
|
||||
'Tetracyclin-TCY',
|
||||
'Tigecycline-TGC',
|
||||
'Gentamicin-GM',
|
||||
'Amikacin-AN',
|
||||
'Meropenem-MEM',
|
||||
'Imipenem-IPM',
|
||||
'Doripenem-DOR',
|
||||
'Ertapenem-ETP',
|
||||
'Minocycline-MNO',
|
||||
'Doxycycline-DOX',
|
||||
'Spectinomycin-SPT',
|
||||
'Tigecycline-TGC',
|
||||
'Trimethoprim/Sulfamethoxazole-SXT',
|
||||
'Fosfomycin-FOS',
|
||||
'Vancomycin-VAN',
|
||||
'Linezolid-LNZ',
|
||||
'Fluconazole',
|
||||
'Voriconazole',
|
||||
'Caspofungin',
|
||||
'Micafungin',
|
||||
'Amphotericin B',
|
||||
'Flucytosine'
|
||||
);
|
||||
|
||||
|
||||
try {
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
@@ -1414,11 +1434,52 @@ class DokterController extends Controller
|
||||
return back();
|
||||
} else if ($worklist == 'generatetabelantibiotik'){
|
||||
$arraysurat = [];
|
||||
$getdataawal = Periksa::where('id', $nofoto)->first();
|
||||
$id = $getdataawal->id ?? $nofoto;
|
||||
$nofoto = $getdataawal->nofoto ?? 0;
|
||||
$cekdulu = RekapAntibiotik::where('orderid', $id)->count();
|
||||
if ($cekdulu == 0){
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
if (!empty($cekada)){
|
||||
foreach($cekada as $rows){
|
||||
if (!empty($rows->additional_result)) {
|
||||
$firstDecode = json_decode($rows->additional_result, true);
|
||||
if (is_string($firstDecode)) {
|
||||
$data = json_decode($firstDecode, true);
|
||||
} else {
|
||||
$data = $firstDecode;
|
||||
}
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $item) {
|
||||
$glassreportname = in_array($item['antibiotic_name'], $jsonantibiotik);
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $item['antibiotic_name'],
|
||||
],
|
||||
[
|
||||
'resistance' => $item['resistance_note'] ?? null,
|
||||
'value' => $item['value'] ?? null,
|
||||
'interpretation' => $item['interpretation'] ?? null,
|
||||
'glassreportname' => $glassreportname,
|
||||
'printrow' => true,
|
||||
'printcol' => false,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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->where('orderid', $id);
|
||||
$data = $data->orderByRaw($order)->paginate($limit);
|
||||
$totaldata = $data->total();
|
||||
if ($data) {
|
||||
@@ -1427,7 +1488,7 @@ class DokterController extends Controller
|
||||
$i++;
|
||||
}
|
||||
$response = [
|
||||
'message' => 'List Data Antibiotik',
|
||||
'message' => 'List Data orderid '.$id,
|
||||
'total' => $totaldata,
|
||||
'data' => $arraysurat
|
||||
];
|
||||
@@ -1437,8 +1498,158 @@ class DokterController extends Controller
|
||||
'message' => 'No Data'
|
||||
];
|
||||
return response()->json($response, 500);
|
||||
} else if ($worklist == 'printunprinttblantibiotik'){
|
||||
} else if ($worklist == 'isitabelantibiotik'){
|
||||
try {
|
||||
$getdataawal = Periksa::where('nofoto', $nofoto)->first();
|
||||
$id = $getdataawal->id ?? $nofoto;
|
||||
$nofoto = $getdataawal->nofoto ?? 0;
|
||||
$antibiotic_name= '';
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
if ($request->input('komponen') == 'id_kbamc' OR $request->input('komponen') == 'id_sirkbamc'){
|
||||
$antibiotic_name = 'Amoxicillin - clavulanic acid';
|
||||
$cekdatalam = RekapAntibiotik::where('orderid', $id)->where('antibiotic', $antibiotic_name)->first();
|
||||
$interpretation = $cekdatalam->interpretation ?? '';
|
||||
$value = $cekdatalam->value ?? '';
|
||||
if ($request->input('komponen') == 'id_sirkbamc'){
|
||||
$interpretation = $request->input('isi');
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kbamc'){
|
||||
$value = $request->input('isi');
|
||||
}
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kblef' OR $request->input('komponen') == 'id_sirkblef'){
|
||||
$antibiotic_name = 'Levofloxacin';
|
||||
$cekdatalam = RekapAntibiotik::where('orderid', $id)->where('antibiotic', $antibiotic_name)->first();
|
||||
$interpretation = $cekdatalam->interpretation ?? '';
|
||||
$value = $cekdatalam->value ?? '';
|
||||
if ($request->input('komponen') == 'id_sirkblef'){
|
||||
$interpretation = $request->input('isi');
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kblef'){
|
||||
$value = $request->input('isi');
|
||||
}
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kbfos' OR $request->input('komponen') == 'id_sirkbfos'){
|
||||
$antibiotic_name = 'Fosfomycin';
|
||||
$cekdatalam = RekapAntibiotik::where('orderid', $id)->where('antibiotic', $antibiotic_name)->first();
|
||||
$interpretation = $cekdatalam->interpretation ?? '';
|
||||
$value = $cekdatalam->value ?? '';
|
||||
if ($request->input('komponen') == 'id_sirkbfos'){
|
||||
$interpretation = $request->input('isi');
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kbfos'){
|
||||
$value = $request->input('isi');
|
||||
}
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kbscf' OR $request->input('komponen') == 'id_sirkbscf'){
|
||||
$antibiotic_name = 'Cefoperazone - Sulbactam';
|
||||
$cekdatalam = RekapAntibiotik::where('orderid', $id)->where('antibiotic', $antibiotic_name)->first();
|
||||
$interpretation = $cekdatalam->interpretation ?? '';
|
||||
$value = $cekdatalam->value ?? '';
|
||||
if ($request->input('komponen') == 'id_sirkbscf'){
|
||||
$interpretation = $request->input('isi');
|
||||
}
|
||||
if ($request->input('komponen') == 'id_kbscf'){
|
||||
$value = $request->input('isi');
|
||||
}
|
||||
}
|
||||
if ($antibiotic_name != ''){
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $id,
|
||||
'antibiotic' => $antibiotic_name,
|
||||
],
|
||||
[
|
||||
'resistance' => $interpretation,
|
||||
'value' => $value,
|
||||
'interpretation' => $interpretation,
|
||||
'glassreportname' => 0,
|
||||
'printrow' => false,
|
||||
'printcol' => false,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
KomponenJawaban::updateOrCreate(
|
||||
[
|
||||
'accnumber' => $nofoto,
|
||||
'template' => $request->input('jenis'),
|
||||
'komponen' => $request->input('komponen'),
|
||||
],
|
||||
[
|
||||
'isidata' => $request->input('isi'),
|
||||
'created_by' => Session('nama')
|
||||
]
|
||||
);
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved to Antibiotic Tables']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error', 'message' => 'Nama Antibiotik tidak ditemukan']);
|
||||
return back();
|
||||
}
|
||||
|
||||
}catch (Exception $e) {
|
||||
$pesan = $e->getMessage();
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error', 'message' => $pesan]);
|
||||
return back();
|
||||
}
|
||||
} else if ($worklist == 'printunprinttblantibiotik'){
|
||||
$pesan = 'Success';
|
||||
try {
|
||||
if ($request->input('isi') == 'updateallmic'){
|
||||
$getdataawal = Periksa::where('nofoto', $nofoto)->first();
|
||||
$orderid = $getdataawal->id ?? 0;
|
||||
$jumlah = 0;
|
||||
$cekada = ResultSample::where('id', $request->input('komponen'))->first();
|
||||
if (isset($cekada->id)){
|
||||
$pesan = 'Data didapat dengan ID '.$cekada->id;
|
||||
$firstDecode = json_decode($cekada->additional_result, true);
|
||||
if (is_string($firstDecode)) {
|
||||
$data = json_decode($firstDecode, true);
|
||||
} else {
|
||||
$data = $firstDecode;
|
||||
}
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $item) {
|
||||
$glassreportname = in_array($item['antibiotic_name'], $jsonantibiotik);
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $item['antibiotic_name'],
|
||||
],
|
||||
[
|
||||
'resistance' => $item['resistance_note'] ?? null,
|
||||
'value' => $item['value'] ?? null,
|
||||
'interpretation' => $item['interpretation'] ?? null,
|
||||
'glassreportname' => $glassreportname,
|
||||
'printrow' => true,
|
||||
'printcol' => false,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
$jumlah++;
|
||||
}
|
||||
}
|
||||
|
||||
$pesan = $pesan.' Sejumlah '.$jumlah.' Antibiotik';
|
||||
}
|
||||
}
|
||||
if ($request->input('isi') == 'deletemic'){
|
||||
$data = RekapAntibiotik::where('id', $nofoto)->first();
|
||||
Log::info('Data Dihapus Oleh :', [
|
||||
'user' => Session('nama'),
|
||||
'timestamp' => date('Y-m-d H:i:s'),
|
||||
'datayangdihapus' => json_encode($data)
|
||||
]);
|
||||
RekapAntibiotik::where('id', $nofoto)->delete();
|
||||
}
|
||||
if ($request->input('isi') == 'updatemic'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'interpretation' => $request->input('komponen')
|
||||
]);
|
||||
}
|
||||
if ($request->input('isi') == 'unprintrow'){
|
||||
RekapAntibiotik::where('id', $nofoto)->update([
|
||||
'printrow' => false
|
||||
@@ -1460,7 +1671,7 @@ class DokterController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
$pesan = 'Success';
|
||||
|
||||
} catch (Exception $e) {
|
||||
$pesan = $e->getMessage();
|
||||
Log::error('Gagal Arsipkan Data.', [
|
||||
@@ -1686,6 +1897,11 @@ class DokterController extends Controller
|
||||
}
|
||||
}
|
||||
return 'Success';
|
||||
} else if ($worklist == 'getothervitek'){
|
||||
$nofoto = $request->input('nofoto');
|
||||
$norm = $request->input('norm');
|
||||
$sql = ResultSample::where('accession_number', 'NOT LIKE', $nofoto.'%')->where('patient_id', $norm)->get();
|
||||
return $sql;
|
||||
} else {
|
||||
$periksa = Periksa::where('id', $idperiksa)->first();
|
||||
if (isset($periksa->id)){
|
||||
|
||||
Reference in New Issue
Block a user