diff --git a/tmh_registry/registry/api/serializers.py b/tmh_registry/registry/api/serializers.py index d335c71..be6b11b 100644 --- a/tmh_registry/registry/api/serializers.py +++ b/tmh_registry/registry/api/serializers.py @@ -545,6 +545,7 @@ class Meta: "seroma", "infection", "numbness", + "recurrence", "further_surgery_need", "surgery_comments_box", ] @@ -574,6 +575,7 @@ class Meta: "seroma", "infection", "numbness", + "recurrence", "further_surgery_need", "surgery_comments_box", ] @@ -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", "" diff --git a/tmh_registry/registry/factories.py b/tmh_registry/registry/factories.py index 356bcc4..2a3aa5e 100644 --- a/tmh_registry/registry/factories.py +++ b/tmh_registry/registry/factories.py @@ -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 diff --git a/tmh_registry/registry/migrations/0036_followup_recurrence.py b/tmh_registry/registry/migrations/0036_followup_recurrence.py new file mode 100644 index 0000000..13c0fc8 --- /dev/null +++ b/tmh_registry/registry/migrations/0036_followup_recurrence.py @@ -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), + ), + ] diff --git a/tmh_registry/registry/models.py b/tmh_registry/registry/models.py index 08acd31..e6fecce 100644 --- a/tmh_registry/registry/models.py +++ b/tmh_registry/registry/models.py @@ -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) diff --git a/tmh_registry/registry/tests/api/viewsets/test_follow_ups.py b/tmh_registry/registry/tests/api/viewsets/test_follow_ups.py index 37477a3..fcb65e9 100644 --- a/tmh_registry/registry/tests/api/viewsets/test_follow_ups.py +++ b/tmh_registry/registry/tests/api/viewsets/test_follow_ups.py @@ -38,6 +38,7 @@ def get_follow_up_data(self): "seroma": True, "infection": False, "numbness": True, + "recurrence": True, "further_surgery_need": True, } @@ -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"])