Добавить колонку отделение. Пока добавлен только МИС #2
This commit is contained in:
11
app/Models/Mis/OmsDepartment.php
Normal file
11
app/Models/Mis/OmsDepartment.php
Normal 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';
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверяет, можно ли выдать эту карту
|
||||
*/
|
||||
|
||||
16
app/Models/Mis/SttMigrationPatient.php
Normal file
16
app/Models/Mis/SttMigrationPatient.php
Normal 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');
|
||||
}
|
||||
}
|
||||
16
app/Models/Mis/SttStationarBranch.php
Normal file
16
app/Models/Mis/SttStationarBranch.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user