redcapAPI icon indicating copy to clipboard operation
redcapAPI copied to clipboard

parseBranchingLogic concatenates arm and field

Open gvds opened this issue 4 years ago • 1 comments

When a field is specified within a particular arm in branching logic (e.g. [screening_arm_4][co_enrol_report]), parseBranchingLogic concatenates these as 'screening_arm_4co_enrol_report' with the result that attempting to evaluate the rule (e.g. with(allrecords, eval(l)) ) returns an object not found error.

gvds avatar Sep 27 '21 16:09 gvds

I don't recall branching logic over forms/arms was a feature when I first wrote parseBranchingLogic.

I'm not quite sure how we would get this to work in redcapAPI. I think the example you give translates to

redcap_event_name == "screening_arm_4" && co_enrol_report == [value]. But you'd also have to match the record ID. In essence, the branching logic affecting a field in row a is going to be dependent on values in row b. That isn't how we normally operate with data frames. Could be pretty tricky.

nutterb avatar Mar 21 '23 15:03 nutterb