Closed dc2007git closed 3 months ago
For additional context/ logging of problem-solving:
After trying s/seed again, this time create_multiaxial_diagnosis() was the function inside of create_epilepsy12_record() that failed. The specific function call that failed is:
Syndrome.objects.create( syndrome_diagnosis_date=random_date( start=registration_instance.first_paediatric_assessment_date, end=date.today(), ), syndrome=syndrome_entity, multiaxial_diagnosis=multiaxial_diagnosis, )
Where the start date passed in was 2024-09-12, and the end date is today, ie 2024-04-30
Obviously this is in agreement with the error, where the end date (30-04-2024) is before the start date (12-09-2024). But why is this error just now appearing? Any ideas @mbarton @eatyourpeas ?
NOTE BEFORE READING - FIXED IN #928
Attempted to boot up a fresh e12 instance in docker with s/up, and once that had worked, I went to run s/seed, but ran into the following error stack:
The most relevant error seems to be related to seed.py, where a random date between a cohort's start and end date is generated for the first paediatric assessment date for a simulated case (line 223 in seed.py).
Importantly, while the above stack suggests that create_assessment() assessment.childrens_epilepsy_surgical_service_referral_date is the affected function and variable, after attempting s/seed a couple more times, I found that create_management() can be affected, in the case of antiepilepsy_medicine_startdate, and really any other 'create' can be affected.
This is the first time I've encountered an error like this, previously seeding was successful without any errors. Does this happen to anyone else?