Skip to content

Commit

Permalink
Added Recurrence option to Followups
Browse files Browse the repository at this point in the history
  • Loading branch information
paolo7 committed Jul 23, 2024
1 parent 90520dd commit f0c3734
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tmh_registry/registry/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ class Meta:
"seroma",
"infection",
"numbness",
"recurrence",
"further_surgery_need",
"surgery_comments_box",
]
Expand Down Expand Up @@ -574,6 +575,7 @@ class Meta:
"seroma",
"infection",
"numbness",
"recurrence",
"further_surgery_need",
"surgery_comments_box",
]
Expand Down Expand Up @@ -615,6 +617,7 @@ def create(self, validated_data):
seroma=validated_data["seroma"],
infection=validated_data["infection"],
numbness=validated_data["numbness"],
recurrence=validated_data["recurrence"],
further_surgery_need=validated_data["further_surgery_need"],
surgery_comments_box=validated_data.get(
"surgery_comments_box", ""
Expand Down
1 change: 1 addition & 0 deletions tmh_registry/registry/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class Meta:
seroma = LazyAttribute(lambda _: faker.boolean())
infection = LazyAttribute(lambda _: faker.boolean())
numbness = LazyAttribute(lambda _: faker.boolean())
recurrence = LazyAttribute(lambda _: faker.boolean())
further_surgery_need = LazyAttribute(lambda _: faker.boolean())

@post_generation
Expand Down
18 changes: 18 additions & 0 deletions tmh_registry/registry/migrations/0036_followup_recurrence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.3 on 2024-07-23 10:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('registry', '0035_episode_comments'),
]

operations = [
migrations.AddField(
model_name='followup',
name='recurrence',
field=models.BooleanField(null=True),
),
]
1 change: 1 addition & 0 deletions tmh_registry/registry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class PainSeverityChoices(TextChoices):
seroma = BooleanField()
infection = BooleanField()
numbness = BooleanField()
recurrence = BooleanField(null=True, blank=False)
further_surgery_need = BooleanField()
surgery_comments_box = TextField(null=True, blank=True)

Expand Down
2 changes: 2 additions & 0 deletions tmh_registry/registry/tests/api/viewsets/test_follow_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def get_follow_up_data(self):
"seroma": True,
"infection": False,
"numbness": True,
"recurrence": True,
"further_surgery_need": True,
}

Expand All @@ -64,6 +65,7 @@ def test_successful(self):
self.assertEqual(response.data["seroma"], data["seroma"])
self.assertEqual(response.data["infection"], data["infection"])
self.assertEqual(response.data["numbness"], data["numbness"])
self.assertEqual(response.data["recurrence"], data["recurrence"])

# check value stored in db
follow_up = FollowUp.objects.get(id=response.data["id"])
Expand Down

0 comments on commit f0c3734

Please sign in to comment.