All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.
SELECT 'Charge' AS txntype, dos as date, pfirst+' '+plast as patientname, 'charge to account' AS description, SUM(amount) AS amount, 'Medical Oncology' AS physicianid, encountercode as practclaimid, '0' as priority, '' AS cpt, '' AS toppriority, '' AS balance, dos AS firstdos FROM [PCAR_Data].[dbo].[txn] WHERE type='C' AND accountid=9949388 GROUP BY encountercode, dos, pfirst+' '+plast having max(txn.created) > DATEADD(DAY, -45, GETDATE()) UNION SELECT LTRIM( case when type = 'a' then 'Adjustment' when type = 'p' then 'Payment' when type = 'c' then 'Charge' end ) as txntype, [date], patientname, description, amount, physicianid, practclaimid, priority, cpt, case when practclaimid = '' then 1 else 0 end as toppriority, balance, firstdos FROM ( SELECT paymentmethod, payerdesc, type, [date] = case when type = 'c' then dos else posted end, pfirst+' '+plast as patientname, LTRIM( case when type = 'a' then payerdesc when type = 'p' then payerdesc when type = 'c' then ISNULL(cpt, '') +' - '+ ISNULL(left(cptdesc,100),'') end ) as description, amount, 'Medical Oncology' as physicianid, coalesce(cg.encountercode, '') as practclaimid, case when type = 'c' then 0 else 1 end as priority, left(cptdesc,100) as cptdesc, cpt as cpt, (select sum(amount) from txn where t.chargegroupid = txn.chargegroupid and t.accountid = txn.accountid) as balance, (select min(dos) from txn where t.chargegroupid = txn.chargegroupid and t.accountid = txn.accountid and type = 'c') as firstdos FROM txn t left join chargegroup cg on t.chargegroupid = cg.id WHERE type<>'C' AND t.accountid = 9949388 and (cg.status1 not in ('rt','hd','rp','fc') or cg.status1 is null) AND cg.id in ( select chargegroupid from txn where accountid = 9949388 GROUP BY chargegroupid having max(txn.created) > DATEADD(DAY, -45, GETDATE()) ) and reversedref is NULL ) u ORDER BY practclaimid, priority ASC, date
|Shop sales Actual vs Forecast||2||26|
|SQL 2016 Setup - Connectivity Issues||4||14|
|SQL Stored Procedure insert running but not inserting record||40||34|
|How to set up data replication from SQL Server to MySQL?||5||9|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!