|
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Lib\Backend;
|
|
|
use App\Models\Appointment;
|
|
|
+use App\Models\AppointmentConfirmationDecision;
|
|
|
use App\Models\AppSession;
|
|
|
use App\Models\ClientMemo;
|
|
|
use App\Models\ClientProChange;
|
|
@@ -393,6 +394,40 @@ class HomeController extends Controller
|
|
|
->whereNull('current_client_pro_change_decision_id')
|
|
|
->get();
|
|
|
|
|
|
+ $proApptUpdates = AppointmentConfirmationDecision
|
|
|
+ ::select('appointment_confirmation_decision.uid', 'client.name_first', 'client.name_last', 'appointment.start_time')
|
|
|
+ ->rightJoin('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
|
|
|
+ ->rightJoin('client', 'client.id', '=', 'appointment.client_id')
|
|
|
+ ->where('appointment_confirmation_decision.was_acknowledged_by_appointment_pro', false)
|
|
|
+ ->where('appointment.status', '!=', 'CREATED')
|
|
|
+ ->where('appointment.status', '!=', 'COMPLETED')
|
|
|
+ ->where('appointment.status', '!=', 'ABANDONED')
|
|
|
+ ->where('appointment.pro_id', $performerProID)
|
|
|
+ ->where('client.mcp_pro_id', $performerProID)
|
|
|
+ ->orderBy('appointment.start_time', 'DESC')
|
|
|
+ ->get();
|
|
|
+
|
|
|
+ $naApptUpdates = AppointmentConfirmationDecision
|
|
|
+ ::select('appointment_confirmation_decision.uid', 'client.name_first', 'client.name_last', 'pro.name_first as pro_name_first', 'pro.name_last as pro_name_last', 'appointment.start_time')
|
|
|
+ ->rightJoin('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
|
|
|
+ ->rightJoin('client', 'client.id', '=', 'appointment.client_id')
|
|
|
+ ->rightJoin('pro', 'pro.id', '=', 'appointment.pro_id')
|
|
|
+ ->where('appointment_confirmation_decision.was_acknowledged_by_appointment_pro', false)
|
|
|
+ ->where('appointment.status', '!=', 'CREATED')
|
|
|
+ ->where('appointment.status', '!=', 'COMPLETED')
|
|
|
+ ->where('appointment.status', '!=', 'ABANDONED')
|
|
|
+ ->where('client.default_na_pro_id', $performerProID)
|
|
|
+ ->orderBy('appointment.start_time', 'DESC')
|
|
|
+ ->get();
|
|
|
+
|
|
|
+// $naApptUpdates = AppointmentConfirmationDecision
|
|
|
+// ::join('appointment', 'appointment.id', '=', 'appointment_confirmation_decision.appointment_id')
|
|
|
+// ->join('client', 'client.id', '=', 'appointment.client_id')
|
|
|
+// ->where('client.default_na_pro_id', $performerProID)
|
|
|
+// ->where('appointment_confirmation_decision.was_acknowledged_by_client_default_na', false)
|
|
|
+// ->orderBy('appointment.start_time DESC')
|
|
|
+// ->get();
|
|
|
+
|
|
|
// unstamped client memos
|
|
|
// for mcp
|
|
|
$mcpClientMemos = DB::select(
|
|
@@ -529,7 +564,8 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
|
|
|
'incomingReports', 'tickets', 'supplyOrders',
|
|
|
'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
|
|
|
'newMCPAssociations', 'newNAAssociations',
|
|
|
- 'mcpClientMemos', 'naClientMemos'));
|
|
|
+ 'mcpClientMemos', 'naClientMemos',
|
|
|
+ 'proApptUpdates', 'naApptUpdates'));
|
|
|
}
|
|
|
|
|
|
public function dashboardMeasurementsTab(Request $request, $page = 1) {
|