I'm trying to calculate the "last interaction" timestamp for a patient, considering new readings, chats with practitioners, and appointments. I'm wondering how to efficiently retrieve and combine data from these different resource types, and how to determine the latest timestamp among them.
Any guidance on the best approach would be greatly appreciated!