The goal is to make it so that when we have a naturally one-to-one visit observation, we only define one visit dimension record, and associate with both the one-to-one visit system and the metadata-based visit system (since they agree).
This is mostly a dimensions configuration change, as far as daf_butler goes:
- remove visit_system from the implied dependencies of visit
- remove visit_system from the implied dependencies of visit_definition
- add a new dimension element, "visit_system_membership", with a required dependency on both visit and visit_system
But it also changes DefineVisitsTask pretty substantially; instead of blindly defining a new visit for the visit_system it was configured with, it should now be checking to see if an existing visit definition might be compatible with the one it would define, and if so, it's really just tagging the visit as belonging to its visit_system as well. There could be some tricky multi-row "update the database only if I would change it" logic that would need support upstream in daf_butler.
This ticket is an alternative to
DM-33703 and is incompatible with it.