|
@@ -118,7 +118,7 @@ class PracticeManagementController extends Controller
|
|
|
|
|
|
case 'without-bills':
|
|
case 'without-bills':
|
|
$query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereDoesntHave('bills');
|
|
$query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereDoesntHave('bills');
|
|
-
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
|
|
|
|
// more cases can be added as needed
|
|
// more cases can be added as needed
|
|
@@ -153,7 +153,7 @@ class PracticeManagementController extends Controller
|
|
public function bills(Request $request, $filter = '')
|
|
public function bills(Request $request, $filter = '')
|
|
{
|
|
{
|
|
$proID = $this->performer()->pro->id;
|
|
$proID = $this->performer()->pro->id;
|
|
- $query = Bill::where('is_cancelled', false);
|
|
|
|
|
|
+ $query = Bill::where('is_cancelled', false)->where('bill_service_type', '<>', 'CARE_MONTH');
|
|
switch ($filter) {
|
|
switch ($filter) {
|
|
case 'not-yet-signed':
|
|
case 'not-yet-signed':
|
|
$query = $query
|
|
$query = $query
|
|
@@ -1092,8 +1092,8 @@ SELECT claim.uid AS uid,
|
|
note.method,
|
|
note.method,
|
|
note.new_or_fu_or_na,
|
|
note.new_or_fu_or_na,
|
|
-- claim.status_updated_at,
|
|
-- claim.status_updated_at,
|
|
- (DATE(claim.status_updated_at) || ' ' ||
|
|
|
|
- LPAD(EXTRACT(hour FROM claim.status_updated_at)::text, 2, '0') || ':' ||
|
|
|
|
|
|
+ (DATE(claim.status_updated_at) || ' ' ||
|
|
|
|
+ LPAD(EXTRACT(hour FROM claim.status_updated_at)::text, 2, '0') || ':' ||
|
|
LPAD(EXTRACT(minute FROM claim.status_updated_at)::text, 2, '0')) AS status_updated_at,
|
|
LPAD(EXTRACT(minute FROM claim.status_updated_at)::text, 2, '0')) AS status_updated_at,
|
|
(SELECT string_agg(claim_line.cpt, ', ') FROM claim_line where claim_id = claim.id) AS cpts,
|
|
(SELECT string_agg(claim_line.cpt, ', ') FROM claim_line where claim_id = claim.id) AS cpts,
|
|
(SELECT COUNT(claim_line_icd.id) FROM claim_line_icd WHERE claim_line_id IN (SELECT id FROM claim_line WHERE claim_id = claim.id)) AS icds,
|
|
(SELECT COUNT(claim_line_icd.id) FROM claim_line_icd WHERE claim_line_id IN (SELECT id FROM claim_line WHERE claim_id = claim.id)) AS icds,
|
|
@@ -1107,9 +1107,9 @@ FROM claim
|
|
--WHERE claim.status IS NULL OR claim.status = 'NEW'
|
|
--WHERE claim.status IS NULL OR claim.status = 'NEW'
|
|
WHERE (claim.status is NULL OR claim.status NOT IN ('CANCELLED', 'ABANDONED'))
|
|
WHERE (claim.status is NULL OR claim.status NOT IN ('CANCELLED', 'ABANDONED'))
|
|
-- AND claim.current_version_id IS NOT NULL
|
|
-- AND claim.current_version_id IS NOT NULL
|
|
-AND (client.name_first ILIKE :q OR
|
|
|
|
- client.name_last ILIKE :q OR
|
|
|
|
- client.chart_number ILIKE :q OR
|
|
|
|
|
|
+AND (client.name_first ILIKE :q OR
|
|
|
|
+ client.name_last ILIKE :q OR
|
|
|
|
+ client.chart_number ILIKE :q OR
|
|
client.mcn ILIKE :q)
|
|
client.mcn ILIKE :q)
|
|
AND (claim.created_at >= :from AND claim.created_at <= :to)
|
|
AND (claim.created_at >= :from AND claim.created_at <= :to)
|
|
" . ($hcpPro ? "AND claim.pro_id = :hcp" : '') . "
|
|
" . ($hcpPro ? "AND claim.pro_id = :hcp" : '') . "
|