Добавить колонку отделение. Пока добавлен только МИС #2
This commit is contained in:
@@ -57,6 +57,8 @@ class IndexSttMedicalHistoryResource extends JsonResource
|
||||
? "$archiveInfoMisCardNumber / $archiveInfoFoxproCardNumber"
|
||||
: $archiveInfoMisCardNumber ?? $archiveInfoFoxproCardNumber;
|
||||
|
||||
$department = $historyType === 'mis' ? $model->outcomeMigration->stationarBranch->department : null;
|
||||
|
||||
return [
|
||||
'id' => $id,
|
||||
'history_type' => $historyType,
|
||||
@@ -69,6 +71,7 @@ class IndexSttMedicalHistoryResource extends JsonResource
|
||||
'dr' => $formattedBirthDate,
|
||||
'daterecipient' => $formattedDateRecipient,
|
||||
'dateextract' => $formattedDateExtract,
|
||||
'department' => $department?->DepartmentNAME,
|
||||
|
||||
// Номера карт
|
||||
'medcardnum' => $cardNumber, // MIS номер или FoxPro номер
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
@@ -56,21 +56,27 @@ const columns = ref([
|
||||
{
|
||||
title: 'Дата рождения',
|
||||
key: 'dr',
|
||||
width: 130,
|
||||
width: 100,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.dr })
|
||||
},
|
||||
{
|
||||
title: 'Дата поступления',
|
||||
key: 'daterecipient',
|
||||
width: 150,
|
||||
width: 100,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.daterecipient })
|
||||
},
|
||||
{
|
||||
title: 'Дата выписки',
|
||||
key: 'dateextract',
|
||||
width: 130,
|
||||
width: 100,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.dateextract })
|
||||
},
|
||||
{
|
||||
title: 'Отделение',
|
||||
key: 'department',
|
||||
width: 180,
|
||||
render: (row) => h(NEllipsis, null, { default: () => row.department })
|
||||
},
|
||||
{
|
||||
title: '№ архива',
|
||||
key: 'card_num',
|
||||
|
||||
Reference in New Issue
Block a user