Patients Seen In Period With Insurance And Provider


Back to Query Directory


Is there a query that will list all clients that were seen in a certain time frame along with name of insurance for a specific provider?

Adjust the desired date range and provider code in the WHERE clause below.

SELECT DISTINCT
  a.lastname,
  a.firstname,
  a.id,
  a.provcode,
  (IF c.payortype = 'I' THEN c.payorname ELSE '' ENDIF) AS "Insurance"
FROM
  rv_charges a
  JOIN ptpayors b ON a.ptpayornum = b.ptpayornum
  JOIN payors c ON b.payornum = c.payornum
WHERE
  trandate BETWEEN '2002-01-01' AND '2002-01-31'
  AND a.provcode = '3'
ORDER BY
  a.lastname, a.firstname, a.id




CategoryQueries
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki