Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -38,6 +38,7 @@ class BillingController extends BaseController
|
||||
private readonly InsuranceRepository $insuranceRepo,
|
||||
private readonly ClaimStatusLogRepository $statusLogRepo,
|
||||
private readonly PatientRecordScopeResolver $scopeResolver,
|
||||
private readonly \App\UserProfile\Repository\UserProfileRepository $profileRepo,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -237,12 +238,14 @@ class BillingController extends BaseController
|
||||
|
||||
$result = $this->invoiceService->patientInvoiceList($entityType, $entityId, $record->getId(), $page, $limit);
|
||||
$patient = $record->getUser();
|
||||
// کد ملی روی پروفایل ذخیره میشود؛ users.national_code برای بیمارِ ساختهشده در نوبتدهی خالی است.
|
||||
$nationalCode = $this->profileRepo->findByUser($patient)?->getNationalCode() ?? $patient->getNationalCode();
|
||||
|
||||
return $this->success([
|
||||
'patient' => [
|
||||
'uuid' => $record->getUuid(),
|
||||
'name' => $patient->getRealName(),
|
||||
'national_code' => $patient->getNationalCode(),
|
||||
'national_code' => $nationalCode,
|
||||
],
|
||||
'data' => $result['items'],
|
||||
'summary' => $result['summary'],
|
||||
|
||||
Reference in New Issue
Block a user