Skip to content

Commit

Permalink
fix(daily_round): resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aeswibon committed Feb 28, 2024
1 parent 603e51c commit 47359c3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,27 +506,25 @@ def set_push_score(item):
def save(self, *args, **kwargs):
# Calculate all automated columns and populate them
if (
self.glasgow_eye_open is None
and self.glasgow_motor_response is None
and self.glasgow_verbal_response is None
self.glasgow_eye_open is not None
and self.glasgow_motor_response is not None
and self.glasgow_verbal_response is not None
):
self.glasgow_total_calculated = None
else:
self.glasgow_total_calculated = (

Check warning on line 513 in care/facility/models/daily_round.py

View check run for this annotation

Codecov / codecov/patch

care/facility/models/daily_round.py#L513

Added line #L513 was not covered by tests
self.cztn(self.glasgow_eye_open)
+ self.cztn(self.glasgow_motor_response)
+ self.cztn(self.glasgow_verbal_response)
)
if not self.infusions and not self.iv_fluids and not self.feeds:
self.total_intake_calculated = None
else:
if (
self.infusions is not None
and self.iv_fluids is not None
and self.feeds is not None
):
self.total_intake_calculated = sum([x["quantity"] for x in self.infusions])
self.total_intake_calculated += sum([x["quantity"] for x in self.iv_fluids])
self.total_intake_calculated += sum([x["quantity"] for x in self.feeds])

if not self.output:
self.total_output_calculated = None
else:
if self.output is not None:
self.total_output_calculated = sum([x["quantity"] for x in self.output])

super(DailyRound, self).save(*args, **kwargs)
Expand Down

0 comments on commit 47359c3

Please sign in to comment.