Condition equals function not comparing the UUID

So, there’s a couple of considerations here.

I don’t think we want to depend on the UUID for condition identity because of the requirements documented here and here to maintain some kind of audit log and to create a new entry on condition changes. This means that UUID (which is really an identifier for a database row) isn’t sufficient to determine that two conditions are “the same”. (This also means it’s actually an error to have two conditions with the same UUID but different values).

Hence my proposal that we define condition equality on the basis of patient and the (coded or free text) condition field. That way, we can identify as “the same” references to the same condition for the same patient regardless of which row in the database represents them.

However, it’s entirely possible for a patient to have had, say TB, to have had that instance of TB cured, and then to be reinfected. In that case, would we want to have two TB entries, one for the past case and one for the active one or is it sufficient to just maintain the active one in the condition list?

@burke @jteich @mogoodrich @mksd Any thoughts on this?