Bug 21712 - Report anonymized patron records
Summary: Report anonymized patron records
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 21336
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-29 13:07 UTC by Marcel de Rooy
Modified: 2019-04-01 07:47 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21712: Report anonymized patron records (2.74 KB, patch)
2018-10-29 13:26 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2018-10-29 13:07:01 UTC
See bug 21336 comment17.
Comment 1 Marcel de Rooy 2018-10-29 13:26:52 UTC
Created attachment 81489 [details] [review]
Bug 21712: Report anonymized patron records

The solution is rather limited but effective on itself.
It only needs an enabled pref BorrowersLog.
We log a specific ANONYMIZE action in Koha::Patron::anonymize.

Now we only need to add a SQL report like:
    select object AS borrowernumber, timestamp AS date_anonymized from action_logs where module='MEMBERS' and action='ANONYMIZE'
Depending on your needs, you could give this report a date parameter to
show all actions from a given date onwards.

Test plan:
[1] Add a patron.
[2] Enable BorrowersLog
[3] Run in perl this line:
    use Koha::Patrons; Koha::Patrons->find(BORROWERNUMBER)->anonymize;

    Or (much more work): enable GDPR, unsubscribe, set reflection delay to
    zero and anonymize delay to zero and run cleanup_database.pl.
[4] Check if the log contains a ANONYMIZE action for this patron.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Katrin Fischer 2018-10-31 13:42:03 UTC
Hi Marcel,

can you explain how this will help with destroying the paper records? What kind of information is logged?
Comment 3 Marcel de Rooy 2018-10-31 13:56:05 UTC
(In reply to Katrin Fischer from comment #2)
> Hi Marcel,
> 
> can you explain how this will help with destroying the paper records? What
> kind of information is logged?

It is a rather simple solution just based on logging the borrowernumber. If we need more information to find back a paper record, we could extend it. Perhaps with surname, firstname or so?
Perhaps Michal Denar could respond here too?
Comment 4 Katrin Fischer 2018-10-31 19:38:51 UTC
I think we'd need the name as they are often filed alphabetically and wihout the borrowernumber. Maybe the cardnumber too.
Comment 5 Michal Denar 2018-10-31 21:30:16 UTC
Hi,
if librarian use anonymisation tool, list of relevant users could be feature of this tool.

If library prefer use automatic way of anonymisation, would be nice to generate some kind report for identify paper contracts. 
Useful informations to find right contract are:
- surname
- name
- home branch

optional:
- date of birth
- adress
- barcode from library card

I prefer report as part of auto anonymisation workflow. List will be generate before anonymisation on based on same select query.

But this is my point of view. 

Mike
Comment 6 Marcel de Rooy 2018-11-05 12:10:21 UTC
(In reply to Michal Denar from comment #5)
> I prefer report as part of auto anonymisation workflow. List will be
> generate before anonymisation on based on same select query.

This actually has my preference too. But I am waiting now first on some moving of the code on 21336 before spending more time.
Comment 7 Marcel de Rooy 2018-11-05 12:12:29 UTC
(In reply to Marcel de Rooy from comment #6)
> (In reply to Michal Denar from comment #5)
> > I prefer report as part of auto anonymisation workflow. List will be
> > generate before anonymisation on based on same select query.
> 
> This actually has my preference too. But I am waiting now first on some
> moving of the code on 21336 before spending more time.

Note that if we add more fields to the log, we actually have a privacy issue there.
Comment 8 Michal Denar 2019-03-15 14:32:52 UTC
I want to take this back to movement. If we want to make anon process automatic and need to destroy paper contracts too, procees should be:
- automatic anon
- some kind of log with relevant info for search of paper contracts
- some trigger that destroy log if all papers contracts from bach was destroyed.

Any ideas how to handle it?

Thanks
Comment 9 Marcel de Rooy 2019-04-01 07:47:25 UTC
21336 is moving again, so i am coming back here soon hopefully