From 79f31348c91152a24ee011f9850d211d5631f52d Mon Sep 17 00:00:00 2001 From: vietdhoang Date: Tue, 10 Aug 2021 19:13:28 -0400 Subject: [PATCH 1/5] Replaced the Center_name field in the mri_protocol table with CenterID. CenterID is a foreign key from the psc table and will be used to indentify the center that the MRI protocol belongs to. If the value is NULL, then the mri_protocol is valid everywhere. --- CHANGELOG.md | 2 +- SQL/0000-00-00-schema.sql | 15 ++++++++------- ...1-07-29_modify_center_name_in_mri_protocol.sql | 14 ++++++++++++++ raisinbread/RB_files/RB_mri_protocol.sql | 14 +++++++------- 4 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 SQL/New_patches/2021-07-29_modify_center_name_in_mri_protocol.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a21cb1e82..0f19750dbba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,10 +24,10 @@ requesting a new account and will be displayed in the User Accounts module (PR # - Candidate's age can be retrieved from the Candidate class in days, months, or years (PR #5945) - Addition of autoSelect prop to React SelectElement allows for auto-selection of only available select option (PR #6156) - An `AcquisitionDate` field has been added to the `files` table (PR #6892) -- The default value of the ScannerID field of the mri_protocol table is now NULL instead of 0 (PR #7496). #### Bug Fixes - The default value of the `ScannerID` field of the `mri_protocol` table is now `NULL` instead of `0`. This means that if a protocol is valid on all the study's scanners, then `ScannerID` of the protocol should be set to `NULL` (PR #7496) - The `EchoTime` field has been added to the following tables: `MRICandidateErrors`, and `mri_violations_log`. `EchoTime` is necessary to distiguish MINC files for multi-echo aquisitions (PR #7515). +- The `Center_name` field in the `mri_protocol` table has been replaced by `CenterID` from the `psc` table. The default value of `CenterID` is `NULL`. Previously, the default for `Center_name` was `AAAA` or `ZZZZ`. (PR #7518) ### Modules #### Help Editor - Cleaned up the deprecated column `Parent Topic` (PR #7025) diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index 2269440804d..9746f005076 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -624,8 +624,8 @@ INSERT INTO `mri_protocol_group` (`Name`) VALUES('Default MRI protocol group'); CREATE TABLE `mri_protocol` ( `ID` int(11) unsigned NOT NULL auto_increment, - `Center_name` varchar(4) NOT NULL default '', - `ScannerID` int(10) unsigned default NULL, + `CenterID` integer unsigned DEFAULT NULL, + `ScannerID` int(10) unsigned DEFAULT NULL, `Scan_type` int(10) unsigned NOT NULL default '0', `TR_min` DECIMAL(10,4) DEFAULT NULL, `TR_max` DECIMAL(10,4) DEFAULT NULL, @@ -655,16 +655,17 @@ CREATE TABLE `mri_protocol` ( PRIMARY KEY (`ID`), KEY `FK_mri_protocol_1` (`ScannerID`), CONSTRAINT `FK_mri_protocol_1` FOREIGN KEY (`ScannerID`) REFERENCES `mri_scanner` (`ID`), + CONSTRAINT `FK_mri_protocol_2` FOREIGN KEY (`CenterID`) REFERENCES `psc` (`CenterID`), CONSTRAINT `FK_mri_protocol_group_ID_1` FOREIGN KEY (`MriProtocolGroupID`) REFERENCES `mri_protocol_group` (`MriProtocolGroupID`) ) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8; -INSERT INTO mri_protocol (Center_name,Scan_type,TR_min,TR_max,TE_min, +INSERT INTO mri_protocol (CenterID,Scan_type,TR_min,TR_max,TE_min, TE_max,time_min,time_max,MriProtocolGroupID) VALUES - ('ZZZZ',48,8000,14000,80,130,0,200,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), - ('ZZZZ',40,1900,2700,10,30,0,500,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), - ('ZZZZ',44,2000,2500,2,5,NULL,NULL,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), - ('ZZZZ',45,3000,9000,100,550,NULL,NULL,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')); + (NULL,48,8000,14000,80,130,0,200,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), + (NULL,40,1900,2700,10,30,0,500,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), + (NULL,44,2000,2500,2,5,NULL,NULL,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')), + (NULL,45,3000,9000,100,550,NULL,NULL,(SELECT MriProtocolGroupID FROM mri_protocol_group WHERE Name='Default MRI protocol group')); CREATE TABLE `mri_protocol_group_target` ( `MriProtocolGroupTargetID` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, diff --git a/SQL/New_patches/2021-07-29_modify_center_name_in_mri_protocol.sql b/SQL/New_patches/2021-07-29_modify_center_name_in_mri_protocol.sql new file mode 100644 index 00000000000..56fd956e297 --- /dev/null +++ b/SQL/New_patches/2021-07-29_modify_center_name_in_mri_protocol.sql @@ -0,0 +1,14 @@ +-- Add a new CenterID column +ALTER TABLE mri_protocol +ADD COLUMN `CenterID` integer unsigned DEFAULT NULL +AFTER `Center_name`; + +ALTER TABLE mri_protocol ADD FOREIGN KEY (`CenterID`) REFERENCES psc(`CenterID`); + +-- Populate the CenterID column using Center_name (equivalent to MRI_alias in the psc table) +UPDATE mri_protocol +INNER JOIN psc ON (Center_name = MRI_alias) +SET mri_protocol.CenterID = psc.CenterID; + +-- Drop the Center_name table (CenterID will be replacing it) +ALTER TABLE mri_protocol DROP COLUMN `Center_name`; diff --git a/raisinbread/RB_files/RB_mri_protocol.sql b/raisinbread/RB_files/RB_mri_protocol.sql index 54bd02ee786..31a3d552999 100644 --- a/raisinbread/RB_files/RB_mri_protocol.sql +++ b/raisinbread/RB_files/RB_mri_protocol.sql @@ -1,12 +1,12 @@ SET FOREIGN_KEY_CHECKS=0; TRUNCATE TABLE `mri_protocol`; LOCK TABLES `mri_protocol` WRITE; -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1004,'ZZZZ',NULL,63,347.0000,667.0000,5.1900,7.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1005,'ZZZZ',NULL,44,2400.0000,2400.0000,2.0000,4.0000,1200.0000,1200.0000,0.9700,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1006,'ZZZZ',NULL,45,3200.0000,3200.0000,384.0000,528.0000,NULL,NULL,1.0000,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1007,'ZZZZ',NULL,40,2500.0000,2500.0000,27.0000,27.0000,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,130,130,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1008,'ZZZZ',NULL,66,10404.0000,14600.0000,88.0000,102.0000,NULL,NULL,2.0000,3.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,25,27,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1009,'ZZZZ',NULL,65,10200.0000,13000.0000,88.0000,105.0000,NULL,NULL,2.0000,2.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,65,66,NULL,NULL,1); -INSERT INTO `mri_protocol` (`ID`, `Center_name`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1010,'ZZZZ',NULL,64,489.0000,489.0000,3.1900,5.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1004,NULL,NULL,63,347.0000,667.0000,5.1900,7.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1005,NULL,NULL,44,2400.0000,2400.0000,2.0000,4.0000,1200.0000,1200.0000,0.9700,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1006,NULL,NULL,45,3200.0000,3200.0000,384.0000,528.0000,NULL,NULL,1.0000,1.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1007,NULL,NULL,40,2500.0000,2500.0000,27.0000,27.0000,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,130,130,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1008,NULL,NULL,66,10404.0000,14600.0000,88.0000,102.0000,NULL,NULL,2.0000,3.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,25,27,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1009,NULL,NULL,65,10200.0000,13000.0000,88.0000,105.0000,NULL,NULL,2.0000,2.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,65,66,NULL,NULL,1); +INSERT INTO `mri_protocol` (`ID`, `CenterID`, `ScannerID`, `Scan_type`, `TR_min`, `TR_max`, `TE_min`, `TE_max`, `TI_min`, `TI_max`, `slice_thickness_min`, `slice_thickness_max`, `xspace_min`, `xspace_max`, `yspace_min`, `yspace_max`, `zspace_min`, `zspace_max`, `xstep_min`, `xstep_max`, `ystep_min`, `ystep_max`, `zstep_min`, `zstep_max`, `time_min`, `time_max`, `image_type`, `series_description_regex`, `MriProtocolGroupID`) VALUES (1010,NULL,NULL,64,489.0000,489.0000,3.1900,5.6500,NULL,NULL,4.0000,4.0000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1); UNLOCK TABLES; SET FOREIGN_KEY_CHECKS=1; From ea6250c5fe29349318ed3359a1f1ffe90ab243f6 Mon Sep 17 00:00:00 2001 From: vietdhoang Date: Tue, 10 Aug 2021 19:19:01 -0400 Subject: [PATCH 2/5] Modified RBdata.sql in the test folder to account for the new CenterID field in mri_protocol and for the removal of Center_name --- test/RBdata.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/RBdata.sql b/test/RBdata.sql index 561f96139d6..853311bbd18 100644 --- a/test/RBdata.sql +++ b/test/RBdata.sql @@ -1589,17 +1589,17 @@ LOCK TABLES `mri_protocol` WRITE; /*!40000 ALTER TABLE `mri_protocol` DISABLE KEYS */; DELETE FROM `mri_protocol`; INSERT INTO `mri_protocol` - (ID, Center_name, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max,slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) - VALUES(1000, 'ZZZZ', 9, 48, 8000.0000, 14000.0000, 80.0000, 130.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 200); + (ID, CenterID, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max,slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) + VALUES(1000, NULL, 9, 48, 8000.0000, 14000.0000, 80.0000, 130.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 200); INSERT INTO `mri_protocol` - (ID, Center_name, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) - VALUES(1001, 'ZZZZ', 9, 40, 1900.0000, 2700.0000, 10.0000, 30.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 500); + (ID, CenterID, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) + VALUES(1001, NULL, 9, 40, 1900.0000, 2700.0000, 10.0000, 30.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 500); INSERT INTO `mri_protocol` - (ID, Center_name, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) - VALUES(1002, 'ZZZZ', 9, 44, 2000.0000, 2500.0000, 2.0000, 5.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + (ID, CenterID, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) + VALUES(1002, NULL, 9, 44, 2000.0000, 2500.0000, 2.0000, 5.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `mri_protocol` - (ID, Center_name, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) - VALUES(1003, 'ZZZZ', 9, 45, 3000.0000, 9000.0000, 100.0000, 550.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + (ID, CenterID, ScannerID, Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, series_description_regex, time_min, time_max) + VALUES(1003, NULL, 9, 45, 3000.0000, 9000.0000, 100.0000, 550.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); /*!40000 ALTER TABLE `mri_protocol` ENABLE KEYS */; UNLOCK TABLES; From 7384d0df4b66718d17d296be4dbb631f04ff5e76 Mon Sep 17 00:00:00 2001 From: Viet Hoang Date: Fri, 13 Aug 2021 11:45:03 -0400 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f19750dbba..137a0125610 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ requesting a new account and will be displayed in the User Accounts module (PR # - The default value of the `ScannerID` field of the `mri_protocol` table is now `NULL` instead of `0`. This means that if a protocol is valid on all the study's scanners, then `ScannerID` of the protocol should be set to `NULL` (PR #7496) - The `EchoTime` field has been added to the following tables: `MRICandidateErrors`, and `mri_violations_log`. `EchoTime` is necessary to distiguish MINC files for multi-echo aquisitions (PR #7515). - The `Center_name` field in the `mri_protocol` table has been replaced by `CenterID` from the `psc` table. The default value of `CenterID` is `NULL`. Previously, the default for `Center_name` was `AAAA` or `ZZZZ`. (PR #7518) +- The `Center_name` field in the `mri_protocol` table has been replaced by `CenterID` from the `psc` table. The default value of `CenterID` is `NULL`. Previously, the default for `Center_name` was `AAAA` or `ZZZZ`. (PR #7525) ### Modules #### Help Editor - Cleaned up the deprecated column `Parent Topic` (PR #7025) From 23c6318eb2ff56514b4b6f547bf04711155d4a7f Mon Sep 17 00:00:00 2001 From: cmadjar Date: Thu, 9 Sep 2021 09:47:39 -0400 Subject: [PATCH 4/5] fix tests --- .../mri_violations/php/mri_protocol_violations.class.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/mri_violations/php/mri_protocol_violations.class.inc b/modules/mri_violations/php/mri_protocol_violations.class.inc index 8c54c31c57e..665455a01bc 100644 --- a/modules/mri_violations/php/mri_protocol_violations.class.inc +++ b/modules/mri_violations/php/mri_protocol_violations.class.inc @@ -170,17 +170,18 @@ class Mri_Protocol_Violations extends \NDB_Menu_Filter // and add Scan_type from mri_scan_type // to mri_protocol's Scan_type $rows = $db->pselect( - "SELECT p.ID, mpg.Name as 'Protocol Group', Center_name, ScannerID, - p.Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, + "SELECT p.ID, mpg.Name as 'Protocol Group', psc.Name as Center_name, + ScannerID, p.Scan_type, TR_min, TR_max, TE_min, TE_max, TI_min, TI_max, slice_thickness_min, slice_thickness_max, xspace_min, xspace_max, yspace_min, yspace_max, zspace_min, zspace_max, xstep_min, xstep_max, ystep_min, ystep_max, zstep_min, zstep_max, time_min, time_max,series_description_regex FROM mri_protocol as p - LEFT JOIN mri_protocol_group mpg + LEFT JOIN mri_protocol_group mpg ON (mpg.MriProtocolGroupID=p.MriProtocolGroupID) LEFT JOIN mri_scan_type as s ON p.Scan_type=s.ID + LEFT JOIN psc ON psc.CenterID=p.CenterID ORDER BY mpg.MriProtocolGroupID ASC, p.Scan_type ASC", [] ); From 37ce81d853f669b2048396ea37eeef3ad8b6421d Mon Sep 17 00:00:00 2001 From: cmadjar Date: Fri, 24 Sep 2021 15:21:18 -0400 Subject: [PATCH 5/5] fix CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 137a0125610..f38f4e85cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,10 +24,10 @@ requesting a new account and will be displayed in the User Accounts module (PR # - Candidate's age can be retrieved from the Candidate class in days, months, or years (PR #5945) - Addition of autoSelect prop to React SelectElement allows for auto-selection of only available select option (PR #6156) - An `AcquisitionDate` field has been added to the `files` table (PR #6892) +- The default value of the ScannerID field of the mri_protocol table is now NULL instead of 0 (PR #7496). #### Bug Fixes - The default value of the `ScannerID` field of the `mri_protocol` table is now `NULL` instead of `0`. This means that if a protocol is valid on all the study's scanners, then `ScannerID` of the protocol should be set to `NULL` (PR #7496) - The `EchoTime` field has been added to the following tables: `MRICandidateErrors`, and `mri_violations_log`. `EchoTime` is necessary to distiguish MINC files for multi-echo aquisitions (PR #7515). -- The `Center_name` field in the `mri_protocol` table has been replaced by `CenterID` from the `psc` table. The default value of `CenterID` is `NULL`. Previously, the default for `Center_name` was `AAAA` or `ZZZZ`. (PR #7518) - The `Center_name` field in the `mri_protocol` table has been replaced by `CenterID` from the `psc` table. The default value of `CenterID` is `NULL`. Previously, the default for `Center_name` was `AAAA` or `ZZZZ`. (PR #7525) ### Modules #### Help Editor