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

Remove filtered displaySets from parameter from study protocolEngine.findMatch() #3343

Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -1389,24 +1389,26 @@ export default class HangingProtocolService extends PubSubService {
this.studies.forEach(study => {
// Skip non-active if active only
if (matchActiveOnly && this.activeStudy !== study) return;
const studyDisplaySets = this.displaySets.filter(
it => it.StudyInstanceUID === study.StudyInstanceUID
);

Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't move this change, but leave it here, then you can pass both displaySets and studyDisplaySets into the findMatch. Then, custom attributes can be setup to choose either of them - and it is only custom attributes which access these.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking it over, probably leaving displaySets as is, but passing allDisplaySets into the findMatch function would be more consistent. The rule is testing this study right now, so it should have the display sets for this study, not all display sets, and if a particular rule wants to look at all display sets, then just having it as a another value would make that possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

The problem is, at the study matching we need to access the list of registered study and display sets.
For unknown reason, this.studies is not updated when you add available studies in OHIF (for instance by opening priors panel), but displayset are correctly added.
At the study matching you need to access all studies and all display set (listing only displayset of the current study will forbid cross study matching for which study matching rule stand for).

So sofien updated his code to have :
displayset === all known displayset at the study level
displayset === studies display set at the series level

const studyMatchDetails = this.protocolEngine.findMatch(
study,
studyMatchingRules,
{
studies: this.studies,
displaySets: studyDisplaySets,
displaySetMatchDetails: this.displaySetMatchDetails,
}
{
studies: this.studies,
displaySets: this.displaySets,
wayfarer3130 marked this conversation as resolved.
Show resolved Hide resolved
displaySetMatchDetails: this.displaySetMatchDetails,
}

);

// Prevent bestMatch from being updated if the matchDetails' required attribute check has failed
if (studyMatchDetails.requiredFailed === true) {
return;
}

const studyDisplaySets = this.displaySets.filter(
it => it.StudyInstanceUID === study.StudyInstanceUID
);
this.debug(
'study',
study.StudyInstanceUID,
Expand Down