Retrieve deleted Appointments for syncing

For requests or help with our API
Post Reply
thjomha
Posts: 4
Joined: Tue Dec 26, 2023 9:29 pm

Retrieve deleted Appointments for syncing

Post by thjomha » Mon Jan 15, 2024 10:25 am

I am writing a module that synchronises my local database with a list of appointments and schedules. I will use DataTStamp to only update/add appointments that have changed since the last sync. The problem is that deleted appointments are just removed instead of changing to status 'deleted'...so I am not sure what the most efficient way to sync deleted appointments would be.

I considered SecurityLog->PermType=237, but the AptNum does not populate in the FKey). I could just search for missing AptNum in the sequence but I am trying to limit API calls and bandwidth since the program will update on intervals as short as 5 min.

Any advice? Has anyone written an open source database sync they are willing to share?

Taha

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

Re: Retrieve deleted Appointments for syncing

Post by DerekR » Mon Jan 15, 2024 10:38 am

When an appointment is deleted and removed from the appointment table, an entry is made in the histappointment table indicating that the appointment was deleted when the HistApptAction field equals "Deleted". See HistAppointments GET (multiple) for more details.

Another option would be to utilize API Events, and more specifically, the Database Events to keep track of deleted appointments.

Thanks!

Post Reply