Update htdocs/app/Services/AstmMessageService.php
This commit is contained in:
@@ -24,7 +24,7 @@ class ProcessAstmMessages extends Command
|
||||
public function handle()
|
||||
{
|
||||
// Ambil data dari DataListener
|
||||
$dataListener = DataListiner::whereNull('processed')->get();
|
||||
$dataListener = DataListiner::where('processed', '0')->get();
|
||||
$dataLocal = DB::table('lis_phoenix')->whereNull('processed')->get();
|
||||
if ($dataListener) {
|
||||
$jumlah = count($dataListener);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
@@ -10,6 +11,7 @@ use App\Pasien;
|
||||
use App\Riwayat;
|
||||
use App\Rekaplogbook;
|
||||
use App\PeriksaTest;
|
||||
|
||||
use Fawno\PhpSerial\SerialDio;
|
||||
use Fawno\PhpSerial\SerialConfig;
|
||||
use DateTime;
|
||||
@@ -25,6 +27,7 @@ use Aranyasen\HL7\Segments\PID;
|
||||
use Aranyasen\HL7\Segments\OBX;
|
||||
use Aranyasen\HL7\Segments\NTE;
|
||||
use Aranyasen\HL7\Segments\EVN;
|
||||
use Session;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
@@ -175,10 +178,7 @@ class Controller extends BaseController
|
||||
protected function getDefaultData($jenis, $master, $mulai, $akhir, $valcari) {
|
||||
$query = Periksa::whereNotNull('nofoto');
|
||||
if ($jenis == 'ThisDay') {
|
||||
$url = url()->current();
|
||||
$baseurl = url('/');
|
||||
$ceklaman = str_replace($baseurl.'/', '', $url);
|
||||
if ($ceklaman == 'pendaftaran'){
|
||||
if (Session('previlage') == 'admin'){
|
||||
return $query->whereDate('daftar', Carbon::today());
|
||||
} else {
|
||||
return $query->where(function($q) {
|
||||
@@ -187,7 +187,6 @@ class Controller extends BaseController
|
||||
->orWhere('status', 'not like', 'Dibatalkan%');
|
||||
});
|
||||
}
|
||||
|
||||
} else if ($jenis == 'mundur2') {
|
||||
return $query->whereDate('daftar', '>=', Carbon::today()->subDays(2));
|
||||
} else if ($jenis == 'mundur3') {
|
||||
|
||||
@@ -6,6 +6,9 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Http\Controllers\SendMail;
|
||||
use App\Services\AstmMessageService;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Poli;
|
||||
use App\Periksa;
|
||||
use App\DataListiner;
|
||||
@@ -1137,21 +1140,28 @@ class DokterController extends Controller
|
||||
try {
|
||||
$ketemu = '';
|
||||
$nomor = 1;
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
if (!empty($cekada)){
|
||||
foreach($cekada as $rows){
|
||||
$ketemu = $rows->test_status;
|
||||
$cekdatalangsung = DataListiner::where('no_id', $nofoto)->whereIn('alat', ['BD Mikro 1', 'BD Mikro 2'])->first();
|
||||
$ketemu = $cekdatalangsung->organisme ?? '';
|
||||
if ($ketemu == ''){
|
||||
$cekada = ResultSample::where('accession_number', 'LIKE', $nofoto.'%')->get();
|
||||
if (!empty($cekada)){
|
||||
foreach($cekada as $rows){
|
||||
$ketemu = $rows->test_status;
|
||||
}
|
||||
} else {
|
||||
$cekdata = DB::table('lis_phoenix')->where('no_id', $nofoto)->first();
|
||||
$ketemu = $cekdata->organisme ?? '';
|
||||
}
|
||||
} else {
|
||||
$cekdata = DB::table('lis_phoenix')->where('no_id', $nofoto)->first();
|
||||
$ketemu = $cekdata->organisme ?? '';
|
||||
}
|
||||
|
||||
if ($ketemu != ''){
|
||||
if ($isidata == '' OR is_null($isidata)){
|
||||
$isidata = $ketemu;
|
||||
} else {
|
||||
$isidata = $isidata.'<br />'.$ketemu;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
if ($isidata == '' OR is_null($isidata)){
|
||||
|
||||
@@ -1709,38 +1719,6 @@ class DokterController extends Controller
|
||||
$idpasien = $request->input('val01');
|
||||
$arrayfiles = [];
|
||||
if ($idpasien == 'sirab'){
|
||||
/*
|
||||
$jumlah = 0;
|
||||
$getklonin = SiraB::orderBy('family', 'ASC')->orderBy('spesies', 'ASC')->whereNull('cek')->get();
|
||||
foreach($getklonin as $row){
|
||||
$family = $row->family;
|
||||
$spesies = $row->spesies;
|
||||
$getallantibiotik = SiraB::where('family', $family)->get();
|
||||
foreach($getallantibiotik as $rowa){
|
||||
SiraB::updateOrCreate(
|
||||
[
|
||||
'family' => $family,
|
||||
'spesies' => $spesies,
|
||||
'antibiotik' => $rowa->antibiotik,
|
||||
'subantibiotik' => $rowa->subantibiotik,
|
||||
],
|
||||
[
|
||||
'diskcontent' => $row->diskcontent,
|
||||
'batasatas' => $row->batasatas,
|
||||
'midrange' => $row->midrange,
|
||||
'batasbawah' => $row->batasbawah,
|
||||
'sumber' => $row->sumber,
|
||||
'kodedok' => $row->kodedok,
|
||||
'atu' => $row->atu,
|
||||
'kelompok' => $row->kelompok,
|
||||
'cek' => '1',
|
||||
]
|
||||
);
|
||||
$jumlah++;
|
||||
}
|
||||
}
|
||||
echo $jumlah;
|
||||
*/
|
||||
$getsirab = SiraB::orderBy('family', 'ASC')
|
||||
->orderBy('spesies', 'ASC')
|
||||
->get()
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Exception;
|
||||
use App\DataListiner;
|
||||
use App\Periksa;
|
||||
|
||||
// Proses untuk Growth and Detection Result
|
||||
function processGrowthDetectionResult($rawData){
|
||||
@@ -227,6 +228,9 @@ class AstmMessageService
|
||||
|
||||
// Simpan ke database
|
||||
if ($noregister){
|
||||
Periksa::where('nofoto', $accession_number)->update([
|
||||
'status' => 'Data Vitek di Terima',
|
||||
]);
|
||||
Log::info("Data berhasil disimpan:", $resultSample->toArray());
|
||||
$resultSample->save();
|
||||
}
|
||||
@@ -530,6 +534,9 @@ class AstmMessageService
|
||||
DataListiner::where('urut', $data->urut)->update([
|
||||
'processed' => 1
|
||||
]);
|
||||
Periksa::where('nofoto', $data->no_id)->update([
|
||||
'status' => 'Data BD di Terima',
|
||||
]);
|
||||
Log::info("Data ASTM BD ", $resultSample->toArray());
|
||||
|
||||
} else {
|
||||
@@ -575,6 +582,9 @@ class AstmMessageService
|
||||
DB::table('lis_phoenix')->where('id', $data->id)->update([
|
||||
'processed' => 1
|
||||
]);
|
||||
Periksa::where('nofoto', $data->no_id)->update([
|
||||
'status' => 'Data BD di Terima',
|
||||
]);
|
||||
Log::info("Data ASTM BD ", $resultSample->toArray());
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user