Loris
Loris copied to clipboard
Refactor mri_protocol into scan_type_identification with similar structure as mri_protocol_checks
Brief summary of changes
This is the LORIS side changes required for the refactoring of the mri_protocol
table to be like mri_protocol_checks
. During an imaging call, it was suggested by @driusan to rename the table to scan_type_identification
to make it clear that the table is used for scan type identification which will avoid future confusion with the mri_protocol_checks
table which validates the protocol of the scan used against some parameters.
Note: because of this naming changes, the mri_protocol_group
, mri_protocol_group_target
and mri_protocol_violated_scans
were renamed to scan_type_identification_group
, scan_type_identification_group_target
and scan_type_identification_failure
to remain consistent and avoid more confusion when looking at the tables.
List of changes:
- [x] modified default schema
- [x] created a patch that adds the
scan_type_identification
andscan_type_identification_failures
tables and alters themri_protocol_group
andmri_protocol_group_target
tables - [x] addition of two scripts that
- [x] populate the new
scan_type_identification
table based on the content ofmri_protocol
- [x] populate the new
scan_type_identification_failures
table based on the content ofmri_protocol_violated_scans
- [x] populate the new
- [x] created a cleanup patch to remove the old
mri_protocol
table - [x] documented the update process in CHANGELOG under Notes for existing projects + in the description of the PR
- [x] modified the MRI violation module where the protocol is displayed (that is going to be fun, LOL)
- [x] updated raisinbread with SQL changes
- [x] checked if those changes affect the API, if so, modify the API code -> no change needed
- [x] checked whether tests need to be updated -> no change needed
- [ ] modify the LORIS-MRI code to use the new table
Testing instructions (if applicable)
- test that the default schema can be sourced
- test the patch
2022-05-17-add-scan_type_identification-table-refactor-mri_protocol-part-1.sql
- run the PHP tool script that populates the
scan_type_identification
table based on the content ofmri_protocol
- test the MRI violations module
Notes for existing projects
mri_protocol
, mri_protocol_group
, mri_protocol_group_target
and mri_protocol_violated_scans
have been redesigned and renamed to scan_type_parameter
, scan_type_parameter_group
,
scan_type_parameter_group_target
and scan_type_identification_failure
respectively. To
upgrade to the new structure, follow the following steps:
- run SQL patch
SQL/New_patches/2022-05-17-add-scan_type_identification-table-refactor-mri_protocol-part-1.sql
- run
tools/single_use/populate_scan_type_parameter_table_based_on_mri_protocol_table.php
to populatescan_type_parameter
based on the entries present inmri_protocol
- run
tools/single_use/populate_scan_type_identification_failure_table_based_on_mri_protocol_violated_scans_table.php
to populatescan_type_identification_failure
based on the entries present inmri_protocol_violated_scans
- optionally, run the two SQL clean up patches to remove
mri_protocol
andmri_protocol_violated_scans
after ensuring there are proper backups of those tables. (Clean up patches are:SQL/Cleanup_patches/2022-05-17-remove-mri_protocol.sql
andSQL/Cleanup_patches/2022-05-17-remove-mri_protocol_violated_scans.sql
)
Link(s) to related issue(s)
- Related to https://github.com/aces/Loris-MRI/issues/363
@driusan @nicolasbrossard before I move forward with this work, could you take a look at the new SQL structure and let me know if the changes make sense? I'd like to validate the SQL changes before changing the code everywhere, including the LORIS-MRI side.
Thank you!
@driusan thank you for the review!! See my answers to your comments. Let me know your thoughts. We can also discuss during the imaging call. Thanks!
@driusan ready for another round of review. All your comments have been replied to or taken care of in the last few commits. I also fixed the dashboard automated tests in theory.
Thank you!
@driusan @kongtiaowang I don't understand where the error comes from in the tests. Would you mind taking a look?