SQL: Active Patients with PCP and Medical Home

About

This report shows all active patients with the PCP and Medical Home that is selected in the Basic Information of their patient chart. Blank fields indicate that the patient chart does not contain the information.

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

Caveats

  • STAFFNAME is the PCP that is selected in the patient chart.
  • LOC NAME is the Medical Home that is selected in the patient chart.

Code

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

select addr_id, patno, staffname,loc_name from register
left outer join staff1 on staff1.staffid = register.addr_id
left outer join location on location.id = register.loc_id
where status_pat = 'ACTIVE' and patno >=99
order by patno