When using the 'Minimum value' or 'Maximum value' options, the result could be incorrect if at some point in the process 0 is the min/max on the non-last instance of a repeating instrument. Please find below 2 examples to clarify.
In both examples, $thisRecValue is equal to 0 when instance 3 is evaluated. Since 0 == '' in PHP, the value from instance 3 is automatically taken as the $thisRecValue, making the EM disregard all previous instances.
If I am not mistaken, changing the operator == to === should solve the issue without breaking any other functionality.
Thanks @lsgs for your continued support of this EM that is much in demand at our institution!
When using the 'Minimum value' or 'Maximum value' options, the result could be incorrect if at some point in the process 0 is the min/max on the non-last instance of a repeating instrument. Please find below 2 examples to clarify.
Example 1: option 'Minimum value'
Example 2: option 'Maximum value'
I am seeing this behaviour using REDCap 13.7.30 and EM version 2.1.0, but I think this bug has been there since EM version 2.0.0 and is linked to the lines below: https://github.com/lsgs/redcap-extended-reports/blob/c35fe00799059d2a8fa903c5b72aa108e9f49c56/Report.php#L813 https://github.com/lsgs/redcap-extended-reports/blob/c35fe00799059d2a8fa903c5b72aa108e9f49c56/Report.php#L820
In both examples, $thisRecValue is equal to 0 when instance 3 is evaluated. Since 0 == '' in PHP, the value from instance 3 is automatically taken as the $thisRecValue, making the EM disregard all previous instances.
If I am not mistaken, changing the operator == to === should solve the issue without breaking any other functionality.
Thanks @lsgs for your continued support of this EM that is much in demand at our institution!