|
@@ -575,7 +575,7 @@ WHERE ((client.mcp_pro_id = {$performer->pro->id}) OR (client.rmm_pro_id = {$per
|
|
|
$keyNumbers['patientsWithoutCoverageInformation'] = DB::select(DB::raw("
|
|
|
SELECT count(DISTINCT (cl.id)) as cnt
|
|
|
FROM client cl
|
|
|
-WHERE cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
+WHERE cl.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
))[0]->cnt;
|
|
|
|
|
|
// patients pending coverage verification
|
|
@@ -583,7 +583,8 @@ WHERE cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
SELECT count(DISTINCT (cl.id)) as cnt
|
|
|
FROM client cl
|
|
|
LEFT JOIN client_primary_coverage cpc ON cl.latest_client_primary_coverage_id = cpc.id
|
|
|
-WHERE (cl.latest_client_primary_coverage_id IS NOT NULL -- coverage exists, but status is null or unknown
|
|
|
+WHERE cl.shadow_pro_id IS NULL
|
|
|
+ AND (cl.latest_client_primary_coverage_id IS NOT NULL -- coverage exists, but status is null or unknown
|
|
|
AND (
|
|
|
(cpc.plan_type = 'MEDICARE' AND (cpc.is_partbprimary = 'UNKNOWN' OR cpc.is_partbprimary IS NULL))
|
|
|
OR
|