Обновление 1.0
This commit is contained in:
@@ -22,7 +22,19 @@ class MedicalHistoryController extends Controller
|
||||
if ($viewType == 'foxpro') $patient = SiSttMedicalHistory::where('keykarta', $id)->first();
|
||||
else $patient = MisSttMedicalHistory::where('MedicalHistoryID', $id)->first();
|
||||
|
||||
$archiveJournal = $patient->archiveHistory ? ArchiveHistoryResource::collection($patient->archiveHistory) : null;
|
||||
if($patient instanceof MisSttMedicalHistory) {
|
||||
if ($patient->archiveHistory->count() === 0) {
|
||||
$foxproCardId = $patient->archiveInfo->foxpro_history_id;
|
||||
$foxproPatient = SiSttMedicalHistory::where('keykarta', $foxproCardId)->first();
|
||||
|
||||
$journalHistory = $foxproPatient->archiveHistory;
|
||||
} else {
|
||||
$journalHistory = $patient->archiveHistory;
|
||||
}
|
||||
} else {
|
||||
$journalHistory = $patient->archiveHistory;
|
||||
}
|
||||
|
||||
$archiveInfo = $patient->archiveInfo ? $patient->archiveInfo : null;
|
||||
|
||||
$patientInfo = [
|
||||
@@ -32,7 +44,7 @@ class MedicalHistoryController extends Controller
|
||||
...PatientInfoResource::make($patient)->toArray(request()),
|
||||
'can_be_issued' => $patient->canBeIssued()
|
||||
],
|
||||
'journal' => $archiveJournal,
|
||||
'journal' => ArchiveHistoryResource::collection($journalHistory),
|
||||
'archiveInfo' => $archiveInfo ? ArchiveInfoResource::make($archiveInfo) : null
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user