ProcedureLogs Date Range

For requests or help with our API
Post Reply
paulwilliamsdds
Posts: 2
Joined: Thu Feb 09, 2023 1:44 pm

ProcedureLogs Date Range

Post by paulwilliamsdds » Thu Feb 09, 2023 2:02 pm

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}'`;

SLeon
Posts: 480
Joined: Mon Mar 01, 2021 10:00 am

Re: ProcedureLogs Date Range

Post by SLeon » Fri Feb 10, 2023 9:04 am

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.

Post Reply