Page 1 of 1

ProcedureLogs Date Range

Posted: Thu Feb 09, 2023 2:02 pm
by paulwilliamsdds
The current API's ProcedureLogs endpoint doesn't allow for a date range.
It was suggested by OpenDental to use the Queries endpoint instead.


The queries endpoint is a little out of my scope.

Could someone please tell me if the following has the correct SQL syntax for the db?

sqlCommand = `SELECT PatNum, ProcDate,ProcFee,Surf,ToothNum,CodeNum FROM procedurelog WHERE ProcDate < '${end}' AND ProcDate > '${start}' AND ProcStatus = '2' AND ProvNum= '${provider}'`;

Re: ProcedureLogs Date Range

Posted: Fri Feb 10, 2023 9:04 am
by SLeon
Good morning,

Are you getting an error when you send this command with real data? You will want to put your SqlCommand in double quotes, not single as shown in your post. For example, using Queries PUT ShortQuery with the payload:

Code: Select all

{
   "SqlCommand": "SELECT PatNum,ProcDate,ProcFee,Surf,ToothNum,CodeNum FROM procedurelog WHERE ProcDate < '2020-10-31' AND ProcDate > '2020-10-25' AND ProcStatus = '1' AND ProvNum= '3' "
}
with our public demo dental office credentials successfully returns a short list of procedures.

I also recommend looking at Open Dental's Query Examples page for commonly used queries.