Много чего
This commit is contained in:
@@ -8,36 +8,43 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SttMedicalHistory extends Model
|
||||
{
|
||||
protected $table = 'si_stt_patients';
|
||||
protected $table = 'foxpro_original_patient';
|
||||
protected $primaryKey = 'keykarta';
|
||||
protected $connection = 'pgsql';
|
||||
protected $keyType = 'string';
|
||||
public $incrementing = false;
|
||||
|
||||
protected $casts = [
|
||||
'keykarta' => 'string',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'family', // Фамилия
|
||||
'name', // Имя
|
||||
'fam', // Фамилия
|
||||
'im', // Имя
|
||||
'ot', // Отчество
|
||||
'daterecipient', // Д. пост. (mpostdate)
|
||||
'dateextract', // Д. вып. (menddate)
|
||||
'mpostdate', // Д. пост. (mpostdate)
|
||||
'menddate', // Д. вып. (menddate)
|
||||
'narhiv', // № в архиве
|
||||
'datearhiv', // Д. архив
|
||||
'statgod', // Год нахождения в стационаре
|
||||
'snils', // Год нахождения в стационаре
|
||||
'enp', // ЕНП
|
||||
'medcardnum', // № карты
|
||||
'nkarta', // № карты
|
||||
'dr', // ДР
|
||||
];
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return "$this->family $this->name $this->ot";
|
||||
return "$this->fam $this->im $this->ot";
|
||||
}
|
||||
|
||||
public function archiveHistory()
|
||||
{
|
||||
return $this->morphMany(ArchiveHistory::class, 'historyable');
|
||||
return $this->hasMany(ArchiveHistory::class, 'foxpro_history_id', 'keykarta');
|
||||
}
|
||||
|
||||
public function archiveInfo()
|
||||
{
|
||||
return $this->morphOne(ArchiveInfo::class, 'historyable');
|
||||
return $this->hasOne(ArchiveInfo::class, 'foxpro_history_id', 'keykarta');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user