[Perl pipeline] Do not duplicate violation entry if it already exists #896
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When the
tarchiveLoader.pl
script is rerun, it checks whether the file has already been registered into thefiles
table before inserting a new entry in thefiles
table but the pipeline does not check whether a violation has already been registered into the 3 violation tables (MRICandidateErrors
,mri_protocol_violated_scans
andmri_violations_log
) and inserts duplicates of the same violation as many times astarchiveLoader.pl
is run on a DICOM archive.This was fixed on the python side by #884 and #891. This PR fixes this for the Perl side as well using the same algorithm.
Reminder: a unique file entry is now determined by the unique combination of
SeriesUID
,EchoTime
,PhaseEncodingDirection
andEchoNumbers
.Resolves #890 as this is the only missing piece to close the issue.