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.
Ex:
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
https://www.facebook.com/pages/Robert-M-Hersh-DMD/118221471599429
User avatar
Hersheydmd
 
Posts: 681
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:
http://www.opendental.com/manual/featurerequests.html
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com
User avatar
jsalmon
 
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
http://www.opendental.com
User avatar
dgraffeo
 
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 1 guest