Skip to content

Commit 8cdb1f3

Browse files
committed
add sub types for skin change symptom type
1 parent 44261a3 commit 8cdb1f3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Generated by Django 5.2.6 on 2025-09-29 08:26
2+
3+
from django.db import migrations
4+
5+
6+
def add_symptom_sub_types(apps, schema_editor):
7+
SymptomSubType = apps.get_model("participants", "SymptomSubType")
8+
9+
SymptomSubType.objects.create(
10+
symptom_type_id="skin-change", id="sores_or_cysts", name="Sores or cysts"
11+
)
12+
SymptomSubType.objects.create(
13+
symptom_type_id="skin-change",
14+
id="dimples_or_indentation",
15+
name="Dimples or indentation",
16+
)
17+
SymptomSubType.objects.create(symptom_type_id="skin-change", id="rash", name="Rash")
18+
SymptomSubType.objects.create(
19+
symptom_type_id="skin-change", id="colour_change", name="Colour change"
20+
)
21+
SymptomSubType.objects.create(
22+
symptom_type_id="skin-change", id="other", name="Otgher"
23+
)
24+
25+
26+
def remove_symptom_sub_types(apps, schema_editor):
27+
SymptomSubType = apps.get_model("participants", "SymptomSubType")
28+
SymptomSubType.objects.all().delete()
29+
30+
31+
class Migration(migrations.Migration):
32+
33+
dependencies = [
34+
("participants", "0027_alter_symptom_area"),
35+
]
36+
37+
operations = [migrations.RunPython(add_symptom_sub_types, remove_symptom_sub_types)]

manage_breast_screening/participants/models/symptom.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ class SymptomType(ReferenceDataModel):
1515

1616

1717
class SymptomSubType(ReferenceDataModel):
18+
SORES_OR_CYSTS = "sores_or_cysts"
19+
DIMPLES_OR_INDENTATION = "dimples_or_indentation"
20+
RASH = "rash"
21+
COLOUR_CHANGE = "colour_change"
22+
OTHER = "other"
23+
1824
symptom_type = models.ForeignKey(SymptomType, on_delete=models.CASCADE)
1925
name = models.CharField(null=False, blank=False)
2026

0 commit comments

Comments
 (0)