14.3.28. crate_anon.crateweb.consent.management.commands.fetch_optouts

crate_anon/crateweb/consent/management/commands/fetch_optouts.py


Copyright (C) 2015, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).

This file is part of CRATE.

CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CRATE. If not, see <https://www.gnu.org/licenses/>.


Django management command to fetch PIDs/MPIDs from the consent-mode database for patients who wish to opt out entirely, and store them in a file (e.g. for the CRATE anonymiser).

class crate_anon.crateweb.consent.management.commands.fetch_optouts.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Django management command to fetch PIDs/MPIDs for opt-out patients from the clinical consent-mode lookup database, and store them in a file (e.g. for use by the CRATE anonymiser).

add_arguments(parser: ArgumentParser) None[source]

Entry point for subclassed commands to add custom arguments.

handle(*args: str, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

crate_anon.crateweb.consent.management.commands.fetch_optouts.fetch_optouts(pid_filename: str, mpid_filename: str) None[source]

Fetch opt-out PIDs/MPIDs from the clinical consent-mode lookup database (defined via Django settings.CLINICAL_LOOKUP_CONSENT_DB) and write them to files.

Parameters:
  • pid_filename – name of the filename to receive PIDs

  • mpid_filename – name of the filename to receive MPIDs

crate_anon.crateweb.consent.management.commands.fetch_optouts.main() None[source]

Command-line entry point (not typically used directly).