Browse Source

fixed patient filter

= 3 years ago
parent
commit
dae959d2de
2 changed files with 13 additions and 0 deletions
  1. 11 0
      app/Http/Controllers/AdminController.php
  2. 2 0
      app/Http/Controllers/McpController.php

+ 11 - 0
app/Http/Controllers/AdminController.php

@@ -82,6 +82,17 @@ class AdminController extends Controller
                 break;
                 break;
         }
         }
 
 
+        $initiative = $request->input('initiative');
+        if($initiative){
+            $wildCardedInitiative = '%'.$initiative.'%';
+            $patients->where('initiative', 'ilike', $wildCardedInitiative);
+        }
+
+        $include_test_records = $request->input('include_test_records');
+        if(!$include_test_records){
+            $patients->where('client_engagement_status_category', '<>', 'DUMMY');
+        }
+
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
         return view('app.mcp.patients', compact('patients', 'filters'));
         return view('app.mcp.patients', compact('patients', 'filters'));
     }
     }

+ 2 - 0
app/Http/Controllers/McpController.php

@@ -110,6 +110,8 @@ class McpController extends Controller
             $patients->where('client_engagement_status_category', '<>', 'DUMMY');
             $patients->where('client_engagement_status_category', '<>', 'DUMMY');
         }
         }
 
 
+        dd("HERE");
+
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
         return view('app.mcp.patients', compact('patients', 'filters'));
         return view('app.mcp.patients', compact('patients', 'filters'));
     }
     }