Skip to content

[redcap] automatic record_id field name registering#10733

Open
regisoc wants to merge 5 commits into
aces:29.0-releasefrom
regisoc:20260701_redcap_record_id_generalized
Open

[redcap] automatic record_id field name registering#10733
regisoc wants to merge 5 commits into
aces:29.0-releasefrom
regisoc:20260701_redcap_record_id_generalized

Conversation

@regisoc

@regisoc regisoc commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Brief summary of changes

This PR adds the generic unique identifier field automatic detection.
Following the current REDCap rules, the project unique identifier field is defined as "the first field of the first instrument, and if not using a template, the default is 'Record ID' [record_id]".
This field name is then used for any REDCap export data query, to include other hidden metadata fields in the response (see documentation)

  • Have you updated related documentation?

Testing instructions (if applicable)

  1. have a multiple instances redcap setup.
  2. try exporting data from several instances having different unique identifier fields.

Link(s) to related issue(s)

@regisoc regisoc added Category: Bug PR or issue that aims to report or fix a bug Category: Feature PR or issue that aims to introduce a new feature Area: API PR or issue related to the API Language: PHP PR or issue that update PHP code 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 1, 2026

@MaximeBICMTL MaximeBICMTL 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.

Thanks for tackling that problem! I don't know if this PR is ready for review yet (if not you can make it a draft!), but it seems the implementation does not match the documentation.

The documentation says the record ID field is the first field of the project, while the implementation looks for the field labeled "Record ID".

I don't have a project to test it, but I think this is problematic, as based on what I found, the label can be renamed.

https://guides.temple.edu/c.php?g=936400&p=9135151

The Record ID field is a unique field that is always the first field in the project and is mostly not modifiable. Users can rename the Record ID field, so some users call it a Study ID or something else.

When you are in the editing field window, you can edit the Field Label, the Variable Name, add validation, and note if the field is an identifier.

I think the code should use the first field of the project data dictionary rather than be based on the field label.

Comment thread modules/redcap/php/client/redcaphttpclient.class.inc Outdated
@regisoc

regisoc commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@MaximeBICMTL I wrote that in the description, but somehow it was not reflected in the code. Thanks for this point, I updated it. Ready for review.

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: API PR or issue related to the API Area: Instruments PR or issue related instruments Category: Bug PR or issue that aims to report or fix a bug Category: Feature PR or issue that aims to introduce a new feature Language: PHP PR or issue that update PHP code Module: redcap PR or issue related to redcap module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants