Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Als 4678 - Variable Distributions graphs showing incorrect counts #68

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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