Report on the currently selected patient

For complex topics that regular users would not be interested in. For power users and database administrators.

Report on the currently selected patient

Postby Hersheydmd » Sat Sep 10, 2016 10:49 pm

To create a custom report for a particular patient you need to insert the patnum into the Where statement of the query.
select patnum from patient
where patnum = '0999'

Is there any way to write the query in such a way as it can pull the current selected patient? The audit trail has a button to select the Current Patient, so I would think we should be able to write a query that can detect the Current Patient as well, no?
Robert M Hersh DMD, FAGD
Univ. of Penn 1982
Brooklyn, NY 11234
User avatar
Posts: 684
Joined: Sun May 03, 2009 9:12 pm

Re: Report on the currently selected patient

Postby jsalmon » Mon Sep 12, 2016 9:45 am

There is a way. It would entail adding code to replace some predetermined string (e.g. [PatNum] ) within the query string that Open Dental would go through and replace with the actual value of whatever patient is currently selected. There currently isn't such a thing in place and would require a feature request:
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
User avatar
Posts: 1486
Joined: Tue Nov 30, 2010 1:33 pm

Re: Report on the currently selected patient

Postby dgraffeo » Mon Sep 12, 2016 9:47 am

Very interesting. It is doable, there are several places in the program such as the appointment reminder text where we substitute entered phrases with certain fields pulled from the program. For instance, we could make it so all instances of [[SelectedPat]] in the query text were replaced with the currently selected patnum. I don't think it'd be particularly difficult, but will require a feature request as that's introducing nice new functionality into the program

Edit: Jason beat me to it :lol:
"To understand what recursion is, you must first understand recursion."

David Graffeo
Open Dental Software
User avatar
Posts: 147
Joined: Wed Sep 24, 2014 3:19 pm

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 4 guests