* связка таблицы архива с пациентами
* добавил разграничение карт по типам баз * модель для хранения изменений статуса карт * добавил окно с просмотром выдачи карты * добавил фильтрацию вывода карт
This commit is contained in:
@@ -10,25 +10,25 @@ class SttMedicalHistory extends Model
|
||||
protected $table = 'si_stt_patients';
|
||||
|
||||
protected $fillable = [
|
||||
'fam', // Фамилия
|
||||
'im', // Имя
|
||||
'family', // Фамилия
|
||||
'name', // Имя
|
||||
'ot', // Отчество
|
||||
'mpostdate', // Д. пост.
|
||||
'menddate', // Д. вып.
|
||||
'daterecipient', // Д. пост. (mpostdate)
|
||||
'dateextract', // Д. вып. (menddate)
|
||||
'narhiv', // № в архиве
|
||||
'datearhiv', // Д. архив
|
||||
'statgod', // Год нахождения в стационаре
|
||||
'enp', // ЕНП
|
||||
'nkarta', // № карты
|
||||
'medcardnum', // № карты
|
||||
'dr', // ДР
|
||||
];
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return "$this->fam $this->im $this->ot";
|
||||
return "$this->family $this->name $this->ot";
|
||||
}
|
||||
|
||||
public function getArchiveHistory()
|
||||
public function archiveHistory()
|
||||
{
|
||||
return $this->morphMany(ArchiveHistory::class, 'historyable');
|
||||
}
|
||||
@@ -37,12 +37,12 @@ class SttMedicalHistory extends Model
|
||||
{
|
||||
return $query->where(function($q) use ($searchText) {
|
||||
if (is_numeric($searchText)) {
|
||||
$q->where('nkarta', 'LIKE', "$searchText%");
|
||||
$q->where('medcardnum', 'ILIKE', "$searchText%");
|
||||
} else {
|
||||
// Ищем по всем частям ФИО
|
||||
$q->where('fam', 'LIKE', "%$searchText%")
|
||||
->orWhere('im', 'LIKE', "%$searchText%")
|
||||
->orWhere('ot', 'LIKE', "%$searchText%");
|
||||
$q->where('family', 'ILIKE', "%$searchText%")
|
||||
->orWhere('name', 'ILIKE', "%$searchText%")
|
||||
->orWhere('ot', 'ILIKE', "%$searchText%");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user