Skip to content

Commit 03db24b

Browse files
authored
Merge pull request #400 from NHSDigital/dtoss-10724-model-improvements
[DTOSS-10724] small model fixes
2 parents c78ba55 + 171011b commit 03db24b

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 5.2.5 on 2025-09-15 16:04
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('participants', '0024_remove_symptom_participant'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='symptom',
15+
name='investigated',
16+
field=models.BooleanField(default=False),
17+
),
18+
migrations.AlterField(
19+
model_name='symptom',
20+
name='when_started',
21+
field=models.CharField(blank=True, choices=[('LESS_THAN_THREE_MONTHS', 'Less than 3 months'), ('THREE MONTHS TO A YEAR', '3 months to a year'), ('ONE_TO_THREE_YEARS', '1 to 3 years'), ('OVER_THREE_YEARS', 'Over 3 years'), ('SINCE_A_SPECIFIC_DATE', 'Since a specific date'), ('NOT_SURE', 'Not sure')]),
22+
),
23+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.5 on 2025-09-16 10:15
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('participants', '0025_alter_symptom_investigated_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='symptom',
15+
name='investigation_details',
16+
field=models.CharField(blank=True),
17+
),
18+
]

manage_breast_screening/participants/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .participant import Participant, ParticipantAddress
44
from .reported_mammograms import ParticipantReportedMammogram, SupportReasons
55
from .screening_episode import ScreeningEpisode
6-
from .symptoms import Symptom, SymptomAreas, SymptomSubType, SymptomType
6+
from .symptom import Symptom, SymptomAreas, SymptomSubType, SymptomType
77

88
__all__ = [
99
"Appointment",

manage_breast_screening/participants/models/symptoms.py renamed to manage_breast_screening/participants/models/symptom.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ class SymptomAreas(models.TextChoices):
2626
OTHER = ("OTHER", "Other")
2727

2828

29+
class RelativeDateChoices(models.TextChoices):
30+
LESS_THAN_THREE_MONTHS = "LESS_THAN_THREE_MONTHS", "Less than 3 months"
31+
THREE_MONTHS_TO_A_YEAR = "THREE MONTHS TO A YEAR", "3 months to a year"
32+
ONE_TO_THREE_YEARS = "ONE_TO_THREE_YEARS", "1 to 3 years"
33+
OVER_THREE_YEARS = "OVER_THREE_YEARS", "Over 3 years"
34+
SINCE_A_SPECIFIC_DATE = "SINCE_A_SPECIFIC_DATE", "Since a specific date"
35+
NOT_SURE = "NOT_SURE", "Not sure"
36+
37+
2938
class Symptom(BaseModel):
3039
symptom_type = models.ForeignKey(SymptomType, on_delete=models.PROTECT)
3140
symptom_sub_type = models.ForeignKey(
@@ -42,10 +51,11 @@ class Symptom(BaseModel):
4251
area_description = models.CharField(blank=True, null=False)
4352

4453
# Has the symptom been investigated already?
45-
investigated = models.BooleanField()
54+
investigated = models.BooleanField(null=False, default=False)
55+
investigation_details = models.CharField(blank=True, null=False)
4656

4757
# Onset information
48-
when_started = models.CharField(blank=True, null=False)
58+
when_started = models.CharField(blank=True, null=False, choices=RelativeDateChoices)
4959
year_started = models.IntegerField(null=True, blank=True)
5060
month_started = models.IntegerField(null=True, blank=True)
5161
intermittent = models.BooleanField(null=False, default=False)

0 commit comments

Comments
 (0)