Update Cara Baca
This commit is contained in:
No files matched your search
@@ -1136,23 +1136,6 @@ class DokterController extends Controller
|
||||
]);
|
||||
}
|
||||
}
|
||||
if(is_array($jsondata) && count($jsondata) > 0){
|
||||
foreach ($jsondata as $item){
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $item['antibiotic'],
|
||||
],
|
||||
[
|
||||
'resistance' => $item['resistance'],
|
||||
'value' => $item['value'],
|
||||
'interpretation' => $item['interpretation'],
|
||||
'created_at' => $getdataawal->daftar ?? date('Y-m-d H:i:s'),
|
||||
'updated_at' => $getdataawal->akhir ?? date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$gentabel = RekapAntibiotik::where('orderid', $orderid)->get();
|
||||
@@ -1160,7 +1143,7 @@ class DokterController extends Controller
|
||||
$nomor = 1;
|
||||
$isidata = '<table border="1" cellpadding="0" cellspacing="0" width="100%"><tr><td width="5%"><strong>No</strong></td><td width="65%"><strong>Antibiotik</strong></td><td width="15%"><strong>Value</strong></td><td width="15%"><strong>S/I/R</strong></td></tr>';
|
||||
foreach($gentabel as $rtabel){
|
||||
$isidata = $isidata.'<tr><td>'.$nomor.'</td><td>'.$rtabel->antibiotic.'</td<td>'.$rtabel->value.'</td><td>'.$rtabel->interpretation.'</td></tr>';
|
||||
$isidata = $isidata.'<tr><td>'.$nomor.'</td><td>'.$rtabel->resistance.'</td><td>'.$rtabel->value.'</td><td>'.$rtabel->interpretation.'</td></tr>';
|
||||
$nomor++;
|
||||
}
|
||||
$isidata = $isidata.'</table>';
|
||||
|
||||
@@ -815,7 +815,7 @@ class FrontpageController extends Controller
|
||||
}
|
||||
}
|
||||
public function registerApi(Request $request) {
|
||||
Log::info(' Incomming '.json_encode($request->input()));
|
||||
//Log::info(' Incomming '.json_encode($request->input()));
|
||||
$decodedData = $request->json()->all();
|
||||
$norm = $decodedData['norm'] ?? null;
|
||||
$nama = $decodedData['nama'] ?? null;
|
||||
|
||||
@@ -9,7 +9,7 @@ use App\Jawaban;
|
||||
use App\Subjawaban;
|
||||
use App\SiraB;
|
||||
use App\Organisms;
|
||||
|
||||
use App\Periksa;
|
||||
use Validator;
|
||||
use Picqer\Barcode\BarcodeGeneratorPNG;
|
||||
use Session;
|
||||
@@ -276,8 +276,9 @@ class TemplateController extends Controller
|
||||
return back();
|
||||
}
|
||||
} else if ($tabel == 'Speciment'){
|
||||
$kodelama = '';
|
||||
if ($id == 'new'){
|
||||
$ceksudah = Organisms::where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
$ceksudah = Organisms::where('name', $request->name)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = new Organisms;
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
@@ -287,9 +288,11 @@ class TemplateController extends Controller
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
} else {
|
||||
$ceksudah = Organisms::where('id', '!=', $id)->where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
$ceksudah = Organisms::where('id', '!=', $id)->where('name', $request->name)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = Organisms::find($id);
|
||||
$kodelama = $data->category;
|
||||
$kodebaru = $request->category;
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->update($inputData);
|
||||
} else {
|
||||
@@ -297,6 +300,9 @@ class TemplateController extends Controller
|
||||
}
|
||||
}
|
||||
if ($data){
|
||||
if ($kodelama != ''){
|
||||
Periksa::where('kd_spesimen', $kodelama)->update(['kd_spesimen' => $kodebaru]);
|
||||
}
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved']);
|
||||
return back();
|
||||
} else {
|
||||
|
||||
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Exception;
|
||||
use App\DataListiner;
|
||||
use App\Periksa;
|
||||
|
||||
use App\RekapAntibiotik;
|
||||
// Proses untuk Growth and Detection Result
|
||||
function processGrowthDetectionResult($rawData){
|
||||
// Format: R|1| ^ ^ ^GND_MGIT^430100001234|INST_POSITIVE ^87| ...
|
||||
@@ -148,6 +148,55 @@ class AstmMessageService
|
||||
if (empty($astmData)) {
|
||||
Log::error("ASTM data kosong atau tidak valid.");
|
||||
}
|
||||
$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'
|
||||
);
|
||||
$headerData = [];
|
||||
$patientData = [];
|
||||
$orderData = [];
|
||||
@@ -246,6 +295,9 @@ class AstmMessageService
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
$mulaikirim = 0;
|
||||
$tanggalmasuk = '';
|
||||
$tanggalkeluar = '';
|
||||
|
||||
$resultSample = new ResultSample();
|
||||
foreach ($mltrData as $index => $field) {
|
||||
if ($field == 'ra'){
|
||||
@@ -277,60 +329,60 @@ class AstmMessageService
|
||||
$interpretation = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else {
|
||||
$cekbersih = trim($field, '"');
|
||||
|
||||
if (strpos($cekbersih, 'ci') === 0) {
|
||||
$accession_number = substr($cekbersih, 2);
|
||||
$cekbersih = trim($field, '"');
|
||||
if (strpos($cekbersih, 'mt') === 0) {
|
||||
$resultSample->sender_name = substr($cekbersih, 2);
|
||||
}
|
||||
$field = substr($field, 2);
|
||||
switch ($index) {
|
||||
case 0:
|
||||
$resultSample->sender_name = $alat;
|
||||
break;
|
||||
case 1:
|
||||
$resultSample->version_number = $field; // iiV2
|
||||
break;
|
||||
case 2:
|
||||
$resultSample->isolate_number = $field; // is000015F278BD
|
||||
break;
|
||||
case 4:
|
||||
$resultSample->patient_id = $field; // pi12009427
|
||||
break;
|
||||
case 5:
|
||||
$patientNames = explode(',', $field ?? null);
|
||||
if (count($patientNames) > 0) {
|
||||
$resultSample->patient_name_last = trim($patientNames[0]); // Last name
|
||||
}
|
||||
if (count($patientNames) > 1) {
|
||||
$resultSample->patient_name_first = trim($patientNames[1]); // First name
|
||||
}
|
||||
if (count($patientNames) > 2) {
|
||||
$resultSample->patient_name_middle = trim($patientNames[2]); // Middle name
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
$resultSample->address_street = $field; // plMANINJAU
|
||||
break;
|
||||
case 12:
|
||||
try {
|
||||
$resultSample->message_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->message_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
try {
|
||||
$resultSample->test_complete_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->test_complete_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
//$resultSample->accession_number = substr($field, 6); // ci30112024.26859
|
||||
break;
|
||||
case 23:
|
||||
$resultSample->organism = $field; // o2Staphylococcus haemolyticus
|
||||
break;
|
||||
if (strpos($cekbersih, 'ii') === 0) {
|
||||
$resultSample->version_number = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'rr') === 0) {
|
||||
$resultSample->isolate_number = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'ci') === 0) {
|
||||
$accession_number = substr($cekbersih, 2);
|
||||
$resultSample->accession_number = $accession_number;
|
||||
}
|
||||
if (strpos($cekbersih, 'pi') === 0) {
|
||||
$resultSample->patient_id = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'pn') === 0) {
|
||||
$patientNames = substr($cekbersih, 2);
|
||||
$patientNames = explode(',', $patientNames ?? null);
|
||||
if (count($patientNames) > 0) {
|
||||
$resultSample->patient_name_first = trim($patientNames[0]);
|
||||
}
|
||||
if (count($patientNames) > 1) {
|
||||
$resultSample->patient_name_last = trim($patientNames[1]);
|
||||
}
|
||||
if (count($patientNames) > 2) {
|
||||
$resultSample->patient_name_middle = trim($patientNames[2]);
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($cekbersih, 'pl') === 0) {
|
||||
$resultSample->hospital_service = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'p2') === 0) {
|
||||
$resultSample->hospital_client = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'ss') === 0) {
|
||||
$resultSample->specimen_type = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 'o2') === 0) {
|
||||
$resultSample->organism = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 's1') === 0) {
|
||||
$tanggalmasuk = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 's2') === 0) {
|
||||
$tanggalmasuk = $tanggalmasuk.' '.substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 's3') === 0) {
|
||||
$tanggalkeluar = substr($cekbersih, 2);
|
||||
}
|
||||
if (strpos($cekbersih, 's4') === 0) {
|
||||
$tanggalkeluar = $tanggalkeluar.' '.substr($cekbersih, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,15 +393,50 @@ class AstmMessageService
|
||||
|
||||
// Result Record
|
||||
$resultSample->additional_result = json_encode($parsedData['antibiotics']);
|
||||
|
||||
// Menyimpan data yang sudah diparse
|
||||
if ($tanggalmasuk != ''){
|
||||
try {
|
||||
$resultSample->message_datetime = Carbon::parse($tanggalmasuk)->format('Y-m-d H:i:s') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->message_datetime = date('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
if ($tanggalkeluar != ''){
|
||||
try {
|
||||
$resultSample->test_complete_datetime = Carbon::parse($tanggalkeluar)->format('Y-m-d H:i:s') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->test_complete_datetime = date('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
$resultSample->save();
|
||||
if ($accession_number){
|
||||
$resultSample->accession_number = $accession_number; // '12345'
|
||||
$getorderid = Periksa::where('nofoto', $accession_number)->first();
|
||||
$orderid = $getorderid->id ?? null;
|
||||
if ($orderid){
|
||||
if(is_array($parsedData['antibiotics']) && count($parsedData['antibiotics']) > 0){
|
||||
foreach ($parsedData['antibiotics'] as $item){
|
||||
$glassreportname = in_array($item['antibiotic'], $jsonantibiotik);
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $orderid,
|
||||
'antibiotic' => $item['antibiotic'],
|
||||
],
|
||||
[
|
||||
'resistance' => $item['resistance'],
|
||||
'value' => $item['value'],
|
||||
'interpretation' => $item['interpretation'],
|
||||
'glassreportname' => $glassreportname,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Periksa::where('nofoto', $accession_number)->update([
|
||||
'status' => 'Data Vitek di Terima',
|
||||
]);
|
||||
}
|
||||
$resultSample->save();
|
||||
|
||||
|
||||
Log::info("Data MTRL Berhasil di Parse dan di simpan ", $resultSample->toArray());
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
|
||||
Reference in New Issue
Block a user