|
@@ -990,6 +990,8 @@ class PracticeManagementController extends Controller
|
|
|
|
|
|
$patientsQuery->whereRaw('(SELECT COUNT(*) FROM note where note.client_id = client.id) > 0');
|
|
|
|
|
|
+ $patientsQuery->whereRaw('((SELECT COUNT(*) FROM note where note.client_id = client.id AND is_bill_closed IS NOT true) != 0 && (SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) !=0)');
|
|
|
+
|
|
|
$patientsQuery->orderBy('notes_without_claiming_closed', 'DESC');
|
|
|
|
|
|
$patients = $patientsQuery->paginate(50);
|