From df8f82db60d2841742d1568ee79d34b383d808ab Mon Sep 17 00:00:00 2001 From: Nan Li Date: Thu, 5 Oct 2023 10:33:06 -0500 Subject: [PATCH] fixed the issue that give the error relative informativeness --- handlers/dataHandlers.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/handlers/dataHandlers.js b/handlers/dataHandlers.js index c1287c6..10e534d 100644 --- a/handlers/dataHandlers.js +++ b/handlers/dataHandlers.js @@ -784,16 +784,19 @@ SeerService.collectionDataExports = async function(req, res, next) { ], }); const csvData = []; + + // first?, second?, third? const {first, second, third} = data.relativeInformative; data.slides.forEach((sid)=>{ const slideData = slideMap.get(sid); // Relative Informativeness need to add - if (sid == first) { + const tumorPresent = slideData.csvData.tumorPresent; + if (tumorPresent == 1 && sid == first) { slideData.csvData.relativeInformativeness = '1'; - } else if (sid == second) { + } else if (tumorPresent == 1 && sid == second) { slideData.csvData.relativeInformativeness = '2'; - } else if (sid == third) { + } else if (tumorPresent == 1 && sid == third) { slideData.csvData.relativeInformativeness = '3'; } else { slideData.csvData.relativeInformativeness = '';