112 lines
3.0 KiB
PHP
112 lines
3.0 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\KomponenJawaban;
|
|
use App\Riwayat;
|
|
use App\ResultSample;
|
|
use App\PertumKolomNi;
|
|
|
|
class Periksa extends Model
|
|
{
|
|
protected $table = "periksa";
|
|
protected $guarded = [];
|
|
public function getMiddlePpdskedua()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','middleppds2');
|
|
}
|
|
public function getJuniorPpdskedua()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','ppdsjunior2');
|
|
}
|
|
public function getNmRadiografer()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','radiografer');
|
|
}
|
|
public function getNmExcutor()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','excutor');
|
|
}
|
|
public function getNmDokter()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','dokter_id');
|
|
}
|
|
public function getNmPPDSSenior()
|
|
{
|
|
return $this->hasOne('App\Models\User','id','ppdssenior');
|
|
}
|
|
public function getPasien()
|
|
{
|
|
return $this->hasOne('App\Pasien','id','pasien_id');
|
|
}
|
|
public function getPoli()
|
|
{
|
|
return $this->hasOne('App\Poli','id','poli_id');
|
|
}
|
|
public function getRuangan()
|
|
{
|
|
return $this->hasOne('App\Ruangan','id','ruangan_id');
|
|
}
|
|
public function getTandatangan()
|
|
{
|
|
return $this->hasOne('App\XFiles','xmarking','tandatangan');
|
|
}
|
|
public function getLogbook()
|
|
{
|
|
return $this->hasOne('App\Logbook','id','diagnosa');
|
|
}
|
|
public function komponen()
|
|
{
|
|
return $this->hasMany(KomponenJawaban::class, 'accnumber', 'nofoto');
|
|
}
|
|
public function riwayats()
|
|
{
|
|
return $this->hasMany(Riwayat::class, 'nofoto', 'nofoto');
|
|
}
|
|
public function rawResult()
|
|
{
|
|
return $this->hasOne(ResultSample::class, 'accession_number', 'nofoto');
|
|
}
|
|
public function pertumkolomni()
|
|
{
|
|
return $this->hasMany(PertumKolomNi::class, 'orderid', 'id');
|
|
}
|
|
public function lastMediaBAP()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media BAP')
|
|
->latest();
|
|
}
|
|
public function lastMediaCAP()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media CAP')
|
|
->latest();
|
|
}
|
|
public function lastMediaMcConkey()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media Mc Conkey')
|
|
->latest();
|
|
}
|
|
public function lastMediaSDA()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media SDA')
|
|
->latest();
|
|
}
|
|
public function lastMediaSelLain()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media Selektif lainnya')
|
|
->latest();
|
|
}
|
|
public function lastMediaTamLain()
|
|
{
|
|
return $this->hasOne(PertumKolomNi::class, 'orderid', 'id')
|
|
->where('media', 'Media Tambahan Lainnya')
|
|
->latest();
|
|
}
|
|
}
|