@php
// eye_recall / eye_prescription / eye_surgical routes live under the
// patient./appointment. route groups for organizational reasons, but their
// sidebar links moved to "Eye Clinic" — exclude them here so this section
// only lights up for its own listed links.
$currentRouteName = \Request::route()->getName();
$isEyeClinicOwnedRoute = str_contains($currentRouteName, 'eye_recall') || str_contains($currentRouteName, 'eye_prescription') || str_contains($currentRouteName, 'eye_surgical') || str_contains($currentRouteName, 'eye_iop_trend');
@endphp
@canany(['patient-view', 'appointment-view', 'patient-birth_certificate-view', 'patient-death_certificate-view',
'patient-medical_report-view', 'patient-referral_latter-view', 'patient-record', 'visit-record-medical', 'visit-record-financial'])
@endcanany
@canany(['eye-clinic-dashboard-view', 'patient-eye_recall-view', 'patient-eye_surgical-view', 'appointment-eye_prescription-view', 'appointment-eye_clinic-view'])
@endcanany
@can('emergency-view')
@endcan
@canany(['room-type-view', 'room-view', 'inpatient-admission-view'])
@endcanany
@canany(['operation-category-view', 'operation-subcategory-view', 'operation-type-view', 'operation-request-view'])
@endcanany
@canany(['delivery-modes-view', 'deliveries-view'])
@endcanany
@canany(['service-category-view', 'service-type-view'])
@endcanany
@canany(['orthodentic-category-view', 'orthodentic-request-view', 'dental-plan-view'])
@endcanany
@canany(['lab-type-view', 'lab-test-uom-view', 'lab-request-view', 'lab-supply-usage-view', 'lab-analyzer-status'])
@php
// lab PC listeners: red dot when any is not OK (offline, not listening, analyzer not connected, results waiting)
$analyzerDot = null;
if (auth()->user()->can('lab-analyzer-status')) {
try {
$als = \App\Models\AnalyzerListener::get();
$analyzerDot = $als->isEmpty() ? null : ($als->contains(fn ($l) => !$l->ok()) ? 'danger' : 'success');
} catch (\Throwable $e) {
$analyzerDot = null; // table not migrated yet
}
}
@endphp
@endcanany
@canany(['image-lab-type-view', 'image-lab-test-uom-view', 'image-lab-request-view'])
@endcanany
@canany(['payment-view'])
@endcanany
@canany(['dosage-view', 'dosage-form-view', 'pharmacy-post-view', 'pharmacy-pos-sales-view-own',
'pharmacy-pos-sales-view-all', 'pharmacy-inventory-view', 'phar-customers-view',
'pharmacy-store-transfer-view', 'phar-customers-payment-view', 'pharmacy-patient_prescription-view','sales-return-view'])
@endcanany
@canany(['supply-category-view', 'supply-subcategory-view', 'product-view', 'supply-measurement-view',
'purchase-order-view', 'supplier-view', 'purchase-order_receive-view','purchase-return-view', 'supplier-payment-view'])
@endcanany
@canany(['chart-account-view', 'journal-view', 'journal-entry-view', 'accounting-report-ledger-summary',
'accounting-report-balancesheet', 'accounting-report-trial-balance', 'currency-view', 'payment-type-view',
'transfer_funds-view', 'cash_transfer-view'])
@endcanany
@canany(['treatment-treatmentype-view'])
@endcanany
@canany(['expense-category-view','expense-expense_source-view'])
@endcanany
@canany(['income-type-view', 'income-view'])
@endcanany
@canany(['role-view', 'user-view', 'user-sessions-view', 'login-history-view'])
@endcanany
@canany(['department-view', 'staff-view', 'attendance-view', 'doctor-commission-setup', 'payroll-view', 'leave-request-view', 'attendance-report-view', 'hrm-attendance-settings', 'shift-view', 'hrm-work-schedule'])
@endcanany
@can('management-dashboard-view')
@endcan
@can('reportcenter-view')
@endcan
@canany(['hospital-view', 'device-view', 'branch-view', 'symptoms-view', 'diagnosis-view', 'system-setting-view', 'sponsors-view', 'notification-settings', 'system-backup', 'system-reset'])
@endcanany