Loris icon indicating copy to clipboard operation
Loris copied to clipboard

REDCap module improvements

Open MaximeBICMTL opened this issue 7 months ago • 1 comments

This PR contains a few small code improvements to the REDCap module. It does not change the behavior of the module, but it will be followed up by another PR that adds automatic session creation when new data is received from REDCap.

List of changes:

  • Extract REDCap / LORIS mapping methods from RedcapNotificationHandler to a new RedcapMapper class, allowing to use those methods without a REDCap notification, which is useful to write a clean REDCap bulk import script.
  • Move the getIssueAssignee() method from the RedcapConfigParser class to the RedcapQueries (previously Queries) class, as the REDCap issue assignee has previously been moved from the XML configuration to the database.
  • Correctly rename all relevant variables and methods to match REDCap "event names" and "unique event names". In REDCap, an "event name" is the user-facing name of an event, whereas a "unique event name" is the internal identifier of an event used in most REDCap API routes. The REDCap API naming is a little confusing on that matter. The differences are now correctly reflected in our code.
  • Rename some variables for better code expliciteness and consistency (example: $instrument -> $instrument_name, snake_case as it is the most used convention in the module).

I can go back on some of these changes if someone disagrees.

I have not tested the PR yet (hence why is it a draft) as I will test it together with the automatic visit registration. Nevertheless it is mostly renaming or moving things around so it should be pretty final.

I targeted the 27.0-release branch as it is where the REDCap module is currently merged, we might prefer to include it in the 28.0 release cycle though. I think it depends on what C-BIG and IBIS prefer regarding version management and update.

MaximeBICMTL avatar Jun 07 '25 09:06 MaximeBICMTL

As discussed in PR assignment call, this should be for 28 and should be rebased to main

CamilleBeau avatar Jun 09 '25 19:06 CamilleBeau

@driusan ready for final review.

regisoc avatar Jul 07 '25 14:07 regisoc