Retrieve Patient/Appointment Data with Custom Fields in a Single API Call

For requests or help with our API
Post Reply
Ummehani
Posts: 16
Joined: Fri May 24, 2024 2:27 am

Retrieve Patient/Appointment Data with Custom Fields in a Single API Call

Post by Ummehani » Fri Mar 28, 2025 4:29 am

I am working with the Open Dental API and need to retrieve patient and appointment details, including data stored in custom fields (PatFields and ApptFields). Currently, I see that:

- The Patients API returns standard patient details but does not include PatFields.
- The Appointments API retrieves appointment details but does not include ApptFields.
- To get custom fields, I need to make separate calls to PatFields (GET /patfields) and ApptFields (GET /apptfields).

Is there any way to retrieve patient or appointment data along with their respective custom fields (PatFields for patients and ApptFields for appointments) in a single API request? If not, is there any recommended best practice to optimize multiple API calls efficiently?

Any guidance would be appreciated!

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

Re: Retrieve Patient/Appointment Data with Custom Fields in a Single API Call

Post by SLeon » Fri Mar 28, 2025 8:13 am

I moved your post to the API forum for visibility.

The Open Dental API is schema based, meaning each one of our resources maps directly to a database table. The Patients GET endpoint only returns data from that table, for example. There is rare exception to this design philosophy.

There are a few "module" based endpoints that return an aggregate of data the OpenDental.exe displays in the UI. FamilyModules GET Insurance is a great example of this. It returns a small amount of relevant data from several database tables. However if you needed additional data, you would need to make subsequent API calls to obtain it.

API calls take less than a second to execute so querying multiple API endpoints back-to-back is very rarely an issues. Many developers will frontload data grabs, caching data that infrequently changes (such as Definitions or Preferences), etc..

For the patient/appointment data you mention, it might makes sense to need specific/custom data from several tables all at once instead of assembling it yourself. In these cases, I recommend the Queries PUT ShortQuery endpoint. You can write your query to get exactly what you need, nothing more nothing less, all in one API call.

Post Reply