|
@@ -857,26 +857,36 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.shipments-multi-print', compact('shipments'));
|
|
return view('app.practice-management.shipments-multi-print', compact('shipments'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function claimsReport(Request $request)
|
|
|
|
- {
|
|
|
|
- return view('app.practice-management.claims-report');
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public function patientClaimSummary(Request $request)
|
|
|
|
|
|
+ public function patientClaimSummary(Request $request, $proUid)
|
|
{
|
|
{
|
|
|
|
+ $performerPro = $this->performer->pro;
|
|
|
|
+ $allPros = [];
|
|
|
|
+ if ($performerPro->pro_type == 'ADMIN') {
|
|
|
|
+ $allPros = Pro::all();
|
|
|
|
+ } else {
|
|
|
|
+ $allPros = [$performerPro];
|
|
|
|
+ }
|
|
|
|
|
|
//Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
|
|
//Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
|
|
- $patients = Client::where('is_dummy', '=', false)
|
|
|
|
|
|
+ $patientsQuery = Client::where('is_dummy', '=', false)
|
|
->select('id', 'uid', 'name_first', 'name_last', 'mcp_pro_id',
|
|
->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 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 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) 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_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")
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
|
|
- )->orderBy('notes_without_claiming_closed', 'desc')
|
|
|
|
- ->paginate(50);
|
|
|
|
|
|
+ )->orderBy('notes_without_claiming_closed', 'desc');
|
|
|
|
+
|
|
|
|
+ if($proUid){
|
|
|
|
+ $mcpPro = Pro::where('uid', $proUid)->first();
|
|
|
|
+ if($mcpPro){
|
|
|
|
+ $patientsQuery->where('client.mcp_pro_id','=', $mcpPro->id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $patients = $patientsQuery->paginate(50);
|
|
|
|
|
|
- return view('app.practice-management.patient-claim-summary', compact('patients'));
|
|
|
|
|
|
+ return view('app.practice-management.patient-claim-summary', compact('patients', 'proUid', 'allPros'));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|