Update
This commit is contained in:
@@ -12,6 +12,7 @@ use App\DataListiner;
|
||||
use App\Periksa;
|
||||
use App\RekapAntibiotik;
|
||||
use App\PendaftaranOnListiner;
|
||||
use App\Organisms;
|
||||
|
||||
// Proses untuk Growth and Detection Result
|
||||
function processGrowthDetectionResult($rawData){
|
||||
@@ -289,10 +290,11 @@ class AstmMessageService
|
||||
|
||||
} else {
|
||||
if (!empty($mltrData)){
|
||||
$mulaikirim = 0;
|
||||
$tanggalmasuk = '';
|
||||
$tanggalkeluar = '';
|
||||
$parsedData = [
|
||||
$mulaikirim = 0;
|
||||
$tanggalmasuk = '';
|
||||
$tanggalkeluar = '';
|
||||
$organism = '';
|
||||
$parsedData = [
|
||||
'patient_info' => [],
|
||||
'antibiotics' => []
|
||||
];
|
||||
@@ -377,7 +379,8 @@ class AstmMessageService
|
||||
$resultSample->specimen_type = substr($field, 2);
|
||||
}
|
||||
if ($kodeduadigit == 'o2'){
|
||||
$resultSample->organism = substr($field, 2);
|
||||
$organism = substr($field, 2);
|
||||
$resultSample->organism = $organism;
|
||||
}
|
||||
if ($kodeduadigit == 's1'){
|
||||
$tanggalmasuk = substr($field, 2);
|
||||
@@ -411,6 +414,41 @@ class AstmMessageService
|
||||
$resultSample->save();
|
||||
if ($accession_number){
|
||||
$accession_number = substr($accession_number, 0, 9);
|
||||
if ($organism !== ''){
|
||||
$sudah = Organisms::where('name', $organism)->count();
|
||||
if ($sudah == 0){
|
||||
Organisms::create([
|
||||
'kelompok' => 'biakankultur',
|
||||
'name' => $organism,
|
||||
'category' => 'Vitek',
|
||||
]);
|
||||
}
|
||||
}
|
||||
$cekdataperiksa = Periksa::where('nofoto', $accession_number)->first();
|
||||
if (isset($cekdataperiksa->id)){
|
||||
if (is_array($parsedData['antibiotics'])) {
|
||||
foreach ($parsedData['antibiotics'] as $item) {
|
||||
$glassreportname = in_array($item['antibiotic_name'], $jsonantibiotik);
|
||||
RekapAntibiotik::updateOrCreate(
|
||||
[
|
||||
'orderid' => $cekdataperiksa->id,
|
||||
'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'),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Periksa::where('nofoto', $accession_number)->update([
|
||||
'status' => 'Data Vitek di Terima',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user