-
Notifications
You must be signed in to change notification settings - Fork 174
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
[imaging_uploader] Fix auto-populating VisitLabel #8881
[imaging_uploader] Fix auto-populating VisitLabel #8881
Conversation
// 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; |
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 feel like I heard somewhere that phantom scans names don't get validated? but im not sure and this doesnt hurt it only helps
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.
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
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.
A thing of beauty
@driusan blocking issue for CBIGR |
Brief summary of changes
Fixes #8803
Testing instructions (if applicable)
Link(s) to related issue(s)