|
@@ -549,11 +549,17 @@ class AdminController extends Controller
|
|
if($missing_default_settings === 'NO_MCP_COMPANY_LOCATION') $patients = $patients->whereNull('default_mcp_company_location_id');
|
|
if($missing_default_settings === 'NO_MCP_COMPANY_LOCATION') $patients = $patients->whereNull('default_mcp_company_location_id');
|
|
}
|
|
}
|
|
|
|
|
|
- $unsigned_care_plans = $request->get('unsigned_care_plans');
|
|
|
|
- if($unsigned_care_plans){
|
|
|
|
- $patients = $patients->whereHas('notes', function($noteQuery){
|
|
|
|
|
|
+ $care_plan = $request->get('care_plan');
|
|
|
|
+ if($care_plan){
|
|
|
|
+ if($care_plan === 'UNSIGNED_CARE_PLANS'){
|
|
|
|
+ $patients = $patients->whereHas('notes', function($noteQuery){
|
|
return $noteQuery->where('cm_setup_manager_signature_status', '!=', 'SIGNED');
|
|
return $noteQuery->where('cm_setup_manager_signature_status', '!=', 'SIGNED');
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if($care_plan === 'UNCLEARED_CARE_PLANS'){
|
|
|
|
+ $patients = $patients->where('has_care_plan_flag', true)->where('is_flag_cleared', false);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
$patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
|
|
$patients = $patients->orderBy('created_at', 'DESC')->paginate(50);
|