[redcap] automatic record_id field name registering#10733
Conversation
There was a problem hiding this comment.
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.
|
@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. |
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)
Testing instructions (if applicable)
Link(s) to related issue(s)
record_idnot a correct field in REDCap #10670