sequencescape
sequencescape copied to clipboard
DPL-027-2 data fix for consent withdrawn metadata
Data fix for https://github.com/sanger/sequencescape/issues/3203
Also consider Rich C's comment from email:
On a side note, regarding the list you sent of <800 samples. Its looking like all samples are artefacts of a bug, which is great. However I’m getting reports that samples on the list cannot have been edited using the sample edits page. Some SSRs say they have never used the page and only make edits using the manifest re-upload.
What are your thoughts on this and will your changes also de-bug manifest data when re-upload?
I have asked for some specific examples from the SSRs involved to help investigate this potential other area.
Script:
samples = Sample.joins(:sample_metadata).where('sample_metadata.consent_withdrawn = 0 AND sample_metadata.date_of_consent_withdrawn IS NOT NULL')
samples.each do |s|
s.sample_metadata.update!(date_of_consent_withdrawn: nil, user_id_of_consent_withdrawn: nil)
end
I tested the sample manifest upload, and looked through the code, and couldn't find anywhere else that the consent withdrawn user and timestamp could be erroneously introduced.
To confirm as of 11/06/21 9.38am there are zero samples matching the above script criteria. I will check this in 2 weeks time (25/06/21) for Rich C's sanity