From e923db627bfdeb3dac266afe49457edcf99282ba Mon Sep 17 00:00:00 2001 From: Cecile Madjar Date: Mon, 12 Nov 2018 11:09:16 -0500 Subject: [PATCH] Renamed CenterID of the candidate table to RegistrationCenterID --- tools/example_scripts/deletemincsqlwrapper.pl | 2 +- uploadNeuroDB/NeuroDB/MRI.pm | 10 ++++++++-- uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/example_scripts/deletemincsqlwrapper.pl b/tools/example_scripts/deletemincsqlwrapper.pl index 4f6502f58..af527f986 100755 --- a/tools/example_scripts/deletemincsqlwrapper.pl +++ b/tools/example_scripts/deletemincsqlwrapper.pl @@ -107,7 +107,7 @@ =head1 DESCRIPTION LEFT JOIN parameter_type AS pt using (ParameterTypeID) LEFT JOIN files_qcstatus AS q using (FileID) LEFT JOIN session AS s ON (f.SessionID=s.ID) - LEFT JOIN psc AS c ON (c.CenterID=s.CenterID) + LEFT JOIN psc AS c ON (c.RegistrationCenterID=s.CenterID) LEFT JOIN mri_scan_type AS m ON (m.ID=f.AcquisitionProtocolID) LEFT JOIN tarchive AS t ON f.TarchiveSource=t.TarchiveID WHERE pt.Name = 'acquisition:slice_thickness' diff --git a/uploadNeuroDB/NeuroDB/MRI.pm b/uploadNeuroDB/NeuroDB/MRI.pm index 90a0b0f9a..7e5f6c6bd 100755 --- a/uploadNeuroDB/NeuroDB/MRI.pm +++ b/uploadNeuroDB/NeuroDB/MRI.pm @@ -271,7 +271,8 @@ sub getSessionID { # fixme add some debug messages if this is to be kept print "Set newVisitNo = $newVisitNo and centerID = $centerID\n"; } else { - $query = "SELECT CenterID FROM candidate WHERE CandID=".$dbh->quote($subjectIDref->{'CandID'}); + $query = "SELECT RegistrationCenterID AS CenterID FROM candidate " + . "WHERE CandID=" . $dbh->quote($subjectIDref->{'CandID'}); $sth = $dbh->prepare($query); $sth->execute(); if($sth->rows > 0) { @@ -1074,7 +1075,12 @@ sub registerScanner { # create a new candidate for the scanner if it does not exist. if(!defined($candID)) { $candID = createNewCandID($dbhr); - $query = "INSERT INTO candidate (CandID, PSCID, CenterID, Date_active, Date_registered, UserID, Entity_type) VALUES ($candID, 'scanner', $centerID, NOW(), NOW(), 'NeuroDB::MRI', 'Scanner')"; + $query = "INSERT INTO candidate " + . "(CandID, PSCID, RegistrationCenterID, Date_active, " + . " Date_registered, UserID, Entity_type ) " + . "VALUES " + . "($candID, 'scanner', $centerID, NOW(), " + . " NOW(), 'NeuroDB::MRI', 'Scanner' ) "; $dbh->do($query); } diff --git a/uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm b/uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm index e582ce055..81a215de9 100755 --- a/uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm +++ b/uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm @@ -1503,8 +1503,8 @@ sub CreateMRICandidates { NeuroDB::MRI::createNewCandID($this->{dbhr}); } $query = "INSERT INTO candidate ". - "(CandID, PSCID, DoB, Sex,CenterID, Date_active,". - " Date_registered, UserID,Entity_type) ". + "(CandID, PSCID, DoB, Sex, RegistrationCenterID, ". + "Date_active, Date_registered, UserID, Entity_type) ". "VALUES(" . ${$this->{'dbhr'}}->quote($subjectIDsref->{'CandID'}).",". ${$this->{'dbhr'}}->quote($subjectIDsref->{'PSCID'}).",".