|
@@ -1408,6 +1408,7 @@ ORDER BY claim.created_at DESC
|
|
|
->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
|
|
|
->where('rm_total_time_in_seconds', '>=', 4200) // at 4200 (70 minutes, it becomes eligible for plus40)
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
+ ->whereRaw('is_rm_time_waived IS NOT TRUE')
|
|
|
->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS TRUE OR has_mcp_rm_interacted_by_note IS TRUE )')
|
|
|
->count();
|
|
|
|
|
@@ -1419,6 +1420,7 @@ ORDER BY claim.created_at DESC
|
|
|
->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
|
|
|
->where('rm_total_time_in_seconds', '>=', 4200) // at 4200 (70 minutes, it becomes eligible for plus40)
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
+ ->whereRaw('is_rm_time_waived IS NOT TRUE')
|
|
|
->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS NOT TRUE AND has_mcp_rm_interacted_by_note IS NOT TRUE AND is_rm_interaction_waived IS NOT TRUE )')
|
|
|
->count();
|
|
|
|
|
@@ -1431,6 +1433,7 @@ ORDER BY claim.created_at DESC
|
|
|
->where('rm_total_time_in_seconds', '<', 4200)
|
|
|
->where('rm_total_time_in_seconds', '>=', 3000) // at 3000 (50 minutes, it becomes eligible for plus20)
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
+ ->whereRaw('is_rm_time_waived IS NOT TRUE')
|
|
|
->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS TRUE OR has_mcp_rm_interacted_by_note IS TRUE)')
|
|
|
->count();
|
|
|
|
|
@@ -1443,6 +1446,7 @@ ORDER BY claim.created_at DESC
|
|
|
->where('rm_total_time_in_seconds', '<', 4200)
|
|
|
->where('rm_total_time_in_seconds', '>=', 3000) // at 3000 (50 minutes, it becomes eligible for plus20)
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
+ ->whereRaw('is_rm_time_waived IS NOT TRUE')
|
|
|
->whereRaw('(has_anyone_interacted_with_client_about_rm_outside_note IS NOT TRUE AND has_mcp_rm_interacted_by_note IS NOT TRUE AND is_rm_interaction_waived IS NOT TRUE )')
|
|
|
->count();
|
|
|
|
|
@@ -1452,10 +1456,20 @@ ORDER BY claim.created_at DESC
|
|
|
->whereNotNull('company_location_id')
|
|
|
->whereRaw('(SELECT count(id) FROM care_month_cm_rm_reason WHERE care_month_id = care_month.id) > 0')
|
|
|
->where('rm_total_time_in_seconds_by_mcp', '>=', 1800)
|
|
|
+ ->whereRaw('is_rm_time_waived IS NOT TRUE')
|
|
|
->whereRaw('(rm_total_time_in_seconds < 3000 OR (rm_total_time_in_seconds >= 3000 AND is_rm_interaction_waived IS TRUE))')
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
->count();
|
|
|
|
|
|
+ $keyNumbers['careMonthsEligibleForBillGeneration_RMB'] = CareMonth::where('is_bill_closed', false)
|
|
|
+ ->whereNotNull('company_pro_id')
|
|
|
+ ->whereNotNull('company_pro_payer_id')
|
|
|
+ ->whereNotNull('company_location_id')
|
|
|
+ ->whereRaw('(SELECT count(id) FROM care_month_cm_rm_reason WHERE care_month_id = care_month.id) > 0')
|
|
|
+ ->whereRaw('is_rm_time_waived IS TRUE')
|
|
|
+ ->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
+ ->count();
|
|
|
+
|
|
|
$keyNumbers['careMonthsWith16OrMoreMeasurementDays'] = CareMonth::where('is_bill_closed', false)
|
|
|
->where('number_of_days_with_remote_measurements', '>=', 16 )
|
|
|
->count();
|