Skip to content

Commit

Permalink
Merge pull request hms-dbmi#68 from hms-dbmi/ALS-4678
Browse files Browse the repository at this point in the history
Als 4678
  • Loading branch information
Gcolon021 authored Jun 13, 2023
2 parents 46f5aa4 + 6f3b749 commit 50e7d6a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,15 @@ public Map<String, Map<String, Integer>> runCategoryCrossCounts(Query query) {
} else {
for (Integer patient : patientSet) {
if (baseQueryPatientSet.contains(patient)) {
// If we have a patient in the base set, we add 1 to the count.
// We are only worried about patients in the base set
varCount.put(category, varCount.getOrDefault(category, 1) + 1);
} else {
varCount.put(category, varCount.getOrDefault(category, 1));
// If we don't have a patient in the base set, we add 0 to the count.
// This is necessary because we need to ensure that all categories are included in the
// map, even if they have a count of 0. This is because we are displaying the counts
// in a table (or other form).
varCount.put(category, varCount.getOrDefault(category, 0));
}
}
}
Expand Down

0 comments on commit 50e7d6a

Please sign in to comment.