Skip to content

Conversation

asafchen-dig
Copy link

This PR fixes a division by zero error in the getActiveLogsRatio method of ClinicActivityDataService.

Changes made:

  1. Added check for zero divisor before performing division
  2. Added logging to track input values and edge cases
  3. Return 0 when there are no logs (instead of throwing exception)
  4. Convert result to percentage for better readability

The changes prevent the ArithmeticException from occurring when there are no logs for a given type, improving the robustness of the service.

Testing:

  • The method now handles the case when no logs exist
  • Added debug logging to help track values
  • Returns percentage instead of raw ratio for better usability

Fixes the reported incident with ArithmeticException in ClinicActivityDataService.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant