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