From 8320e1183034e806cd411b505ac002512682109d Mon Sep 17 00:00:00 2001 From: Evren Ozkan Date: Fri, 11 Nov 2016 16:40:18 -0500 Subject: [PATCH] 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 --- Packages/hangingprotocols/client/protocolEngine.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/hangingprotocols/client/protocolEngine.js b/Packages/hangingprotocols/client/protocolEngine.js index ddd292ca2..94f365b99 100644 --- a/Packages/hangingprotocols/client/protocolEngine.js +++ b/Packages/hangingprotocols/client/protocolEngine.js @@ -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; }