Skip to content

Commit

Permalink
fix: clarify use of percentage in CDR engine
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller committed Apr 21, 2024
1 parent 8085a15 commit 5be871e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/clinical_rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,9 +1162,9 @@ function test_rules_clinic($provider = '', $type = '', $dateTarget = '', $mode =
}
}

// Calculate and save the data for the rule
$percentage = calculate_percentage($pass_filter, $exclude_filter, $pass_target);
if ($mode == "report") {
// Calculate and save the data for the rule (only pertinent for report mode)
$percentage = calculate_percentage($pass_filter, $exclude_filter, $pass_target);
$newRow = array('is_main' => true,'total_patients' => $total_patients,'excluded' => $exclude_filter,'pass_filter' => $pass_filter,'pass_target' => $pass_target,'percentage' => $percentage);
$newRow = array_merge($newRow, $rowRule);

Expand Down Expand Up @@ -1294,8 +1294,10 @@ function test_rules_clinic($provider = '', $type = '', $dateTarget = '', $mode =
}
}

// Calculate and save the data for the rule
$percentage = calculate_percentage($pass_filter, $exclude_filter, $pass_target);
if ($mode == "report") {
// Calculate percentage for the rule (only pertinent for report mode)
$percentage = calculate_percentage($pass_filter, $exclude_filter, $pass_target);
}

// Collect action for title (just use the first one, if more than one)
$actionArray = resolve_action_sql($rowRule['id'], $i);
Expand Down

0 comments on commit 5be871e

Please sign in to comment.