Skip to content

Commit

Permalink
Merge pull request #4767 from alisman/fxComparisonSessionGenerat
Browse files Browse the repository at this point in the history
Study view: fix comparison session generation from study view bin cha…
  • Loading branch information
alisman authored Nov 7, 2023
2 parents eec4050 + f73a4e0 commit bfd177b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/pages/studyView/StudyViewUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2871,12 +2871,23 @@ export function getGroupedClinicalDataByBins(
// Check if the ClinicalData value is number
if (!isNaN(datum.value as any)) {
//find if it belongs to any of numeric bins.
dataBin = _.find(
numericDataBins,
dataBin =>
parseFloat(datum.value) > dataBin.start &&
parseFloat(datum.value) <= dataBin.end
);
dataBin = _.find(numericDataBins, dataBin => {
if (dataBin.start === dataBin.end) {
// this is a special case where the buckets are single integers, end
// is the same value as the start
// ideally this would never be the case--it should be handled in bin creation
// but this is simplest way to resolve problem
return (
parseFloat(datum.value) === dataBin.start ||
parseFloat(datum.value) === dataBin.end
);
} else {
return (
parseFloat(datum.value) > dataBin.start &&
parseFloat(datum.value) <= dataBin.end
);
}
});
}

//If ClinicalData value is not a number of does not belong to any number bins
Expand Down

0 comments on commit bfd177b

Please sign in to comment.