fix(HangingProtocolService): Add callback property & update description (#3349)

The description for the numberOfDisplaySetsWithImages property was corrected. The update also involves adding a callback property that returns several objects (matchedViewports, viewportMatchDetails, displaySetMatchDetails) and returning them from the method 'findViewportProtocols'. The refactored code also has better readability.
This commit is contained in:
Alireza 2023-05-02 13:31:51 -04:00 committed by GitHub
parent 0f85b1a681
commit ef24d89930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,8 +102,8 @@ export default class HangingProtocolService extends PubSubService {
}, },
numberOfDisplaySetsWithImages: { numberOfDisplaySetsWithImages: {
name: 'numberOfDisplaySetsWithImages', name: 'numberOfDisplaySetsWithImages',
desription: 'Number of displays sets with images', description: 'Number of displays sets with images',
numberOfDisplaySetsWithImages, callback: numberOfDisplaySetsWithImages,
}, },
}; };
listeners = {}; listeners = {};
@ -1058,7 +1058,11 @@ export default class HangingProtocolService extends PubSubService {
viewportMatchDetails.set(viewportIndex, matchDetails); viewportMatchDetails.set(viewportIndex, matchDetails);
} }
}); });
return { matchedViewports, viewportMatchDetails, displaySetMatchDetails }; return {
matchedViewports,
viewportMatchDetails,
displaySetMatchDetails,
};
} }
protected findDeduplicatedMatchDetails( protected findDeduplicatedMatchDetails(
@ -1080,7 +1084,10 @@ export default class HangingProtocolService extends PubSubService {
) { ) {
const match = matchDetails.matchingScores[i]; const match = matchDetails.matchingScores[i];
return match.matchingScore > 0 return match.matchingScore > 0
? { matchingScores, ...matchDetails.matchingScores[i] } ? {
matchingScores,
...matchDetails.matchingScores[i],
}
: null; : null;
} }
} }