Is there a report or query that we can run that will give us a list of the active patients with a zero balance and no activity within the last 31 days?
In the following query you can adjust the desired period of inactivity by simply changing “31” in the WHERE clause to some other number of days. If you want to sort by primary provider, just change the ORDER BY clause as in the second version below.
(For a related query that returns more information, see http://www.sosoft.com/queries/2014/07/27/716/)
SELECT
"Name/ID",
lfeedate AS "Last Service",
priprvcode AS "Primary Provider"
FROM
sos.rv_patients a
JOIN sos.PatientBalance b ON a.ptnum = b.ptnum
WHERE
flag = 0
AND lfeedate < ( TODAY() - 31 )
AND b.ptbalance = 0
AND a.dischargedate IS NULL
ORDER BY "name/id"