Изменения в основном report
This commit is contained in:
@@ -4,8 +4,8 @@ namespace App\Infrastructure\Reports\Sources;
|
||||
|
||||
use App\Data\UnifiedPatientData;
|
||||
use App\Models\DepartmentPatientOperation;
|
||||
use App\Models\MedicalHistory;
|
||||
use App\Models\MedicalHistorySnapshot;
|
||||
use App\Models\MisMedicalHistory;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class SnapshotPatientSource
|
||||
@@ -181,15 +181,15 @@ class SnapshotPatientSource
|
||||
return [];
|
||||
}
|
||||
|
||||
return MisMedicalHistory::query()
|
||||
->whereIn('MedicalHistoryID', $historyIds)
|
||||
->with(['surgicalOperations.serviceMedical'])
|
||||
return MedicalHistory::query()
|
||||
->whereIn('original_id', $historyIds)
|
||||
->with(['operations'])
|
||||
->get()
|
||||
->mapWithKeys(function (MisMedicalHistory $history) {
|
||||
->mapWithKeys(function (MedicalHistory $history) {
|
||||
return [
|
||||
$history->MedicalHistoryID => $history->surgicalOperations->map(fn ($operation) => [
|
||||
'code' => $operation->serviceMedical?->ServiceMedicalCode,
|
||||
'name' => $operation->serviceMedical?->ServiceMedicalName,
|
||||
$history->original_id => $history->operations->map(fn ($operation) => [
|
||||
'code' => $operation->service_medical_code ?? null,
|
||||
'name' => $operation->service_medical_name ?? null,
|
||||
])->values()->all(),
|
||||
];
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user