-
Notifications
You must be signed in to change notification settings - Fork 51
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
Updated rules to set the default project, cohort #809
Conversation
dicom-archive/profileTemplate.pl
Outdated
@@ -88,6 +91,7 @@ sub getSubjectIDs { | |||
# ? 1 : 2; | |||
# When createVisitLabel is set to 0, $subjectID{'SubprojectID'} is ignored. | |||
|
|||
$subjectID{'ProjectID'} = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I would give a default value to the ProjectID
. I think it would be better to leave it undefined and have the MRI pipeline complain that if was not set instead of setting the project ID of the newly created candidate to 1 (which might not be the correct value). @cmadjar Can you weigh in on this?
The rest of the PR gets my approval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @nicolasbrossard. Since ProjectID
can be NULL
I would leave the default to be undef
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree it's not a super safe change. I get confused by this change.
Since v24.0 session ProjectID cannot be null. createVisitLabel is set to 1 by default, so I suspect setting Project to undef will trigger an error when attempting to create a session . Is setting createVisitLabel to 0 by default a better option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am more worried about the scanner
candidate having to have a ProjectID than a phantom session since that could technically be in the PatientName
the same way the site is specified. But creating a scanner
candidate for a specific project seems a little odd. Maybe we could create a 'scanner' project?
dicom-archive/profileTemplate.pl
Outdated
@@ -79,6 +81,7 @@ sub getSubjectIDs { | |||
|
|||
$subjectID{'createVisitLabel'} = 0; | |||
|
|||
# $subjectID{'SubprojectID'} = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well, I would put the default to be undef
dicom-archive/profileTemplate.pl
Outdated
# When createVisitLabel is set to 1, SubprojectID must also | ||
# be set to the ID of the subproject that the newly created | ||
# visit should have. Assuming for example that all patient | ||
# names end with "_<mySubProjectID>", then we could write: | ||
# ($subjectID{'SubprojectID'}) = $patientName =~ /_(\d+)$/; | ||
# When createVisitLabel is set to 0, $subjectID{'SubprojectID'} is ignored. | ||
|
||
# $subjectID{'ProjectID'} = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well, I would put the default to be undef
dicom-archive/profileTemplate.pl
Outdated
@@ -51,13 +51,15 @@ sub getSubjectIDs { | |||
|
|||
$subjectID{'createVisitLabel'} = 1; | |||
|
|||
# $subjectID{'SubprojectID'} = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well, I would put the default to be undef
DoB => $subjectIDsref->{'PatientDoB'}, | ||
Sex => $sex, | ||
RegistrationCenterID => $centerID, | ||
RegistrationProjectID => $subjectIDsref->{'ProjectID'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the default ProjectID would be undef, I wonder whether the if statement line 1758 should not be modified by !defined $subjectIDsref->{'ProjectID'} and $pscid eq 'scanner'
since no ProjectID should be assigned to scanner candidates.
@laemtl thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the change here will not allow scanners to be registered without a ProjectID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh noooo. Indeed. I thought RegistrationProjectID
could be NULL
. Not sure what to do cause like you mentioned, a scanner can belong to more than one Project... Let's add that to tomorrow's LORIS agenda and see what we can do.
@laemtl Based on today's discussion at the LORIS call, the best approach to this might be to set the Then, when Phantom session are being inserted into LORIS, the session |
I guess, the same way we have @laemtl @nicolasbrossard would that make sense to you? |
@cmadjar Makes sense to me. |
@laemtl ping on this one :) |
afb670d
to
7489f42
Compare
@laemtl I tested the PR with the new config in the config module but I get the following error:
Looking at the code, I realize that the config values from the Config module are not being fetched as far as I can tell. Maybe you did not push the latest version of the code? Note to myself for upcoming testing once this PR is updated to resume testing: (test on ROM666_966666_V1 which does not exist in RB with default Project set to
|
@@ -93,6 +93,9 @@ use constant BIDS_DATASET_AUTHORS => 'bids_dataset_authors'; | |||
use constant BIDS_ACKNOWLEDGMENTS_TEXT => 'bids_acknowledgments_text'; | |||
use constant BIDS_README_TEXT => 'bids_readme_text'; | |||
use constant BIDS_VALIDATOR_OPTIONS_TO_IGNORE => 'bids_validator_options_to_ignore'; | |||
use constant CREATE_CANDIDATES => 'createCandidates'; | |||
use constant CREATE_VISIT => 'createVisit'; | |||
use constant DEFAULT_COHORT => 'default_cohort'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing the following here:
use constant DEFAULT_COHORT => 'default_cohort'; | |
use constant DEFAULT_COHORT => 'default_cohort'; | |
use constant DEFAULT_PROJECT => 'default_project'; |
Which results in the following error:
Bareword "DEFAULT_PROJECT" not allowed while "strict subs" in use at /data/qpn/bin/mri/uploadNeuroDB/NeuroDB/objectBroker/ConfigOB.pm line 477.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it was probably introduced by a merge conflict not properly resolved 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmadjar I will retest to make sure something else was not broken
070215b
to
5f3f634
Compare
@cmadjar Ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* ProjectID fix * New Config CreateVisit, default_project and default_cohort * Create getDefaultCohort and getDefaultProject in ConfigOB * Documentation and updates
Solves several problems:
getSubjectIDs
comments/documentation for$subjectID{'ProjectID'}
updatedRegistrationProjectID
instead ofProjectID
.CreateVisit
(replace the variable in the prod file),default_project
anddefault_cohort
(fallback to the variables in the prod file if not set). See createVisit/Project/Cohort imaging config Loris#8384prod
fileProjectID
RegistrationProjectID
prod
fileCohortID