Добавить колонку отделение. Пока добавлен только МИС #2

This commit is contained in:
brusnitsyn
2026-02-27 15:01:00 +09:00
parent f15a394d5e
commit 090c7709c0
6 changed files with 67 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models\Mis;
use Illuminate\Database\Eloquent\Model;
class OmsDepartment extends Model
{
protected $table = 'oms_department';
protected $primaryKey = 'DepartmentID';
}

View File

@@ -32,6 +32,18 @@ class SttMedicalHistory extends Model
return $this->hasOne(ArchiveInfo::class, 'mis_history_id', 'MedicalHistoryID');
}
public function migrations()
{
return $this->hasOne(SttMigrationPatient::class, 'rf_MedicalHistoryID', 'MedicalHistoryID');
}
public function outcomeMigration()
{
return $this->migrations()
->where('rf_kl_VisitResultID', 1)
->whereDate('DateOut', '<>', '2222-01-01');
}
/**
* Проверяет, можно ли выдать эту карту
*/

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models\Mis;
use Illuminate\Database\Eloquent\Model;
class SttMigrationPatient extends Model
{
protected $table = 'stt_migrationpatient';
protected $primaryKey = 'MigrationPatientID';
public function stationarBranch()
{
return $this->hasOne(SttStationarBranch::class, 'StationarBranchID', 'rf_StationarBranchID');
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models\Mis;
use Illuminate\Database\Eloquent\Model;
class SttStationarBranch extends Model
{
protected $table = 'stt_stationarbranch';
protected $primaryKey = 'StationarBranchID';
public function department()
{
return $this->hasOne(OmsDepartment::class, 'DepartmentID', 'rf_DepartmentID');
}
}