|
@@ -73,7 +73,15 @@ class PracticeManagementController extends Controller
|
|
->where('number_of_days_with_remote_measurements', '>=', 16)
|
|
->where('number_of_days_with_remote_measurements', '>=', 16)
|
|
->where('days_between_most_recent_mcp_note_date_and_end_of_care_month', '<=', 90);
|
|
->where('days_between_most_recent_mcp_note_date_and_end_of_care_month', '<=', 90);
|
|
if(!$isAdmin) $query->where('mcp_pro_id', '=', $proID);
|
|
if(!$isAdmin) $query->where('mcp_pro_id', '=', $proID);
|
|
- $rows = $query->orderByRaw(DB::raw('start_date DESC'))->paginate(10000) ;
|
|
|
|
|
|
+
|
|
|
|
+ if($request->get('show_billing_not_closed_only')){
|
|
|
|
+ $query->where(function($q){
|
|
|
|
+ return $q->where('is_bill_closed', false)->orWhereNull('is_bill_closed');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $rows = $query->orderByRaw(DB::raw('start_date DESC'))->paginate(100) ;
|
|
return view ('app.practice-management.remote-monitoring-report', compact('rows', 'isAdmin'));
|
|
return view ('app.practice-management.remote-monitoring-report', compact('rows', 'isAdmin'));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -84,11 +92,18 @@ class PracticeManagementController extends Controller
|
|
|
|
|
|
$rows = BillingReport::paginate(50);
|
|
$rows = BillingReport::paginate(50);
|
|
if($claimStatus){
|
|
if($claimStatus){
|
|
- $rows = BillingReport::whereHas('note', function($noteQuery) use ($claimStatus){
|
|
|
|
- return $noteQuery->whereHas('claims', function($claimQuery) use ($claimStatus) {
|
|
|
|
- return $claimQuery->where('status', $claimStatus);
|
|
|
|
- });
|
|
|
|
- })->paginate(50);
|
|
|
|
|
|
+ if($claimStatus == 'NO_CLAIMS'){
|
|
|
|
+ $rows = BillingReport::whereHas('note', function($noteQuery) use ($claimStatus){
|
|
|
|
+ return $noteQuery->has('claims', '=', 0);
|
|
|
|
+ })->paginate(50);
|
|
|
|
+ }else{
|
|
|
|
+ $rows = BillingReport::whereHas('note', function($noteQuery) use ($claimStatus){
|
|
|
|
+ return $noteQuery->whereHas('claims', function($claimQuery) use ($claimStatus) {
|
|
|
|
+ return $claimQuery->where('status', $claimStatus);
|
|
|
|
+ });
|
|
|
|
+ })->paginate(50);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|