Новая логика поисковой выдачи

И добавлена кнопка Добавить карту в архив
This commit is contained in:
brusnitsyn
2025-12-26 17:41:25 +09:00
parent 329304076d
commit c5c1a2b3e1
14 changed files with 508 additions and 38 deletions

View File

@@ -38,7 +38,7 @@ class ArchiveHistoryController extends Controller
'employee_post' => 'nullable|string',
'comment' => 'nullable|string',
'has_lost' => 'boolean',
'archive_info_id' => 'required|numeric',
'history_id' => 'required',
'type' => 'required|string',
]);
@@ -55,9 +55,16 @@ class ArchiveHistoryController extends Controller
->format('Y-m-d');
}
$archiveInfo = ArchiveInfo::whereId($data['archive_info_id'])->first();
if ($data['type'] === 'mis') {
$archiveHistory = $archiveInfo->misHistory->archiveHistory()->create([
$patient = \App\Models\Mis\SttMedicalHistory::where('MedicalHistoryID', $data['history_id'])->first();
} else {
$patient = \App\Models\Si\SttMedicalHistory::where('keykarta', $data['history_id'])->first();
}
// $archiveInfo = ArchiveInfo::whereId($data['archive_info_id'])->first();
if ($data['type'] === 'mis') {
$archiveHistory = $patient->archiveHistory()->create([
'issue_at' => $data['issue_at'],
'return_at' => $data['return_at'],
'org_id' => $data['org_id'],
@@ -65,10 +72,10 @@ class ArchiveHistoryController extends Controller
'employee_post' => $data['employee_post'],
'comment' => $data['comment'],
'has_lost' => $data['has_lost'],
'mis_history_id' => $archiveInfo->mis_history_id
'mis_history_id' => $patient->MedicalHistoryID
]);
} else {
$archiveHistory = $archiveInfo->foxproHistory->archiveHistory()->create([
$archiveHistory = $patient->archiveHistory()->create([
'issue_at' => $data['issue_at'],
'return_at' => $data['return_at'],
'org_id' => $data['org_id'],
@@ -76,7 +83,7 @@ class ArchiveHistoryController extends Controller
'employee_post' => $data['employee_post'],
'comment' => $data['comment'],
'has_lost' => $data['has_lost'],
'foxpro_history_id' => $archiveInfo->foxpro_history_id,
'foxpro_history_id' => $patient->keykarta,
]);
}
@@ -131,10 +138,9 @@ class ArchiveHistoryController extends Controller
$data['post_in'] = Carbon::createFromTimestampMs($data['post_in'])->format('Y-m-d');
}
$archiveInfo = ArchiveInfo::whereId($patientId)->first();
$archiveInfo = ArchiveInfo::whereId($data['id'])->first();
$archiveInfo->updateOrCreate(
['id' => $patientId],
$archiveInfo->update(
[
'archive_num' => $data['num'],
'post_in' => $data['post_in'],