-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data_dictionary_builder.php unique constraint fix #9201
data_dictionary_builder.php unique constraint fix #9201
Conversation
4eb5df8
to
4591517
Compare
4591517
to
812ec37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tesed and looks good
@laemtl what is the usecase here? In my DB, the Name parameter includes the "sourceFrom" basically on my end Name = sourcefrom+sourcefield |
@ridz1208 Some EEG/MRI pipelines use parameters with the same Name, different SourceFrom since they both import BIDS file parameters. We experienced this issue on HBCD. I guess it's all about how the different pipelines will decide to name the parameters but our only uniqueness guarantee is the one enforced by the db (Name + SourceFrom) |
@driusan I think the better fix here would be to make sure this script is looking at instrument fields in parameter_type. What do you think? |
I still don't understand. There are 2 issues:
|
@driusan in the PR description you mention, it is written that this was discussed during a roadmap meeting so this does not come out of nowhere ;). How do you categorize things as instrument in the parameter_type table? Maybe from the sourceFrom, if the sourceFrom comes from an instrument table, then build data dictionary? |
@driusan also, sourcefrom is linking to |
@cmadjar We can join the table parameter_type_category to filter the instruments. |
Current script implementation does not distinguish instruments vs other parameters in the first query that collects all the parameters, so the first select in the script is failing since we use pselectColWithIndexKey with a non unique key. This is as far as EEG/MRI is involved. |
c5f69b5
to
40a51a6
Compare
Fix the data_dictionary_builder.php script
by enforcing the unique key constraint Name + SourceFrom.by reducing the scope of the main query to instruments. Instruments have unique parameter names, and the script is intended to build a dictionary for instruments.
Error below was encountered with EEG/MRI parameter_file fields.
Error seen when 2 parameter_type entries share the same Name: