diff --git a/app/Http/Resources/IndexSttMedicalHistoryResource.php b/app/Http/Resources/IndexSttMedicalHistoryResource.php index aed22d7..8b91b42 100644 --- a/app/Http/Resources/IndexSttMedicalHistoryResource.php +++ b/app/Http/Resources/IndexSttMedicalHistoryResource.php @@ -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 номер diff --git a/app/Models/Mis/OmsDepartment.php b/app/Models/Mis/OmsDepartment.php new file mode 100644 index 0000000..23fabc7 --- /dev/null +++ b/app/Models/Mis/OmsDepartment.php @@ -0,0 +1,11 @@ +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'); + } + /** * Проверяет, можно ли выдать эту карту */ diff --git a/app/Models/Mis/SttMigrationPatient.php b/app/Models/Mis/SttMigrationPatient.php new file mode 100644 index 0000000..ad479de --- /dev/null +++ b/app/Models/Mis/SttMigrationPatient.php @@ -0,0 +1,16 @@ +hasOne(SttStationarBranch::class, 'StationarBranchID', 'rf_StationarBranchID'); + } +} diff --git a/app/Models/Mis/SttStationarBranch.php b/app/Models/Mis/SttStationarBranch.php new file mode 100644 index 0000000..6506fae --- /dev/null +++ b/app/Models/Mis/SttStationarBranch.php @@ -0,0 +1,16 @@ +hasOne(OmsDepartment::class, 'DepartmentID', 'rf_DepartmentID'); + } +} diff --git a/resources/js/Pages/Home/DataTable/Index.vue b/resources/js/Pages/Home/DataTable/Index.vue index f7090e8..548bb89 100644 --- a/resources/js/Pages/Home/DataTable/Index.vue +++ b/resources/js/Pages/Home/DataTable/Index.vue @@ -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',