ouhft / COPE

Project Repository for Work Package 4 of the COPE Transplant Trial
https://cope.nds.ox.ac.uk
1 stars 0 forks source link

"Merge" of Duplicate Donor records #327

Closed marshalc closed 5 years ago

marshalc commented 6 years ago

There's a topic being discussed where it seems some Donors have been entered more than once in the database. Need to establish firstly who and how many, then we need to look at the clean up process.

One potential process is to manually chose a master record, and then add in the data from the other records to that one record. After that, notify me of the duplicate/redundant records and then we inactivate those records and all the data linked to them.

Note to self (for this and the data removal on consent topic too): Establish a data inactivation / deletion path that ensures data integrity. I.e. working from outer most models in the tree, and back to the Donor and Person records.

marshalc commented 5 years ago

delete_donor and delete_recipient functions added to wp4.compare.utils, and can be run from the python prompt. 7 Records have been "deleted' in the live data today and emails sent to @mertenssarah and others.

There is an issue that some queries (especially ones spanning foreign key relationships in templates) are not respecting the live field and need to be looked at in more detail.