|
@@ -420,8 +420,44 @@ class PatientController extends Controller
|
|
|
|
|
|
public function careMonths(Request $request, Client $patient )
|
|
|
{
|
|
|
- $careMonths = CareMonth::where('client_id', $patient->id)->orderBy('start_date', 'desc')->get();
|
|
|
- $notes = Note::where('is_cancelled', false)->get();
|
|
|
+ if($request->input('ql')) DB::enableQueryLog();
|
|
|
+
|
|
|
+ $careMonths = CareMonth
|
|
|
+ ::select(
|
|
|
+ 'id',
|
|
|
+ 'uid',
|
|
|
+ 'start_date',
|
|
|
+ 'uid',
|
|
|
+ 'was_rm_setup_performed',
|
|
|
+ 'number_of_days_with_remote_measurements',
|
|
|
+ 'rm_total_time_in_seconds',
|
|
|
+ 'rm_total_time_in_seconds_by_mcp',
|
|
|
+ 'rm_total_time_in_seconds_by_rme_pro',
|
|
|
+ 'rm_total_time_in_seconds_by_rmm_pro',
|
|
|
+ 'mcp_pro_id',
|
|
|
+ 'rm_bill_id',
|
|
|
+ 'cm_pro_id',
|
|
|
+ 'rmm_pro_id',
|
|
|
+ 'rme_pro_id',
|
|
|
+ 'number_of_days_with_remote_measurements',
|
|
|
+ 'rm_total_time_in_seconds_by_mcp',
|
|
|
+ 'has_mcp_interacted_with_client_about_rm'
|
|
|
+ )
|
|
|
+ ->where('client_id', $patient->id)
|
|
|
+ ->orderBy('start_date', 'desc')->get();
|
|
|
+
|
|
|
+ $notes = [];
|
|
|
+
|
|
|
+ if($patient->has_mcp_done_onboarding_visit !== 'YES') {
|
|
|
+ $notes = Note
|
|
|
+ ::select('uid', 'title', 'effective_dateest', 'hcp_pro_id')
|
|
|
+ ->where('client_id', $patient->id)
|
|
|
+ ->where('is_cancelled', false)
|
|
|
+ ->get();
|
|
|
+ }
|
|
|
+
|
|
|
+ if($request->input('ql')) dd(DB::getQueryLog());
|
|
|
+
|
|
|
return view('app.patient.care-months', compact('patient', 'careMonths', 'notes'));
|
|
|
}
|
|
|
|