HistoryDateTime for Patient type

Apr 26, 2016 at 6:11 PM
Edited Apr 26, 2016 at 6:23 PM
Hello,
I am looking for an API class to track changes by users. For the Patient class, what changes will count as modifications for the HistoryDateTime property? It doesn't seem to change if the structure sets or plans change for a given patient.

Also, when you loop through to find the patient summaries (e.g. foreach (var patient summary in app.PatientSummaries)), what is the order of the query? Does it search from the most recently created patient summaries to the oldest?

Thank you for your help
Coordinator
May 22, 2016 at 4:35 PM
I don't know the exact answers to your questions, but I can make some educated guesses.

For your first question, the HistoryDateTime property probably returns the data in the corresponding field of the Patient table in the ARIA database. This would mean that the HistoryDateTime property changes only when any field in the Patient table is modified. This would explain why a change in the structure sets or plans doesn't cause the HistoryDateTime property to change: they're in different tables.

For your second question, it appears that the order is the same as the order the patient was added to the database. (I did a database query and the top ten patients matched the top ten patient summaries.) If you want to ensure a specific order, you can use the LINQ extension method OrderBy:
// Order by Id
var patients = app.PatientSummaries.OrderBy(ps => ps.Id);

// Order by creation time
var patients = app.PatientSummaries.OrderBy(ps => ps.CreationDateTime);