Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[imaging_uploader] Fix auto-populating VisitLabel #8881

Merged

Conversation

zaliqarosli
Copy link
Contributor

@zaliqarosli zaliqarosli commented Sep 7, 2023

Brief summary of changes

  • Have you updated related documentation?

Fixes #8803

Testing instructions (if applicable)

  1. In Imaging uploader Upload Form, choose Phantom 'No' and select a file with the proper naming convention, suffixed by any random string.
  2. Make sure that only the visit label is populated in the Visit Label field, and not the entire end of the string

Link(s) to related issue(s)

  • Resolves # (Reference the issue this fixes, if any.)

@zaliqarosli zaliqarosli added the Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) label Sep 7, 2023
Comment on lines +69 to +84
// visitLabel can contain underscores, filename can have suffix appended to PSCID_CandID_VisitLabel
// join the remaining elements of patientName and pattern match
// against each visit label. Use as visitLabel the best (longest) match
ids.splice(0, 2);
formData.visitLabel = ids.join('_');
const suffix = ids.join('_');
const visitLabels = Object.keys(form.visitLabel.options);
let bestMatch = '';
visitLabels.map((visitLabel) => {
if (suffix.match(visitLabel) !== null) {
// consider the first match only
if (suffix.match(visitLabel)[0].length > bestMatch.length) {
bestMatch = suffix.match(visitLabel)[0];
}
}
});
formData.visitLabel = bestMatch;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I heard somewhere that phantom scans names don't get validated? but im not sure and this doesnt hurt it only helps

Copy link
Contributor Author

@zaliqarosli zaliqarosli Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case isn't for phantom scans, its in the else if statement. the difference between this block of code and the block below is the auto-populating happening if you're filling out the IsPhantom first or the mriFile first, i think

Copy link
Collaborator

@ridz1208 ridz1208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thing of beauty

@ridz1208 ridz1208 added the Priority: Projects PR or issue is a priority for at least one project and should be a higher priority for LORIS label Sep 8, 2023
@ridz1208
Copy link
Collaborator

ridz1208 commented Sep 8, 2023

@driusan blocking issue for CBIGR

@driusan driusan merged commit 80740e4 into aces:24.1-release Sep 12, 2023
9 checks passed
@ridz1208 ridz1208 added this to the 24.1.5 milestone Nov 9, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) Priority: Projects PR or issue is a priority for at least one project and should be a higher priority for LORIS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[imaging_uploader] Visit Label populated from the entire end of the file name
3 participants