Personal tools
You are here: Home / OSCAR Users / EMR and Case Management Resources / Query By Example - Database Searches / Patient appointments in the last year
 

Patient appointments in the last year

Created By Ian Pun - Who is the patient with the most appointments over the last year? Find out with my SQL QUERY! Copy and paste this SQL query into ADMIN->Query by Examples then click on QUERY

Plain Text icon Number of appointments per patient QBE.txt — Plain Text, 290 bytes

File contents

SELECT a.demographic_no ,  concat (dm.last_name,', ', dm.first_name) as
name, COUNT(1) AS count
FROM appointment a   ,  demographic dm 
WHERE  a.demographic_no = dm.demographic_no and a.appointment_date >=
DATE_SUB(NOW(),INTERVAL 1 YEAR)
GROUP BY a.demographic_no
ORDER BY count desc;

Document Actions

 

Download button

DOWNLOAD OSCAR FOR TESTING

 

eForms button

DOWNLOAD SHARED E-FORMS


 Customize button

FIND PLUG-INS AND TWEAKS
FOR YOUR OSCAR EMR

 

Subscribe Button

SUBSCRIBE TO DISCUSSION LIST 
(SEE ALL LISTS)

  

Help button

ACCESS THE ONLINE MANUALS
(PAID SUPPORT)