|
@@ -850,4 +850,19 @@ class PracticeManagementController extends Controller
|
|
|
return view('app.practice-management.claims-report');
|
|
|
}
|
|
|
|
|
|
+ public function patientClaimSummary(Request $request){
|
|
|
+
|
|
|
+ //Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
|
|
|
+ $patients = Client::where('is_dummy', '=' , false)
|
|
|
+ ->select('id','uid','name_first','name_last','mcp_pro_id',
|
|
|
+ DB::raw("(SELECT name_first||' '||name_last FROM pro where pro.id = client.mcp_pro_id) as mcp"),
|
|
|
+ DB::raw("(SELECT uid FROM pro where pro.id = mcp_pro_id) as mcp_pro_uid"),
|
|
|
+ DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id) as notes_total"),
|
|
|
+ DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_bill_closed IS NOT true) as notes_without_billing_closed"),
|
|
|
+ DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
|
|
|
+ )->get();
|
|
|
+
|
|
|
+ return view('app.practice-management.patient-claim-summary', compact('patients'));
|
|
|
+ }
|
|
|
+
|
|
|
}
|