The following classes do not have changed_by or date_changed fields. Would love if people could confirm whether any of these classes do not need those fields otherwise I will move on to the next step of the issue and add the fields to the database for the relevant classes.
@cathychen
Thanks! This is great
@dkayiwa@wyclif could you run through these classes and confirm which need changed_by or date_changed fields in the database as @darius is unavailable.
Some of them are weak entities (all the concept collections for instance). I don’t think they need audit attributes per se, because its main entity already has.
I don’t have enough business knowledge to say it, I just expressed an opinion about weak entities.
Technically I’m not even sure that it can be possible to know if a person name has changed, given that the UI sends the whole Person to the business layer. To be really sure if a member of a collection has changed, its attributes shoudl be compared one by one. It seems too complex and the benefit probably not worth it.
That gave me a list of table names preceded with “0” (no changed_by column) or “1” (has changed_by column). Putting that into Sublime Text 3, sorting, and then removing the leading zeroes yielded this list of tables without a changed_by:
Glancing through those and applying what I know off the top of my head about how we use these objects (e.g., we don’t track changes to mappings, we don’t edit obs or orders, etc.), yield this list of potential tables missing changed_by columns:
concept_answer
concept_class
concept_datatype
concept_name
concept_name_tag
concept_reference_source
concept_set
drug_ingredient
encounter_type
field_answer
form_resource
global_property
patient_identifier_type
relationship_type
user_property
Most of these are types (_type, _datatype) or answers (_answer), which we may just overwrite/replace (so wouldn’t need changed_by columns). The five (5) I marked in bold are the most curious to me – i.e., the most likely to benefit from adding changed_by columns.
I agree with Darius suggestions.
ConceptReferenceSource is not updatable in the legacy UI but it’s not enforced in the API, so i would assume it should have the changed_* columns