Deleted patient

For requests or help with our API
Post Reply
saskia
Posts: 69
Joined: Tue Apr 04, 2023 8:31 am

Deleted patient

Post by saskia » Tue Dec 03, 2024 10:52 am

We pull in patient demographic data via GET /patients/Simple however I can't figure out how we can see if a patient has been deleted. We have some clients who do occasionally delete patients (accidental duplicates usually) but we end up with two records that appear 'live' because I'm not seeing anything to denote them as deleted (so we keep both records). I saw in another forum the patStatus should show deleted, but I'm not seeing that in the documentation. What am I overlooking?

https://www.opendental.com/site/apipatients.html
PatStatus: Either "Patient", "NonPatient", "Inactive", "Archived", "Deceased", or "Prospective".

justine
Posts: 250
Joined: Tue Dec 28, 2021 7:59 am

Re: Deleted patient

Post by justine » Tue Dec 03, 2024 11:40 am

saskia wrote:
Tue Dec 03, 2024 10:52 am
We pull in patient demographic data via GET /patients/Simple however I can't figure out how we can see if a patient has been deleted. We have some clients who do occasionally delete patients (accidental duplicates usually) but we end up with two records that appear 'live' because I'm not seeing anything to denote them as deleted (so we keep both records). I saw in another forum the patStatus should show deleted, but I'm not seeing that in the documentation. What am I overlooking?

https://www.opendental.com/site/apipatients.html
PatStatus: Either "Patient", "NonPatient", "Inactive", "Archived", "Deceased", or "Prospective".
OD API intentionally filters out patients with a patStatus of 'Deleted'. However, if you were to use GET /patients/Simple and supply a PK of a deleted patient, the return response message would say, "Patient has been deleted." So, if you had two records that appear 'live' and call them both, the deleted one would return that response message. Then you'd know that PK has been deleted. Another solution is for you is to use a ShortQuery and select patients from the database with a deleted status.

Thanks!

saskia
Posts: 69
Joined: Tue Apr 04, 2023 8:31 am

Re: Deleted patient

Post by saskia » Tue Dec 03, 2024 12:41 pm

Gotcha - not a sexy approach when we're making the regular call to GET /patients/Simple to keep our records up to date. Sounds like we'll need to add a call in to check for deleted status. Dumb question - why not include in that endpoint? Why filter it out? Thanks!

DerekR
Posts: 103
Joined: Wed Aug 31, 2022 1:13 pm

Re: Deleted patient

Post by DerekR » Tue Dec 03, 2024 1:31 pm

saskia wrote:
Tue Dec 03, 2024 12:41 pm
Gotcha - not a sexy approach when we're making the regular call to GET /patients/Simple to keep our records up to date. Sounds like we'll need to add a call in to check for deleted status. Dumb question - why not include in that endpoint? Why filter it out? Thanks!
That is a completely valid question! A patient can only be deleted when they have no procedures, claims, payments, procedures attached to claims, or Commlog entries. Once deleted, the patient cannot be accessed from any portion of the program. Since there is no way to access that patient through Open Dental itself, it was decided to not allow them to be accessed through Open Dentals APIs as well.

Please see the "Delete Patient" sections of our Family Module documentation for more information.

Thanks!

saskia
Posts: 69
Joined: Tue Apr 04, 2023 8:31 am

Re: Deleted patient

Post by saskia » Tue Dec 03, 2024 1:39 pm

I see how that makes sense. On the flip side we end up with incorrect data because we don't even know it was deleted since it becomes inaccessible once it's deleted. Isn't circular logic fun? Ha! Thanks for your help! I guess we'll have to make a call every so often to get a list of deleted patients and make sure we (soft) delete them on our side too.

Post Reply