Important Content Update Message
We are currently updating the OP Help Center content for the release of OP 20. OP 20 (official version 20.0.x) is the certified, 2015 Edition, version of the Office Practicum software. This is displayed in your software (Help tab > About) and in the Help Center tab labeled Version 20.0. We appreciate your patience as we continue to update all of our content.

SQL: Referral Review

About

This report shows the following information:
  • Patient chart number
  • First name
  • Last name
  • Location
  • Referral date
  • Provider to whom patient was referred
  • Referral category/type
  • Dx code(s)
  • Referring provider
  • Status of referral

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

None.

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select patno, fname, lname, loc_name, date1 as referral_date, refmd, refmdspecialty as category, dx, dx2, p_md as referring_provider, status
 from referalletter  rl
inner join register r on r.patno = rl.patno
inner join location on location.id = r.loc_id
where date1 between :Start_Date and :end_Date and custom1 = 'REFERRAL'