rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

csv_upload does not remove previous visits #97

Closed eatyourpeas closed 2 weeks ago

eatyourpeas commented 3 weeks ago

Currently csv_upload overwrites existing Patient records, but does not remove the attached visits, leading to orphan records.

To fix this: On csv_upload, if a Patient instance is being updated, rather than created, the associated visits should be removed first