|
@@ -116,9 +116,9 @@ class AdminController extends Controller
|
|
|
$this->filterMultiQuery($request, $patients, 'created_at', 'created_at', 'created_at_value_1', 'created_at_value_2');
|
|
|
$this->filterMultiQuery($request, $patients, 'most_recent_completed_mcp_note_date', 'last_visit_category', 'last_visit_value_1', 'last_visit_value_2');
|
|
|
|
|
|
- $hasEmail = $request->input('has_email');
|
|
|
- if($hasEmail) {
|
|
|
- if($hasEmail === 'YES') {
|
|
|
+ $fVal = $request->input('has_email');
|
|
|
+ if($fVal) {
|
|
|
+ if($fVal === 'YES') {
|
|
|
$patients = $patients->whereRaw("(email_address IS NOT NULL AND TRIM(email_address) != '')");
|
|
|
}
|
|
|
else {
|
|
@@ -126,9 +126,9 @@ class AdminController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $hasAccount = $request->input('has_account');
|
|
|
- if($hasAccount) {
|
|
|
- if($hasAccount === 'YES') {
|
|
|
+ $fVal = $request->input('has_account');
|
|
|
+ if($fVal) {
|
|
|
+ if($fVal === 'YES') {
|
|
|
$patients = $patients->whereRaw("((SELECT COUNT(ac.id) FROM account_client ac WHERE ac.client_id = client.id) > 0)");
|
|
|
}
|
|
|
else {
|
|
@@ -136,6 +136,36 @@ class AdminController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $fVal = $request->input('has_default_mcp_company_pro');
|
|
|
+ if($fVal) {
|
|
|
+ if($fVal === 'YES') {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_pro_id IS NOT NULL)");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_pro_id IS NULL)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $fVal = $request->input('has_default_mcp_company_pro_payer');
|
|
|
+ if($fVal) {
|
|
|
+ if($fVal === 'YES') {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_pro_payer_id IS NOT NULL)");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_pro_payer_id IS NULL)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $fVal = $request->input('has_default_mcp_company_location');
|
|
|
+ if($fVal) {
|
|
|
+ if($fVal === 'YES') {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_location_id IS NOT NULL)");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $patients = $patients->whereRaw("(default_mcp_company_location_id IS NULL)");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if($request->input('number_of_measurements')){
|
|
|
$keyName = $request->input('number_of_measurements');
|
|
|
$measurementCountQuery = '(SELECT COUNT(*) FROM measurement WHERE measurement.client_id = client.id AND is_active IS TRUE AND is_cellular IS TRUE AND is_cellular_zero IS NOT TRUE)';
|