Fix hanging protocol bugs

- Insert the protocol into MatchedProtocols with its score to be used in getBestMatch
- Use isImage function to check if the instance has image data in hanging protocol engine
This commit is contained in:
Evren Ozkan 2016-11-11 16:40:18 -05:00
parent 205e11ea03
commit 8320e11830

View File

@ -252,9 +252,9 @@ HP.ProtocolEngine = class ProtocolEngine {
id: protocol.id
});
// If it is not already in the MatchedProtocols Collection, insert it
// If it is not already in the MatchedProtocols Collection, insert it with its score
if (!protocolInCollection) {
MatchedProtocols.insert(protocol);
MatchedProtocols.insert(matchedDetail);
}
});
});
@ -277,7 +277,7 @@ HP.ProtocolEngine = class ProtocolEngine {
}).fetch();
// Return the highest scoring Protocol
return sorted[0];
return sorted[0].protocol;
}
/**
@ -435,7 +435,7 @@ HP.ProtocolEngine = class ProtocolEngine {
// This tests to make sure there is actually image data in this instance
// TODO: Change this when we add PDF and MPEG support
// See https://ohiforg.atlassian.net/browse/LT-227
if (!instance.rows || !instance.columns) {
if (!isImage(instance.sopClassUid) && !instance.rows) {
return;
}