We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

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'