ctsit / form_render_skip_logic

This REDCap module hides and shows instruments based on the value of a single field on a single form - i.e. a branching logic for instruments.
Other
6 stars 17 forks source link

Advanced Control Field should continue to handle Smart Variables #74

Open pbchase opened 4 years ago

pbchase commented 4 years ago

In release 3.3.8, we declared that the Advanced Control Field is deprecated. I think this statement misses the reality of the issue with the advanced control field and exaggerates the problem. We need deprecate field logic and keep smart variables.

The problem was that field logic testing was eating our lunch when the product of record, form and event counts got high. The API call that processes field logic is too expensive to run at every page load across thousands of record form event combinations. We tried to optimize this but could barely improve the page load time. Yet taking the calculations out of the advanced control field and instead referencing a field that had the same calculation works fine, because each of the accessed fields was already pre-calculated and stored.

Smart Variables work fine in advanced control fields because they cost about the same as a field lookup.

I think we need to change the text in the warning to say something like "Warning: the use of equations in the Advanced Control Field is deprecated for performance reasons. It will be removed in a future version of this module." Later, we should remove the ability to process calculated fields, not smart variables.

mschulze0 commented 4 years ago

@pbchase if that's the case you might as well turn it into a drop-down menu with pre-set smart variables. Having a text input field where you can only input one variable would be confusing