|
@@ -260,9 +260,6 @@ class HomeController extends Controller
|
|
})
|
|
})
|
|
->count();
|
|
->count();
|
|
|
|
|
|
- // num measurements that need stamping
|
|
|
|
- $keyNumbers['measurementsToBeStamped'] = $this->performer()->pro->getUnstampedMeasurements(true, null, null);
|
|
|
|
-
|
|
|
|
// unacknowledged cancelled bills for authed pro
|
|
// unacknowledged cancelled bills for authed pro
|
|
$keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
|
|
$keyNumbers['unacknowledgedCancelledBills'] = Bill::where('hcp_pro_id', $performerProID)
|
|
->where('is_cancelled', true)
|
|
->where('is_cancelled', true)
|
|
@@ -441,6 +438,65 @@ WHERE
|
|
})
|
|
})
|
|
->count();
|
|
->count();
|
|
|
|
|
|
|
|
+ $count = DB::select(
|
|
|
|
+ DB::raw(
|
|
|
|
+ "
|
|
|
|
+SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
|
+WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
|
|
|
|
+ OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
|
+ AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
|
|
|
|
+ AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
|
|
|
|
+ AND (care_month.number_of_days_with_remote_measurements < 16 OR care_month.number_of_days_with_remote_measurements IS NULL)
|
|
|
|
+"
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ $keyNumbers['rmPatientsWithLT16MD'] = $count[0]->cnt;
|
|
|
|
+
|
|
|
|
+ $count = DB::select(
|
|
|
|
+ DB::raw(
|
|
|
|
+ "
|
|
|
|
+SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
|
+WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
|
|
|
|
+ OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
|
+ AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
|
|
|
|
+ AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
|
|
|
|
+ AND (care_month.number_of_days_with_remote_measurements >= 16 AND care_month.number_of_days_with_remote_measurements IS NOT NULL)
|
|
|
|
+"
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ $keyNumbers['rmPatientsWithGTE16MD'] = $count[0]->cnt;
|
|
|
|
+
|
|
|
|
+ $count = DB::select(
|
|
|
|
+ DB::raw(
|
|
|
|
+ "
|
|
|
|
+SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
|
+WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
|
|
|
|
+ OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
|
+ AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
|
|
|
|
+ AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
|
|
|
|
+ AND care_month.has_non_hcp_communicated_to_patient_about_rm = TRUE
|
|
|
|
+"
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ $keyNumbers['rmPatientsWithWhomCommDone'] = $count[0]->cnt;
|
|
|
|
+
|
|
|
|
+ $count = DB::select(
|
|
|
|
+ DB::raw(
|
|
|
|
+ "
|
|
|
|
+SELECT count(client.id) as cnt FROM client join care_month on care_month.client_id = client.id
|
|
|
|
+WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$performer->pro->id})
|
|
|
|
+ OR (client.rme_pro_id = {$performer->pro->id}) OR (client.default_na_pro_id = {$performer->pro->id}))
|
|
|
|
+ AND EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
|
|
|
|
+ AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
|
|
|
|
+ AND care_month.has_non_hcp_communicated_to_patient_about_rm = FALSE
|
|
|
|
+"
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ $keyNumbers['rmPatientsWithWhomCommNotDone'] = $count[0]->cnt;
|
|
|
|
+
|
|
|
|
+ // num measurements that need stamping
|
|
|
|
+ $keyNumbers['measurementsToBeStamped'] = $this->performer()->pro->getUnstampedMeasurementsFromCurrentMonth(true, null, null);
|
|
|
|
+
|
|
return view('app/dashboard', compact('keyNumbers', 'reimbursement', 'milliseconds',
|
|
return view('app/dashboard', compact('keyNumbers', 'reimbursement', 'milliseconds',
|
|
'businessNumbers',
|
|
'businessNumbers',
|
|
'incomingReports', 'tickets', 'supplyOrders',
|
|
'incomingReports', 'tickets', 'supplyOrders',
|