Skip to content

[redcap/tools] ip_output_builder and redcap2linst terminal tag remove - #10826

Open
regisoc wants to merge 15 commits into
aces:29.0-releasefrom
regisoc:20260706_redcap2linst_terminal_tag_remove
Open

[redcap/tools] ip_output_builder and redcap2linst terminal tag remove#10826
regisoc wants to merge 15 commits into
aces:29.0-releasefrom
regisoc:20260706_redcap2linst_terminal_tag_remove

Conversation

@regisoc

@regisoc regisoc commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Brief summary of changes

  • removes the {-@-} tag from redcap2linst tool so instruments will be created without it.
  • adds a new ip_output_builder.php to generate ip_output.txt file for all instruments (LINST and PHP).
    • based on CBIG builder.
    • kept the parseElements() function from lorisform_parser.
    • added {-@-} tag at the end of each instrument parsing/copying.
    • added --add-linst option to add linst instrument in ip_output.txt.
    • added --add-meta option to prepend the linst corresponding .meta file in ip_output.txt when it exists.
    • added --one-instrument=INST option to only run the process on one instrument.
  • deprecates lorisform_parser.sh in favour of ip_output_builder.php.

Documentation:

  • Have you updated related documentation?

Testing instructions (if applicable)

  1. Run tools/redcap2linst.php with REDCap instrument/API.
  2. Run tools/ip_output_builder.php with the different arguments.
  3. Check that other tools using the ip_output.txt file are successful.

Link(s) to related issue(s)

@github-actions github-actions Bot added the Language: PHP PR or issue that update PHP code label Jul 7, 2026
@regisoc regisoc added Category: Bug PR or issue that aims to report or fix a bug Category: Cleanup PR or issue introducing/requiring at least one clean-up operation Area: Instruments PR or issue related instruments Module: redcap PR or issue related to redcap module 29.0.0 - Bugs Issues found during the release testing for 29.0.0 labels Jul 7, 2026
@github-actions github-actions Bot added the Module: datadict PR or issue related to (old) datadict module label Jul 7, 2026
@CamilleBeau CamilleBeau added the Critical to release PR or issue is key for the release to which it has been assigned label Jul 13, 2026
@CamilleBeau
CamilleBeau requested a review from MaximeBICMTL July 13, 2026 18:08
@regisoc regisoc removed the Critical to release PR or issue is key for the release to which it has been assigned label Jul 21, 2026
Comment thread tools/ip_output_builder.php Outdated
Comment thread tools/ip_output_builder.php Outdated
Co-authored-by: Michael Lapadula <lapadula.michael@courrier.uqam.ca>

@lapadulamichael lapadulamichael left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also getting this error when trying to run tools/generate_tables_sql.php

PHP Fatal error:  Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /var/www/loris/tools/generate_tables_sql.php:43
Stack trace:
#0 /var/www/loris/tools/generate_tables_sql.php(43): preg_match()
#1 {main}
  thrown in /var/www/loris/tools/generate_tables_sql.php on line 43

and this one when trying to run tools/generate_tables_sql_and_testNames.php

Filename: /var/www/loris/tools/../project/tables_sql/aosi.sql
Filename: /var/www/loris/tools/../project/tables_sql/medical_history.sql
Filename: /var/www/loris/tools/../project/tables_sql/mri_parameter_form.sql
Filename: /var/www/loris/tools/../project/tables_sql/radiology_review.sql
PHP Warning:  Undefined array key 1 in /var/www/loris/tools/generate_tables_sql_and_testNames.php on line 38
PHP Fatal error:  Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /var/www/loris/tools/generate_tables_sql_and_testNames.php:38
Stack trace:
#0 /var/www/loris/tools/generate_tables_sql_and_testNames.php(38): preg_match()
#1 {main}
  thrown in /var/www/loris/tools/generate_tables_sql_and_testNames.php on line 38

@lapadulamichael lapadulamichael added the State: Needs work PR awaiting additional work by the author to proceed label Jul 30, 2026
@regisoc

regisoc commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

fixed.

@regisoc

regisoc commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

@lapadulamichael ready for another round.

@lapadulamichael
lapadulamichael self-requested a review July 31, 2026 13:46
@lapadulamichael

Copy link
Copy Markdown
Contributor

@regisoc ip_output_builder.php and the scripts that use it seem to work perfectly fine.

Should we also update the documentation mentioning lorisform_parser here?

@regisoc

regisoc commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

@lapadulamichael nice catch, I might have forgotten the recursive flag in grep, thanks!

@lapadulamichael lapadulamichael left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@regisoc

regisoc commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Updating assignee to @driusan for final review.

@regisoc regisoc removed the State: Needs work PR awaiting additional work by the author to proceed label Jul 31, 2026
@MaximeBICMTL
MaximeBICMTL removed their request for review July 31, 2026 15:48
@MaximeBICMTL

Copy link
Copy Markdown
Contributor

The REDCap part is minimal in that PR but looks fine to me. For the rest, I am not really familiar with that part of the codebase, especially the handling of non-JSON instruments, so trusting @lapadulamichael's and others review. No objection on my part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

29.0.0 - Bugs Issues found during the release testing for 29.0.0 Area: Instruments PR or issue related instruments Category: Bug PR or issue that aims to report or fix a bug Category: Cleanup PR or issue introducing/requiring at least one clean-up operation Language: PHP PR or issue that update PHP code Module: datadict PR or issue related to (old) datadict module Module: redcap PR or issue related to redcap module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants