Skip to content

Commit 0427db0

Browse files
authored
Merge pull request #482 from NHSDigital/change-appointment-number-field-type
Alter Appointment#number field to CharField
2 parents 3d8166a + c6e7c70 commit 0427db0

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.6 on 2025-10-02 09:31
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('notifications', '0018_alter_appointment_status'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='appointment',
15+
name='number',
16+
field=models.CharField(max_length=30, null=True),
17+
),
18+
]

manage_breast_screening/notifications/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class Meta:
128128
booked_at = models.DateTimeField(null=True)
129129
cancelled_by = models.CharField(max_length=50)
130130
cancelled_at = models.DateTimeField(null=True)
131-
number = models.IntegerField(null=True, default=1)
131+
number = models.CharField(max_length=30, null=True)
132132
starts_at = models.DateTimeField(null=False)
133133
created_at = models.DateTimeField(null=False, auto_now_add=True)
134134
updated_at = models.DateTimeField(null=True, auto_now=True)

manage_breast_screening/notifications/tests/fixtures/ABC_20241202091221_APPT_106.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"NBSSAPPT_FLDS"|"Sequence"|"BSO"|"Action"|"Clinic Code"|"Holding Clinic"|"Status"|"Attended Not Scr"|"Appointment ID"|"NHS Num"|"Epsiode Type"|"Episode Start"|"BatchID"|"Screen or Asses"|"Screen Appt num"|"Booked By"|"Cancelled By"|"Appt Date"|"Appt Time"|"Location"|"Clinic Name"|"Clinic Name (Let)"|"Clinic Address 1"|"Clinic Address 2"|"Clinic Address 3"|"Clinic Address 4"|"Clinic Address 5"|"Postcode"|"Action Timestamp"
33
"NBSSAPPT_DATA"|"000001"|"KMK"|"C"|"BU003"|"N"|"C"|"N"|"BU003-67215-RA1-DN-Z2222-1"|"9449304424"|"S"|"20250102"|"KMKS02441"|"S"|""|"C"|"H"|"20250110"|"0845"|"MKGH"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"MILTON KEYNES HOSPITAL"|"STANDING WAY"|"MILTON KEYNES"|"MK6 5LD"|"MK6 5LD"|"20250123-121433"
44
"NBSSAPPT_DATA"|"000002"|"KMK"|"B"|"BU011"|"N"|"B"|"N"|"BU011-67278-RA1-DN-Y1111-1"|"9449305552"|"S"|"20250128"|"KMK001326"|"S"|"1"|"H"|""|"20250314"|"1345"|"MKGH"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"MILTON KEYNES HOSPITAL"|"STANDING WAY"|"MILTON KEYNES"|"MK6 5LD"|"MK6 5LD"|"20250128-154003"
5-
"NBSSAPPT_DATA"|"000003"|"KMK"|"B"|"BU011"|"N"|"B"|"N"|"BU011-67278-RA1-DN-X0000-1"|"9449306621"|"F"|"20250128"|"KMK001326"|"A"|"3"|"H"|""|"20250314"|"1445"|"MKGH"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"MILTON KEYNES HOSPITAL"|"STANDING WAY"|"MILTON KEYNES"|"MK6 5LD"|"MK6 5LD"|"20250128-154004"
5+
"NBSSAPPT_DATA"|"000003"|"KMK"|"B"|"BU011"|"N"|"B"|"N"|"BU011-67278-RA1-DN-X0000-1"|"9449306621"|"F"|"20250128"|"KMK001326"|"A"|""|"H"|""|"20250314"|"1445"|"MKGH"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"BREAST CARE UNIT"|"MILTON KEYNES HOSPITAL"|"STANDING WAY"|"MILTON KEYNES"|"MK6 5LD"|"MK6 5LD"|"20250128-154004"
66
"NBSSAPPT_END"|"00000013"|"20250128"|"17:09:22"|"000003"

manage_breast_screening/notifications/tests/management/commands/test_create_appointments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def test_handle_creates_records(self):
114114
assert appointments[0].clinic == clinics[1]
115115
assert appointments[1].clinic == clinics[1]
116116

117-
assert appointments[0].number == 1
118-
assert appointments[1].number == 3
117+
assert appointments[0].number == "1"
118+
assert appointments[1].number == ""
119119

120120
assert appointments[1].assessment is True
121121

0 commit comments

Comments
 (0)