Рефакторинг
This commit is contained in:
@@ -47,8 +47,6 @@ class IndexController extends Controller
|
|||||||
$pageSize
|
$pageSize
|
||||||
);
|
);
|
||||||
|
|
||||||
// dd($data);
|
|
||||||
|
|
||||||
$statuses = ArchiveStatus::all()->map(function ($status) {
|
$statuses = ArchiveStatus::all()->map(function ($status) {
|
||||||
return [
|
return [
|
||||||
'value' => $status->id,
|
'value' => $status->id,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class MedicalHistoryController extends Controller
|
|||||||
else $patient = MisSttMedicalHistory::where('MedicalHistoryID', $id)->first();
|
else $patient = MisSttMedicalHistory::where('MedicalHistoryID', $id)->first();
|
||||||
|
|
||||||
if($patient instanceof MisSttMedicalHistory) {
|
if($patient instanceof MisSttMedicalHistory) {
|
||||||
if ($patient->archiveHistory->count() === 0) {
|
if ($patient->archiveHistory->count() === 0 && $patient->archiveInfo->foxpro_history_id) {
|
||||||
$foxproCardId = $patient->archiveInfo->foxpro_history_id;
|
$foxproCardId = $patient->archiveInfo->foxpro_history_id;
|
||||||
$foxproPatient = SiSttMedicalHistory::where('keykarta', $foxproCardId)->first();
|
$foxproPatient = SiSttMedicalHistory::where('keykarta', $foxproCardId)->first();
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ class MedicalHistoryController extends Controller
|
|||||||
...PatientInfoResource::make($patient)->toArray(request()),
|
...PatientInfoResource::make($patient)->toArray(request()),
|
||||||
'can_be_issued' => $patient->canBeIssued()
|
'can_be_issued' => $patient->canBeIssued()
|
||||||
],
|
],
|
||||||
'journal' => ArchiveHistoryResource::collection($journalHistory),
|
'journal' => $journalHistory ? ArchiveHistoryResource::collection($journalHistory) : [],
|
||||||
'archiveInfo' => $archiveInfo ? ArchiveInfoResource::make($archiveInfo) : null
|
'archiveInfo' => $archiveInfo ? ArchiveInfoResource::make($archiveInfo) : null
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user