Skip to content

Commit

Permalink
Renamed CenterID of the candidate table to RegistrationCenterID
Browse files Browse the repository at this point in the history
  • Loading branch information
cmadjar committed Nov 12, 2018
1 parent aafaf45 commit a6a7f78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/example_scripts/deletemincsqlwrapper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 8 additions & 2 deletions uploadNeuroDB/NeuroDB/MRI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions uploadNeuroDB/NeuroDB/MRIProcessingUtility.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1503,8 +1503,8 @@ sub CreateMRICandidates {
NeuroDB::MRI::createNewCandID($this->{dbhr});
}
$query = "INSERT INTO candidate ".
"(CandID, PSCID, DoB, Gender,CenterID, Date_active,".
" Date_registered, UserID,Entity_type) ".
"(CandID, PSCID, DoB, Gender, RegistrationCenterID, ".
"Date_active, Date_registered, UserID,Entity_type) ".
"VALUES(" .
${$this->{'dbhr'}}->quote($subjectIDsref->{'CandID'}).",".
${$this->{'dbhr'}}->quote($subjectIDsref->{'PSCID'}).",".
Expand Down

0 comments on commit a6a7f78

Please sign in to comment.