Skip to content
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

Rename candidate CenterID to RegistrationCenterID #341

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, 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'}).",".
Expand Down