Page 1 of 1

Best Way to Retrieve Deleted Patients via API

Posted: Fri Feb 21, 2025 1:53 am
by Ummehani
We are looking for the best way to retrieve deleted patients using Open Dental’s API. Based on our findings, Open Dental does not provide a direct API to get deleted patients, as the GET Patients API does not return records with a "Deleted" status.

However, we found that using the Queries PUT ShortQuery API, we can retrieve deleted patient records with the following query:

Code: Select all

{
    "SqlCommand": "SELECT * FROM patient WHERE PatStatus = 4"
}
Before implementing this approach, we wanted to check if there is a more recommended or standard way to retrieve deleted patient records. Is there any other API or method available for this?

Any guidance on retrieving deleted patients via API would be greatly appreciated!

Re: Best Way to Retrieve Deleted Patients via API

Posted: Fri Feb 21, 2025 8:21 am
by justine
Ummehani wrote:
Fri Feb 21, 2025 1:53 am
We are looking for the best way to retrieve deleted patients using Open Dental’s API. Based on our findings, Open Dental does not provide a direct API to get deleted patients, as the GET Patients API does not return records with a "Deleted" status.

However, we found that using the Queries PUT ShortQuery API, we can retrieve deleted patient records with the following query:

Code: Select all

{
    "SqlCommand": "SELECT * FROM patient WHERE PatStatus = 4"
}
Before implementing this approach, we wanted to check if there is a more recommended or standard way to retrieve deleted patient records. Is there any other API or method available for this?

Any guidance on retrieving deleted patients via API would be greatly appreciated!
That'll work.

Re: Best Way to Retrieve Deleted Patients via API

Posted: Wed Mar 12, 2025 5:01 am
by Ummehani
Thank you for the prompt response and confirmation regarding retrieving deleted patients using the PUT ShortQuery API.

We now have another query:
We attempted to delete appointment records using the PUT ShortQuery API with the following query:

Code: Select all

{
    "SqlCommand": "DELETE FROM appointment WHERE AptNum = [AppointmentId]"
}
However, we encountered the following error:

Code: Select all

"Query command must either be read-only or execute on a temporary table."
Since there is no direct DELETE API available for patients or appointments, we would like to know:

What is the recommended approach to delete patient or appointment records using Open Dental’s API?
Is there any alternative method or workaround to perform deletions?
We would greatly appreciate any guidance on how to handle deletions through the API.

Re: Best Way to Retrieve Deleted Patients via API

Posted: Wed Mar 12, 2025 8:27 am
by justine
Ummehani wrote:
Wed Mar 12, 2025 5:01 am
Thank you for the prompt response and confirmation regarding retrieving deleted patients using the PUT ShortQuery API.

We now have another query:
We attempted to delete appointment records using the PUT ShortQuery API with the following query:

Code: Select all

{
    "SqlCommand": "DELETE FROM appointment WHERE AptNum = [AppointmentId]"
}
However, we encountered the following error:

Code: Select all

"Query command must either be read-only or execute on a temporary table."
Since there is no direct DELETE API available for patients or appointments, we would like to know:

What is the recommended approach to delete patient or appointment records using Open Dental’s API?
Is there any alternative method or workaround to perform deletions?
We would greatly appreciate any guidance on how to handle deletions through the API.
Hello Ummehani,

Appointments and Patients are never deleted in Open Dental.

Thanks!