Personal tools
You are here: Home / OSCAR Users / EMR and Case Management Resources / Query By Example - Database Searches / query by example to find patients whose most recent A1C is > 7%
 

query by example to find patients whose most recent A1C is > 7%

From Ian Pun: I wrote this query by example to find patients whose most recent A1C is > 7% so I can bring them put them more in line with CDA guidelines of <7% (with more aggressive therapy in certain individuals and more lax with frail elderly or terminal patients) http://guidelines.diabetes.ca/bloodglucoselowering/a1ctarget Ian

Plain Text icon Most Recent A1c over 7 QBE.txt — Plain Text, 740 bytes

File contents

<query>
select * from
(
select * from (
select  l.demographicNo ,
concat (" ", d.chart_no , "
<\"../demographic/demographiccontrol.jsp?keyword=",d.chart_no,"&orderby=last_name%2+first_name&dboperation=search_titlename&limit1=0&limit2=10&displaymode=Search&ptstatus=active&displaymode=Search&search_mode=search_chart_no\"target=\"blank\">
") as chart,
l.dateObserved,  d.last_name, d.first_name, l.type, l.dataField
FROM measurements l, demographic d
WHERE d.patient_status = "AC" and l.demographicNo = d.demographic_no and ( l.type like '%A1C%')
ORDER BY  demographic_no, dateObserved desc  )
 as t1  group by demographicNo order by dateObserved )
 as t2 where (dataField > 0.07 and datafield <= 1) or datafield > 7 ;
</query>

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)