|
@@ -3638,15 +3638,15 @@ ORDER BY c.name_last, c.name_first
|
|
|
n.visit_number,
|
|
|
ROUND(b.number_of_units * 60) as minutes,
|
|
|
|
|
|
- n.note_reason_icd1 AS icd1,
|
|
|
- n.note_reason_icd1description AS icd1description,
|
|
|
- n.note_reason_icd2 AS icd2,
|
|
|
- n.note_reason_icd2description AS icd2description,
|
|
|
- n.note_reason_icd3 AS icd3,
|
|
|
- n.note_reason_icd3description AS icd3description,
|
|
|
- n.note_reason_icd4 AS icd4,
|
|
|
- n.note_reason_icd4description AS icd4description,
|
|
|
- n.note_reason_memo AS icd_memo
|
|
|
+ n.note_reason_icd1 AS icd1,
|
|
|
+ n.note_reason_icd1description AS icd1description,
|
|
|
+ n.note_reason_icd2 AS icd2,
|
|
|
+ n.note_reason_icd2description AS icd2description,
|
|
|
+ n.note_reason_icd3 AS icd3,
|
|
|
+ n.note_reason_icd3description AS icd3description,
|
|
|
+ n.note_reason_icd4 AS icd4,
|
|
|
+ n.note_reason_icd4description AS icd4description,
|
|
|
+ n.note_reason_memo AS icd_memo
|
|
|
|
|
|
";
|
|
|
$from = "FROM note AS n
|
|
@@ -3669,9 +3669,9 @@ ORDER BY c.name_last, c.name_first
|
|
|
c.name_last NOT ILIKE '%test%' AND
|
|
|
n.id IN (SELECT note_id FROM bill WHERE code ILIKE '%treatment%' AND bill.is_cancelled IS NOT TRUE AND note_id IS NOT NULL) AND
|
|
|
-- n.id NOT IN (SELECT note_id FROM claim WHERE note_id IS NOT NULL) AND
|
|
|
- c.is_part_b_primary = 'YES' AND
|
|
|
- c.latest_eligible_refresh_at::DATE >= '2022-01-01' AND
|
|
|
- c.mpb_remaining = 0 -- AND
|
|
|
+ c.is_part_b_primary <> 'YES' -- AND
|
|
|
+ -- c.latest_eligible_refresh_at::DATE >= '2022-01-01' AND
|
|
|
+ -- c.mpb_remaining = 0 -- AND
|
|
|
-- c.created_at::DATE >= '2022-01-01'::DATE
|
|
|
";
|
|
|
$filters = [];
|