Page 1 of 1

Report on the currently selected patient

Posted: Sat Sep 10, 2016 10:49 pm
by Hersheydmd
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?

Re: Report on the currently selected patient

Posted: Mon Sep 12, 2016 9:45 am
by jsalmon
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

Re: Report on the currently selected patient

Posted: Mon Sep 12, 2016 9:47 am
by dgraffeo
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: