Skip to content

Commit

Permalink
fix(daily_rounds): migrated blood pressure field
Browse files Browse the repository at this point in the history
  • Loading branch information
aeswibon committed Feb 8, 2024
1 parent ad500a0 commit 11804be
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ def forwards_func(apps, schema_editor):
obj.ventilator_oxygen_modality = None
if obj.insulin_intake_frequency == 0:
obj.insulin_intake_frequency = None

if obj.bp and obj.bp.get("systolic") and obj.bp.get("diastolic"):
if obj.bp.get("systolic") < 0 and obj.bp.get("diastolic") < 0:
obj.bp = {}
else:
if obj.bp.get("systolic") < 0:
obj.bp.update({"systolic": None})
if obj.bp.get("diastolic") < 0:
obj.bp.update({"diastolic": None})
objects.append(obj)

DailyRound.objects.bulk_update(
Expand All @@ -50,6 +57,7 @@ def forwards_func(apps, schema_editor):
"ventilator_interface",
"ventilator_oxygen_modality",
"insulin_intake_frequency",
"bp",
],
)

Expand Down

0 comments on commit 11804be

Please sign in to comment.