Задача #8
Убран фильтр по номеру карты Добавлена загрузка связи visitResult Правка размеров колонок Добавлена колонка исход Исправлено определение последнего движения в SttMedicalHistory
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models\Mis;
|
||||
|
||||
use App\Models\ArchiveHistory;
|
||||
use App\Models\ArchiveInfo;
|
||||
use App\Models\OmsVisitResult;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -34,14 +35,14 @@ class SttMedicalHistory extends Model
|
||||
|
||||
public function migrations()
|
||||
{
|
||||
return $this->hasOne(SttMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
|
||||
return $this->hasMany(SttMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
|
||||
}
|
||||
|
||||
public function outcomeMigration()
|
||||
{
|
||||
return $this->migrations()
|
||||
->where('rf_kl_VisitResultID', 1)
|
||||
->whereDate('DateOut', '<>', '2222-01-01');
|
||||
->whereDate('DateOut', '<>', '2222-01-01')
|
||||
->orderBy('DateOut', 'desc');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,4 +78,9 @@ class SttMedicalHistory extends Model
|
||||
->latest('issue_at')
|
||||
->first();
|
||||
}
|
||||
|
||||
public function visitResult()
|
||||
{
|
||||
return $this->hasOne(OmsVisitResult::class, 'kl_VisitResultID', 'rf_kl_VisitResultID');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user