|
@@ -64,9 +64,19 @@ class AdminController extends Controller
|
|
|
]
|
|
|
*/
|
|
|
|
|
|
+ if ($request->input('name')) {
|
|
|
+ $name = trim($request->input('name'));
|
|
|
+ if ($name) {
|
|
|
+ $patients = $patients->where(function ($q) use ($name) {
|
|
|
+ $q->where('name_first', 'ILIKE', '%' . $name . '%')
|
|
|
+ ->orWhere('name_last', 'ILIKE', '%' . $name . '%');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
|
|
|
$this->filterSimpleQuery($request, $patients, 'sex', 'sex');
|
|
|
- $this->filterMultiQuery($request, $patients, 'usual_bmi', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
|
|
|
+ $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
|
|
|
$this->filterMultiQuery($request, $patients, 'most_recent_weight_at', 'last_weighed_in_category', 'last_weighed_in_value_1', 'last_weighed_in_value_2');
|
|
|
$this->filterMultiQuery($request, $patients, 'most_recent_bp_at', 'last_bp_category', 'last_bp_value_1', 'last_bp_value_2');
|
|
|
|
|
@@ -90,10 +100,13 @@ class AdminController extends Controller
|
|
|
|
|
|
$include_test_records = $request->input('include_test_records');
|
|
|
if(!$include_test_records){
|
|
|
- $patients->where('client_engagement_status_category', '<>', 'DUMMY');
|
|
|
+ $patients = $patients->where(function ($q) {
|
|
|
+ $q->whereNull('client_engagement_status_category')
|
|
|
+ ->orWhere('client_engagement_status_category', '<>', 'DUMMY');
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
|
|
|
+ $patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
|
|
|
return view('app.mcp.patients', compact('patients', 'filters'));
|
|
|
}
|
|
|
|