Personal tools
You are here: Home / OSCAR Users / EMR and Case Management Resources / Query By Example - Database Searches / Search for patients based on the diagnostic code used at billing
 

Search for patients based on the diagnostic code used at billing

Contributed by Jay Gallagher, Patti Rodger-Kirkpatrick

The Problem:

"I am wanting to write a query that can search for patients based on the diagnostic code used at billing (eg those patients with a diagnostic code of 250). The Query I have looks at the disease registry for those patients." David Page

 

The Query:

 1) From Jay

select last_name,first_name 

from  billingmaster, demographic

where  billingmaster.demographic_no = demographic.demographic_no and  dx_code1 in ('250');


You can replace 250 with any code you want.  If you want to search more than one at a time just add a comma between the codes  eg  ('250','401'); Jay Gallagher

 

2) From Patti

select b.provider_no, b.billing_date, b.demographic_name,bm.dx_code1

from billing b, billingmaster bm

where b.provider_no = '301' and b.billing_no = bm.billing_no and bm.dx_code1 = '250' and b.billing_date > '2005-09-09' order by b.demographic_name


The above will give you the provider, date, name of the patient....for all patients belonging to provider number 301 and who have had the dx code 250 used since September 2005.

Patti Rodger-Kirkpatrick

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)