|
@@ -519,16 +519,16 @@ 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.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
+WHERE cl.shadow_pro_id IS NULL AND cl.effective_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
))[0]->cnt;
|
|
|
|
|
|
// patients pending coverage verification
|
|
|
$keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
|
|
|
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
|
|
|
+ LEFT JOIN client_primary_coverage cpc ON cl.effective_client_primary_coverage_id = cpc.id
|
|
|
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 (cl.effective_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
|
|
@@ -900,16 +900,16 @@ 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.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
+WHERE cl.shadow_pro_id IS NULL AND cl.effective_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
))[0]->cnt;
|
|
|
|
|
|
// patients pending coverage verification
|
|
|
$keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
|
|
|
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
|
|
|
+ LEFT JOIN client_primary_coverage cpc ON cl.effective_client_primary_coverage_id = cpc.id
|
|
|
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 (cl.effective_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
|
|
@@ -1355,16 +1355,16 @@ 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.shadow_pro_id IS NULL AND cl.latest_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
+WHERE cl.shadow_pro_id IS NULL AND cl.effective_client_primary_coverage_id IS NULL -- no coverage record"
|
|
|
))[0]->cnt;
|
|
|
|
|
|
// patients pending coverage verification
|
|
|
$keyNumbers['patientsPendingCoverageVerification'] = DB::select(DB::raw("
|
|
|
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
|
|
|
+ LEFT JOIN client_primary_coverage cpc ON cl.effective_client_primary_coverage_id = cpc.id
|
|
|
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 (cl.effective_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
|