Thanks, everybody. I don't think I completely understand what's going on, but I 
found insurance company names and such in there.

The query below gave me counts of some kind of account type name that looks 
relevant, though some 90% are null:

"10^"                         "NAME"                        
"6.5"                         ""                            
"5.6"                         "Personal/Family"             
"5.2"                         "Interface"                   
"3.7"                         "Transplant"                  
"3.1"                         "Workers Comp"                
"2.8"                         "Third Party Liability"       
"1.3"                         "Other"                       
"1"                           "Clearing Account"            
"0"                           "Corporate"                   


I don't know how to pick out clinic visits off hand, though.

select round(log(10, count(*)), 1) "10^", name from (
select pe.PAT_ENC_CSN_ID, pe.contact_date, pc.pat_id, pc.line, pc.account_id, 
pc.serv_area_id, zat.name, pc.fin_class
     , payor.payor_name
from pat_enc pe
left join PAT_ACCT_CVG pc on pc.pat_id = pe.pat_id and pc.ACCOUNT_ID = 
pe.ACCOUNT_ID
left join zc_account_type zat on zat.account_type_c = pc.account_type_c
left JOIN COVERAGE c ON c.COVERAGE_ID = pc.COVERAGE_ID
left join clarity_epm payor on payor.payor_id = c.PAYOR_ID
where pe.contact_date > to_date('2013-01-01', 'YYYY-MM-DD')
)
group by name
order by 1 desc
;

-- 
Dan
_______________________________________________
Gpc-dev mailing list
[email protected]
http://listserv.kumc.edu/mailman/listinfo/gpc-dev

Reply via email to