|
@@ -64,14 +64,6 @@ class AdminController extends Controller
|
|
|
]
|
|
|
*/
|
|
|
|
|
|
- $insurance = $request->get('insurance');
|
|
|
- if($insurance){
|
|
|
- // $patients = $patients->where(function ($query) use ($insurance) {
|
|
|
- // return $query
|
|
|
- // ->whereRaw('client_id IN (SELECT client_id FROM client_primary_coverage WHERE (plan_type ILIKE %'.$insurance.'%)');
|
|
|
- // });
|
|
|
- }
|
|
|
-
|
|
|
if ($request->input('name')) {
|
|
|
$name = trim($request->input('name'));
|
|
|
if ($name) {
|
|
@@ -114,6 +106,15 @@ class AdminController extends Controller
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ $insurance = $request->get('insurance');
|
|
|
+ if($insurance){
|
|
|
+ if($insurance === 'MEDICARE'){
|
|
|
+ $patients = $patients->where('is_part_b_primary', 'YES');
|
|
|
+ }else{
|
|
|
+ $patients = $patients->where('is_part_b_primary', '!=', 'YES');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$patients = $patients->orderBy('created_at', 'DESC')->paginate(25);
|
|
|
return view('app.admin.patients', compact('patients', 'filters'));
|
|
|
}
|