|
@@ -54,8 +54,10 @@ class PracticeManagementController extends Controller
|
|
$rows = null;
|
|
$rows = null;
|
|
$proID = $this->performer()->pro->id;
|
|
$proID = $this->performer()->pro->id;
|
|
$isAdmin = $this->performer()->pro->pro_type == 'ADMIN';
|
|
$isAdmin = $this->performer()->pro->pro_type == 'ADMIN';
|
|
- $rows = $isAdmin ? ClientMeasurementDaysPerMonth::all() : ClientMeasurementDaysPerMonth::where('mcp_pro_id', $proID)->orderBy('year_month', 'asc')->orderBy('num_of_days_with_measurement', 'asc')->get();
|
|
|
|
- return view ('app.practice-management.remote-monitoring-report', compact('rows'));
|
|
|
|
|
|
+ //$rows = $isAdmin ? ClientMeasurementDaysPerMonth::all() : ClientMeasurementDaysPerMonth::where('mcp_pro_id', $proID)->orderBy('year_month', 'asc')->orderBy('num_of_days_with_measurement', 'asc')->get();
|
|
|
|
+ $rows = $isAdmin ? CareMonth::orderByRaw(DB::raw('number_of_days_with_remote_measurements DESC NULLS LAST'))->paginate(50) : CareMonth::where('mcp_pro_id', $proID)->orderBy(DB::raw('number_of_days_with_remote_measurements DESC NULLS LAST'))->paginate(50);
|
|
|
|
+
|
|
|
|
+ return view ('app.practice-management.remote-monitoring-report', compact('rows'));
|
|
}
|
|
}
|
|
|
|
|
|
public function billingReport(Request $request)
|
|
public function billingReport(Request $request)
|
|
@@ -202,10 +204,10 @@ class PracticeManagementController extends Controller
|
|
->where('is_cancelled', FALSE)
|
|
->where('is_cancelled', FALSE)
|
|
->whereRaw("
|
|
->whereRaw("
|
|
(
|
|
(
|
|
- SELECT count(bill.id)
|
|
|
|
- FROM bill WHERE
|
|
|
|
- bill.is_cancelled = FALSE AND
|
|
|
|
- bill.generic_pro_id = {$this->performer()->pro->id} AND
|
|
|
|
|
|
+ SELECT count(bill.id)
|
|
|
|
+ FROM bill WHERE
|
|
|
|
+ bill.is_cancelled = FALSE AND
|
|
|
|
+ bill.generic_pro_id = {$this->performer()->pro->id} AND
|
|
bill.note_id = note.id
|
|
bill.note_id = note.id
|
|
) = 0
|
|
) = 0
|
|
");
|
|
");
|
|
@@ -955,7 +957,7 @@ SELECT measurement.label,
|
|
FROM measurement RIGHT JOIN client on measurement.client_id = client.id
|
|
FROM measurement RIGHT JOIN client on measurement.client_id = client.id
|
|
WHERE
|
|
WHERE
|
|
client.id = {$careMonth->client_id}
|
|
client.id = {$careMonth->client_id}
|
|
- AND measurement.label IS NOT NULL
|
|
|
|
|
|
+ AND measurement.label IS NOT NULL
|
|
AND measurement.label NOT IN ('SBP', 'DBP')
|
|
AND measurement.label NOT IN ('SBP', 'DBP')
|
|
AND (measurement.is_cellular_zero = FALSE or measurement.is_cellular_zero IS NULL)
|
|
AND (measurement.is_cellular_zero = FALSE or measurement.is_cellular_zero IS NULL)
|
|
AND measurement.is_removed IS FALSE
|
|
AND measurement.is_removed IS FALSE
|
|
@@ -1537,7 +1539,7 @@ ORDER BY claim.created_at DESC
|
|
|
|
|
|
$mode = $request->input('mode') ? $request->input('mode') : '1';
|
|
$mode = $request->input('mode') ? $request->input('mode') : '1';
|
|
if(($mode < 1 || $mode > 5) && $mode != 8) $mode = 1;
|
|
if(($mode < 1 || $mode > 5) && $mode != 8) $mode = 1;
|
|
-
|
|
|
|
|
|
+
|
|
DB::enableQueryLog(); // Enable query log
|
|
DB::enableQueryLog(); // Enable query log
|
|
|
|
|
|
$test = Note::where('is_cancelled', false)
|
|
$test = Note::where('is_cancelled', false)
|
|
@@ -1614,7 +1616,7 @@ ORDER BY claim.created_at DESC
|
|
// ->whereRaw("(((detail_json)::json->>'isGood')::text <> 'true')")
|
|
// ->whereRaw("(((detail_json)::json->>'isGood')::text <> 'true')")
|
|
->where('is_claim_closed', true)
|
|
->where('is_claim_closed', true)
|
|
->whereRaw("((SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0)")
|
|
->whereRaw("((SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0)")
|
|
-
|
|
|
|
|
|
+
|
|
->count(),
|
|
->count(),
|
|
// has unsubmitted claims MARKED GOOD!
|
|
// has unsubmitted claims MARKED GOOD!
|
|
"mode-8" => Note::where('is_cancelled', false)
|
|
"mode-8" => Note::where('is_cancelled', false)
|
|
@@ -1738,7 +1740,7 @@ ORDER BY claim.created_at DESC
|
|
break;
|
|
break;
|
|
case 4: // claiming not closed
|
|
case 4: // claiming not closed
|
|
DB::enableQueryLog(); // Enable query log
|
|
DB::enableQueryLog(); // Enable query log
|
|
-
|
|
|
|
|
|
+
|
|
$note = Note::where('is_cancelled', false)
|
|
$note = Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|