Anesthetic medications delivered query for Anesthesia Module

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Anesthetic medications delivered query for Anesthesia Module

Post by wjstarck » Fri Mar 11, 2011 4:05 pm

Here is a query that will output the patient demographic data, Anesthetic Med Name, Qty Given and Qty Wasted for a given time period:

Code: Select all

SELECT anestheticrecord.AnestheticRecordNum,anestheticrecord.AnestheticDate, patient.PatNum as 'Patient#',patient.LName,patient.FName,
patient.Gender,patient.Birthdate,patient.Address,patient.Address2,patient.City,patient.Zip,patient.HmPhone,patient.WirelessPhone,
anesthmedsgiven.AnesthMedName,anesthmedsgiven.QtyGiven,anesthmedsgiven.QtyWasted
FROM anestheticrecord
LEFT JOIN anesthmedsgiven ON anesthmedsgiven.AnestheticRecordNum = anestheticrecord.AnestheticRecordNum 
LEFT JOIN patient ON patient.PatNum = anestheticrecord.PatNum
WHERE DATE_FORMAT(anestheticdate,'%Y-%m-%d') >= '2011-01-01' AND DATE_FORMAT(anestheticdate,'%Y-%m-%d') <= '2011-03-31'
ORDER BY anestheticdate ASC
Just copy and paste this into the box at the top of Reports > User Query and click 'Submit Query'. This report would give you all the meds delivered in the first quarter of this year. For different time periods just change the date ranges. It sorts ascending, so if you want descending sort, just change the 'ASC' to 'DESC'.

If you want to pretty up the output, click the 'Export' button in the lower right of the User Query window and save it as a .xls file. Then you can open it in Excel and format it however you like.

If anyone needs any other type of Anesthesia-related queries for their practice, just let me know.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

Roy Bloom
Posts: 79
Joined: Fri Jul 27, 2007 5:46 pm
Location: Spring Texas
Contact:

Re: Anesthetic medications delivered query for Anesthesia Module

Post by Roy Bloom » Wed Apr 13, 2011 8:26 am

Thanks Bill.
[img]C:\Users\Roy%20Bloom%20DDS\Pictures\Roy.jpg[/img]


Roy Bloom DDS
General Dentist Providing IV Sedation and Oral Surgery for Your Patients at Your Practice.

http://sedationoncall.com
http://drbloom.com

Post Reply