@extends('layouts.yellow') @section('content')
@php $identity = \App\Helper\ClinicIdentityHelper::getActiveIdentity(); @endphp

{{ __('dashboard.welcome') }}, {{ Auth::user()->name }}

{{ \Carbon\Carbon::now()->isoFormat('dddd, D [de] MMMM [de] YYYY') }}
@if($identity)

{{ $identity->name }}

@if($identity->specialty) {{ $identity->specialty }} @endif
@endif
@php $accessMode = \App\Models\Settings::getAccessMode(); @endphp @if(in_array(\App\Models\Settings::APPOINTMENT_ONLY_MODE, $accessMode) || in_array(\App\Models\Settings::FULL_ACCESS_MODE, $accessMode)) {{__("view-appointments.create")}} @endif {{__("view-patients.create")}}
@if(isset($paymentTotals) && count($paymentTotals) > 0) @endif
{{__('dashboard.patientRegistered')}}

{{ $patientsMinorThat18 + $patientsMajorThat18 }}

{{ $patientsMinorThat18 }} menores / {{ $patientsMajorThat18 }} adultos
@if(in_array(\App\Models\Settings::APPOINTMENT_ONLY_MODE, $accessMode) || in_array(\App\Models\Settings::FULL_ACCESS_MODE, $accessMode))
{{__('dashboard.appointmentsToday')}}

{{ $appointmentsToday }}

@if($appointmentsToday > 0) {{__('dashboard.active')}} @endif
Para hoy {{ \Carbon\Carbon::now()->format('d/m/Y') }}
{{__('dashboard.appointmentsViews')}}

{{ $appointmentsViews }}

@if($appointmentsViews > 0) {{__('dashboard.completed')}} @endif
Consultas completadas
Próxima Cita
@if($appointmentsToday > 0) @php $nextAppointment = \App\Models\Appointments::where("active", "1") ->whereDate('date', \Carbon\Carbon::today()) ->where('date', '>=', \Carbon\Carbon::now()) ->orderBy('date', 'asc') ->first(); if (!$nextAppointment) { $nextAppointment = \App\Models\Appointments::where("active", "1") ->whereDate('date', \Carbon\Carbon::today()) ->orderBy('date', 'asc') ->first(); } $hora = $nextAppointment ? (new DateTime($nextAppointment->date))->format('H:i') : '-'; @endphp

{{ $hora }}

{{ __('dashboard.today') }} @else

-

Sin citas programadas @endif
@endif
Acciones Rápidas
@if(in_array(\App\Models\Settings::APPOINTMENT_ONLY_MODE, $accessMode) || in_array(\App\Models\Settings::FULL_ACCESS_MODE, $accessMode))
Actividad Reciente
{!! $chart1->renderHtml() !!}
{!! $chart2->renderHtml() !!}
{!! $chart3->renderHtml() !!}
Próximas Citas
@if($appointmentsToday > 0) @php $todayAppointments = \App\Models\Appointments::where("active", "1") ->whereDate('date', \Carbon\Carbon::today()) ->orderBy('date', 'asc') ->take(3) ->get(); @endphp @foreach($todayAppointments as $appointment) @php $patient = $appointment->patient()->first(); $dateTime = new DateTime($appointment->date); $hour = $dateTime->format('H:i'); $ampm = $dateTime->format('A'); $especiality = \App\Models\Especiality::find($appointment->especiality_id); $motivo = $especiality ? $especiality->especiality : ($appointment->appointment_type ?: 'Consulta'); @endphp
{{ $hour }}
{{ $ampm }}
{{ $patient ? $patient->firstname . ' ' . $patient->lastname : 'Paciente' }}
{{ $motivo }} Agendada
@endforeach @else

No hay citas programadas para hoy

Programar nueva cita
@endif
{{ __('recurring-appointments.upcomingReturnHeading') }}
@php $recurringAppointments = \App\Models\RecurringAppointment::where('is_active', true) ->where('next_appointment_date', '>=', \Carbon\Carbon::now()) ->orderBy('next_appointment_date', 'asc') ->take(3) ->with(['patient', 'doctor', 'especialityRelation']) ->get(); @endphp @if($recurringAppointments->isNotEmpty()) @foreach($recurringAppointments as $recurring) @php $daysUntil = \Carbon\Carbon::now()->startOfDay()->diffInDays(\Carbon\Carbon::parse($recurring->next_appointment_date)->startOfDay(), false); $patient = $recurring->patient; $doctor = $recurring->doctor; $especiality = $recurring->especialityRelation; $nextDate = \Carbon\Carbon::parse($recurring->next_appointment_date)->format('d/m/Y'); @endphp
{{ $nextDate }}
{{ $daysUntil }} días
{{ $patient->firstname . ' ' . $patient->lastname }}
{{ $especiality->name }} - {{ $doctor->name }} {{ $daysUntil <= $recurring->reminder_days ? 'Próximo' : 'Programado' }}
@endforeach @else

No hay retornos programados próximamente

Gestionar retornos
@endif
@endif
@endsection @section('javascript') {!! $chart1->renderChartJsLibrary() !!} {!! $chart1->renderJs() !!} {!! $chart2->renderJs() !!} {!! $chart3->renderJs() !!} @endsection